signalk-alert-center 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,45 @@ Versioning while it remains pre-1.0.
7
7
 
8
8
  Future changes intended for the next release belong here.
9
9
 
10
+ ## [0.3.0] - 2026-10-12
11
+
12
+ ### Alert overview
13
+
14
+ - Show every alert definition without a history-based **Load more** button.
15
+ Active alerts are loaded independently of paginated history.
16
+ - Sort active alerts by severity first, then configured zones without an active
17
+ alert, then inactive discovered alerts.
18
+ - Show configured zones without an active alert as **Normal**, including zones
19
+ that have never fired. This means no active alert has been reported; it is not
20
+ a guarantee that the sensor is available or its reading is fresh.
21
+ - Add a **Zones and active alerts** filter to hide inactive discovered alerts.
22
+ - Keep source and history filters complete across multiple result pages and
23
+ include normal zones when filtering the overview by normal severity.
24
+
25
+ ### Fixes and maintenance
26
+
27
+ - Render original notification-service icons correctly in the Signal K Store
28
+ README instead of displaying raw HTML image tags.
29
+ - Respect `SIGNALK_NODE_CONFIG_DIR` in the Docker startup script and derive
30
+ default data and server paths from the container user's home directory.
31
+ Existing saved configuration and the default database location are preserved.
32
+ - Add official Signal K plugin CI checks on Node 22 and 24 across Linux x64,
33
+ Linux ARM64, macOS, and Windows. Keep checkout line endings consistent and
34
+ require both compatibility and project-specific checks before publishing.
35
+ - Require changelog entries for future user-visible changes in contributor
36
+ instructions.
37
+
38
+ ### Upgrading
39
+
40
+ - No database schema, API, notification-delivery, or saved-settings changes from
41
+ 0.2.0. Existing alerts, history, policies, and queued deliveries are preserved;
42
+ no reset or migration is required.
43
+ - Node.js 22.5 or newer remains required. Optional notification-service
44
+ requirements are unchanged.
45
+ - Rollback to 0.2.0 does not require restoring an older database schema. If you
46
+ use a custom Docker data directory, keep mounting the same data volume and
47
+ account for 0.2.0's hardcoded Docker paths before rolling back.
48
+
10
49
  ## [0.2.0] - 2026-10-11
11
50
 
12
51
  ### Pushover notifications
package/DEVELOPERS.md CHANGED
@@ -114,6 +114,24 @@ npm run package:smoke # clean packaged-plugin installation
114
114
  Browser and acceptance fixtures live under `test/integration/`. They publish
115
115
  deterministic Signal K zones and notification deltas and must remain test-only.
116
116
 
117
+ ### Signal K plugin compatibility checks
118
+
119
+ `.github/workflows/signalk-ci.yml` calls the official Signal K reusable plugin
120
+ workflow on pull requests, pushes to `main`, manual runs, and release validation. It builds the plugin
121
+ and runs the unit suite on Node 22 and 24 across Linux x64, Linux arm64, macOS,
122
+ and Windows, alongside the upstream packaging and lifecycle checks. The upstream
123
+ workflow is pinned to a reviewed commit; review its changes before updating it.
124
+
125
+ The existing `ci.yml` remains responsible for our Docker acceptance, browser,
126
+ restart, and package-specific checks. Formatting and unit tests run only in the
127
+ official workflow; our package build also performs strict TypeScript checking.
128
+ Releases require both workflows to succeed before publishing. The publish job
129
+ still builds and checks the package it will actually upload.
130
+ After merging and obtaining a successful default-branch run, request a registry
131
+ re-score through the [Signal K registry](https://github.com/SignalK/signalk-plugin-registry#requesting-a-re-score)
132
+ to refresh its plugin CI badge. Adding this workflow alone does not confirm a
133
+ new registry score.
134
+
117
135
  ## Store screenshots
118
136
 
119
137
  The Store assets in `docs/screenshots/` are generated from the isolated Compose
package/README.md CHANGED
@@ -6,14 +6,14 @@ notifications while offline for delivery when connectivity returns.
6
6
 
7
7
  ## Supported notification services
8
8
 
9
- | Service | Use it for |
10
- | ------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------- |
11
- | <img src="./docs/icons/ntfy.svg" width="24" height="24" alt="ntfy logo"> **ntfy** | Push notifications through your own ntfy server or a hosted service. |
12
- | <img src="./docs/icons/pagerduty.svg" width="24" height="24" alt="PagerDuty logo"> **PagerDuty** | Incidents with trigger, acknowledgement, and resolution events. |
13
- | <img src="./docs/icons/discord.svg" width="24" height="24" alt="Discord logo"> **Discord** | Alert and recovery messages through webhooks. |
14
- | <img src="./docs/icons/telegram.svg" width="24" height="24" alt="Telegram logo"> **Telegram** | Bot messages to chats and forum topics, with optional silent delivery. |
15
- | **Pushover** | Push notifications to users or groups, with optional devices and sounds. |
16
- | **Signal K Wyoming** | Onboard notification sounds and spoken alerts through optional `signalk-wyoming`. |
9
+ | Service | Use it for |
10
+ | ----------------------------------------------------------- | --------------------------------------------------------------------------------- |
11
+ | ![ntfy logo](./docs/icons/ntfy.svg) **ntfy** | Push notifications through your own ntfy server or a hosted service. |
12
+ | ![PagerDuty logo](./docs/icons/pagerduty.svg) **PagerDuty** | Incidents with trigger, acknowledgement, and resolution events. |
13
+ | ![Discord logo](./docs/icons/discord.svg) **Discord** | Alert and recovery messages through webhooks. |
14
+ | ![Telegram logo](./docs/icons/telegram.svg) **Telegram** | Bot messages to chats and forum topics, with optional silent delivery. |
15
+ | **Pushover** | Push notifications to users or groups, with optional devices and sounds. |
16
+ | **Signal K Wyoming** | Onboard notification sounds and spoken alerts through optional `signalk-wyoming`. |
17
17
 
18
18
  Use several services together, with independent delivery tracking and retries.
19
19
  **No audio plugin is required.** Wyoming audio needs `signalk-wyoming` 0.3.0 or
@@ -34,7 +34,11 @@ operational history and delivery tracking needed when alerts matter after the
34
34
  current value changes:
35
35
 
36
36
  - **See what needs attention now.** Active alerts appear first in one compact
37
- list alongside inactive discovered alerts and defined zones.
37
+ list, followed by configured zones with no active alert (shown as Normal),
38
+ then inactive discovered alerts. All definitions are loaded without a
39
+ history-based “Load more” button. Choose **Zones and active alerts** to hide
40
+ inactive discovered alerts. Normal means no active alert has been reported;
41
+ it does not certify sensor availability or freshness.
38
42
  - **Keep the full story.** Raises, meaningful updates, clears,
39
43
  acknowledgements, silences, and delivery results remain available after a
40
44
  restart.
@@ -5,6 +5,9 @@ The README uses locally packaged brand SVGs from
5
5
  distributed under [CC0 1.0](https://github.com/simple-icons/simple-icons/blob/13.0.0/LICENSE.md).
6
6
  Paths are unchanged; fill colours use that release's brand metadata.
7
7
 
8
+ SVGs declare an intrinsic 24 × 24 pixel size. Use Markdown image syntax in the
9
+ README: the Signal K Store renderer displays raw HTML image tags as text.
10
+
8
11
  | Asset | Brand source | Colour |
9
12
  | --------------- | ------------------------------------- | --------- |
10
13
  | `ntfy.svg` | https://ntfy.sh | `#317F6F` |
@@ -1 +1 @@
1
- <svg fill="#5865F2" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Discord</title><path d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"/></svg>
1
+ <svg width="24" height="24" fill="#5865F2" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Discord</title><path d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"/></svg>
@@ -1 +1 @@
1
- <svg fill="#317F6F" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>ntfy</title><path d="M12.597 13.693v2.156h6.205v-2.156ZM5.183 6.549v2.363l3.591 1.901.023.01-.023.009-3.591 1.901v2.35l.386-.211 5.456-2.969V9.729ZM3.659 2.037C1.915 2.037.42 3.41.42 5.154v.002L.438 18.73 0 21.963l5.956-1.583h14.806c1.744 0 3.238-1.374 3.238-3.118V5.154c0-1.744-1.493-3.116-3.237-3.117h-.001zm0 2.2h17.104c.613.001 1.037.447 1.037.917v12.108c0 .47-.424.916-1.038.916H5.633l-3.026.915.031-.179-.017-13.76c0-.47.424-.917 1.038-.917z"/></svg>
1
+ <svg width="24" height="24" fill="#317F6F" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>ntfy</title><path d="M12.597 13.693v2.156h6.205v-2.156ZM5.183 6.549v2.363l3.591 1.901.023.01-.023.009-3.591 1.901v2.35l.386-.211 5.456-2.969V9.729ZM3.659 2.037C1.915 2.037.42 3.41.42 5.154v.002L.438 18.73 0 21.963l5.956-1.583h14.806c1.744 0 3.238-1.374 3.238-3.118V5.154c0-1.744-1.493-3.116-3.237-3.117h-.001zm0 2.2h17.104c.613.001 1.037.447 1.037.917v12.108c0 .47-.424.916-1.038.916H5.633l-3.026.915.031-.179-.017-13.76c0-.47.424-.917 1.038-.917z"/></svg>
@@ -1 +1 @@
1
- <svg fill="#06AC38" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>PagerDuty</title><path d="M16.965 1.18C15.085.164 13.769 0 10.683 0H3.73v14.55h6.926c2.743 0 4.8-.164 6.61-1.37 1.975-1.303 3.004-3.484 3.004-6.007 0-2.716-1.262-4.896-3.305-5.994zm-5.5 10.326h-4.21V3.113l3.977-.027c3.62-.028 5.43 1.234 5.43 4.128 0 3.113-2.248 4.292-5.197 4.292zM3.73 17.61h3.525V24H3.73Z"/></svg>
1
+ <svg width="24" height="24" fill="#06AC38" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>PagerDuty</title><path d="M16.965 1.18C15.085.164 13.769 0 10.683 0H3.73v14.55h6.926c2.743 0 4.8-.164 6.61-1.37 1.975-1.303 3.004-3.484 3.004-6.007 0-2.716-1.262-4.896-3.305-5.994zm-5.5 10.326h-4.21V3.113l3.977-.027c3.62-.028 5.43 1.234 5.43 4.128 0 3.113-2.248 4.292-5.197 4.292zM3.73 17.61h3.525V24H3.73Z"/></svg>
@@ -1 +1 @@
1
- <svg fill="#26A5E4" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Telegram</title><path d="M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"/></svg>
1
+ <svg width="24" height="24" fill="#26A5E4" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Telegram</title><path d="M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"/></svg>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "signalk-alert-center",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Signal K alerts and history with offline delivery to ntfy, PagerDuty, Discord, Telegram, Pushover, and optional Wyoming sound and speech",
5
5
  "author": "Sebastian Karasek",
6
6
  "repository": {
package/public/app.js CHANGED
@@ -8,7 +8,6 @@ const state = {
8
8
  deliveries: [],
9
9
  deliveryTotal: 0,
10
10
  alertHistory: [],
11
- occurrenceCursor: undefined,
12
11
  deliveryCursor: undefined,
13
12
  alertHistoryCursor: undefined,
14
13
  eventCursor: undefined,
@@ -43,7 +42,6 @@ const elements = {
43
42
  updated: $("#updated"),
44
43
  error: $("#error"),
45
44
  login: $("#login"),
46
- moreOccurrences: $("#history-more"),
47
45
  drawer: $("#detail-drawer"),
48
46
  backdrop: $("#drawer-backdrop"),
49
47
  drawerTitle: $("#drawer-title"),
@@ -121,11 +119,13 @@ async function api(path, options = {}) {
121
119
  }
122
120
  async function allPages(path) {
123
121
  const items = [];
122
+ const [pathname, query] = path.split("?");
123
+ const params = new URLSearchParams(query);
124
+ params.set("limit", "100");
124
125
  let cursor;
125
126
  do {
126
- const page = await api(
127
- `${path}${path.includes("?") ? "&" : "?"}limit=100${cursor ? `&cursor=${encodeURIComponent(cursor)}` : ""}`,
128
- );
127
+ if (cursor) params.set("cursor", cursor);
128
+ const page = await api(`${pathname}?${params}`);
129
129
  items.push(...pageItems(page));
130
130
  cursor = page.nextCursor;
131
131
  } while (cursor);
@@ -468,16 +468,10 @@ function bindOccurrenceActions(root = elements.drawerBody) {
468
468
 
469
469
  function renderDefinitions() {
470
470
  const showActive = $("#state-filter").value === "active";
471
+ const showZonesActive = $("#state-filter").value === "zones-active";
471
472
  const severity = $("#severity-filter").value;
472
473
  const search = $("#alert-search").value.trim().toLocaleLowerCase();
473
- const historyFiltered = [
474
- "state-filter",
475
- "severity-filter",
476
- "path-filter",
477
- "source-filter",
478
- "from-filter",
479
- "to-filter",
480
- ].some((id) => $(`#${id}`).value);
474
+ const historyFiltered = hasHistoryFilters();
481
475
  const visible = state.definitions
482
476
  .flatMap((definition) => {
483
477
  const occurrences = state.occurrences.filter(
@@ -504,7 +498,22 @@ function renderDefinitions() {
504
498
  ];
505
499
  })
506
500
  .filter((entry) => !showActive || entry.active)
507
- .filter(({ latest }) => !severity || latest?.currentSeverity === severity)
501
+ .filter(
502
+ ({ definition, active }) =>
503
+ !showZonesActive || active || definitionZones(definition).length > 0,
504
+ )
505
+ .filter(
506
+ ({ definition }) =>
507
+ !$("#path-filter").value ||
508
+ definition.pathPattern === $("#path-filter").value,
509
+ )
510
+ .filter(
511
+ (entry) =>
512
+ !severity ||
513
+ (historyFiltered
514
+ ? entry.latest?.currentSeverity
515
+ : definitionStatus(entry)) === severity,
516
+ )
508
517
  .filter(({ definition, latest }) =>
509
518
  [
510
519
  definition.name,
@@ -523,12 +532,12 @@ function renderDefinitions() {
523
532
  ? severityOrder.indexOf(right.latest?.currentSeverity) -
524
533
  severityOrder.indexOf(left.latest?.currentSeverity)
525
534
  : 0) ||
526
- String(left.definition.name).localeCompare(
527
- String(right.definition.name),
528
- ),
535
+ Number(definitionZones(right.definition).length > 0) -
536
+ Number(definitionZones(left.definition).length > 0) ||
537
+ alertName(left.definition).localeCompare(alertName(right.definition)),
529
538
  );
530
539
  $("#list-summary").textContent =
531
- `${visible.length} shown · ${state.definitions.filter((item) => definitionZones(item).length > 0).length} configured zone paths · active first`;
540
+ `${visible.length} shown · ${state.definitions.filter((item) => definitionZones(item).length > 0).length} configured zone paths · active first, then zones, then inactive`;
532
541
  elements.definitions.innerHTML = visible.length
533
542
  ? `<table class="data-table alert-table">
534
543
  <thead><tr><th>Alert</th><th>Value</th><th>Age</th><th>State</th><th><span class="visually-hidden">Actions</span></th></tr></thead>
@@ -544,12 +553,14 @@ function renderDefinitions() {
544
553
  ]
545
554
  .filter(Boolean)
546
555
  .join(" · ");
547
- const status = active ? latest.currentSeverity : "inactive";
556
+ const status = definitionStatus(definition);
548
557
  const statusTitle = active
549
558
  ? latest.currentSeverity
550
- : hasHistory
551
- ? "No active alert has been recorded"
552
- : "No alert has been recorded for this definition";
559
+ : definitionZones(item).length
560
+ ? "Configured zone with no active alert reported by Signal K"
561
+ : hasHistory
562
+ ? "No active alert has been recorded"
563
+ : "No alert has been recorded for this definition";
553
564
  return `<tr class="clickable-row" data-definition-id="${escapeHtml(item.id)}" ${occurrence ? `data-occurrence-id="${escapeHtml(occurrence.id)}"` : ""} tabindex="0" aria-label="Open ${escapeHtml(item.name ?? item.pathPattern)}">
554
565
  <td data-label="Alert"><strong class="cell-title" title="${escapeHtml(item.pathPattern)}">${escapeHtml(alertName(item))}</strong><span class="cell-detail compact-detail alert-summary" data-live-occurrence="${active ? escapeHtml(latest.id) : ""}" title="${escapeHtml(alertSummary)}">${escapeHtml(alertSummary)}</span></td>
555
566
  <td data-label="Value" class="live-value">${escapeHtml(liveValueText(item))}</td>
@@ -578,6 +589,13 @@ function renderDefinitions() {
578
589
  });
579
590
  bindOccurrenceActions(elements.definitions);
580
591
  }
592
+ function definitionStatus({ definition, active, latest }) {
593
+ return active
594
+ ? latest.currentSeverity
595
+ : definitionZones(definition).length
596
+ ? "normal"
597
+ : "inactive";
598
+ }
581
599
 
582
600
  function audioWasSkipped(item) {
583
601
  return item.remoteId === "suppressed:method";
@@ -717,6 +735,7 @@ function occurrenceParams(cursor) {
717
735
  if (cursor) params.set("cursor", cursor);
718
736
  for (const id of ["state", "severity", "path", "source"]) {
719
737
  const value = $(`#${id}-filter`).value.trim();
738
+ if (id === "state" && value === "zones-active") continue;
720
739
  if (value) params.set(id, value);
721
740
  }
722
741
  for (const id of ["from", "to"]) {
@@ -750,14 +769,12 @@ function alertHistoryParams(cursor) {
750
769
  }
751
770
 
752
771
  function hasHistoryFilters() {
753
- return [
754
- "state-filter",
755
- "severity-filter",
756
- "path-filter",
757
- "source-filter",
758
- "from-filter",
759
- "to-filter",
760
- ].some((id) => $(`#${id}`).value);
772
+ return (
773
+ $("#state-filter").value === "cleared" ||
774
+ ["source-filter", "from-filter", "to-filter"].some(
775
+ (id) => $(`#${id}`).value,
776
+ )
777
+ );
761
778
  }
762
779
 
763
780
  function renderPathOptions() {
@@ -781,17 +798,6 @@ function renderAlertHistoryDefinitionOptions() {
781
798
  select.value = selected;
782
799
  }
783
800
 
784
- async function loadOccurrences(append = false) {
785
- const page = await api(
786
- `/occurrences?${occurrenceParams(append ? state.occurrenceCursor : undefined)}`,
787
- );
788
- state.occurrences = append
789
- ? mergeById(state.occurrences, pageItems(page))
790
- : pageItems(page);
791
- state.occurrenceCursor = page.nextCursor;
792
- elements.moreOccurrences.hidden = !page.nextCursor;
793
- renderDefinitions();
794
- }
795
801
  async function loadDeliveries(append = false) {
796
802
  const params = new URLSearchParams({ limit: "50" });
797
803
  if (append && state.deliveryCursor)
@@ -835,7 +841,9 @@ async function load(preserveLoadedHistory = false) {
835
841
  ] = await Promise.all([
836
842
  allPages("/definitions"),
837
843
  allPages("/occurrences?state=active"),
838
- api(`/occurrences?${occurrenceParams()}`),
844
+ hasHistoryFilters()
845
+ ? allPages(`/occurrences?${occurrenceParams()}`)
846
+ : api("/occurrences?limit=100"),
839
847
  api("/notifiers"),
840
848
  api("/status").catch(() => ({})),
841
849
  api("/deliveries?limit=50"),
@@ -874,7 +882,6 @@ async function load(preserveLoadedHistory = false) {
874
882
  preserveLoadedHistory && previousHistoryCursor
875
883
  ? previousHistoryCursor
876
884
  : alertHistoryPage.nextCursor;
877
- state.occurrenceCursor = occurrences.nextCursor;
878
885
  elements.activeCount.textContent = activeOccurrences.length;
879
886
  elements.definitionCount.textContent =
880
887
  status.alerts?.definitions ?? state.definitions.length;
@@ -892,7 +899,6 @@ async function load(preserveLoadedHistory = false) {
892
899
  renderDiagnostics(status);
893
900
  renderSnooze();
894
901
  elements.updated.textContent = `Updated ${new Date().toLocaleTimeString()}`;
895
- elements.moreOccurrences.hidden = !state.occurrenceCursor;
896
902
  renderDefinitions();
897
903
  renderAlertHistory();
898
904
  renderDeliveries(state.deliveries);
@@ -1472,9 +1478,6 @@ $("#filters-clear").addEventListener("click", () => {
1472
1478
  $("#history-filters").reset();
1473
1479
  void load();
1474
1480
  });
1475
- elements.moreOccurrences.addEventListener("click", () =>
1476
- loadOccurrences(true).catch(showError),
1477
- );
1478
1481
  elements.moreDeliveries.addEventListener("click", () =>
1479
1482
  loadDeliveries(true).catch(showError),
1480
1483
  );
package/public/index.html CHANGED
@@ -106,6 +106,7 @@
106
106
  <label for="state-filter">Show</label
107
107
  ><select id="state-filter" name="state">
108
108
  <option value="" selected>All alerts and zones</option>
109
+ <option value="zones-active">Zones and active alerts</option>
109
110
  <option value="active">Active alerts only</option>
110
111
  <option value="cleared">Cleared history only</option>
111
112
  </select>
@@ -159,14 +160,6 @@
159
160
  <p id="list-summary" class="field-help" role="status"></p>
160
161
  <p id="action-result" class="field-help" role="status"></p>
161
162
  <div id="definition-list" class="table-shell" aria-live="polite"></div>
162
- <button
163
- id="history-more"
164
- class="button button-quiet load-more"
165
- type="button"
166
- hidden
167
- >
168
- Load more
169
- </button>
170
163
  </section>
171
164
 
172
165
  <section