Skip to content

feat: allow maintenance without affected monitors#6606

Merged
CommanderStorm merged 7 commits intolouislam:masterfrom
MkDev11:optional-maintenance-monitors
Jan 9, 2026
Merged

feat: allow maintenance without affected monitors#6606
CommanderStorm merged 7 commits intolouislam:masterfrom
MkDev11:optional-maintenance-monitors

Conversation

@MkDev11
Copy link
Copy Markdown
Contributor

@MkDev11 MkDev11 commented Jan 6, 2026

Allow Maintenance Without Affected Monitors

Summary

This PR removes the requirement to select at least one monitor when creating or editing a maintenance window.

Problem

Currently, when scheduling maintenance in Uptime Kuma, users are forced to select at least one affected monitor. However, there are legitimate use cases where you want to create a maintenance notification without linking it to any specific monitor:

  • Unmonitorable services: Some services can't be monitored due to network restrictions or lack of a suitable check type
  • General announcements: Maintenance windows for infrastructure that affects multiple systems but isn't directly tied to a specific monitor
  • Placeholder maintenance: Scheduling future maintenance before the related monitors are set up

As the issue author mentioned, the current workaround is to create a dummy group that isn't displayed on any status page, which is clunky and adds unnecessary clutter.

Solution

Removed the frontend validation that blocks maintenance creation when no monitors are selected. The backend already handles empty monitor arrays gracefully, so this was purely a UI restriction.

Changes

  • src/pages/EditMaintenance.vue: Removed the validation check that required affectedMonitors.length > 0

Testing

  1. Create a new maintenance without selecting any monitors → Should succeed
  2. Edit an existing maintenance and remove all monitors → Should succeed
  3. Maintenance should still display correctly on status pages when linked to status pages directly

Related Issue

Fixes #6177


Contribution by Gittensor, see my contribution statistics at https://gittensor.io/miners/details?githubId=94194147

@louislam
Copy link
Copy Markdown
Owner

louislam commented Jan 6, 2026

However, there are legitimate use cases where you want to create a maintenance notification without linking it to any specific monitor:

I don't think Uptime Kuma will send maintenance notifications. If you are vibe coding, be careful don't waste our time.

And maybe off topic, but why there are so many pr linked with Gittensor recently, you guys ignore our pull request template completely.

@louislam louislam closed this Jan 6, 2026
@MkDev11
Copy link
Copy Markdown
Contributor Author

MkDev11 commented Jan 6, 2026

Hi @louislam, thanks for the feedback.

You're right — I misspoke in the description. Maintenance windows don't send notifications; they display on status pages and suppress alerts during the scheduled period. I should have been more careful with the wording.

The actual use case from #6177 is straightforward: sometimes you want to show a maintenance message on a status page for a service that isn't monitored (or can't be monitored). Right now the UI blocks you from saving unless you pick at least one monitor, so users have to create dummy monitors as a workaround.

This PR just removes that frontend validation. The backend already accepts empty monitor arrays, so it's a one-line change.

Regarding the PR template — apologies for missing that. I'll make sure to follow it properly on future contributions.

Happy to close this if you'd prefer a different approach, or I can update the description to be more accurate. Let me know.

@MkDev11 MkDev11 deleted the optional-maintenance-monitors branch January 8, 2026 10:39
@MkDev11 MkDev11 restored the optional-maintenance-monitors branch January 8, 2026 10:44
@CommanderStorm CommanderStorm reopened this Jan 9, 2026
MkDev11 added a commit to MkDev11/uptime-kuma that referenced this pull request Jan 9, 2026
- Add Confirm modal when creating maintenance without affected monitors
- Replace unused 'atLeastOneMonitor' translation with 'noMonitorsSelectedWarning'
- Allow maintenance creation without monitors (user must confirm)

Addresses review feedback on PR louislam#6606
@MkDev11 MkDev11 force-pushed the optional-maintenance-monitors branch from de63005 to ad662cc Compare January 9, 2026 01:37
MkDev11 added a commit to MkDev11/uptime-kuma that referenced this pull request Jan 9, 2026
- Add Confirm modal when creating maintenance without affected monitors
- Replace unused 'atLeastOneMonitor' translation with 'noMonitorsSelectedWarning'
- Allow maintenance creation without monitors (user must confirm)

Addresses review feedback on PR louislam#6606
@MkDev11 MkDev11 requested a review from CommanderStorm January 9, 2026 01:38
Removes the validation that requires at least one monitor to be selected
when creating or editing maintenance. This allows users to create
maintenance notifications for services that cannot be monitored.

Fixes louislam#6177
- Add Confirm modal when creating maintenance without affected monitors
- Replace unused 'atLeastOneMonitor' translation with 'noMonitorsSelectedWarning'
- Allow maintenance creation without monitors (user must confirm)

Addresses review feedback on PR louislam#6606
@MkDev11
Copy link
Copy Markdown
Contributor Author

MkDev11 commented Jan 9, 2026

@CommanderStorm could you please merge the PR?

Copy link
Copy Markdown
Collaborator

@CommanderStorm CommanderStorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you and sorry for the misunderstanding 😓

@CommanderStorm CommanderStorm enabled auto-merge (squash) January 9, 2026 05:01
@CommanderStorm CommanderStorm merged commit 680f0f4 into louislam:master Jan 9, 2026
24 checks passed
@CommanderStorm CommanderStorm added this to the 2.1.0 milestone Jan 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Do not require affected monitors for maintance

3 participants