@juice-js/observability 1.1.0-alpha.23 → 1.1.0-alpha.28

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.
Files changed (50) hide show
  1. package/fesm2022/juice-js-observability-agent.page-VsTEvbSN.mjs +956 -0
  2. package/fesm2022/juice-js-observability-agent.page-VsTEvbSN.mjs.map +1 -0
  3. package/fesm2022/juice-js-observability-agents.page-C9WjP1nl.mjs +413 -0
  4. package/fesm2022/juice-js-observability-agents.page-C9WjP1nl.mjs.map +1 -0
  5. package/fesm2022/{juice-js-observability-alert.page-DOAX9WWa.mjs → juice-js-observability-alert.page-79qA1Wqg.mjs} +2 -2
  6. package/fesm2022/{juice-js-observability-alert.page-DOAX9WWa.mjs.map → juice-js-observability-alert.page-79qA1Wqg.mjs.map} +1 -1
  7. package/fesm2022/{juice-js-observability-alerts.page-DUXXBanH.mjs → juice-js-observability-alerts.page-DVqDxYSq.mjs} +2 -2
  8. package/fesm2022/{juice-js-observability-alerts.page-DUXXBanH.mjs.map → juice-js-observability-alerts.page-DVqDxYSq.mjs.map} +1 -1
  9. package/fesm2022/{juice-js-observability-incident.page-CCHEWXou.mjs → juice-js-observability-incident.page-CayeZdF_.mjs} +2 -2
  10. package/fesm2022/{juice-js-observability-incident.page-CCHEWXou.mjs.map → juice-js-observability-incident.page-CayeZdF_.mjs.map} +1 -1
  11. package/fesm2022/{juice-js-observability-incidents.page-CpNqYp2W.mjs → juice-js-observability-incidents.page-Bx7afoIh.mjs} +2 -2
  12. package/fesm2022/{juice-js-observability-incidents.page-CpNqYp2W.mjs.map → juice-js-observability-incidents.page-Bx7afoIh.mjs.map} +1 -1
  13. package/fesm2022/{juice-js-observability-load-runs.page-C2rk2bz9.mjs → juice-js-observability-load-runs.page-ByWrvCra.mjs} +2 -2
  14. package/fesm2022/{juice-js-observability-load-runs.page-C2rk2bz9.mjs.map → juice-js-observability-load-runs.page-ByWrvCra.mjs.map} +1 -1
  15. package/fesm2022/{juice-js-observability-logs.page-i76xbJLH.mjs → juice-js-observability-logs.page-DMRfXnA-.mjs} +2 -2
  16. package/fesm2022/{juice-js-observability-logs.page-i76xbJLH.mjs.map → juice-js-observability-logs.page-DMRfXnA-.mjs.map} +1 -1
  17. package/fesm2022/{juice-js-observability-metrics.page-Cq5S0yGJ.mjs → juice-js-observability-metrics.page-D3xK5mgs.mjs} +2 -2
  18. package/fesm2022/{juice-js-observability-metrics.page-Cq5S0yGJ.mjs.map → juice-js-observability-metrics.page-D3xK5mgs.mjs.map} +1 -1
  19. package/fesm2022/{juice-js-observability-notifications.page-BDqb10C6.mjs → juice-js-observability-notifications.page-BvUjV46Y.mjs} +39 -6
  20. package/fesm2022/juice-js-observability-notifications.page-BvUjV46Y.mjs.map +1 -0
  21. package/fesm2022/{juice-js-observability-overview.page-DXZl_fUh.mjs → juice-js-observability-overview.page-56xVtAo2.mjs} +2 -2
  22. package/fesm2022/{juice-js-observability-overview.page-DXZl_fUh.mjs.map → juice-js-observability-overview.page-56xVtAo2.mjs.map} +1 -1
  23. package/fesm2022/{juice-js-observability-resource.page-CauDE6kK.mjs → juice-js-observability-resource.page-CRSA-zpR.mjs} +2 -2
  24. package/fesm2022/{juice-js-observability-resource.page-CauDE6kK.mjs.map → juice-js-observability-resource.page-CRSA-zpR.mjs.map} +1 -1
  25. package/fesm2022/{juice-js-observability-resources.page-CukW8vVc.mjs → juice-js-observability-resources.page-BW7W5Wy2.mjs} +2 -2
  26. package/fesm2022/{juice-js-observability-resources.page-CukW8vVc.mjs.map → juice-js-observability-resources.page-BW7W5Wy2.mjs.map} +1 -1
  27. package/fesm2022/{juice-js-observability-rules.page-Df2uDVwz.mjs → juice-js-observability-rules.page-uKeK44Iz.mjs} +2 -2
  28. package/fesm2022/{juice-js-observability-rules.page-Df2uDVwz.mjs.map → juice-js-observability-rules.page-uKeK44Iz.mjs.map} +1 -1
  29. package/fesm2022/{juice-js-observability-service.page-BFXUe4mX.mjs → juice-js-observability-service.page-D7-Wbc5P.mjs} +2 -2
  30. package/fesm2022/{juice-js-observability-service.page-BFXUe4mX.mjs.map → juice-js-observability-service.page-D7-Wbc5P.mjs.map} +1 -1
  31. package/fesm2022/{juice-js-observability-services.page-B1huLe_a.mjs → juice-js-observability-services.page-CNarlAgr.mjs} +2 -2
  32. package/fesm2022/{juice-js-observability-services.page-B1huLe_a.mjs.map → juice-js-observability-services.page-CNarlAgr.mjs.map} +1 -1
  33. package/fesm2022/{juice-js-observability-silences.page-Cg53dJAy.mjs → juice-js-observability-silences.page-DBBZBZ0a.mjs} +2 -2
  34. package/fesm2022/{juice-js-observability-silences.page-Cg53dJAy.mjs.map → juice-js-observability-silences.page-DBBZBZ0a.mjs.map} +1 -1
  35. package/fesm2022/{juice-js-observability-telemetry-BftWSOaQ.mjs → juice-js-observability-telemetry-B98lekF2.mjs} +100 -90
  36. package/fesm2022/juice-js-observability-telemetry-B98lekF2.mjs.map +1 -0
  37. package/fesm2022/{juice-js-observability-timeline.page-CtU2EoDN.mjs → juice-js-observability-timeline.page-DhU78o_M.mjs} +2 -2
  38. package/fesm2022/{juice-js-observability-timeline.page-CtU2EoDN.mjs.map → juice-js-observability-timeline.page-DhU78o_M.mjs.map} +1 -1
  39. package/fesm2022/{juice-js-observability-topology.page-CUayiRVT.mjs → juice-js-observability-topology.page-CVdoBph4.mjs} +2 -2
  40. package/fesm2022/{juice-js-observability-topology.page-CUayiRVT.mjs.map → juice-js-observability-topology.page-CVdoBph4.mjs.map} +1 -1
  41. package/fesm2022/{juice-js-observability-trace.page-ByxGFLpE.mjs → juice-js-observability-trace.page-C-icZvAo.mjs} +2 -2
  42. package/fesm2022/{juice-js-observability-trace.page-ByxGFLpE.mjs.map → juice-js-observability-trace.page-C-icZvAo.mjs.map} +1 -1
  43. package/fesm2022/{juice-js-observability-traces.page-DXSDdeTH.mjs → juice-js-observability-traces.page-c8CoI2AY.mjs} +2 -2
  44. package/fesm2022/{juice-js-observability-traces.page-DXSDdeTH.mjs.map → juice-js-observability-traces.page-c8CoI2AY.mjs.map} +1 -1
  45. package/fesm2022/juice-js-observability.mjs +76 -22
  46. package/fesm2022/juice-js-observability.mjs.map +1 -1
  47. package/package.json +1 -1
  48. package/types/juice-js-observability.d.ts +100 -0
  49. package/fesm2022/juice-js-observability-notifications.page-BDqb10C6.mjs.map +0 -1
  50. package/fesm2022/juice-js-observability-telemetry-BftWSOaQ.mjs.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { ApiService } from "./juice-js-observability.mjs";
2
- import { S as apiResource, o as problemText, u as ContextBar } from "./juice-js-observability-telemetry-BftWSOaQ.mjs";
2
+ import { c as ContextBar, h as apiResource, o as problemText } from "./juice-js-observability-telemetry-B98lekF2.mjs";
3
3
  import * as i0 from "@angular/core";
4
4
  import { ChangeDetectionStrategy, Component, computed, inject, signal } from "@angular/core";
5
5
  import { forkJoin, map } from "rxjs";
@@ -53,6 +53,9 @@ var NotificationsPage = class NotificationsPage {
53
53
  channelError = signal("", ...ngDevMode ? [{ debugName: "channelError" }] : /* istanbul ignore next */ []);
54
54
  policyError = signal("", ...ngDevMode ? [{ debugName: "policyError" }] : /* istanbul ignore next */ []);
55
55
  allowError = signal("", ...ngDevMode ? [{ debugName: "allowError" }] : /* istanbul ignore next */ []);
56
+ retryError = signal("", ...ngDevMode ? [{ debugName: "retryError" }] : /* istanbul ignore next */ []);
57
+ testing = signal(null, ...ngDevMode ? [{ debugName: "testing" }] : /* istanbul ignore next */ []);
58
+ tests = signal({}, ...ngDevMode ? [{ debugName: "tests" }] : /* istanbul ignore next */ []);
56
59
  destination = "";
57
60
  ports = "";
58
61
  data = apiResource({ stream: () => forkJoin({
@@ -172,6 +175,28 @@ var NotificationsPage = class NotificationsPage {
172
175
  removeAllowed(destination) {
173
176
  this.run(this.api.removeAllowlist(destination), (m) => this.allowError.set(m), () => void 0);
174
177
  }
178
+ testChannel(id) {
179
+ this.testing.set(id);
180
+ const show = (ok, text) => {
181
+ this.testing.set(null);
182
+ this.tests.update((t) => ({
183
+ ...t,
184
+ [id]: {
185
+ ok,
186
+ text
187
+ }
188
+ }));
189
+ };
190
+ this.api.testChannel(id).subscribe({
191
+ next: (r) => show(r.delivered, r.delivered ? `Test delivered in ${r.durationMs} ms${r.statusCode ? ` (HTTP ${r.statusCode})` : ""}` : `Test failed: ${r.error ?? "unknown"}${r.statusCode ? ` (HTTP ${r.statusCode})` : ""}`),
192
+ error: (e) => show(false, e.status === 403 ? "Testing a channel needs the admin role." : problemText(e))
193
+ });
194
+ }
195
+ retry(deliveryId) {
196
+ const channel = this.history();
197
+ if (!channel) return;
198
+ this.run(this.api.retryDelivery(channel, deliveryId), (m) => this.retryError.set(m), () => this.deliveries.reload());
199
+ }
175
200
  static ɵfac = i0.ɵɵngDeclareFactory({
176
201
  minVersion: "12.0.0",
177
202
  version: "22.2.4",
@@ -237,7 +262,9 @@ var NotificationsPage = class NotificationsPage {
237
262
  <td>{{ c.waiting }}</td>
238
263
  <td class="jc-row-actions">
239
264
  <button mat-button type="button" [attr.data-testid]="'channel-history-' + c.key" (click)="history.set(history() === c.id ? null : c.id)">History</button>
265
+ <button mat-button type="button" [attr.data-testid]="'channel-test-' + c.key" [disabled]="testing() === c.id" (click)="testChannel(c.id)">Test</button>
240
266
  @if (c.managedBy !== 'config') { <button mat-button type="button" [attr.data-testid]="'channel-edit-' + c.key" (click)="editChannel(c)">Change</button> }
267
+ @if (tests()[c.id]; as t) { <div class="jc-small" [class.jc-error]="!t.ok" [attr.data-testid]="'channel-test-result-' + c.key">{{ t.text }}</div> }
241
268
  </td>
242
269
  </tr>
243
270
  } @empty { <tr><td colspan="7" class="jc-muted">No channels: alerts fire, but nobody is told.</td></tr> }
@@ -247,7 +274,7 @@ var NotificationsPage = class NotificationsPage {
247
274
  <h3>Delivery history</h3>
248
275
  @if (deliveries.error()) { <p class="jc-error">{{ deliveriesError() }}</p> }
249
276
  <table class="jc-table" data-testid="channel-history">
250
- <thead><tr><th>Created</th><th>Event</th><th>Status</th><th>Attempts</th><th>Last result</th></tr></thead>
277
+ <thead><tr><th>Created</th><th>Event</th><th>Status</th><th>Attempts</th><th>Last result</th><th></th></tr></thead>
251
278
  <tbody>
252
279
  @for (d of deliveries.value()?.items ?? []; track d.id) {
253
280
  <tr>
@@ -256,10 +283,12 @@ var NotificationsPage = class NotificationsPage {
256
283
  <td [class.jc-bad]="d.status === 'Failed'">{{ d.status }}</td>
257
284
  <td>{{ d.attempts }}</td>
258
285
  <td class="jc-small">{{ d.lastError ?? (d.lastStatusCode ? 'HTTP ' + d.lastStatusCode : '') }}</td>
286
+ <td class="jc-row-actions">@if (d.status === 'Failed') { <button mat-button type="button" [attr.data-testid]="'delivery-retry-' + d.id" [disabled]="saving()" (click)="retry(d.id)">Retry</button> }</td>
259
287
  </tr>
260
- } @empty { <tr><td colspan="5" class="jc-muted">Nothing sent yet.</td></tr> }
288
+ } @empty { <tr><td colspan="6" class="jc-muted">Nothing sent yet.</td></tr> }
261
289
  </tbody>
262
290
  </table>
291
+ @if (retryError()) { <p class="jc-error" data-testid="delivery-retry-error">{{ retryError() }}</p> }
263
292
  }
264
293
  </section>
265
294
 
@@ -632,7 +661,9 @@ i0.ɵɵngDeclareClassMetadata({
632
661
  <td>{{ c.waiting }}</td>
633
662
  <td class="jc-row-actions">
634
663
  <button mat-button type="button" [attr.data-testid]="'channel-history-' + c.key" (click)="history.set(history() === c.id ? null : c.id)">History</button>
664
+ <button mat-button type="button" [attr.data-testid]="'channel-test-' + c.key" [disabled]="testing() === c.id" (click)="testChannel(c.id)">Test</button>
635
665
  @if (c.managedBy !== 'config') { <button mat-button type="button" [attr.data-testid]="'channel-edit-' + c.key" (click)="editChannel(c)">Change</button> }
666
+ @if (tests()[c.id]; as t) { <div class="jc-small" [class.jc-error]="!t.ok" [attr.data-testid]="'channel-test-result-' + c.key">{{ t.text }}</div> }
636
667
  </td>
637
668
  </tr>
638
669
  } @empty { <tr><td colspan="7" class="jc-muted">No channels: alerts fire, but nobody is told.</td></tr> }
@@ -642,7 +673,7 @@ i0.ɵɵngDeclareClassMetadata({
642
673
  <h3>Delivery history</h3>
643
674
  @if (deliveries.error()) { <p class="jc-error">{{ deliveriesError() }}</p> }
644
675
  <table class="jc-table" data-testid="channel-history">
645
- <thead><tr><th>Created</th><th>Event</th><th>Status</th><th>Attempts</th><th>Last result</th></tr></thead>
676
+ <thead><tr><th>Created</th><th>Event</th><th>Status</th><th>Attempts</th><th>Last result</th><th></th></tr></thead>
646
677
  <tbody>
647
678
  @for (d of deliveries.value()?.items ?? []; track d.id) {
648
679
  <tr>
@@ -651,10 +682,12 @@ i0.ɵɵngDeclareClassMetadata({
651
682
  <td [class.jc-bad]="d.status === 'Failed'">{{ d.status }}</td>
652
683
  <td>{{ d.attempts }}</td>
653
684
  <td class="jc-small">{{ d.lastError ?? (d.lastStatusCode ? 'HTTP ' + d.lastStatusCode : '') }}</td>
685
+ <td class="jc-row-actions">@if (d.status === 'Failed') { <button mat-button type="button" [attr.data-testid]="'delivery-retry-' + d.id" [disabled]="saving()" (click)="retry(d.id)">Retry</button> }</td>
654
686
  </tr>
655
- } @empty { <tr><td colspan="5" class="jc-muted">Nothing sent yet.</td></tr> }
687
+ } @empty { <tr><td colspan="6" class="jc-muted">Nothing sent yet.</td></tr> }
656
688
  </tbody>
657
689
  </table>
690
+ @if (retryError()) { <p class="jc-error" data-testid="delivery-retry-error">{{ retryError() }}</p> }
658
691
  }
659
692
  </section>
660
693
 
@@ -722,4 +755,4 @@ i0.ɵɵngDeclareClassMetadata({
722
755
  });
723
756
  export { NotificationsPage };
724
757
 
725
- //# sourceMappingURL=juice-js-observability-notifications.page-BDqb10C6.mjs.map
758
+ //# sourceMappingURL=juice-js-observability-notifications.page-BvUjV46Y.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"juice-js-observability-notifications.page-BvUjV46Y.mjs","names":[],"sources":["../../../../projects/juice-js/observability/src/lib/pages/notifications.page.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, inject, signal } from '@angular/core';\nimport { DatePipe } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\nimport { MatSelectModule } from '@angular/material/select';\nimport { Observable, forkJoin, map } from 'rxjs';\nimport { ApiService } from '../core/api.service';\nimport { Channel, EscalationPolicy, EscalationStep } from '../core/models';\nimport { apiResource } from '../shared/resource';\nimport { problemText } from '../shared/telemetry';\nimport { ContextBar } from '../shared/ui';\n\nconst list = (text: string) => text.split(',').map(s => s.trim()).filter(Boolean);\n\ninterface ChannelForm {\n id: string | null; key: string; kind: string; url: string; secretRef: string; recipients: string; ruleKeys: string; environments: string; minimumSeverity: string; groupWindowSeconds: number; firing: boolean; resolved: boolean; enabled: boolean;\n}\n\ninterface PolicyForm { editing: boolean; key: string; name: string; ruleKeys: string; environments: string; minimumSeverity: string; stopOnAcknowledge: boolean; enabled: boolean; steps: string; }\n\nconst NEW_CHANNEL: ChannelForm = { id: null, key: '', kind: 'Slack', url: '', secretRef: '', recipients: '', ruleKeys: '', environments: '', minimumSeverity: 'Info', groupWindowSeconds: 0, firing: true, resolved: true, enabled: true };\nconst NEW_POLICY: PolicyForm = { editing: false, key: '', name: '', ruleKeys: '', environments: '', minimumSeverity: 'Critical', stopOnAcknowledge: true, enabled: true, steps: '' };\n\n/**\n * Where notifications go: channels with their failures and history, the private destinations they may reach, and who is told as an alert stays open. Changing any of these\n * needs the admin role. A channel's address and secret are never shown: only the name of where the secret is, to admins.\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [DatePipe, FormsModule, MatButtonModule, MatCheckboxModule, MatFormFieldModule, MatInputModule, MatProgressBarModule, MatSelectModule, ContextBar],\n template: `\n <jc-context-bar><h1>Notifications</h1></jc-context-bar>\n @if (data.isLoading()) { <mat-progress-bar mode=\"indeterminate\" /> }\n @if (data.error()) { <p class=\"jc-error\">{{ error() }}</p> }\n\n <section class=\"jc-card\">\n <h2>Channels <button mat-button type=\"button\" data-testid=\"channel-new\" (click)=\"channel.set(newChannel())\">New channel</button></h2>\n @if (channel(); as f) {\n <form class=\"jc-form\" data-testid=\"channel-form\" (ngSubmit)=\"saveChannel(f)\">\n @if (!f.id) {\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Key</mat-label><input matInput name=\"key\" [(ngModel)]=\"f.key\" required></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Kind</mat-label>\n <mat-select name=\"kind\" [(ngModel)]=\"f.kind\"><mat-option value=\"Slack\">Slack</mat-option><mat-option value=\"Teams\">Teams</mat-option><mat-option value=\"Email\">Email</mat-option><mat-option value=\"Webhook\">Signed webhook</mat-option></mat-select>\n </mat-form-field>\n }\n @if (f.kind === 'Webhook') { <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-wide\"><mat-label>{{ f.id ? 'New URL (keeps the current one if empty)' : 'URL' }}</mat-label><input matInput name=\"url\" [(ngModel)]=\"f.url\"></mat-form-field> }\n @if (f.kind === 'Email') { <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-wide\"><mat-label>Recipients, comma separated</mat-label><input matInput name=\"recipients\" [(ngModel)]=\"f.recipients\"></mat-form-field> }\n @else {\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-wide\"><mat-label>{{ f.kind === 'Webhook' ? 'Signing secret reference' : 'Reference to the channel URL' }}</mat-label><input matInput name=\"secretRef\" [(ngModel)]=\"f.secretRef\" placeholder=\"env:JUICE_WEBHOOK_OPS\"></mat-form-field>\n <p class=\"jc-muted jc-small jc-form-actions\">{{ f.kind === 'Webhook' ? 'The name of where the signing secret is, set on the host.' : 'A Slack or Teams URL is itself a credential, so it stays on the host: this is the name of where it is.' }} Not the secret itself.</p>\n }\n <mat-form-field subscriptSizing=\"dynamic\"><mat-label>Only these rules</mat-label><input matInput name=\"ruleKeys\" [(ngModel)]=\"f.ruleKeys\"></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\"><mat-label>Only these environments</mat-label><input matInput name=\"environments\" [(ngModel)]=\"f.environments\"></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Severity at least</mat-label>\n <mat-select name=\"minimumSeverity\" [(ngModel)]=\"f.minimumSeverity\"><mat-option value=\"Info\">Info</mat-option><mat-option value=\"Warning\">Warning</mat-option><mat-option value=\"Critical\">Critical</mat-option></mat-select>\n </mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Group for (s)</mat-label><input matInput type=\"number\" min=\"0\" max=\"3600\" name=\"group\" [(ngModel)]=\"f.groupWindowSeconds\"></mat-form-field>\n <mat-checkbox name=\"firing\" [(ngModel)]=\"f.firing\">Firing</mat-checkbox>\n <mat-checkbox name=\"resolved\" [(ngModel)]=\"f.resolved\">Resolved</mat-checkbox>\n <mat-checkbox name=\"enabled\" [(ngModel)]=\"f.enabled\">Enabled</mat-checkbox>\n <div class=\"jc-form-actions\">\n <button mat-flat-button type=\"submit\" data-testid=\"channel-save\" [disabled]=\"saving()\">Save</button>\n <button mat-button type=\"button\" (click)=\"channel.set(null)\">Cancel</button>\n @if (channelError()) { <span class=\"jc-error\" data-testid=\"channel-error\">{{ channelError() }}</span> }\n </div>\n </form>\n }\n <table class=\"jc-table\" data-testid=\"channels\">\n <thead><tr><th>Channel</th><th>Kind</th><th>Destination</th><th>Takes</th><th>Failed (24 h)</th><th>Waiting</th><th></th></tr></thead>\n <tbody>\n @for (c of channels(); track c.id) {\n <tr [class.jc-muted]=\"!c.enabled\">\n <td><strong>{{ c.key }}</strong><div class=\"jc-muted jc-small\">@if (!c.enabled) { disabled · }@if (c.managedBy === 'config') { from the webhooks file }</div></td>\n <td>{{ c.kind }}</td>\n <td>{{ c.destination }}</td>\n <td class=\"jc-small\">{{ c.minimumSeverity }} and above@if (c.environments.length) { · {{ c.environments.join(', ') }} }@if (c.ruleKeys.length) { · {{ c.ruleKeys.join(', ') }} }@if (c.groupWindowSeconds) { · grouped {{ c.groupWindowSeconds }} s }</td>\n <td [class.jc-bad]=\"c.recentFailures > 0\">{{ c.recentFailures }}</td>\n <td>{{ c.waiting }}</td>\n <td class=\"jc-row-actions\">\n <button mat-button type=\"button\" [attr.data-testid]=\"'channel-history-' + c.key\" (click)=\"history.set(history() === c.id ? null : c.id)\">History</button>\n <button mat-button type=\"button\" [attr.data-testid]=\"'channel-test-' + c.key\" [disabled]=\"testing() === c.id\" (click)=\"testChannel(c.id)\">Test</button>\n @if (c.managedBy !== 'config') { <button mat-button type=\"button\" [attr.data-testid]=\"'channel-edit-' + c.key\" (click)=\"editChannel(c)\">Change</button> }\n @if (tests()[c.id]; as t) { <div class=\"jc-small\" [class.jc-error]=\"!t.ok\" [attr.data-testid]=\"'channel-test-result-' + c.key\">{{ t.text }}</div> }\n </td>\n </tr>\n } @empty { <tr><td colspan=\"7\" class=\"jc-muted\">No channels: alerts fire, but nobody is told.</td></tr> }\n </tbody>\n </table>\n @if (history()) {\n <h3>Delivery history</h3>\n @if (deliveries.error()) { <p class=\"jc-error\">{{ deliveriesError() }}</p> }\n <table class=\"jc-table\" data-testid=\"channel-history\">\n <thead><tr><th>Created</th><th>Event</th><th>Status</th><th>Attempts</th><th>Last result</th><th></th></tr></thead>\n <tbody>\n @for (d of deliveries.value()?.items ?? []; track d.id) {\n <tr>\n <td class=\"jc-nowrap\">{{ d.createdAt | date: 'MMM d, HH:mm:ss' }}</td>\n <td>{{ d.event }}@if (d.escalationStep) { step {{ d.escalationStep }} }</td>\n <td [class.jc-bad]=\"d.status === 'Failed'\">{{ d.status }}</td>\n <td>{{ d.attempts }}</td>\n <td class=\"jc-small\">{{ d.lastError ?? (d.lastStatusCode ? 'HTTP ' + d.lastStatusCode : '') }}</td>\n <td class=\"jc-row-actions\">@if (d.status === 'Failed') { <button mat-button type=\"button\" [attr.data-testid]=\"'delivery-retry-' + d.id\" [disabled]=\"saving()\" (click)=\"retry(d.id)\">Retry</button> }</td>\n </tr>\n } @empty { <tr><td colspan=\"6\" class=\"jc-muted\">Nothing sent yet.</td></tr> }\n </tbody>\n </table>\n @if (retryError()) { <p class=\"jc-error\" data-testid=\"delivery-retry-error\">{{ retryError() }}</p> }\n }\n </section>\n\n <section class=\"jc-card\">\n <h2>Escalation <button mat-button type=\"button\" data-testid=\"policy-new\" (click)=\"policy.set(newPolicy())\">New policy</button></h2>\n @if (policy(); as f) {\n <form class=\"jc-form\" data-testid=\"policy-form\" (ngSubmit)=\"savePolicy(f)\">\n @if (!f.editing) { <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Key</mat-label><input matInput name=\"key\" [(ngModel)]=\"f.key\" required></mat-form-field> }\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-wide\"><mat-label>Name</mat-label><input matInput name=\"name\" [(ngModel)]=\"f.name\" required></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-wide\"><mat-label>Steps, one a line</mat-label><textarea matInput name=\"steps\" rows=\"3\" [(ngModel)]=\"f.steps\" placeholder=\"5: oncall-slack&#10;15: pager, lead-email\"></textarea></mat-form-field>\n <p class=\"jc-muted jc-small jc-form-actions\">Minutes after firing, then the channels to tell if the alert is still open.</p>\n <mat-form-field subscriptSizing=\"dynamic\"><mat-label>Only these rules</mat-label><input matInput name=\"ruleKeys\" [(ngModel)]=\"f.ruleKeys\"></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\"><mat-label>Only these environments</mat-label><input matInput name=\"environments\" [(ngModel)]=\"f.environments\"></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Severity at least</mat-label>\n <mat-select name=\"minimumSeverity\" [(ngModel)]=\"f.minimumSeverity\"><mat-option value=\"Info\">Info</mat-option><mat-option value=\"Warning\">Warning</mat-option><mat-option value=\"Critical\">Critical</mat-option></mat-select>\n </mat-form-field>\n <mat-checkbox name=\"stop\" [(ngModel)]=\"f.stopOnAcknowledge\">Stop when acknowledged</mat-checkbox>\n <mat-checkbox name=\"policyEnabled\" [(ngModel)]=\"f.enabled\">Enabled</mat-checkbox>\n <div class=\"jc-form-actions\">\n <button mat-flat-button type=\"submit\" data-testid=\"policy-save\" [disabled]=\"saving()\">Save</button>\n <button mat-button type=\"button\" (click)=\"policy.set(null)\">Cancel</button>\n @if (policyError()) { <span class=\"jc-error\" data-testid=\"policy-error\">{{ policyError() }}</span> }\n </div>\n </form>\n }\n <table class=\"jc-table\" data-testid=\"policies\">\n <thead><tr><th>Policy</th><th>Steps</th><th>Applies to</th><th>Stops when</th><th></th></tr></thead>\n <tbody>\n @for (p of policies(); track p.id) {\n <tr [class.jc-muted]=\"!p.enabled\">\n <td><strong>{{ p.name }}</strong><div class=\"jc-muted jc-small\">{{ p.key }}@if (!p.enabled) { · disabled }</div></td>\n <td class=\"jc-small\">@for (s of p.steps; track s.afterMinutes) { <div>{{ s.afterMinutes }} min: {{ s.endpointKeys.join(', ') }}</div> }</td>\n <td class=\"jc-small\">{{ p.minimumSeverity }} and above@if (p.environments.length) { · {{ p.environments.join(', ') }} }@if (p.ruleKeys.length) { · {{ p.ruleKeys.join(', ') }} }</td>\n <td class=\"jc-small\">{{ p.stopOnAcknowledge ? 'Acknowledged or resolved' : 'Resolved' }}</td>\n <td class=\"jc-row-actions\"><button mat-button type=\"button\" (click)=\"editPolicy(p)\">Change</button></td>\n </tr>\n } @empty { <tr><td colspan=\"5\" class=\"jc-muted\">No policies: a firing alert notifies once.</td></tr> }\n </tbody>\n </table>\n </section>\n\n <section class=\"jc-card\">\n <h2>Private destinations</h2>\n <p class=\"jc-muted jc-small\">A channel may reach a private address only if it's listed here. Loopback, link-local and cloud metadata addresses are never reachable.</p>\n <form class=\"jc-form\" (ngSubmit)=\"addAllowed()\">\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-wide\"><mat-label>CIDR or host name</mat-label><input matInput name=\"destination\" data-testid=\"allow-destination\" [(ngModel)]=\"destination\"></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-md\"><mat-label>Ports (443 if empty)</mat-label><input matInput name=\"ports\" data-testid=\"allow-ports\" [(ngModel)]=\"ports\"></mat-form-field>\n <button mat-stroked-button type=\"submit\" data-testid=\"allow-add\" [disabled]=\"saving()\">Allow</button>\n @if (allowError()) { <span class=\"jc-error\" data-testid=\"allow-error\">{{ allowError() }}</span> }\n </form>\n <table class=\"jc-table\" data-testid=\"allowlist\">\n <tbody>\n @for (a of allowed(); track a.destination) {\n <tr>\n <td><strong>{{ a.destination }}</strong> @if (a.managedBy === 'config') { <span class=\"jc-muted jc-small\">from the webhooks file</span> }</td>\n <td>{{ a.ports.length ? a.ports.join(', ') : '443' }}</td>\n <td class=\"jc-row-actions\">@if (a.managedBy !== 'config') { <button mat-button type=\"button\" (click)=\"removeAllowed(a.destination)\">Remove</button> }</td>\n </tr>\n } @empty { <tr><td class=\"jc-muted\">None: channels reach public addresses only.</td></tr> }\n </tbody>\n </table>\n </section>`,\n})\nexport class NotificationsPage {\n private readonly api = inject(ApiService);\n protected readonly channel = signal<ChannelForm | null>(null);\n protected readonly policy = signal<PolicyForm | null>(null);\n protected readonly history = signal<string | null>(null);\n protected readonly saving = signal(false);\n protected readonly channelError = signal('');\n protected readonly policyError = signal('');\n protected readonly allowError = signal('');\n protected readonly retryError = signal('');\n protected readonly testing = signal<string | null>(null);\n protected readonly tests = signal<Record<string, { ok: boolean; text: string }>>({});\n protected destination = '';\n protected ports = '';\n\n protected readonly data = apiResource({\n stream: () => forkJoin({\n channels: this.api.channels().pipe(map(p => p.items)),\n policies: this.api.escalationPolicies().pipe(map(p => p.items)),\n allowlist: this.api.allowlist().pipe(map(p => p.items)),\n }),\n });\n protected readonly error = computed(() => problemText(this.data.error()));\n protected readonly channels = computed(() => this.data.value()?.channels ?? []);\n protected readonly policies = computed(() => this.data.value()?.policies ?? []);\n protected readonly allowed = computed(() => this.data.value()?.allowlist ?? []);\n protected readonly deliveries = apiResource({ params: () => this.history() ?? undefined, stream: ({ params }) => this.api.deliveries(params) });\n protected readonly deliveriesError = computed(() => problemText(this.deliveries.error()));\n\n protected newChannel(): ChannelForm { this.channelError.set(''); return { ...NEW_CHANNEL }; }\n protected newPolicy(): PolicyForm { this.policyError.set(''); return { ...NEW_POLICY }; }\n\n protected editChannel(c: Channel) {\n this.channelError.set('');\n this.channel.set({\n id: c.id, key: c.key, kind: c.kind, url: '', secretRef: c.secretRef ?? '', recipients: (c.recipients ?? []).join(', '), ruleKeys: c.ruleKeys.join(', '), environments: c.environments.join(', '),\n minimumSeverity: c.minimumSeverity, groupWindowSeconds: c.groupWindowSeconds, firing: c.events.includes('alert.firing'), resolved: c.events.includes('alert.resolved'), enabled: c.enabled,\n });\n }\n\n private run<T>(request: Observable<T>, error: (message: string) => void, done: () => void) {\n this.saving.set(true);\n error('');\n request.subscribe({\n next: () => { this.saving.set(false); done(); this.data.reload(); },\n error: e => { this.saving.set(false); error((e as { status?: number }).status === 403 ? 'This needs the admin role.' : problemText(e)); },\n });\n }\n\n protected saveChannel(f: ChannelForm) {\n const events = [f.firing ? 'alert.firing' : '', f.resolved ? 'alert.resolved' : ''].filter(Boolean);\n const body = {\n key: f.key, kind: f.kind, url: f.kind === 'Webhook' && f.url.trim() ? f.url.trim() : undefined, secretRef: f.kind === 'Email' ? undefined : f.secretRef.trim(), recipients: f.kind === 'Email' ? list(f.recipients) : undefined,\n events, ruleKeys: list(f.ruleKeys), environments: list(f.environments).map(e => e.toLowerCase()), minimumSeverity: f.minimumSeverity, groupWindowSeconds: f.groupWindowSeconds || 0, enabled: f.enabled,\n };\n this.run(f.id ? this.api.updateChannel(f.id, body) : this.api.createChannel(body), m => this.channelError.set(m), () => this.channel.set(null));\n }\n\n protected editPolicy(p: EscalationPolicy) {\n this.policyError.set('');\n this.policy.set({\n editing: true, key: p.key, name: p.name, ruleKeys: p.ruleKeys.join(', '), environments: p.environments.join(', '), minimumSeverity: p.minimumSeverity, stopOnAcknowledge: p.stopOnAcknowledge, enabled: p.enabled,\n steps: p.steps.map(s => `${s.afterMinutes}: ${s.endpointKeys.join(', ')}`).join('\\n'),\n });\n }\n\n /** `5: oncall, pager` per line. A line that doesn't read goes to the server as no channels, which says what's wrong. */\n private parseSteps(text: string): EscalationStep[] {\n return text.split('\\n').map(l => l.trim()).filter(Boolean).map(line => {\n const [minutes, ...rest] = line.split(':');\n return { afterMinutes: Number(minutes.trim()), endpointKeys: list(rest.join(':')) };\n });\n }\n\n protected savePolicy(f: PolicyForm) {\n const body = {\n key: f.key, name: f.name, enabled: f.enabled, ruleKeys: list(f.ruleKeys), environments: list(f.environments).map(e => e.toLowerCase()), minimumSeverity: f.minimumSeverity,\n stopOnAcknowledge: f.stopOnAcknowledge, steps: this.parseSteps(f.steps),\n };\n this.run(f.editing ? this.api.updateEscalationPolicy(f.key, body) : this.api.createEscalationPolicy(body), m => this.policyError.set(m), () => this.policy.set(null));\n }\n\n protected addAllowed() {\n this.run(this.api.putAllowlist(this.destination.trim(), list(this.ports).map(Number)), m => this.allowError.set(m), () => { this.destination = ''; this.ports = ''; });\n }\n\n protected removeAllowed(destination: string) {\n this.run(this.api.removeAllowlist(destination), m => this.allowError.set(m), () => undefined);\n }\n\n /** Sends a test through the channel now and shows what happened beside it. Admins only; nothing is queued or retried. */\n protected testChannel(id: string) {\n this.testing.set(id);\n const show = (ok: boolean, text: string) => { this.testing.set(null); this.tests.update(t => ({ ...t, [id]: { ok, text } })); };\n this.api.testChannel(id).subscribe({\n next: r => show(r.delivered, r.delivered\n ? `Test delivered in ${r.durationMs} ms${r.statusCode ? ` (HTTP ${r.statusCode})` : ''}`\n : `Test failed: ${r.error ?? 'unknown'}${r.statusCode ? ` (HTTP ${r.statusCode})` : ''}`),\n error: e => show(false, (e as { status?: number }).status === 403 ? 'Testing a channel needs the admin role.' : problemText(e)),\n });\n }\n\n /** Sends a failed delivery once more; its history shows the new attempt. */\n protected retry(deliveryId: string) {\n const channel = this.history();\n if (!channel) return;\n this.run(this.api.retryDelivery(channel, deliveryId), m => this.retryError.set(m), () => this.deliveries.reload());\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAgBA,MAAM,QAAQ,SAAiB,KAAK,MAAM,GAAG,CAAC,CAAC,KAAI,MAAK,EAAE,KAAI,CAAE,CAAC,CAAC,OAAO,OAAO;AAQhF,MAAM,cAA2B;CAAE,IAAI;CAAM,KAAK;CAAI,MAAM;CAAS,KAAK;CAAI,WAAW;CAAI,YAAY;CAAI,UAAU;CAAI,cAAc;CAAI,iBAAiB;CAAQ,oBAAoB;CAAG,QAAQ;CAAM,UAAU;CAAM,SAAS;AAAI;AACxO,MAAM,aAAyB;CAAE,SAAS;CAAO,KAAK;CAAI,MAAM;CAAI,UAAU;CAAI,cAAc;CAAI,iBAAiB;CAAY,mBAAmB;CAAM,SAAS;CAAM,OAAO;AAAE;AAqJlL,IAAa,oBAAb,MAAa,kBAAiB;CACX,MAAM,OAAO,UAAU;CACrB,UAAU,OAA2B,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAC1C,SAAS,OAA0B,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CACxC,UAAU,OAAsB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CACrC,SAAS,OAAO,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CACtB,eAAe,OAAO,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;CACzB,cAAc,OAAO,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;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- import { S as apiResource, d as HealthBadge, h as AgoPipe, o as problemText, u as ContextBar, v as ReasonPipe } from "./juice-js-observability-telemetry-BftWSOaQ.mjs";
2
+ import { c as ContextBar, g as AgoPipe, h as apiResource, l as HealthBadge, o as problemText, y as ReasonPipe } from "./juice-js-observability-telemetry-B98lekF2.mjs";
3
3
  import * as i0 from "@angular/core";
4
4
  import { ChangeDetectionStrategy, Component, computed, inject } from "@angular/core";
5
5
  import { map } from "rxjs";
@@ -246,4 +246,4 @@ i0.ɵɵngDeclareClassMetadata({
246
246
  });
247
247
  export { OverviewPage };
248
248
 
249
- //# sourceMappingURL=juice-js-observability-overview.page-DXZl_fUh.mjs.map
249
+ //# sourceMappingURL=juice-js-observability-overview.page-56xVtAo2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"juice-js-observability-overview.page-DXZl_fUh.mjs","names":[],"sources":["../../../../projects/juice-js/observability/src/lib/pages/overview.page.ts"],"sourcesContent":["import { LinkPipe } from '../core/options';\nimport { ChangeDetectionStrategy, Component, computed, inject } from '@angular/core';\nimport { apiResource } from '../shared/resource';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\nimport { RouterLink } from '@angular/router';\nimport { map } from 'rxjs';\nimport { ApiService } from '../core/api.service';\nimport { ContextService } from '../core/context.service';\nimport { HealthState } from '../core/models';\nimport { AgoPipe, ReasonPipe } from '../shared/format';\nimport { ContextBar, HealthBadge } from '../shared/ui';\nimport { problemText } from '../shared/telemetry';\n\nconst ORDER: HealthState[] = ['Critical', 'Unhealthy', 'Degraded', 'Offline', 'Unknown', 'Healthy'];\n\n/** How many rows each list shows: the overview orients, the alerts and services pages list everything. */\nconst SHOWN = 10;\n\n/**\n * Where an investigation starts (Console requirements §4, §21 step 1): what is firing and which services are not\n * healthy, each one click from its service page. Orientation, not a dashboard.\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [LinkPipe, RouterLink, MatProgressBarModule, ContextBar, HealthBadge, AgoPipe],\n template: `\n <jc-context-bar><h1>Overview</h1></jc-context-bar>\n @if (health.isLoading() || alerts.isLoading()) { <mat-progress-bar mode=\"indeterminate\" /> }\n @if (health.error()) { <p class=\"jc-error\">{{ error() }}</p> }\n\n <div class=\"jc-tiles\">\n @for (s of order; track s) {\n <a class=\"jc-card jc-tile\" [routerLink]=\"['services'] | jcLink\" [queryParams]=\"ctx.keep({ state: s })\">\n <jc-health [state]=\"s\" /><strong>{{ counts()[s] ?? 0 }}</strong><span class=\"jc-muted\">services</span>\n </a>\n }\n </div>\n\n <section class=\"jc-card\">\n <div class=\"jc-row\">\n <h2>Firing alerts @if (firing().length) { <span class=\"jc-muted\">({{ firing().length }}@if (criticalCount()) { · {{ criticalCount() }} critical})</span> }</h2>\n @if (firing().length) { <a [routerLink]=\"['alerts'] | jcLink\" [queryParams]=\"ctx.keep({ state: 'firing' })\">All firing alerts</a> }\n </div>\n @for (a of firingShown(); track a.id) {\n <div class=\"jc-list-row\">\n <span class=\"jc-badge\" [class.jc-health-unhealthy]=\"a.severity === 'Critical'\" [class.jc-health-degraded]=\"a.severity !== 'Critical'\">{{ a.severity }}</span>\n <a [routerLink]=\"['alerts', a.id] | jcLink\" [queryParams]=\"ctx.keep()\">{{ a.rule }}</a>\n <span>{{ a.subjectKey }}</span>\n <span class=\"jc-muted\">fired {{ a.firedAt | ago }}@if (a.acknowledgedBy) { · acknowledged by {{ a.acknowledgedBy }} }</span>\n </div>\n } @empty { <p class=\"jc-muted\">Nothing firing.</p> }\n @if (firing().length > shown) {\n <p class=\"jc-more\"><span class=\"jc-muted\">Critical first, then the newest; {{ firing().length - shown }} more.</span>\n <a [routerLink]=\"['alerts'] | jcLink\" [queryParams]=\"ctx.keep({ state: 'firing' })\">See all {{ firing().length }}</a></p>\n }\n </section>\n\n <section class=\"jc-card\">\n <h2>Services needing attention @if (attention().length) { <span class=\"jc-muted\">({{ attention().length }})</span> }</h2>\n @for (h of attention().slice(0, shown); track h.subjectId + h.environment) {\n <div class=\"jc-list-row\">\n <jc-health [state]=\"h.state\" [stale]=\"h.stale\" />\n <a [routerLink]=\"['services', h.subjectId] | jcLink\" [queryParams]=\"ctx.keep({ env: h.environment })\">{{ h.subjectName }}</a>\n <span class=\"jc-muted\">{{ h.environment }}</span>\n <span>{{ h.reasons.slice(0, 3).map(reason).join(' · ') }}</span>\n <span class=\"jc-muted\">since {{ h.since | ago }}</span>\n </div>\n } @empty { <p class=\"jc-muted\">Every evaluated service is healthy.</p> }\n @if (attention().length > shown) {\n <p class=\"jc-more\"><span class=\"jc-muted\">The worst first; {{ attention().length - shown }} more. The counts above open each state's list:</span>\n @for (s of order; track s) { @if (s !== 'Healthy' && counts()[s]) {\n <a [routerLink]=\"['services'] | jcLink\" [queryParams]=\"ctx.keep({ state: s })\">{{ counts()[s] }} {{ s.toLowerCase() }}</a>\n } }</p>\n }\n </section>`,\n})\nexport class OverviewPage {\n protected readonly ctx = inject(ContextService);\n private readonly api = inject(ApiService);\n protected readonly order = ORDER;\n protected readonly shown = SHOWN;\n private readonly reasonPipe = new ReasonPipe();\n protected readonly reason = (r: string) => this.reasonPipe.transform(r);\n\n protected readonly health = apiResource({\n params: () => this.ctx.environment(),\n stream: ({ params }) => this.api.health({ subjectType: 'service', environment: params }).pipe(map(p => p.items)),\n });\n protected readonly alerts = apiResource({\n params: () => this.ctx.environment(),\n stream: ({ params }) => this.api.allAlerts({ state: 'firing', environment: params }).pipe(map(p => p.items)),\n });\n protected readonly error = computed(() => problemText(this.health.error()));\n /** Critical first, then the newest. */\n protected readonly firing = computed(() => [...(this.alerts.value() ?? [])].sort((a, b) =>\n Number(b.severity === 'Critical') - Number(a.severity === 'Critical')\n || (b.firedAt ?? '').localeCompare(a.firedAt ?? '')));\n protected readonly firingShown = computed(() => this.firing().slice(0, SHOWN));\n protected readonly criticalCount = computed(() => this.firing().filter(a => a.severity === 'Critical').length);\n protected readonly counts = computed(() => {\n const counts: Partial<Record<HealthState, number>> = {};\n for (const h of this.health.value() ?? []) counts[h.state] = (counts[h.state] ?? 0) + 1;\n return counts;\n });\n protected readonly attention = computed(() => (this.health.value() ?? [])\n .filter(h => h.state !== 'Healthy')\n .sort((a, b) => ORDER.indexOf(a.state) - ORDER.indexOf(b.state)));\n}\n"],"mappings":";;;;;;;;AAaA,MAAM,QAAuB;CAAC;CAAY;CAAa;CAAY;CAAW;CAAW;AAAS;AAGlG,MAAM,QAAQ;AA4Dd,IAAa,eAAb,MAAa,aAAY;CACJ,MAAM,OAAO,cAAc;CAC7B,MAAM,OAAO,UAAU;CACrB,QAAQ;CACR,QAAQ;CACV,aAAa,IAAI,WAAU;CACzB,UAAU,MAAc,KAAK,WAAW,UAAU,CAAC;CAEnD,SAAS,YAAY;EACtC,cAAc,KAAK,IAAI,YAAW;EAClC,SAAS,EAAE,aAAa,KAAK,IAAI,OAAO;GAAE,aAAa;GAAW,aAAa;EAAM,CAAE,CAAC,CAAC,KAAK,KAAI,MAAK,EAAE,KAAK,CAAC;CAChH,CAAA;CACkB,SAAS,YAAY;EACtC,cAAc,KAAK,IAAI,YAAW;EAClC,SAAS,EAAE,aAAa,KAAK,IAAI,UAAU;GAAE,OAAO;GAAU,aAAa;EAAM,CAAE,CAAC,CAAC,KAAK,KAAI,MAAK,EAAE,KAAK,CAAC;CAC5G,CAAA;CACkB,QAAQ,eAAe,YAAY,KAAK,OAAO,MAAK,CAAE,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAExD,SAAS,eAAe,CAAC,GAAI,KAAK,OAAO,MAAK,KAAM,CAAA,CAAG,CAAC,CAAC,MAAM,GAAG,MACnF,OAAO,EAAE,aAAa,UAAU,IAAI,OAAO,EAAE,aAAa,UAAU,MAChE,EAAE,WAAW,GAAA,CAAI,cAAc,EAAE,WAAW,EAAE,CAAC,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CACpC,cAAc,eAAe,KAAK,OAAM,CAAE,CAAC,MAAM,GAA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GAAA;IAAA,MAAA;IAAA,MAAA,GAAA;IAAA,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;KAAA;IAAA;IAAA,SAAA,CAAA,cAAA;IAAA,UAAA,CAAA,gBAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAU,UAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAW,UAAA;IAAA,QAAA,CAAA,SAAA,OAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAnE;IAAQ,MAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAA6D;IAAO,MAAA;GAAA;EAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAoD3E,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAY,YAAA,CAAA;EAtDxB,MAAA;EAAU,MAAA,CAAA;GACT,iBAAiB,wBAAwB;GACzC,SAAS;IAAC;IAAU;IAAY;IAAsB;IAAY;IAAa;GAAO;GACtF,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkDX,CAAA"}
1
+ {"version":3,"file":"juice-js-observability-overview.page-56xVtAo2.mjs","names":[],"sources":["../../../../projects/juice-js/observability/src/lib/pages/overview.page.ts"],"sourcesContent":["import { LinkPipe } from '../core/options';\nimport { ChangeDetectionStrategy, Component, computed, inject } from '@angular/core';\nimport { apiResource } from '../shared/resource';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\nimport { RouterLink } from '@angular/router';\nimport { map } from 'rxjs';\nimport { ApiService } from '../core/api.service';\nimport { ContextService } from '../core/context.service';\nimport { HealthState } from '../core/models';\nimport { AgoPipe, ReasonPipe } from '../shared/format';\nimport { ContextBar, HealthBadge } from '../shared/ui';\nimport { problemText } from '../shared/telemetry';\n\nconst ORDER: HealthState[] = ['Critical', 'Unhealthy', 'Degraded', 'Offline', 'Unknown', 'Healthy'];\n\n/** How many rows each list shows: the overview orients, the alerts and services pages list everything. */\nconst SHOWN = 10;\n\n/**\n * Where an investigation starts (Console requirements §4, §21 step 1): what is firing and which services are not\n * healthy, each one click from its service page. Orientation, not a dashboard.\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [LinkPipe, RouterLink, MatProgressBarModule, ContextBar, HealthBadge, AgoPipe],\n template: `\n <jc-context-bar><h1>Overview</h1></jc-context-bar>\n @if (health.isLoading() || alerts.isLoading()) { <mat-progress-bar mode=\"indeterminate\" /> }\n @if (health.error()) { <p class=\"jc-error\">{{ error() }}</p> }\n\n <div class=\"jc-tiles\">\n @for (s of order; track s) {\n <a class=\"jc-card jc-tile\" [routerLink]=\"['services'] | jcLink\" [queryParams]=\"ctx.keep({ state: s })\">\n <jc-health [state]=\"s\" /><strong>{{ counts()[s] ?? 0 }}</strong><span class=\"jc-muted\">services</span>\n </a>\n }\n </div>\n\n <section class=\"jc-card\">\n <div class=\"jc-row\">\n <h2>Firing alerts @if (firing().length) { <span class=\"jc-muted\">({{ firing().length }}@if (criticalCount()) { · {{ criticalCount() }} critical})</span> }</h2>\n @if (firing().length) { <a [routerLink]=\"['alerts'] | jcLink\" [queryParams]=\"ctx.keep({ state: 'firing' })\">All firing alerts</a> }\n </div>\n @for (a of firingShown(); track a.id) {\n <div class=\"jc-list-row\">\n <span class=\"jc-badge\" [class.jc-health-unhealthy]=\"a.severity === 'Critical'\" [class.jc-health-degraded]=\"a.severity !== 'Critical'\">{{ a.severity }}</span>\n <a [routerLink]=\"['alerts', a.id] | jcLink\" [queryParams]=\"ctx.keep()\">{{ a.rule }}</a>\n <span>{{ a.subjectKey }}</span>\n <span class=\"jc-muted\">fired {{ a.firedAt | ago }}@if (a.acknowledgedBy) { · acknowledged by {{ a.acknowledgedBy }} }</span>\n </div>\n } @empty { <p class=\"jc-muted\">Nothing firing.</p> }\n @if (firing().length > shown) {\n <p class=\"jc-more\"><span class=\"jc-muted\">Critical first, then the newest; {{ firing().length - shown }} more.</span>\n <a [routerLink]=\"['alerts'] | jcLink\" [queryParams]=\"ctx.keep({ state: 'firing' })\">See all {{ firing().length }}</a></p>\n }\n </section>\n\n <section class=\"jc-card\">\n <h2>Services needing attention @if (attention().length) { <span class=\"jc-muted\">({{ attention().length }})</span> }</h2>\n @for (h of attention().slice(0, shown); track h.subjectId + h.environment) {\n <div class=\"jc-list-row\">\n <jc-health [state]=\"h.state\" [stale]=\"h.stale\" />\n <a [routerLink]=\"['services', h.subjectId] | jcLink\" [queryParams]=\"ctx.keep({ env: h.environment })\">{{ h.subjectName }}</a>\n <span class=\"jc-muted\">{{ h.environment }}</span>\n <span>{{ h.reasons.slice(0, 3).map(reason).join(' · ') }}</span>\n <span class=\"jc-muted\">since {{ h.since | ago }}</span>\n </div>\n } @empty { <p class=\"jc-muted\">Every evaluated service is healthy.</p> }\n @if (attention().length > shown) {\n <p class=\"jc-more\"><span class=\"jc-muted\">The worst first; {{ attention().length - shown }} more. The counts above open each state's list:</span>\n @for (s of order; track s) { @if (s !== 'Healthy' && counts()[s]) {\n <a [routerLink]=\"['services'] | jcLink\" [queryParams]=\"ctx.keep({ state: s })\">{{ counts()[s] }} {{ s.toLowerCase() }}</a>\n } }</p>\n }\n </section>`,\n})\nexport class OverviewPage {\n protected readonly ctx = inject(ContextService);\n private readonly api = inject(ApiService);\n protected readonly order = ORDER;\n protected readonly shown = SHOWN;\n private readonly reasonPipe = new ReasonPipe();\n protected readonly reason = (r: string) => this.reasonPipe.transform(r);\n\n protected readonly health = apiResource({\n params: () => this.ctx.environment(),\n stream: ({ params }) => this.api.health({ subjectType: 'service', environment: params }).pipe(map(p => p.items)),\n });\n protected readonly alerts = apiResource({\n params: () => this.ctx.environment(),\n stream: ({ params }) => this.api.allAlerts({ state: 'firing', environment: params }).pipe(map(p => p.items)),\n });\n protected readonly error = computed(() => problemText(this.health.error()));\n /** Critical first, then the newest. */\n protected readonly firing = computed(() => [...(this.alerts.value() ?? [])].sort((a, b) =>\n Number(b.severity === 'Critical') - Number(a.severity === 'Critical')\n || (b.firedAt ?? '').localeCompare(a.firedAt ?? '')));\n protected readonly firingShown = computed(() => this.firing().slice(0, SHOWN));\n protected readonly criticalCount = computed(() => this.firing().filter(a => a.severity === 'Critical').length);\n protected readonly counts = computed(() => {\n const counts: Partial<Record<HealthState, number>> = {};\n for (const h of this.health.value() ?? []) counts[h.state] = (counts[h.state] ?? 0) + 1;\n return counts;\n });\n protected readonly attention = computed(() => (this.health.value() ?? [])\n .filter(h => h.state !== 'Healthy')\n .sort((a, b) => ORDER.indexOf(a.state) - ORDER.indexOf(b.state)));\n}\n"],"mappings":";;;;;;;;AAaA,MAAM,QAAuB;CAAC;CAAY;CAAa;CAAY;CAAW;CAAW;AAAS;AAGlG,MAAM,QAAQ;AA4Dd,IAAa,eAAb,MAAa,aAAY;CACJ,MAAM,OAAO,cAAc;CAC7B,MAAM,OAAO,UAAU;CACrB,QAAQ;CACR,QAAQ;CACV,aAAa,IAAI,WAAU;CACzB,UAAU,MAAc,KAAK,WAAW,UAAU,CAAC;CAEnD,SAAS,YAAY;EACtC,cAAc,KAAK,IAAI,YAAW;EAClC,SAAS,EAAE,aAAa,KAAK,IAAI,OAAO;GAAE,aAAa;GAAW,aAAa;EAAM,CAAE,CAAC,CAAC,KAAK,KAAI,MAAK,EAAE,KAAK,CAAC;CAChH,CAAA;CACkB,SAAS,YAAY;EACtC,cAAc,KAAK,IAAI,YAAW;EAClC,SAAS,EAAE,aAAa,KAAK,IAAI,UAAU;GAAE,OAAO;GAAU,aAAa;EAAM,CAAE,CAAC,CAAC,KAAK,KAAI,MAAK,EAAE,KAAK,CAAC;CAC5G,CAAA;CACkB,QAAQ,eAAe,YAAY,KAAK,OAAO,MAAK,CAAE,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAExD,SAAS,eAAe,CAAC,GAAI,KAAK,OAAO,MAAK,KAAM,CAAA,CAAG,CAAC,CAAC,MAAM,GAAG,MACnF,OAAO,EAAE,aA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;;;;;;;;;;;;;;EAiDG,UAAA;EAAA,cAAA;GAAA;IAAA,MAAA;IAAA,MAlDO;IAAU,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;IAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;GAAoB;GAAA;IAAA,MAAA;IAAA,MAAA,GAAA;IAAA,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;KAAA;IAAA;IAAA,SAAA,CAAA,cAAA;IAAA,UAAA,CAAA,gBAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAU,UAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAW,UAAA;IAAA,QAAA,CAAA,SAAA,OAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAnE;IAAQ,MAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAA6D;IAAO,MAAA;GAAA;EAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAoD3E,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAY,YAAA,CAAA;EAtDxB,MAAA;EAAU,MAAA,CAAA;GACT,iBAAiB,wBAAwB;GACzC,SAAS;IAAC;IAAU;IAAY;IAAsB;IAAY;IAAa;GAAO;GACtF,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkDX,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { ApiService, ContextService, LinkPipe } from "./juice-js-observability.mjs";
2
- import { S as apiResource, a as TraceTable, d as HealthBadge, f as KeyValueTable, h as AgoPipe, l as ConfidenceBadge, n as LogTable, o as problemText, r as MetricExplorer, u as ContextBar, v as ReasonPipe } from "./juice-js-observability-telemetry-BftWSOaQ.mjs";
2
+ import { a as TraceTable, c as ContextBar, g as AgoPipe, h as apiResource, l as HealthBadge, n as LogTable, o as problemText, r as MetricExplorer, s as ConfidenceBadge, u as KeyValueTable, y as ReasonPipe } from "./juice-js-observability-telemetry-B98lekF2.mjs";
3
3
  import * as i0 from "@angular/core";
4
4
  import { ChangeDetectionStrategy, Component, computed, inject, input } from "@angular/core";
5
5
  import { RouterLink } from "@angular/router";
@@ -271,4 +271,4 @@ i0.ɵɵngDeclareClassMetadata({
271
271
  });
272
272
  export { ResourcePage };
273
273
 
274
- //# sourceMappingURL=juice-js-observability-resource.page-CauDE6kK.mjs.map
274
+ //# sourceMappingURL=juice-js-observability-resource.page-CRSA-zpR.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"juice-js-observability-resource.page-CauDE6kK.mjs","names":[],"sources":["../../../../projects/juice-js/observability/src/lib/pages/resource.page.ts"],"sourcesContent":["import { LinkPipe } from '../core/options';\nimport { ChangeDetectionStrategy, Component, computed, inject, input } from '@angular/core';\nimport { apiResource } from '../shared/resource';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\nimport { RouterLink } from '@angular/router';\nimport { ApiService } from '../core/api.service';\nimport { ContextService } from '../core/context.service';\nimport { AgoPipe, ReasonPipe } from '../shared/format';\nimport { ConfidenceBadge, ContextBar, HealthBadge, KeyValueTable } from '../shared/ui';\nimport { LogTable, MetricExplorer, TraceTable, problemText } from '../shared/telemetry';\n\n/**\n * A host, container, pod, database or destination (Console requirements §11): what runs on it or who uses it, its\n * health, and its telemetry. A database or destination has traces (the calls to it) but no logs or metrics of its own.\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [LinkPipe, RouterLink, MatProgressBarModule, ContextBar, HealthBadge, ConfidenceBadge, KeyValueTable, TraceTable, LogTable,\n MetricExplorer, AgoPipe],\n template: `\n <jc-context-bar>\n <a [routerLink]=\"['resources'] | jcLink\" [queryParams]=\"ctx.keep({ type: resource.value()?.type })\" class=\"jc-crumb\">Resources</a>\n <span class=\"jc-crumb-sep\">›</span>\n <h1>{{ resource.value()?.displayName ?? '…' }}</h1>\n <span class=\"jc-muted\">{{ resource.value()?.type }}</span>\n </jc-context-bar>\n @if (resource.isLoading()) { <mat-progress-bar mode=\"indeterminate\" /> }\n @if (resource.error()) { <p class=\"jc-error\">{{ error() }}</p> }\n @if (resource.value(); as r) {\n <div class=\"jc-grid-2\">\n <section class=\"jc-card\">\n <h2>Identity</h2>\n <jc-kv [values]=\"{ key: r.key, 'first seen': r.firstSeen, 'last seen': r.lastSeen }\" />\n <jc-kv [values]=\"r.attributes\" empty=\"\" />\n @for (h of r.health; track h.subjectId) {\n <p><jc-health [state]=\"h.state\" [stale]=\"h.stale\" /> {{ h.reasons.map(reason).join(' · ') }}</p>\n }\n </section>\n <section class=\"jc-card\">\n @if (isInfrastructure()) {\n <h2>Instances running here</h2>\n @for (i of r.instances; track i.id) {\n <div class=\"jc-list-row\"><jc-health [state]=\"i.health\" /><span>{{ i.instanceKey }}</span>\n <span class=\"jc-muted\">{{ i.environment }}</span><span class=\"jc-muted\">{{ i.lastSeen | ago }}</span></div>\n } @empty { <p class=\"jc-muted\">No service instances seen on it.</p> }\n } @else {\n <h2>Used by</h2>\n @for (e of users(); track e.id) {\n <div class=\"jc-list-row\"><a [routerLink]=\"['services', e.source] | jcLink\" [queryParams]=\"ctx.keep()\">{{ name(e.source) }}</a>\n <span>{{ e.relation }}</span><jc-confidence [confidence]=\"e.confidence\" />\n <a [routerLink]=\"['topology'] | jcLink\" [queryParams]=\"ctx.keep({ edge: e.id })\">evidence</a></div>\n } @empty { <p class=\"jc-muted\">No users seen{{ ctx.environment() ? ' in ' + ctx.environment() : '' }}.</p> }\n }\n </section>\n </div>\n @if (isInfrastructure()) {\n <h2>Metrics</h2>\n <jc-metric-explorer [scope]=\"{ resourceId: id() }\" />\n <h2>Logs</h2>\n <jc-log-table [query]=\"{ resourceId: id() }\" />\n } @else {\n <h2>Traces that reach it</h2>\n <jc-trace-table [query]=\"{ resourceId: id() }\" />\n }\n }`,\n})\nexport class ResourcePage {\n protected readonly ctx = inject(ContextService);\n private readonly api = inject(ApiService);\n readonly id = input.required<string>();\n\n protected readonly resource = apiResource({ params: () => this.id(), stream: ({ params }) => this.api.resource(params) });\n protected readonly topology = apiResource({ params: () => this.ctx.environment(), stream: ({ params }) => this.api.topology(params || null) });\n protected readonly error = computed(() => problemText(this.resource.error()));\n protected readonly isInfrastructure = computed(() => ['host', 'container', 'k8s-pod'].includes(this.resource.value()?.type ?? ''));\n protected readonly users = computed(() => (this.topology.value()?.edges ?? []).filter(e => e.target === this.id()));\n private readonly reasonPipe = new ReasonPipe();\n protected readonly reason = (r: string) => this.reasonPipe.transform(r);\n\n name(id: string) { return this.topology.value()?.nodes.find(n => n.id === id)?.displayName ?? id; }\n}\n"],"mappings":";;;;;;;AAkEA,IAAa,eAAb,MAAa,aAAY;CACJ,MAAM,OAAO,cAAc;CAC7B,MAAM,OAAO,UAAU;CAC/B,KAAK,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,KAAA,CAAA,+BAAA,CAAA,CAAA;CAEnB,WAAW,YAAY;EAAE,cAAc,KAAK,GAAE;EAAI,SAAS,EAAE,aAAa,KAAK,IAAI,SAAS,MAAM;CAAC,CAAE;CACrG,WAAW,YAAY;EAAE,cAAc,KAAK,IAAI,YAAW;EAAI,SAAS,EAAE,aAAa,KAAK,IAAI,SAAS,UAAU,IAAI;CAAC,CAAE;CAC1H,QAAQ,eAAe,YAAY,KAAK,SAAS,MAAK,CAAE,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAC1D,mBAAmB,eAAe;EAAC;EAAQ;EAAa;CAAS,CAAC,CAAC,SAAS,KAAK,SAAS,MAAK,CAAE,EAAE,QAAQ,EAAE,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,mBAAA,CAAA,+BAAA,CAAA,CAAA;CAC/G,QAAQ,gBAAgB,KAAK,SAAS,MAAK,CAAE,EAAE,SAAS,CAAA,EAAA,CAAI,QAAO,MAAK,EAAE,WAAW,KAAK,GAAE,CAAE,GAA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AAE;IAAa,UAAA;IAAA,QAAA,CAAA,UAAA,OAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAU,UAAA;IAAA,QAAA,CAAA,SAAA,OAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAQ,UAAA;IAAA,QAAA,CAAA,SAAA,SAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MACjI;IAAc,UAAA;IAAA,QAAA,CAAA,SAAA,SAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MADN;IAAQ,MAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MACA;IAAO,MAAA;GAAA;EAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAgDd,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAY,YAAA,CAAA;EAnDxB,MAAA;EAAU,MAAA,CAAA;GACT,iBAAiB,wBAAwB;GACzC,SAAS;IAAC;IAAU;IAAY;IAAsB;IAAY;IAAa;IAAiB;IAAe;IAAY;IACzH;IAAgB;GAAO;GACzB,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8CX,CAAA"}
1
+ {"version":3,"file":"juice-js-observability-resource.page-CRSA-zpR.mjs","names":[],"sources":["../../../../projects/juice-js/observability/src/lib/pages/resource.page.ts"],"sourcesContent":["import { LinkPipe } from '../core/options';\nimport { ChangeDetectionStrategy, Component, computed, inject, input } from '@angular/core';\nimport { apiResource } from '../shared/resource';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\nimport { RouterLink } from '@angular/router';\nimport { ApiService } from '../core/api.service';\nimport { ContextService } from '../core/context.service';\nimport { AgoPipe, ReasonPipe } from '../shared/format';\nimport { ConfidenceBadge, ContextBar, HealthBadge, KeyValueTable } from '../shared/ui';\nimport { LogTable, MetricExplorer, TraceTable, problemText } from '../shared/telemetry';\n\n/**\n * A host, container, pod, database or destination (Console requirements §11): what runs on it or who uses it, its\n * health, and its telemetry. A database or destination has traces (the calls to it) but no logs or metrics of its own.\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [LinkPipe, RouterLink, MatProgressBarModule, ContextBar, HealthBadge, ConfidenceBadge, KeyValueTable, TraceTable, LogTable,\n MetricExplorer, AgoPipe],\n template: `\n <jc-context-bar>\n <a [routerLink]=\"['resources'] | jcLink\" [queryParams]=\"ctx.keep({ type: resource.value()?.type })\" class=\"jc-crumb\">Resources</a>\n <span class=\"jc-crumb-sep\">›</span>\n <h1>{{ resource.value()?.displayName ?? '…' }}</h1>\n <span class=\"jc-muted\">{{ resource.value()?.type }}</span>\n </jc-context-bar>\n @if (resource.isLoading()) { <mat-progress-bar mode=\"indeterminate\" /> }\n @if (resource.error()) { <p class=\"jc-error\">{{ error() }}</p> }\n @if (resource.value(); as r) {\n <div class=\"jc-grid-2\">\n <section class=\"jc-card\">\n <h2>Identity</h2>\n <jc-kv [values]=\"{ key: r.key, 'first seen': r.firstSeen, 'last seen': r.lastSeen }\" />\n <jc-kv [values]=\"r.attributes\" empty=\"\" />\n @for (h of r.health; track h.subjectId) {\n <p><jc-health [state]=\"h.state\" [stale]=\"h.stale\" /> {{ h.reasons.map(reason).join(' · ') }}</p>\n }\n </section>\n <section class=\"jc-card\">\n @if (isInfrastructure()) {\n <h2>Instances running here</h2>\n @for (i of r.instances; track i.id) {\n <div class=\"jc-list-row\"><jc-health [state]=\"i.health\" /><span>{{ i.instanceKey }}</span>\n <span class=\"jc-muted\">{{ i.environment }}</span><span class=\"jc-muted\">{{ i.lastSeen | ago }}</span></div>\n } @empty { <p class=\"jc-muted\">No service instances seen on it.</p> }\n } @else {\n <h2>Used by</h2>\n @for (e of users(); track e.id) {\n <div class=\"jc-list-row\"><a [routerLink]=\"['services', e.source] | jcLink\" [queryParams]=\"ctx.keep()\">{{ name(e.source) }}</a>\n <span>{{ e.relation }}</span><jc-confidence [confidence]=\"e.confidence\" />\n <a [routerLink]=\"['topology'] | jcLink\" [queryParams]=\"ctx.keep({ edge: e.id })\">evidence</a></div>\n } @empty { <p class=\"jc-muted\">No users seen{{ ctx.environment() ? ' in ' + ctx.environment() : '' }}.</p> }\n }\n </section>\n </div>\n @if (isInfrastructure()) {\n <h2>Metrics</h2>\n <jc-metric-explorer [scope]=\"{ resourceId: id() }\" />\n <h2>Logs</h2>\n <jc-log-table [query]=\"{ resourceId: id() }\" />\n } @else {\n <h2>Traces that reach it</h2>\n <jc-trace-table [query]=\"{ resourceId: id() }\" />\n }\n }`,\n})\nexport class ResourcePage {\n protected readonly ctx = inject(ContextService);\n private readonly api = inject(ApiService);\n readonly id = input.required<string>();\n\n protected readonly resource = apiResource({ params: () => this.id(), stream: ({ params }) => this.api.resource(params) });\n protected readonly topology = apiResource({ params: () => this.ctx.environment(), stream: ({ params }) => this.api.topology(params || null) });\n protected readonly error = computed(() => problemText(this.resource.error()));\n protected readonly isInfrastructure = computed(() => ['host', 'container', 'k8s-pod'].includes(this.resource.value()?.type ?? ''));\n protected readonly users = computed(() => (this.topology.value()?.edges ?? []).filter(e => e.target === this.id()));\n private readonly reasonPipe = new ReasonPipe();\n protected readonly reason = (r: string) => this.reasonPipe.transform(r);\n\n name(id: string) { return this.topology.value()?.nodes.find(n => n.id === id)?.displayName ?? id; }\n}\n"],"mappings":";;;;;;;AAkEA,IAAa,eAAb,MAAa,aAAY;CACJ,MAAM,OAAO,cAAc;CAC7B,MAAM,OAAO,UAAU;CAC/B,KAAK,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,KAAA,CAAA,+BAAA,CAAA,CAAA;CAEnB,WAAW,YAAY;EAAE,cAAc,KAAK,GAAE;EAAI,SAAS,EAAE,aAAa,KAAK,IAAI,SAAS,MAAM;CAAC,CAAE;CACrG,WAAW,YAAY;EAAE,cAAc,KAAK,IAAI,YAAW;EAAI,SAAS,EAAE,aAAa,KAAK,IAAI,SAAS,UAAU,IAAI;CAAC,CAAE;CAC1H,QAAQ,eAAe,YAAY,KAAK,SAAS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AE;GAAoB;GAAA;IAAA,MAAA;IAAA,MAAA,GAAA;IAAA,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;KAAA;IAAA;IAAA,SAAA,CAAA,cAAA;IAAA,UAAA,CAAA,gBAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAU,UAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAW,UAAA;IAAA,QAAA,CAAA,SAAA,OAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAe,UAAA;IAAA,QAAA,CAAA,YAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAa,UAAA;IAAA,QAAA,CAAA,UAAA,OAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAU,UAAA;IAAA,QAAA,CAAA,SAAA,OAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAQ,UAAA;IAAA,QAAA,CAAA,SAAA,SAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MACjI;IAAc,UAAA;IAAA,QAAA,CAAA,SAAA,SAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MADN;IAAQ,MAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MACA;IAAO,MAAA;GAAA;EAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAgDd,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAY,YAAA,CAAA;EAnDxB,MAAA;EAAU,MAAA,CAAA;GACT,iBAAiB,wBAAwB;GACzC,SAAS;IAAC;IAAU;IAAY;IAAsB;IAAY;IAAa;IAAiB;IAAe;IAAY;IACzH;IAAgB;GAAO;GACzB,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8CX,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { ApiService, ContextService, LinkPipe } from "./juice-js-observability.mjs";
2
- import { S as apiResource, c as screenPages, h as AgoPipe, o as problemText, u as ContextBar } from "./juice-js-observability-telemetry-BftWSOaQ.mjs";
2
+ import { c as ContextBar, g as AgoPipe, h as apiResource, m as screenPages, o as problemText } from "./juice-js-observability-telemetry-B98lekF2.mjs";
3
3
  import * as i0 from "@angular/core";
4
4
  import { ChangeDetectionStrategy, Component, computed, inject, input, signal } from "@angular/core";
5
5
  import { RouterLink } from "@angular/router";
@@ -206,4 +206,4 @@ i0.ɵɵngDeclareClassMetadata({
206
206
  });
207
207
  export { ResourcesPage };
208
208
 
209
- //# sourceMappingURL=juice-js-observability-resources.page-CukW8vVc.mjs.map
209
+ //# sourceMappingURL=juice-js-observability-resources.page-BW7W5Wy2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"juice-js-observability-resources.page-CukW8vVc.mjs","names":[],"sources":["../../../../projects/juice-js/observability/src/lib/pages/resources.page.ts"],"sourcesContent":["import { LinkPipe } from '../core/options';\nimport { ChangeDetectionStrategy, Component, computed, inject, input, signal } from '@angular/core';\nimport { apiResource } from '../shared/resource';\nimport { MatPaginatorModule } from '@angular/material/paginator';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\nimport { RouterLink } from '@angular/router';\nimport { SearchablePage } from '@juice-js/layout';\nimport { ApiService } from '../core/api.service';\nimport { ContextService } from '../core/context.service';\nimport { AgoPipe } from '../shared/format';\nimport { ContextBar } from '../shared/ui';\nimport { problemText } from '../shared/telemetry';\nimport { screenPages } from '../shared/paging';\n\nconst TYPES = ['host', 'container', 'k8s-pod', 'database', 'messaging-destination'];\n\n/**\n * Where services run and what they use (Console requirements §11): hosts, containers, pods, databases and\n * destinations, as discovery reconciled them. Never deleted automatically; renames come only from configured aliases.\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [LinkPipe, RouterLink, MatPaginatorModule, MatProgressBarModule, ContextBar, AgoPipe],\n template: `\n <jc-context-bar><h1>Resources</h1>\n @for (t of types; track t) {\n <a class=\"jc-chip\" [class.jc-selected]=\"t === (type() ?? 'host')\" [routerLink]=\"['resources'] | jcLink\" [queryParams]=\"ctx.keep({ type: t })\">{{ t }}</a>\n }\n </jc-context-bar>\n @if (resources.isLoading()) { <mat-progress-bar mode=\"indeterminate\" /> }\n @if (resources.error()) { <p class=\"jc-error\">{{ error() }}</p> }\n @if (capped()) { <p class=\"jc-notice\">Showing the first 5,000 only. Narrow the list with the search box or a filter.</p> }\n <table class=\"jc-table\">\n <thead><tr><th>Name</th><th>Key</th><th>First seen</th><th>Last seen</th></tr></thead>\n <tbody>\n @for (r of pages.visible(); track r.id) {\n <tr><td><a [routerLink]=\"['resources', r.id] | jcLink\" [queryParams]=\"ctx.keep()\">{{ r.displayName }}</a></td>\n <td class=\"jc-mono jc-small\">{{ r.key }}</td><td>{{ r.firstSeen | ago }}</td><td>{{ r.lastSeen | ago }}</td></tr>\n } @empty { <tr><td colspan=\"4\" class=\"jc-muted\">None seen.</td></tr> }\n </tbody>\n </table>\n @if (pages.needed()) {\n <mat-paginator [length]=\"rows().length\" [pageSize]=\"pages.size()\" [pageIndex]=\"pages.index()\" [pageSizeOptions]=\"pages.sizes\"\n (page)=\"pages.change($event)\" aria-label=\"Pages\" />\n }`,\n})\nexport class ResourcesPage implements SearchablePage {\n protected readonly ctx = inject(ContextService);\n private readonly api = inject(ApiService);\n protected readonly types = TYPES;\n readonly type = input<string>();\n private readonly filter = signal('');\n\n protected readonly resources = apiResource({\n params: () => this.type() ?? 'host',\n stream: ({ params }) => this.api.resources(params),\n });\n protected readonly error = computed(() => problemText(this.resources.error()));\n protected readonly capped = computed(() => (this.resources.value()?.nextCursor ?? null) !== null);\n protected readonly rows = computed(() => (this.resources.value()?.items ?? [])\n .filter(r => !this.filter() || `${r.displayName} ${r.key}`.toLowerCase().includes(this.filter().toLowerCase())));\n\n protected readonly pages = screenPages(this.rows);\n\n onSearch(query: string) { this.filter.set(query); }\n}\n"],"mappings":";;;;;;;;;AAcA,MAAM,QAAQ;CAAC;CAAQ;CAAa;CAAW;CAAY;AAAuB;AAgClF,IAAa,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ourcesContent":["import { LinkPipe } from '../core/options';\nimport { ChangeDetectionStrategy, Component, computed, inject, input, signal } from '@angular/core';\nimport { apiResource } from '../shared/resource';\nimport { MatPaginatorModule } from '@angular/material/paginator';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\nimport { RouterLink } from '@angular/router';\nimport { SearchablePage } from '@juice-js/layout';\nimport { ApiService } from '../core/api.service';\nimport { ContextService } from '../core/context.service';\nimport { AgoPipe } from '../shared/format';\nimport { ContextBar } from '../shared/ui';\nimport { problemText } from '../shared/telemetry';\nimport { screenPages } from '../shared/paging';\n\nconst TYPES = ['host', 'container', 'k8s-pod', 'database', 'messaging-destination'];\n\n/**\n * Where services run and what they use (Console requirements §11): hosts, containers, pods, databases and\n * destinations, as discovery reconciled them. Never deleted automatically; renames come only from configured aliases.\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [LinkPipe, RouterLink, MatPaginatorModule, MatProgressBarModule, ContextBar, AgoPipe],\n template: `\n <jc-context-bar><h1>Resources</h1>\n @for (t of types; track t) {\n <a class=\"jc-chip\" [class.jc-selected]=\"t === (type() ?? 'host')\" [routerLink]=\"['resources'] | jcLink\" [queryParams]=\"ctx.keep({ type: t })\">{{ t }}</a>\n }\n </jc-context-bar>\n @if (resources.isLoading()) { <mat-progress-bar mode=\"indeterminate\" /> }\n @if (resources.error()) { <p class=\"jc-error\">{{ error() }}</p> }\n @if (capped()) { <p class=\"jc-notice\">Showing the first 5,000 only. Narrow the list with the search box or a filter.</p> }\n <table class=\"jc-table\">\n <thead><tr><th>Name</th><th>Key</th><th>First seen</th><th>Last seen</th></tr></thead>\n <tbody>\n @for (r of pages.visible(); track r.id) {\n <tr><td><a [routerLink]=\"['resources', r.id] | jcLink\" [queryParams]=\"ctx.keep()\">{{ r.displayName }}</a></td>\n <td class=\"jc-mono jc-small\">{{ r.key }}</td><td>{{ r.firstSeen | ago }}</td><td>{{ r.lastSeen | ago }}</td></tr>\n } @empty { <tr><td colspan=\"4\" class=\"jc-muted\">None seen.</td></tr> }\n </tbody>\n </table>\n @if (pages.needed()) {\n <mat-paginator [length]=\"rows().length\" [pageSize]=\"pages.size()\" [pageIndex]=\"pages.index()\" [pageSizeOptions]=\"pages.sizes\"\n (page)=\"pages.change($event)\" aria-label=\"Pages\" />\n }`,\n})\nexport class ResourcesPage implements SearchablePage {\n protected readonly ctx = inject(ContextService);\n private readonly api = inject(ApiService);\n protected readonly types = TYPES;\n readonly type = input<string>();\n private readonly filter = signal('');\n\n protected readonly resources = apiResource({\n params: () => this.type() ?? 'host',\n stream: ({ params }) => this.api.resources(params),\n });\n protected readonly error = computed(() => problemText(this.resources.error()));\n protected readonly capped = computed(() => (this.resources.value()?.nextCursor ?? null) !== null);\n protected readonly rows = computed(() => (this.resources.value()?.items ?? [])\n .filter(r => !this.filter() || `${r.displayName} ${r.key}`.toLowerCase().includes(this.filter().toLowerCase())));\n\n protected readonly pages = screenPages(this.rows);\n\n onSearch(query: string) { this.filter.set(query); }\n}\n"],"mappings":";;;;;;;;;AAcA,MAAM,QAAQ;CAAC;CAAQ;CAAa;CAAW;CAAY;AAAuB;AAgClF,IAAa,gBAAb,MAAa,cAAa;CACL,MAAM,OAAO,cAAc;CAC7B,MAAM,OAAO,UAAU;CACrB,QAAQ;CAClB,OAAO,MAAe,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CACd,SAAS,OAAO,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAEjB,YAAY,YAAY;EACzC,cAAc,KAAK,KAAI,KAAM;EAC7B,SAAS,EAAE,aAAa,KAAK,IAAI,UAAU,MAAM;CAClD,CAAA;CACkB,QAAQ,eAAe,YAAY,KAAK,UAAU,MAAK,CAAE,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAC3D,SAAS,gBAAgB,KAAK,UAAU,MAAK,CAAE,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A,MAAE;GAAoB;GAAA;IAAA,MAAA;IAAA,MAAA,GAAA;IAAA,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;KAAA;IAAA;IAAA,SAAA,CAAA,cAAA;IAAA,UAAA,CAAA,gBAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAU,UAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAA1E;IAAQ,MAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAoE;IAAO,MAAA;GAAA;EAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAwBlF,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAa,YAAA,CAAA;EA1BzB,MAAA;EAAU,MAAA,CAAA;GACT,iBAAiB,wBAAwB;GACzC,SAAS;IAAC;IAAU;IAAY;IAAoB;IAAsB;IAAY;GAAO;GAC7F,UAAU;;;;;;;;;;;;;;;;;;;;;;EAsBX,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { ApiService, ContextService, LinkPipe } from "./juice-js-observability.mjs";
2
- import { S as apiResource, h as AgoPipe, o as problemText, u as ContextBar } from "./juice-js-observability-telemetry-BftWSOaQ.mjs";
2
+ import { c as ContextBar, g as AgoPipe, h as apiResource, o as problemText } from "./juice-js-observability-telemetry-B98lekF2.mjs";
3
3
  import * as i0 from "@angular/core";
4
4
  import { ChangeDetectionStrategy, Component, computed, inject, signal } from "@angular/core";
5
5
  import { forkJoin, map } from "rxjs";
@@ -577,4 +577,4 @@ i0.ɵɵngDeclareClassMetadata({
577
577
  });
578
578
  export { RulesPage };
579
579
 
580
- //# sourceMappingURL=juice-js-observability-rules.page-Df2uDVwz.mjs.map
580
+ //# sourceMappingURL=juice-js-observability-rules.page-uKeK44Iz.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"juice-js-observability-rules.page-Df2uDVwz.mjs","names":[],"sources":["../../../../projects/juice-js/observability/src/lib/pages/rules.page.ts"],"sourcesContent":["import { LinkPipe } from '../core/options';\nimport { ChangeDetectionStrategy, Component, computed, inject, signal } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\nimport { MatSelectModule } from '@angular/material/select';\nimport { apiResource } from '../shared/resource';\nimport { RouterLink } from '@angular/router';\nimport { Observable, forkJoin, map } from 'rxjs';\nimport { ApiService } from '../core/api.service';\nimport { ContextService } from '../core/context.service';\nimport { Rule } from '../core/models';\nimport { AgoPipe } from '../shared/format';\nimport { ContextBar } from '../shared/ui';\nimport { problemText } from '../shared/telemetry';\n\nconst TEMPLATES: Record<string, string> = {\n ErrorRate: 'Ratio of failed requests, 0 to 1. Fires above the threshold.',\n LatencyP95: 'Milliseconds at the 95th percentile. Fires above the threshold.',\n ThroughputAbsent: 'Requests in the window, for a service that had traffic. Fires at or below the threshold.',\n DeliveryFailureRate: 'Ratio of failed deliveries, 0 to 1. Fires above the threshold.',\n HostMemory: 'Ratio of host memory used, 0 to 1. Fires above the threshold.',\n MediatorErrors: 'Mediator errors in the window. Fires above the threshold.',\n ConsumerFailures: 'Failed consumer messages in the window. Fires above the threshold.',\n};\n\n/** A TimeSpan as the API writes it (`1.02:03:04`) in seconds. */\nfunction seconds(value: unknown): number {\n const match = /^(?:(\\d+)\\.)?(\\d+):(\\d+):(\\d+)/.exec(String(value ?? ''));\n return match ? (+(match[1] ?? 0)) * 86400 + +match[2] * 3600 + +match[3] * 60 + +match[4] : 0;\n}\n\nfunction span(total: number): string {\n const s = Math.max(0, Math.round(total || 0));\n const pad = (n: number) => String(n).padStart(2, '0');\n const days = Math.floor(s / 86400);\n return `${days ? `${days}.` : ''}${pad(Math.floor(s / 3600) % 24)}:${pad(Math.floor(s / 60) % 60)}:${pad(s % 60)}`;\n}\n\ninterface RuleForm {\n key: string; name: string; template: string; severity: string; service: string; environment: string; host: string; threshold: number | null; recoveryThreshold: number | null;\n minimumSamples: number; scheduleSeconds: number; windowSeconds: number; forSeconds: number; recoverySeconds: number; cooldownSeconds: number; enabled: boolean;\n}\n\nconst NEW_RULE: RuleForm = {\n key: '', name: '', template: 'ErrorRate', severity: 'Warning', service: '', environment: '', host: '', threshold: null, recoveryThreshold: null,\n minimumSamples: 10, scheduleSeconds: 60, windowSeconds: 300, forSeconds: 120, recoverySeconds: 120, cooldownSeconds: 600, enabled: true,\n};\n\n/**\n * Rules and their current state (Console requirements §14), and changing them for admins. They stay typed templates (D5): this page never takes a query.\n * A rule in the deployment's file is shown but changed there. Disabling one, or changing what it watches, closes its open alerts, which the form says first.\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [LinkPipe, RouterLink, FormsModule, MatButtonModule, MatCheckboxModule, MatFormFieldModule, MatInputModule, MatProgressBarModule, MatSelectModule, ContextBar, AgoPipe],\n template: `\n <jc-context-bar>\n <h1>Rules</h1>\n <span class=\"jc-spacer\"></span>\n <button mat-flat-button type=\"button\" data-testid=\"rule-new\" (click)=\"startNew()\">New rule</button>\n </jc-context-bar>\n @if (data.isLoading()) { <mat-progress-bar mode=\"indeterminate\" /> }\n @if (data.error()) { <p class=\"jc-error\">{{ error() }}</p> }\n @if (form(); as f) {\n <section class=\"jc-card\" data-testid=\"rule-form\">\n <h2>{{ editing() ? 'Change ' + editing()!.key : 'New rule' }}</h2>\n <form class=\"jc-form\" (ngSubmit)=\"save(f)\">\n @if (!editing()) { <mat-form-field subscriptSizing=\"dynamic\"><mat-label>Key</mat-label><input matInput name=\"key\" [(ngModel)]=\"f.key\" required></mat-form-field> }\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-wide\"><mat-label>Name</mat-label><input matInput name=\"name\" [(ngModel)]=\"f.name\" required></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\"><mat-label>Template</mat-label>\n <mat-select name=\"template\" [(ngModel)]=\"f.template\">@for (t of templates; track t) { <mat-option [value]=\"t\">{{ t }}</mat-option> }</mat-select>\n </mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Severity</mat-label>\n <mat-select name=\"severity\" [(ngModel)]=\"f.severity\"><mat-option value=\"Info\">Info</mat-option><mat-option value=\"Warning\">Warning</mat-option><mat-option value=\"Critical\">Critical</mat-option></mat-select>\n </mat-form-field>\n @if (f.template === 'HostMemory') {\n <mat-form-field subscriptSizing=\"dynamic\"><mat-label>Host (all if empty)</mat-label><input matInput name=\"host\" [(ngModel)]=\"f.host\"></mat-form-field>\n } @else {\n <mat-form-field subscriptSizing=\"dynamic\"><mat-label>Service (all if empty)</mat-label><input matInput name=\"service\" [(ngModel)]=\"f.service\"></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\"><mat-label>Environment (all if empty)</mat-label><input matInput name=\"environment\" [(ngModel)]=\"f.environment\"></mat-form-field>\n }\n <p class=\"jc-muted jc-small jc-form-actions\">{{ hint(f.template) }}</p>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Threshold</mat-label><input matInput type=\"number\" step=\"any\" name=\"threshold\" [(ngModel)]=\"f.threshold\" required></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Recovery threshold</mat-label><input matInput type=\"number\" step=\"any\" name=\"recoveryThreshold\" [(ngModel)]=\"f.recoveryThreshold\"></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Minimum samples</mat-label><input matInput type=\"number\" name=\"minimumSamples\" [(ngModel)]=\"f.minimumSamples\"></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Every (s)</mat-label><input matInput type=\"number\" name=\"schedule\" [(ngModel)]=\"f.scheduleSeconds\"></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Window (s)</mat-label><input matInput type=\"number\" name=\"window\" [(ngModel)]=\"f.windowSeconds\"></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Fire after (s)</mat-label><input matInput type=\"number\" name=\"for\" [(ngModel)]=\"f.forSeconds\"></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Recover after (s)</mat-label><input matInput type=\"number\" name=\"recovery\" [(ngModel)]=\"f.recoverySeconds\"></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Cooldown (s)</mat-label><input matInput type=\"number\" name=\"cooldown\" [(ngModel)]=\"f.cooldownSeconds\"></mat-form-field>\n <mat-checkbox name=\"enabled\" [(ngModel)]=\"f.enabled\">Enabled</mat-checkbox>\n @if (editing()) { <p class=\"jc-muted jc-small jc-form-actions\">Disabling this rule, or changing its template or scope, resolves its open alerts: nothing would be watching them any more.</p> }\n <div class=\"jc-form-actions\">\n <button mat-flat-button type=\"submit\" data-testid=\"rule-save\" [disabled]=\"saving()\">Save</button>\n <button mat-button type=\"button\" (click)=\"form.set(null)\">Cancel</button>\n @if (saveError()) { <span class=\"jc-error\" data-testid=\"rule-error\">{{ saveError() }}</span> }\n </div>\n </form>\n </section>\n }\n <table class=\"jc-table\" data-testid=\"rules\">\n <thead><tr><th>Rule</th><th>Template</th><th>Severity</th><th>Threshold</th><th>Recovery</th><th>Wait</th><th>Open alerts</th><th>Last evaluation</th><th></th></tr></thead>\n <tbody>\n @for (r of rows(); track r.key) {\n <tr [class.jc-muted]=\"!r.enabled\">\n <td><strong>{{ r.name }}</strong><div class=\"jc-muted jc-small\">{{ r.key }}@if (!r.enabled) { · disabled }@if (r.managedBy === 'config') { · from the rules file }</div></td>\n <td>{{ r.template }}</td>\n <td>{{ r.severity }}</td>\n <td>{{ r.definition['threshold'] ?? '—' }}</td>\n <td>{{ r.definition['recoveryThreshold'] ?? '—' }}</td>\n <td>{{ r.definition['forDuration'] ?? '—' }}</td>\n <td>\n @for (a of r.open; track a.id) {\n <div><a [routerLink]=\"['alerts', a.id] | jcLink\" [queryParams]=\"ctx.keep()\">{{ a.state }}</a> {{ a.subjectKey }} = {{ a.lastValue ?? 'no data' }}</div>\n } @empty { <span class=\"jc-muted\">none</span> }\n </td>\n <td>{{ r.lastEvaluatedAt | ago }}</td>\n <td class=\"jc-row-actions\">@if (r.managedBy !== 'config') { <button mat-button type=\"button\" [attr.data-testid]=\"'rule-edit-' + r.key\" (click)=\"edit(r)\">Change</button> }</td>\n </tr>\n }\n </tbody>\n </table>`,\n})\nexport class RulesPage {\n protected readonly ctx = inject(ContextService);\n private readonly api = inject(ApiService);\n protected readonly templates = Object.keys(TEMPLATES);\n protected readonly form = signal<RuleForm | null>(null);\n protected readonly editing = signal<Rule | null>(null);\n protected readonly saving = signal(false);\n protected readonly saveError = signal('');\n protected readonly data = apiResource({\n stream: () => forkJoin({\n rules: this.api.rules().pipe(map(p => p.items)),\n firing: this.api.allAlerts({ state: 'firing' }).pipe(map(p => p.items)),\n pending: this.api.allAlerts({ state: 'pending' }).pipe(map(p => p.items)),\n }),\n });\n protected readonly error = computed(() => problemText(this.data.error()));\n protected readonly rows = computed(() => {\n const d = this.data.value();\n if (!d) return [];\n const open = [...d.firing, ...d.pending];\n return d.rules.map(r => {\n const mine = open.filter(a => a.rule === r.key);\n const last = mine.map(a => a.lastEvaluatedAt).sort().at(-1) ?? null;\n return { ...r, open: mine, lastEvaluatedAt: last };\n });\n });\n\n protected hint(template: string): string { return TEMPLATES[template] ?? ''; }\n\n protected startNew() { this.editing.set(null); this.saveError.set(''); this.form.set({ ...NEW_RULE }); }\n\n protected edit(rule: Rule) {\n const d = rule.definition;\n this.editing.set(rule);\n this.saveError.set('');\n this.form.set({\n key: rule.key, name: rule.name, template: rule.template, severity: rule.severity, service: String(d['service'] ?? ''), environment: String(d['environment'] ?? ''), host: String(d['host'] ?? ''),\n threshold: d['threshold'] as number, recoveryThreshold: (d['recoveryThreshold'] as number | null) ?? null, minimumSamples: d['minimumSamples'] as number, scheduleSeconds: seconds(d['schedule']), windowSeconds: seconds(d['window']),\n forSeconds: seconds(d['forDuration']), recoverySeconds: seconds(d['recoveryDuration']), cooldownSeconds: seconds(d['cooldown']), enabled: rule.enabled,\n });\n }\n\n protected save(f: RuleForm) {\n const host = f.template === 'HostMemory';\n const body = {\n key: f.key, name: f.name, template: f.template, severity: f.severity, service: host ? '' : f.service.trim(), environment: host ? '' : f.environment.trim().toLowerCase(), host: host ? f.host.trim() : '',\n threshold: f.threshold, recoveryThreshold: f.recoveryThreshold, minimumSamples: f.minimumSamples, schedule: span(f.scheduleSeconds), window: span(f.windowSeconds), forDuration: span(f.forSeconds),\n recoveryDuration: span(f.recoverySeconds), cooldown: span(f.cooldownSeconds), enabled: f.enabled,\n };\n const editing = this.editing();\n const request: Observable<Rule> = editing ? this.api.updateRule(editing.key, body, editing.etag) : this.api.createRule(body);\n this.saving.set(true);\n this.saveError.set('');\n request.subscribe({\n next: () => { this.saving.set(false); this.form.set(null); this.data.reload(); },\n error: e => { this.saving.set(false); this.saveError.set(problemText(e)); },\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBA,MAAM,YAAoC;CACxC,WAAW;CACX,YAAY;CACZ,kBAAkB;CAClB,qBAAqB;CACrB,YAAY;CACZ,gBAAgB;CAChB,kBAAkB;AACnB;AAGD,SAAS,QAAQ,OAAc;CAC7B,MAAM,QAAQ,iCAAiC,KAAK,OAAO,SAAS,EAAE,CAAC;CACvE,OAAO,QAAS,EAAE,MAAM,MAAM,KAAM,QAAQ,CAAC,MAAM,KAAK,OAAO,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM,KAAK;AAC9F;AAEA,SAAS,KAAK,OAAa;CACzB,MAAM,IAAI,KAAK,IAAI,GAAG,KAAK,MAAM,SAAS,CAAC,CAAC;CAC5C,MAAM,OAAO,MAAc,OAAO,CAAC,CAAC,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IAAA,SAAA,CAAA,mBAAA;IAAA,UAAA,CAAA,WAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAU,UAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAA5J;IAAQ,MAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAsJ;IAAO,MAAA;GAAA;EAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAqEpK,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAS,YAAA,CAAA;EAvErB,MAAA;EAAU,MAAA,CAAA;GACT,iBAAiB,wBAAwB;GACzC,SAAS;IAAC;IAAU;IAAY;IAAa;IAAiB;IAAmB;IAAoB;IAAgB;IAAsB;IAAiB;IAAY;GAAO;GAC/K,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmEX,CAAA"}
1
+ {"version":3,"file":"juice-js-observability-rules.page-uKeK44Iz.mjs","names":[],"sources":["../../../../projects/juice-js/observability/src/lib/pages/rules.page.ts"],"sourcesContent":["import { LinkPipe } from '../core/options';\nimport { ChangeDetectionStrategy, Component, computed, inject, signal } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\nimport { MatSelectModule } from '@angular/material/select';\nimport { apiResource } from '../shared/resource';\nimport { RouterLink } from '@angular/router';\nimport { Observable, forkJoin, map } from 'rxjs';\nimport { ApiService } from '../core/api.service';\nimport { ContextService } from '../core/context.service';\nimport { Rule } from '../core/models';\nimport { AgoPipe } from '../shared/format';\nimport { ContextBar } from '../shared/ui';\nimport { problemText } from '../shared/telemetry';\n\nconst TEMPLATES: Record<string, string> = {\n ErrorRate: 'Ratio of failed requests, 0 to 1. Fires above the threshold.',\n LatencyP95: 'Milliseconds at the 95th percentile. Fires above the threshold.',\n ThroughputAbsent: 'Requests in the window, for a service that had traffic. Fires at or below the threshold.',\n DeliveryFailureRate: 'Ratio of failed deliveries, 0 to 1. Fires above the threshold.',\n HostMemory: 'Ratio of host memory used, 0 to 1. Fires above the threshold.',\n MediatorErrors: 'Mediator errors in the window. Fires above the threshold.',\n ConsumerFailures: 'Failed consumer messages in the window. Fires above the threshold.',\n};\n\n/** A TimeSpan as the API writes it (`1.02:03:04`) in seconds. */\nfunction seconds(value: unknown): number {\n const match = /^(?:(\\d+)\\.)?(\\d+):(\\d+):(\\d+)/.exec(String(value ?? ''));\n return match ? (+(match[1] ?? 0)) * 86400 + +match[2] * 3600 + +match[3] * 60 + +match[4] : 0;\n}\n\nfunction span(total: number): string {\n const s = Math.max(0, Math.round(total || 0));\n const pad = (n: number) => String(n).padStart(2, '0');\n const days = Math.floor(s / 86400);\n return `${days ? `${days}.` : ''}${pad(Math.floor(s / 3600) % 24)}:${pad(Math.floor(s / 60) % 60)}:${pad(s % 60)}`;\n}\n\ninterface RuleForm {\n key: string; name: string; template: string; severity: string; service: string; environment: string; host: string; threshold: number | null; recoveryThreshold: number | null;\n minimumSamples: number; scheduleSeconds: number; windowSeconds: number; forSeconds: number; recoverySeconds: number; cooldownSeconds: number; enabled: boolean;\n}\n\nconst NEW_RULE: RuleForm = {\n key: '', name: '', template: 'ErrorRate', severity: 'Warning', service: '', environment: '', host: '', threshold: null, recoveryThreshold: null,\n minimumSamples: 10, scheduleSeconds: 60, windowSeconds: 300, forSeconds: 120, recoverySeconds: 120, cooldownSeconds: 600, enabled: true,\n};\n\n/**\n * Rules and their current state (Console requirements §14), and changing them for admins. They stay typed templates (D5): this page never takes a query.\n * A rule in the deployment's file is shown but changed there. Disabling one, or changing what it watches, closes its open alerts, which the form says first.\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [LinkPipe, RouterLink, FormsModule, MatButtonModule, MatCheckboxModule, MatFormFieldModule, MatInputModule, MatProgressBarModule, MatSelectModule, ContextBar, AgoPipe],\n template: `\n <jc-context-bar>\n <h1>Rules</h1>\n <span class=\"jc-spacer\"></span>\n <button mat-flat-button type=\"button\" data-testid=\"rule-new\" (click)=\"startNew()\">New rule</button>\n </jc-context-bar>\n @if (data.isLoading()) { <mat-progress-bar mode=\"indeterminate\" /> }\n @if (data.error()) { <p class=\"jc-error\">{{ error() }}</p> }\n @if (form(); as f) {\n <section class=\"jc-card\" data-testid=\"rule-form\">\n <h2>{{ editing() ? 'Change ' + editing()!.key : 'New rule' }}</h2>\n <form class=\"jc-form\" (ngSubmit)=\"save(f)\">\n @if (!editing()) { <mat-form-field subscriptSizing=\"dynamic\"><mat-label>Key</mat-label><input matInput name=\"key\" [(ngModel)]=\"f.key\" required></mat-form-field> }\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-wide\"><mat-label>Name</mat-label><input matInput name=\"name\" [(ngModel)]=\"f.name\" required></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\"><mat-label>Template</mat-label>\n <mat-select name=\"template\" [(ngModel)]=\"f.template\">@for (t of templates; track t) { <mat-option [value]=\"t\">{{ t }}</mat-option> }</mat-select>\n </mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Severity</mat-label>\n <mat-select name=\"severity\" [(ngModel)]=\"f.severity\"><mat-option value=\"Info\">Info</mat-option><mat-option value=\"Warning\">Warning</mat-option><mat-option value=\"Critical\">Critical</mat-option></mat-select>\n </mat-form-field>\n @if (f.template === 'HostMemory') {\n <mat-form-field subscriptSizing=\"dynamic\"><mat-label>Host (all if empty)</mat-label><input matInput name=\"host\" [(ngModel)]=\"f.host\"></mat-form-field>\n } @else {\n <mat-form-field subscriptSizing=\"dynamic\"><mat-label>Service (all if empty)</mat-label><input matInput name=\"service\" [(ngModel)]=\"f.service\"></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\"><mat-label>Environment (all if empty)</mat-label><input matInput name=\"environment\" [(ngModel)]=\"f.environment\"></mat-form-field>\n }\n <p class=\"jc-muted jc-small jc-form-actions\">{{ hint(f.template) }}</p>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Threshold</mat-label><input matInput type=\"number\" step=\"any\" name=\"threshold\" [(ngModel)]=\"f.threshold\" required></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Recovery threshold</mat-label><input matInput type=\"number\" step=\"any\" name=\"recoveryThreshold\" [(ngModel)]=\"f.recoveryThreshold\"></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Minimum samples</mat-label><input matInput type=\"number\" name=\"minimumSamples\" [(ngModel)]=\"f.minimumSamples\"></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Every (s)</mat-label><input matInput type=\"number\" name=\"schedule\" [(ngModel)]=\"f.scheduleSeconds\"></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Window (s)</mat-label><input matInput type=\"number\" name=\"window\" [(ngModel)]=\"f.windowSeconds\"></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Fire after (s)</mat-label><input matInput type=\"number\" name=\"for\" [(ngModel)]=\"f.forSeconds\"></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Recover after (s)</mat-label><input matInput type=\"number\" name=\"recovery\" [(ngModel)]=\"f.recoverySeconds\"></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Cooldown (s)</mat-label><input matInput type=\"number\" name=\"cooldown\" [(ngModel)]=\"f.cooldownSeconds\"></mat-form-field>\n <mat-checkbox name=\"enabled\" [(ngModel)]=\"f.enabled\">Enabled</mat-checkbox>\n @if (editing()) { <p class=\"jc-muted jc-small jc-form-actions\">Disabling this rule, or changing its template or scope, resolves its open alerts: nothing would be watching them any more.</p> }\n <div class=\"jc-form-actions\">\n <button mat-flat-button type=\"submit\" data-testid=\"rule-save\" [disabled]=\"saving()\">Save</button>\n <button mat-button type=\"button\" (click)=\"form.set(null)\">Cancel</button>\n @if (saveError()) { <span class=\"jc-error\" data-testid=\"rule-error\">{{ saveError() }}</span> }\n </div>\n </form>\n </section>\n }\n <table class=\"jc-table\" data-testid=\"rules\">\n <thead><tr><th>Rule</th><th>Template</th><th>Severity</th><th>Threshold</th><th>Recovery</th><th>Wait</th><th>Open alerts</th><th>Last evaluation</th><th></th></tr></thead>\n <tbody>\n @for (r of rows(); track r.key) {\n <tr [class.jc-muted]=\"!r.enabled\">\n <td><strong>{{ r.name }}</strong><div class=\"jc-muted jc-small\">{{ r.key }}@if (!r.enabled) { · disabled }@if (r.managedBy === 'config') { · from the rules file }</div></td>\n <td>{{ r.template }}</td>\n <td>{{ r.severity }}</td>\n <td>{{ r.definition['threshold'] ?? '—' }}</td>\n <td>{{ r.definition['recoveryThreshold'] ?? '—' }}</td>\n <td>{{ r.definition['forDuration'] ?? '—' }}</td>\n <td>\n @for (a of r.open; track a.id) {\n <div><a [routerLink]=\"['alerts', a.id] | jcLink\" [queryParams]=\"ctx.keep()\">{{ a.state }}</a> {{ a.subjectKey }} = {{ a.lastValue ?? 'no data' }}</div>\n } @empty { <span class=\"jc-muted\">none</span> }\n </td>\n <td>{{ r.lastEvaluatedAt | ago }}</td>\n <td class=\"jc-row-actions\">@if (r.managedBy !== 'config') { <button mat-button type=\"button\" [attr.data-testid]=\"'rule-edit-' + r.key\" (click)=\"edit(r)\">Change</button> }</td>\n </tr>\n }\n </tbody>\n </table>`,\n})\nexport class RulesPage {\n protected readonly ctx = inject(ContextService);\n private readonly api = inject(ApiService);\n protected readonly templates = Object.keys(TEMPLATES);\n protected readonly form = signal<RuleForm | null>(null);\n protected readonly editing = signal<Rule | null>(null);\n protected readonly saving = signal(false);\n protected readonly saveError = signal('');\n protected readonly data = apiResource({\n stream: () => forkJoin({\n rules: this.api.rules().pipe(map(p => p.items)),\n firing: this.api.allAlerts({ state: 'firing' }).pipe(map(p => p.items)),\n pending: this.api.allAlerts({ state: 'pending' }).pipe(map(p => p.items)),\n }),\n });\n protected readonly error = computed(() => problemText(this.data.error()));\n protected readonly rows = computed(() => {\n const d = this.data.value();\n if (!d) return [];\n const open = [...d.firing, ...d.pending];\n return d.rules.map(r => {\n const mine = open.filter(a => a.rule === r.key);\n const last = mine.map(a => a.lastEvaluatedAt).sort().at(-1) ?? null;\n return { ...r, open: mine, lastEvaluatedAt: last };\n });\n });\n\n protected hint(template: string): string { return TEMPLATES[template] ?? ''; }\n\n protected startNew() { this.editing.set(null); this.saveError.set(''); this.form.set({ ...NEW_RULE }); }\n\n protected edit(rule: Rule) {\n const d = rule.definition;\n this.editing.set(rule);\n this.saveError.set('');\n this.form.set({\n key: rule.key, name: rule.name, template: rule.template, severity: rule.severity, service: String(d['service'] ?? ''), environment: String(d['environment'] ?? ''), host: String(d['host'] ?? ''),\n threshold: d['threshold'] as number, recoveryThreshold: (d['recoveryThreshold'] as number | null) ?? null, minimumSamples: d['minimumSamples'] as number, scheduleSeconds: seconds(d['schedule']), windowSeconds: seconds(d['window']),\n forSeconds: seconds(d['forDuration']), recoverySeconds: seconds(d['recoveryDuration']), cooldownSeconds: seconds(d['cooldown']), enabled: rule.enabled,\n });\n }\n\n protected save(f: RuleForm) {\n const host = f.template === 'HostMemory';\n const body = {\n key: f.key, name: f.name, template: f.template, severity: f.severity, service: host ? '' : f.service.trim(), environment: host ? '' : f.environment.trim().toLowerCase(), host: host ? f.host.trim() : '',\n threshold: f.threshold, recoveryThreshold: f.recoveryThreshold, minimumSamples: f.minimumSamples, schedule: span(f.scheduleSeconds), window: span(f.windowSeconds), forDuration: span(f.forSeconds),\n recoveryDuration: span(f.recoverySeconds), cooldown: span(f.cooldownSeconds), enabled: f.enabled,\n };\n const editing = this.editing();\n const request: Observable<Rule> = editing ? this.api.updateRule(editing.key, body, editing.etag) : this.api.createRule(body);\n this.saving.set(true);\n this.saveError.set('');\n request.subscribe({\n next: () => { this.saving.set(false); this.form.set(null); this.data.reload(); },\n error: e => { this.saving.set(false); this.saveError.set(problemText(e)); },\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBA,MAAM,YAAoC;CACxC,WAAW;CACX,YAAY;CACZ,kBAAkB;CAClB,qBAAqB;CACrB,YAAY;CACZ,gBAAgB;CAChB,kBAAkB;AACnB;AAGD,SAAS,QAAQ,OAAc;CAC7B,MAAM,QAAQ,iCAAiC,KAAK,OAAO,SAAS,EAAE,CAAC;CACvE,OAAO,QAAS,EAAE,MAAM,MAAM,KAAM,QAAQ,CAAC,MAAM,KAAK,OAAO,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM,KAAK;AAC9F;AAEA,SAAS,KAAK,OAAa;CACzB,MAAM,IAAI,KAAK,IAAI,GAAG,KAAK,MAAM,SAAS,CAAC,CAAC;CAC5C,MAAM,OAAO,MAAc,OAAO,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG;CACpD,MAAM,OAAO,KAAK,MAAM,IAAI,KAAK;CACjC,OAAO,GAAG,OAAO,GAAG,KAAI,KAAM,KAAK,IAAI,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,EAAC,GAAI,IAAI,KAAK,MAAM,IAAI,EAAE,IAAI,EAAE,EAAC,GAAI,IAAI,IAAI,EAAE;AACjH;AAOA,MAAM,WAAqB;CACzB,KAAK;CAAI,MAAM;CAAI,UAAU;CAAa,UAAU;CAAW,SAAS;CAAI,aAAa;CAAI,MAAM;CAAI,WAAW;CAAM,mBAAmB;CAC3I,gBAAgB;CAAI,iBAAiB;CAAI,eAAe;CAAK,YAAY;CAAK,iBAAiB;CAAK,iBAAiB;CAAK,SAAS;AACpI;AA6ED,IAAa,YAAb,MAAa,UAAS;CACD,MAAM,OAAO,cAAc;C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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmEX,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { ApiService, ContextService, LinkPipe, ObservabilityLinks } from "./juice-js-observability.mjs";
2
- import { S as apiResource, _ as PercentPipe, a as TraceTable, d as HealthBadge, g as DurationPipe, h as AgoPipe, i as ServiceStatsCharts, l as ConfidenceBadge, n as LogTable, o as problemText, r as MetricExplorer, u as ContextBar, v as ReasonPipe } from "./juice-js-observability-telemetry-BftWSOaQ.mjs";
2
+ import { _ as DurationPipe, a as TraceTable, c as ContextBar, g as AgoPipe, h as apiResource, i as ServiceStatsCharts, l as HealthBadge, n as LogTable, o as problemText, r as MetricExplorer, s as ConfidenceBadge, v as PercentPipe, y as ReasonPipe } from "./juice-js-observability-telemetry-B98lekF2.mjs";
3
3
  import * as i0 from "@angular/core";
4
4
  import { ChangeDetectionStrategy, Component, computed, inject, input, linkedSignal, signal } from "@angular/core";
5
5
  import { Router, RouterLink } from "@angular/router";
@@ -1254,4 +1254,4 @@ i0.ɵɵngDeclareClassMetadata({
1254
1254
  });
1255
1255
  export { ServicePage };
1256
1256
 
1257
- //# sourceMappingURL=juice-js-observability-service.page-BFXUe4mX.mjs.map
1257
+ //# sourceMappingURL=juice-js-observability-service.page-D7-Wbc5P.mjs.map