@juice-js/observability 1.1.0-alpha.22 → 1.1.0-alpha.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/{juice-js-observability-notifications.page-BDqb10C6.mjs → juice-js-observability-notifications.page-DVYN60Me.mjs} +38 -5
- package/fesm2022/juice-js-observability-notifications.page-DVYN60Me.mjs.map +1 -0
- package/fesm2022/juice-js-observability.mjs +7 -1
- package/fesm2022/juice-js-observability.mjs.map +1 -1
- package/package.json +1 -1
- package/types/juice-js-observability.d.ts +10 -0
- package/fesm2022/juice-js-observability-notifications.page-BDqb10C6.mjs.map +0 -1
|
@@ -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="
|
|
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="
|
|
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-
|
|
758
|
+
//# sourceMappingURL=juice-js-observability-notifications.page-DVYN60Me.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"juice-js-observability-notifications.page-DVYN60Me.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 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,OA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;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AA6IP,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAiB,YAAA,CAAA;EA/I7B,MAAA;EAAU,MAAA,CAAA;GACT,iBAAiB,wBAAwB;GACzC,SAAS;IAAC;IAAU;IAAa;IAAiB;IAAmB;IAAoB;IAAgB;IAAsB;IAAiB;GAAU;GAC1J,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2IX,CAAA"}
|
|
@@ -179,6 +179,12 @@ var ApiService = class ApiService {
|
|
|
179
179
|
...query
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
|
+
testChannel(id) {
|
|
183
|
+
return this.send("POST", `/webhooks/${id}/test`);
|
|
184
|
+
}
|
|
185
|
+
retryDelivery(channelId, deliveryId) {
|
|
186
|
+
return this.send("POST", `/webhooks/${channelId}/deliveries/${deliveryId}/retry`);
|
|
187
|
+
}
|
|
182
188
|
allowlist() {
|
|
183
189
|
return this.get("/webhooks/allowlist");
|
|
184
190
|
}
|
|
@@ -444,7 +450,7 @@ const OBSERVABILITY_ROUTES = [
|
|
|
444
450
|
page("alerts", "Alerts", () => import("./juice-js-observability-alerts.page-DUXXBanH.mjs").then((m) => m.AlertsPage)),
|
|
445
451
|
page("alerts/:id", "Alert", () => import("./juice-js-observability-alert.page-DOAX9WWa.mjs").then((m) => m.AlertPage)),
|
|
446
452
|
page("rules", "Rules", () => import("./juice-js-observability-rules.page-Df2uDVwz.mjs").then((m) => m.RulesPage)),
|
|
447
|
-
page("notifications", "Notifications", () => import("./juice-js-observability-notifications.page-
|
|
453
|
+
page("notifications", "Notifications", () => import("./juice-js-observability-notifications.page-DVYN60Me.mjs").then((m) => m.NotificationsPage)),
|
|
448
454
|
page("silences", "Silences", () => import("./juice-js-observability-silences.page-Cg53dJAy.mjs").then((m) => m.SilencesPage)),
|
|
449
455
|
page("incidents", "Incidents", () => import("./juice-js-observability-incidents.page-CpNqYp2W.mjs").then((m) => m.IncidentsPage)),
|
|
450
456
|
page("incidents/:id", "Incident", () => import("./juice-js-observability-incident.page-CCHEWXou.mjs").then((m) => m.IncidentPage)),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"juice-js-observability.mjs","names":[],"sources":["../../../../projects/juice-js/observability/src/lib/core/options.ts","../../../../projects/juice-js/observability/src/lib/core/api.service.ts","../../../../projects/juice-js/observability/src/lib/core/context.service.ts","../../../../projects/juice-js/observability/src/lib/observability.routes.ts"],"sourcesContent":["import { EnvironmentProviders, Injectable, InjectionToken, Pipe, PipeTransform, inject, makeEnvironmentProviders } from '@angular/core';\n\n/** How the host app mounts Juice Observability. */\nexport interface ObservabilityOptions {\n /** The Juice API origin; empty when the API serves the app (same origin). */\n apiBase: string;\n /** Where the host mounts {@link OBSERVABILITY_ROUTES}: `/` for the whole app, or a path such as `/observability`. */\n basePath: string;\n /**\n * A link to the audit records of a trace, shown on the trace page: for the Juice Audit pages mounted at `/audit`,\n * `id => ['/audit/traces', id]`. A string is an external URL. Without it, no link.\n */\n auditLink?: ((traceId: string) => unknown[] | string | null) | null;\n}\n\nexport const OBSERVABILITY_OPTIONS = new InjectionToken<ObservabilityOptions>('OBSERVABILITY_OPTIONS', {\n providedIn: 'root',\n factory: () => ({ apiBase: '', basePath: '/', auditLink: null }),\n});\n\n/** Configures the pages: where the API is, where the host mounted the routes, and where a trace's audit records open. */\nexport function provideJuiceObservability(options: Partial<ObservabilityOptions> = {}): EnvironmentProviders {\n return makeEnvironmentProviders([\n {\n provide: OBSERVABILITY_OPTIONS,\n useValue: {\n apiBase: options.apiBase ?? '',\n basePath: options.basePath ?? '/',\n auditLink: options.auditLink ?? null,\n } satisfies ObservabilityOptions,\n },\n ]);\n}\n\n/** `/observability/` → `/observability`; `` and `/` → `/`. */\nexport function normalizeBasePath(basePath: string): string {\n const trimmed = basePath.trim().replace(/^\\/+|\\/+$/g, '');\n return trimmed ? `/${trimmed}` : '/';\n}\n\n/** Router links to the pages, under the host's mount path. */\n@Injectable({ providedIn: 'root' })\nexport class ObservabilityLinks {\n private readonly options = inject(OBSERVABILITY_OPTIONS);\n readonly base = normalizeBasePath(this.options.basePath);\n\n /** `to('services', id)` → `['/observability', 'services', id]`. */\n to(...segments: unknown[]): unknown[] { return [this.base, ...segments]; }\n\n /** The host's link to the audit records of a trace, if it gave one. */\n audit(traceId: string | null | undefined): { route: unknown[] } | { href: string } | null {\n if (!traceId || !this.options.auditLink) return null;\n const link = this.options.auditLink(traceId);\n if (!link) return null;\n return typeof link === 'string' ? { href: link } : { route: link };\n }\n}\n\n/** `['services', id] | jcLink`: the same as {@link ObservabilityLinks.to} in a template. */\n@Pipe({ name: 'jcLink' })\nexport class LinkPipe implements PipeTransform {\n private readonly links = inject(ObservabilityLinks);\n transform(segments: unknown[]): unknown[] { return this.links.to(...segments); }\n}\n","import { HttpClient, HttpParams } from '@angular/common/http';\nimport { Injectable, inject } from '@angular/core';\nimport { EMPTY, Observable, expand, map, reduce, shareReplay, switchMap } from 'rxjs';\nimport { OBSERVABILITY_OPTIONS } from './options';\nimport {\n AlertDetail, AlertNotifications, Alert, AllowlistEntry, Application, Channel, Delivery, EscalationPolicy, IncidentDetail, IncidentEvent, IncidentSummary, Silence, DependencyEvidence, DependencyStatsPage, DeploymentEnvironment, LoadRun, LoadRunResults, Related, Timeline, Health, LogRecord, MetricInfo, Operation,\n Page, ResourceDetail, ResourceSummary, Rule, SearchHit, Series, Capacity, ServiceStats, Tenant, TelemetryPage, Topology, Trace,\n TraceSummary,\n} from './models';\n\nexport type Query = Record<string, string | number | boolean | string[] | null | undefined>;\n\n/**\n * The Console's only backend: the Juice API (Console requirements §3). One deployment serves one tenant, the one the\n * signed-in user's token names.\n */\n@Injectable({ providedIn: 'root' })\nexport class ApiService {\n private readonly http = inject(HttpClient);\n private readonly base = `${inject(OBSERVABILITY_OPTIONS).apiBase}/api/v1`;\n\n /** The caller's tenant, fetched once. */\n readonly tenant$: Observable<Tenant> = this.http.get<Page<Tenant>>(`${this.base}/tenants`).pipe(\n map(page => {\n if (page.items.length === 0) throw new Error('No tenant is authorized for this user.');\n return page.items[0];\n }),\n shareReplay(1),\n );\n\n private get<T>(path: string, query: Query = {}): Observable<T> {\n let params = new HttpParams();\n for (const [key, value] of Object.entries(query)) {\n if (value === null || value === undefined || value === '') continue;\n for (const item of Array.isArray(value) ? value : [value]) params = params.append(key, String(item));\n }\n return this.tenant$.pipe(switchMap(t => this.http.get<T>(`${this.base}/tenants/${t.id}${path}`, { params })));\n }\n\n /** A change. `Idempotency-Key` on what can be retried, so a repeated click or a lost response doesn't do it twice. */\n private send<T>(method: 'POST' | 'PUT' | 'DELETE', path: string, body?: unknown, headers: Record<string, string> = {}): Observable<T> {\n return this.tenant$.pipe(switchMap(t => this.http.request<T>(method, `${this.base}/tenants/${t.id}${path}`, { body, headers })));\n }\n private once<T>(path: string, body: unknown): Observable<T> { return this.send<T>('POST', path, body, { 'Idempotency-Key': crypto.randomUUID() }); }\n\n /** Every page of a cursor-paged list (bounded: at most `maxPages` requests). */\n private all<T>(path: string, query: Query = {}, maxPages = 25): Observable<Page<T>> {\n let pages = 0;\n return this.get<Page<T>>(path, { ...query, limit: 200 }).pipe(\n expand(page => page.nextCursor && ++pages < maxPages ? this.get<Page<T>>(path, { ...query, limit: 200, cursor: page.nextCursor }) : EMPTY),\n reduce((all, page) => ({ items: [...all.items, ...page.items], nextCursor: page.nextCursor }), { items: [] as T[], nextCursor: null as string | null }),\n );\n }\n\n environments() { return this.get<Page<DeploymentEnvironment>>('/environments'); }\n applications() { return this.get<Page<Application>>('/applications', { limit: 200 }); }\n resources(type?: string) { return this.all<ResourceSummary>('/resources', { type }); }\n resource(id: string) { return this.get<ResourceDetail>(`/resources/${id}`); }\n health(query: Query) { return this.all<Health>('/health', query); }\n topology(environment?: string | null) { return this.get<Topology>('/topology', { environment }); }\n\n rules() { return this.get<Page<Rule>>('/rules', { limit: 200 }); }\n createRule(definition: unknown) { return this.send<Rule>('POST', '/rules', definition); }\n /** With the rule's etag, so a change made since it was read isn't overwritten. */\n updateRule(key: string, definition: unknown, etag: string) { return this.send<Rule>('PUT', `/rules/${key}`, definition, { 'If-Match': `\"${etag}\"` }); }\n\n channels() { return this.get<Page<Channel>>('/webhooks'); }\n createChannel(body: unknown) { return this.send<Channel>('POST', '/webhooks', body); }\n updateChannel(id: string, body: unknown) { return this.send<Channel>('PUT', `/webhooks/${id}`, body); }\n deliveries(id: string, query: Query = {}) { return this.get<Page<Delivery>>(`/webhooks/${id}/deliveries`, { limit: 50, ...query }); }\n allowlist() { return this.get<Page<AllowlistEntry>>('/webhooks/allowlist'); }\n putAllowlist(destination: string, ports: number[]) { return this.send<AllowlistEntry>('PUT', '/webhooks/allowlist', { destination, ports }); }\n removeAllowlist(destination: string) { return this.send<void>('DELETE', `/webhooks/allowlist?destination=${encodeURIComponent(destination)}`); }\n\n escalationPolicies() { return this.get<Page<EscalationPolicy>>('/escalation-policies'); }\n createEscalationPolicy(body: unknown) { return this.send<EscalationPolicy>('POST', '/escalation-policies', body); }\n updateEscalationPolicy(key: string, body: unknown) { return this.send<EscalationPolicy>('PUT', `/escalation-policies/${key}`, body); }\n\n silences(query: Query = {}) { return this.get<Page<Silence>>('/silences', { limit: 200, ...query }); }\n createSilence(body: unknown) { return this.once<Silence>('/silences', body); }\n cancelSilence(id: string) { return this.send<void>('DELETE', `/silences/${id}`); }\n\n incidents(query: Query = {}) { return this.get<Page<IncidentSummary>>('/incidents', { limit: 100, ...query }); }\n incident(id: string) { return this.get<IncidentDetail>(`/incidents/${id}`); }\n createIncident(body: unknown) { return this.once<IncidentSummary>('/incidents', body); }\n moveIncident(id: string, to: string, comment: string) { return this.once<IncidentSummary>(`/incidents/${id}/transitions`, { to, comment }); }\n addIncidentNote(id: string, text: string) { return this.once<IncidentEvent>(`/incidents/${id}/notes`, { text }); }\n removeIncidentAlert(id: string, alertId: string) { return this.send<void>('DELETE', `/incidents/${id}/alerts/${alertId}`); }\n alertNotifications(id: string) { return this.get<AlertNotifications>(`/alerts/${id}/notifications`); }\n\n /** One page of alerts, newest first; pass the previous page's `nextCursor` as `cursor` for the next. */\n alerts(query: Query) { return this.get<Page<Alert>>('/alerts', { limit: 100, ...query }); }\n /** Every alert matching the query (bounded, like the other complete lists). */\n allAlerts(query: Query) { return this.all<Alert>('/alerts', query); }\n alert(id: string) { return this.get<AlertDetail>(`/alerts/${id}`); }\n acknowledge(id: string, comment: string): Observable<Alert> {\n return this.tenant$.pipe(switchMap(t => this.http.post<Alert>(`${this.base}/tenants/${t.id}/alerts/${id}/acknowledgement`,\n { comment }, { headers: { 'Idempotency-Key': crypto.randomUUID() } })));\n }\n\n traces(query: Query) { return this.get<TelemetryPage<TraceSummary>>('/telemetry/traces', query); }\n trace(traceId: string) { return this.get<Trace>(`/telemetry/traces/${traceId}`); }\n logs(query: Query) { return this.get<TelemetryPage<LogRecord>>('/telemetry/logs', query); }\n operations(query: Query) { return this.get<TelemetryPage<Operation>>('/telemetry/operations', query); }\n metrics(query: Query) { return this.get<TelemetryPage<MetricInfo>>('/telemetry/metrics', query); }\n series(query: Query) { return this.get<Series>('/telemetry/metrics/series', query); }\n serviceStats(query: Query) { return this.get<ServiceStats>('/telemetry/service-stats', query); }\n capacity(query: Query) { return this.get<Capacity>('/telemetry/capacity', query); }\n timeline(query: Query) { return this.get<Timeline>('/timeline', query); }\n relatedToAlert(id: string) { return this.get<Related>(`/alerts/${id}/related`); }\n loadRuns(query: Query) { return this.get<Page<LoadRun>>('/load-runs', query); }\n loadRunResults(id: string) { return this.get<LoadRunResults>(`/load-runs/${id}/results`); }\n dependencyStats(query: Query) { return this.get<DependencyStatsPage>('/telemetry/dependencies', query); }\n dependency(id: string, query: Query) { return this.get<DependencyEvidence>(`/telemetry/dependencies/${id}`, query); }\n search(q: string) { return this.get<TelemetryPage<SearchHit>>('/search', { q }); }\n}\n","import { Injectable, computed, inject } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { ActivatedRoute, NavigationEnd, Params, Router } from '@angular/router';\nimport { filter, map, startWith } from 'rxjs';\n\nexport const RANGES: Record<string, number> = {\n '15m': 15 * 60_000, '1h': 3_600_000, '6h': 6 * 3_600_000, '24h': 24 * 3_600_000, '7d': 7 * 24 * 3_600_000,\n};\n\n/** Search ranges are at most 24 hours (the API's bound); series and operations take up to 7 days. */\nexport const MAX_SEARCH_MS = RANGES['24h'];\n\n/**\n * The investigation context that follows the user between pages (Console requirements §17): environment and time\n * range. It lives in the URL (`env`, and `range` or `from`/`to`), so every page is a deep link and the browser's back\n * button restores it.\n */\n@Injectable({ providedIn: 'root' })\nexport class ContextService {\n private readonly router = inject(Router);\n\n // Created on first use, after the first navigation may already have ended: start from the current URL.\n private readonly params = toSignal(this.router.events.pipe(\n filter(e => e instanceof NavigationEnd),\n startWith(null),\n map(() => this.leaf().snapshot.queryParams),\n ), { initialValue: {} as Params });\n\n readonly environment = computed(() => (this.params()['env'] as string | undefined) ?? '');\n readonly range = computed(() => {\n const p = this.params();\n return p['from'] && p['to'] ? 'custom' : ((p['range'] as string | undefined) ?? '1h');\n });\n readonly absolute = computed(() => {\n const p = this.params();\n return p['from'] && p['to'] ? { from: p['from'] as string, to: p['to'] as string } : null;\n });\n\n /** The window as ISO strings, evaluated now for a relative range. */\n window(maxMs?: number): { from: string; to: string } {\n const absolute = this.absolute();\n if (absolute) return absolute;\n const to = Date.now();\n const span = Math.min(RANGES[this.range()] ?? RANGES['1h'], maxMs ?? Number.MAX_SAFE_INTEGER);\n return { from: new Date(to - span).toISOString(), to: new Date(to).toISOString() };\n }\n\n /** Query parameters for a link: the context plus the target page's own. */\n keep(extra: Params = {}): Params {\n const p = this.params();\n const context: Params = {};\n for (const key of ['env', 'range', 'from', 'to']) if (p[key]) context[key] = p[key];\n return { ...context, ...extra };\n }\n\n /** Changes the context on the current page, keeping its other parameters. */\n set(change: { env?: string | null; range?: string | null; from?: string | null; to?: string | null }) {\n const queryParams: Params = { ...change };\n if (change.range) Object.assign(queryParams, { from: null, to: null });\n void this.router.navigate([], { relativeTo: this.leaf(), queryParams, queryParamsHandling: 'merge' });\n }\n\n /** A time window centred on a moment, for \"around this span\" links. */\n around(at: string, durationMs: number, paddingMs = 5 * 60_000): Params {\n const start = new Date(at).getTime();\n return this.keep({\n from: new Date(start - paddingMs).toISOString(),\n to: new Date(start + durationMs + paddingMs).toISOString(),\n range: null,\n });\n }\n\n private leaf(): ActivatedRoute {\n let route = this.router.routerState.root;\n while (route.firstChild) route = route.firstChild;\n return route;\n }\n}\n","import { Routes } from '@angular/router';\nimport { Menus } from '@juice-js/core';\nimport { normalizeBasePath } from './core/options';\n\nfunction page(path: string, title: string, load: Routes[number]['loadComponent']): Routes[number] {\n return { path, title: `${title} · Juice Observability`, loadComponent: load };\n}\n\n/**\n * The pages, investigation first (Console requirements §4): services, traces, topology, logs and metrics; alerts and\n * rules after. Detail pages are deep links (§17) and carry the environment and time range in their query parameters.\n * The host mounts them at its `basePath` (see {@link provideJuiceObservability}) and adds its own guards.\n */\nexport const OBSERVABILITY_ROUTES: Routes = [\n page('', 'Overview', () => import('./pages/overview.page').then(m => m.OverviewPage)),\n page('services', 'Services', () => import('./pages/services.page').then(m => m.ServicesPage)),\n page('services/:id', 'Service', () => import('./pages/service.page').then(m => m.ServicePage)),\n page('traces', 'Traces', () => import('./pages/traces.page').then(m => m.TracesPage)),\n page('traces/:traceId', 'Trace', () => import('./pages/trace.page').then(m => m.TracePage)),\n page('topology', 'Dependencies', () => import('./pages/topology.page').then(m => m.TopologyPage)),\n page('logs', 'Logs', () => import('./pages/logs.page').then(m => m.LogsPage)),\n page('metrics', 'Metrics', () => import('./pages/metrics.page').then(m => m.MetricsPage)),\n page('resources', 'Resources', () => import('./pages/resources.page').then(m => m.ResourcesPage)),\n page('resources/:id', 'Resource', () => import('./pages/resource.page').then(m => m.ResourcePage)),\n page('alerts', 'Alerts', () => import('./pages/alerts.page').then(m => m.AlertsPage)),\n page('alerts/:id', 'Alert', () => import('./pages/alert.page').then(m => m.AlertPage)),\n page('rules', 'Rules', () => import('./pages/rules.page').then(m => m.RulesPage)),\n page('notifications', 'Notifications', () => import('./pages/notifications.page').then(m => m.NotificationsPage)),\n page('silences', 'Silences', () => import('./pages/silences.page').then(m => m.SilencesPage)),\n page('incidents', 'Incidents', () => import('./pages/incidents.page').then(m => m.IncidentsPage)),\n page('incidents/:id', 'Incident', () => import('./pages/incident.page').then(m => m.IncidentPage)),\n page('timeline', 'Timeline', () => import('./pages/timeline.page').then(m => m.TimelinePage)),\n page('load-runs', 'Load runs', () => import('./pages/load-runs.page').then(m => m.LoadRunsPage)),\n];\n\n/** The side menu entries (juice-layout), investigation pages first, linking under `basePath`. */\nexport function observabilityMenus(basePath = '/', order = 1): Menus {\n const base = normalizeBasePath(basePath);\n const link = (path: string) => (base === '/' ? `/${path}` : path ? `${base}/${path}` : base);\n return [\n { id: 'overview', label: 'Overview', icon: 'dashboard', routerLink: link('') },\n { id: 'services', label: 'Services', icon: 'hub', routerLink: link('services') },\n { id: 'traces', label: 'Traces', icon: 'timeline', routerLink: link('traces') },\n { id: 'topology', label: 'Dependencies', icon: 'account_tree', routerLink: link('topology') },\n { id: 'logs', label: 'Logs', icon: 'notes', routerLink: link('logs') },\n { id: 'metrics', label: 'Metrics', icon: 'show_chart', routerLink: link('metrics') },\n { id: 'resources', label: 'Resources', icon: 'dns', routerLink: link('resources') },\n { id: 'alerts', label: 'Alerts', icon: 'notifications', routerLink: link('alerts') },\n { id: 'incidents', label: 'Incidents', icon: 'emergency', routerLink: link('incidents') },\n { id: 'rules', label: 'Rules', icon: 'rule', routerLink: link('rules') },\n { id: 'silences', label: 'Silences', icon: 'notifications_paused', routerLink: link('silences') },\n { id: 'notifications', label: 'Notifications', icon: 'campaign', routerLink: link('notifications') },\n { id: 'timeline', label: 'Timeline', icon: 'history', routerLink: link('timeline') },\n { id: 'load-runs', label: 'Load runs', icon: 'speed', routerLink: link('load-runs') },\n ].map((menu, index) => ({ ...menu, order: order + index }));\n}\n"],"mappings":";;;;;;AAeA,MAAa,wBAAwB,IAAI,eAAqC,yBAAyB;CACrG,YAAY;CACZ,gBAAgB;EAAE,SAAS;EAAI,UAAU;EAAK,WAAW;CAAI;AAC9D,CAAA;AAGD,SAAgB,0BAA0B,UAAyC,CAAA,GAAE;CACnF,OAAO,yBAAyB,CAC9B;EACE,SAAS;EACT,UAAU;GACR,SAAS,QAAQ,WAAW;GAC5B,UAAU,QAAQ,YAAY;GAC9B,WAAW,QAAQ,aAAa;EACF;CACjC,CACF,CAAA;AACH;AAGA,SAAgB,kBAAkB,UAAgB;CAChD,MAAM,UAAU,SAAS,KAAI,CAAE,CAAC,QAAQ,cAAc,EAAE;CACxD,OAAO,UAAU,IAAI,YAAY;AACnC;AAIA,IAAa,qBAAb,MAAa,mBAAkB;CACZ,UAAU,OAAO,qBAAqB;CAC9C,OAAO,kBAAkB,KAAK,QAAQ,QAAQ;CAGvD,GAAG,GAAG,UAAmB;EAAe,OAAO,CAAC,KAAK,MAAM,GAAG,QAAQ;CAAG;CAGzE,MAAM,SAAkC;EACtC,IAAI,CAAC,WAAW,CAAC,KAAK,QAAQ,WAAW,OAAO;EAChD,MAAM,OAAO,KAAK,QAAQ,UAAU,OAAO;EAC3C,IAAI,CAAC,MAAM,OAAO;EAClB,OAAO,OAAO,SAAS,WAAW,EAAE,MAAM,KAAI,IAAK,EAAE,OAAO,KAAI;CAClE;CAbW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAkB,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAlB,OAAA,QAAA,GAAA,sBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAA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AAO;GAAa,MAAM;GAAa,YAAY,KAAK,WAAW;EAAC;EACvF;GAAE,IAAI;GAAS,OAAO;GAAS,MAAM;GAAQ,YAAY,KAAK,OAAO;EAAC;EACtE;GAAE,IAAI;GAAY,OAAO;GAAY,MAAM;GAAwB,YAAY,KAAK,UAAU;EAAC;EAC/F;GAAE,IAAI;GAAiB,OAAO;GAAiB,MAAM;GAAY,YAAY,KAAK,eAAe;EAAC;EAClG;GAAE,IAAI;GAAY,OAAO;GAAY,MAAM;GAAW,YAAY,KAAK,UAAU;EAAC;EAClF;GAAE,IAAI;GAAa,OAAO;GAAa,MAAM;GAAS,YAAY,KAAK,WAAW;EAAC;CACpF,CAAA,CAAC,KAAK,MAAM,WAAW;EAAE,GAAG;EAAM,OAAO,QAAQ;CAAK,EAAG;AAC5D"}
|
|
1
|
+
{"version":3,"file":"juice-js-observability.mjs","names":[],"sources":["../../../../projects/juice-js/observability/src/lib/core/options.ts","../../../../projects/juice-js/observability/src/lib/core/api.service.ts","../../../../projects/juice-js/observability/src/lib/core/context.service.ts","../../../../projects/juice-js/observability/src/lib/observability.routes.ts"],"sourcesContent":["import { EnvironmentProviders, Injectable, InjectionToken, Pipe, PipeTransform, inject, makeEnvironmentProviders } from '@angular/core';\n\n/** How the host app mounts Juice Observability. */\nexport interface ObservabilityOptions {\n /** The Juice API origin; empty when the API serves the app (same origin). */\n apiBase: string;\n /** Where the host mounts {@link OBSERVABILITY_ROUTES}: `/` for the whole app, or a path such as `/observability`. */\n basePath: string;\n /**\n * A link to the audit records of a trace, shown on the trace page: for the Juice Audit pages mounted at `/audit`,\n * `id => ['/audit/traces', id]`. A string is an external URL. Without it, no link.\n */\n auditLink?: ((traceId: string) => unknown[] | string | null) | null;\n}\n\nexport const OBSERVABILITY_OPTIONS = new InjectionToken<ObservabilityOptions>('OBSERVABILITY_OPTIONS', {\n providedIn: 'root',\n factory: () => ({ apiBase: '', basePath: '/', auditLink: null }),\n});\n\n/** Configures the pages: where the API is, where the host mounted the routes, and where a trace's audit records open. */\nexport function provideJuiceObservability(options: Partial<ObservabilityOptions> = {}): EnvironmentProviders {\n return makeEnvironmentProviders([\n {\n provide: OBSERVABILITY_OPTIONS,\n useValue: {\n apiBase: options.apiBase ?? '',\n basePath: options.basePath ?? '/',\n auditLink: options.auditLink ?? null,\n } satisfies ObservabilityOptions,\n },\n ]);\n}\n\n/** `/observability/` → `/observability`; `` and `/` → `/`. */\nexport function normalizeBasePath(basePath: string): string {\n const trimmed = basePath.trim().replace(/^\\/+|\\/+$/g, '');\n return trimmed ? `/${trimmed}` : '/';\n}\n\n/** Router links to the pages, under the host's mount path. */\n@Injectable({ providedIn: 'root' })\nexport class ObservabilityLinks {\n private readonly options = inject(OBSERVABILITY_OPTIONS);\n readonly base = normalizeBasePath(this.options.basePath);\n\n /** `to('services', id)` → `['/observability', 'services', id]`. */\n to(...segments: unknown[]): unknown[] { return [this.base, ...segments]; }\n\n /** The host's link to the audit records of a trace, if it gave one. */\n audit(traceId: string | null | undefined): { route: unknown[] } | { href: string } | null {\n if (!traceId || !this.options.auditLink) return null;\n const link = this.options.auditLink(traceId);\n if (!link) return null;\n return typeof link === 'string' ? { href: link } : { route: link };\n }\n}\n\n/** `['services', id] | jcLink`: the same as {@link ObservabilityLinks.to} in a template. */\n@Pipe({ name: 'jcLink' })\nexport class LinkPipe implements PipeTransform {\n private readonly links = inject(ObservabilityLinks);\n transform(segments: unknown[]): unknown[] { return this.links.to(...segments); }\n}\n","import { HttpClient, HttpParams } from '@angular/common/http';\nimport { Injectable, inject } from '@angular/core';\nimport { EMPTY, Observable, expand, map, reduce, shareReplay, switchMap } from 'rxjs';\nimport { OBSERVABILITY_OPTIONS } from './options';\nimport {\n AlertDetail, AlertNotifications, Alert, AllowlistEntry, Application, Channel, ChannelTestResult, Delivery, EscalationPolicy, IncidentDetail, IncidentEvent, IncidentSummary, Silence, DependencyEvidence, DependencyStatsPage, DeploymentEnvironment, LoadRun, LoadRunResults, Related, Timeline, Health, LogRecord, MetricInfo, Operation,\n Page, ResourceDetail, ResourceSummary, Rule, SearchHit, Series, Capacity, ServiceStats, Tenant, TelemetryPage, Topology, Trace,\n TraceSummary,\n} from './models';\n\nexport type Query = Record<string, string | number | boolean | string[] | null | undefined>;\n\n/**\n * The Console's only backend: the Juice API (Console requirements §3). One deployment serves one tenant, the one the\n * signed-in user's token names.\n */\n@Injectable({ providedIn: 'root' })\nexport class ApiService {\n private readonly http = inject(HttpClient);\n private readonly base = `${inject(OBSERVABILITY_OPTIONS).apiBase}/api/v1`;\n\n /** The caller's tenant, fetched once. */\n readonly tenant$: Observable<Tenant> = this.http.get<Page<Tenant>>(`${this.base}/tenants`).pipe(\n map(page => {\n if (page.items.length === 0) throw new Error('No tenant is authorized for this user.');\n return page.items[0];\n }),\n shareReplay(1),\n );\n\n private get<T>(path: string, query: Query = {}): Observable<T> {\n let params = new HttpParams();\n for (const [key, value] of Object.entries(query)) {\n if (value === null || value === undefined || value === '') continue;\n for (const item of Array.isArray(value) ? value : [value]) params = params.append(key, String(item));\n }\n return this.tenant$.pipe(switchMap(t => this.http.get<T>(`${this.base}/tenants/${t.id}${path}`, { params })));\n }\n\n /** A change. `Idempotency-Key` on what can be retried, so a repeated click or a lost response doesn't do it twice. */\n private send<T>(method: 'POST' | 'PUT' | 'DELETE', path: string, body?: unknown, headers: Record<string, string> = {}): Observable<T> {\n return this.tenant$.pipe(switchMap(t => this.http.request<T>(method, `${this.base}/tenants/${t.id}${path}`, { body, headers })));\n }\n private once<T>(path: string, body: unknown): Observable<T> { return this.send<T>('POST', path, body, { 'Idempotency-Key': crypto.randomUUID() }); }\n\n /** Every page of a cursor-paged list (bounded: at most `maxPages` requests). */\n private all<T>(path: string, query: Query = {}, maxPages = 25): Observable<Page<T>> {\n let pages = 0;\n return this.get<Page<T>>(path, { ...query, limit: 200 }).pipe(\n expand(page => page.nextCursor && ++pages < maxPages ? this.get<Page<T>>(path, { ...query, limit: 200, cursor: page.nextCursor }) : EMPTY),\n reduce((all, page) => ({ items: [...all.items, ...page.items], nextCursor: page.nextCursor }), { items: [] as T[], nextCursor: null as string | null }),\n );\n }\n\n environments() { return this.get<Page<DeploymentEnvironment>>('/environments'); }\n applications() { return this.get<Page<Application>>('/applications', { limit: 200 }); }\n resources(type?: string) { return this.all<ResourceSummary>('/resources', { type }); }\n resource(id: string) { return this.get<ResourceDetail>(`/resources/${id}`); }\n health(query: Query) { return this.all<Health>('/health', query); }\n topology(environment?: string | null) { return this.get<Topology>('/topology', { environment }); }\n\n rules() { return this.get<Page<Rule>>('/rules', { limit: 200 }); }\n createRule(definition: unknown) { return this.send<Rule>('POST', '/rules', definition); }\n /** With the rule's etag, so a change made since it was read isn't overwritten. */\n updateRule(key: string, definition: unknown, etag: string) { return this.send<Rule>('PUT', `/rules/${key}`, definition, { 'If-Match': `\"${etag}\"` }); }\n\n channels() { return this.get<Page<Channel>>('/webhooks'); }\n createChannel(body: unknown) { return this.send<Channel>('POST', '/webhooks', body); }\n updateChannel(id: string, body: unknown) { return this.send<Channel>('PUT', `/webhooks/${id}`, body); }\n deliveries(id: string, query: Query = {}) { return this.get<Page<Delivery>>(`/webhooks/${id}/deliveries`, { limit: 50, ...query }); }\n testChannel(id: string) { return this.send<ChannelTestResult>('POST', `/webhooks/${id}/test`); }\n retryDelivery(channelId: string, deliveryId: string) { return this.send<Delivery>('POST', `/webhooks/${channelId}/deliveries/${deliveryId}/retry`); }\n allowlist() { return this.get<Page<AllowlistEntry>>('/webhooks/allowlist'); }\n putAllowlist(destination: string, ports: number[]) { return this.send<AllowlistEntry>('PUT', '/webhooks/allowlist', { destination, ports }); }\n removeAllowlist(destination: string) { return this.send<void>('DELETE', `/webhooks/allowlist?destination=${encodeURIComponent(destination)}`); }\n\n escalationPolicies() { return this.get<Page<EscalationPolicy>>('/escalation-policies'); }\n createEscalationPolicy(body: unknown) { return this.send<EscalationPolicy>('POST', '/escalation-policies', body); }\n updateEscalationPolicy(key: string, body: unknown) { return this.send<EscalationPolicy>('PUT', `/escalation-policies/${key}`, body); }\n\n silences(query: Query = {}) { return this.get<Page<Silence>>('/silences', { limit: 200, ...query }); }\n createSilence(body: unknown) { return this.once<Silence>('/silences', body); }\n cancelSilence(id: string) { return this.send<void>('DELETE', `/silences/${id}`); }\n\n incidents(query: Query = {}) { return this.get<Page<IncidentSummary>>('/incidents', { limit: 100, ...query }); }\n incident(id: string) { return this.get<IncidentDetail>(`/incidents/${id}`); }\n createIncident(body: unknown) { return this.once<IncidentSummary>('/incidents', body); }\n moveIncident(id: string, to: string, comment: string) { return this.once<IncidentSummary>(`/incidents/${id}/transitions`, { to, comment }); }\n addIncidentNote(id: string, text: string) { return this.once<IncidentEvent>(`/incidents/${id}/notes`, { text }); }\n removeIncidentAlert(id: string, alertId: string) { return this.send<void>('DELETE', `/incidents/${id}/alerts/${alertId}`); }\n alertNotifications(id: string) { return this.get<AlertNotifications>(`/alerts/${id}/notifications`); }\n\n /** One page of alerts, newest first; pass the previous page's `nextCursor` as `cursor` for the next. */\n alerts(query: Query) { return this.get<Page<Alert>>('/alerts', { limit: 100, ...query }); }\n /** Every alert matching the query (bounded, like the other complete lists). */\n allAlerts(query: Query) { return this.all<Alert>('/alerts', query); }\n alert(id: string) { return this.get<AlertDetail>(`/alerts/${id}`); }\n acknowledge(id: string, comment: string): Observable<Alert> {\n return this.tenant$.pipe(switchMap(t => this.http.post<Alert>(`${this.base}/tenants/${t.id}/alerts/${id}/acknowledgement`,\n { comment }, { headers: { 'Idempotency-Key': crypto.randomUUID() } })));\n }\n\n traces(query: Query) { return this.get<TelemetryPage<TraceSummary>>('/telemetry/traces', query); }\n trace(traceId: string) { return this.get<Trace>(`/telemetry/traces/${traceId}`); }\n logs(query: Query) { return this.get<TelemetryPage<LogRecord>>('/telemetry/logs', query); }\n operations(query: Query) { return this.get<TelemetryPage<Operation>>('/telemetry/operations', query); }\n metrics(query: Query) { return this.get<TelemetryPage<MetricInfo>>('/telemetry/metrics', query); }\n series(query: Query) { return this.get<Series>('/telemetry/metrics/series', query); }\n serviceStats(query: Query) { return this.get<ServiceStats>('/telemetry/service-stats', query); }\n capacity(query: Query) { return this.get<Capacity>('/telemetry/capacity', query); }\n timeline(query: Query) { return this.get<Timeline>('/timeline', query); }\n relatedToAlert(id: string) { return this.get<Related>(`/alerts/${id}/related`); }\n loadRuns(query: Query) { return this.get<Page<LoadRun>>('/load-runs', query); }\n loadRunResults(id: string) { return this.get<LoadRunResults>(`/load-runs/${id}/results`); }\n dependencyStats(query: Query) { return this.get<DependencyStatsPage>('/telemetry/dependencies', query); }\n dependency(id: string, query: Query) { return this.get<DependencyEvidence>(`/telemetry/dependencies/${id}`, query); }\n search(q: string) { return this.get<TelemetryPage<SearchHit>>('/search', { q }); }\n}\n","import { Injectable, computed, inject } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { ActivatedRoute, NavigationEnd, Params, Router } from '@angular/router';\nimport { filter, map, startWith } from 'rxjs';\n\nexport const RANGES: Record<string, number> = {\n '15m': 15 * 60_000, '1h': 3_600_000, '6h': 6 * 3_600_000, '24h': 24 * 3_600_000, '7d': 7 * 24 * 3_600_000,\n};\n\n/** Search ranges are at most 24 hours (the API's bound); series and operations take up to 7 days. */\nexport const MAX_SEARCH_MS = RANGES['24h'];\n\n/**\n * The investigation context that follows the user between pages (Console requirements §17): environment and time\n * range. It lives in the URL (`env`, and `range` or `from`/`to`), so every page is a deep link and the browser's back\n * button restores it.\n */\n@Injectable({ providedIn: 'root' })\nexport class ContextService {\n private readonly router = inject(Router);\n\n // Created on first use, after the first navigation may already have ended: start from the current URL.\n private readonly params = toSignal(this.router.events.pipe(\n filter(e => e instanceof NavigationEnd),\n startWith(null),\n map(() => this.leaf().snapshot.queryParams),\n ), { initialValue: {} as Params });\n\n readonly environment = computed(() => (this.params()['env'] as string | undefined) ?? '');\n readonly range = computed(() => {\n const p = this.params();\n return p['from'] && p['to'] ? 'custom' : ((p['range'] as string | undefined) ?? '1h');\n });\n readonly absolute = computed(() => {\n const p = this.params();\n return p['from'] && p['to'] ? { from: p['from'] as string, to: p['to'] as string } : null;\n });\n\n /** The window as ISO strings, evaluated now for a relative range. */\n window(maxMs?: number): { from: string; to: string } {\n const absolute = this.absolute();\n if (absolute) return absolute;\n const to = Date.now();\n const span = Math.min(RANGES[this.range()] ?? RANGES['1h'], maxMs ?? Number.MAX_SAFE_INTEGER);\n return { from: new Date(to - span).toISOString(), to: new Date(to).toISOString() };\n }\n\n /** Query parameters for a link: the context plus the target page's own. */\n keep(extra: Params = {}): Params {\n const p = this.params();\n const context: Params = {};\n for (const key of ['env', 'range', 'from', 'to']) if (p[key]) context[key] = p[key];\n return { ...context, ...extra };\n }\n\n /** Changes the context on the current page, keeping its other parameters. */\n set(change: { env?: string | null; range?: string | null; from?: string | null; to?: string | null }) {\n const queryParams: Params = { ...change };\n if (change.range) Object.assign(queryParams, { from: null, to: null });\n void this.router.navigate([], { relativeTo: this.leaf(), queryParams, queryParamsHandling: 'merge' });\n }\n\n /** A time window centred on a moment, for \"around this span\" links. */\n around(at: string, durationMs: number, paddingMs = 5 * 60_000): Params {\n const start = new Date(at).getTime();\n return this.keep({\n from: new Date(start - paddingMs).toISOString(),\n to: new Date(start + durationMs + paddingMs).toISOString(),\n range: null,\n });\n }\n\n private leaf(): ActivatedRoute {\n let route = this.router.routerState.root;\n while (route.firstChild) route = route.firstChild;\n return route;\n }\n}\n","import { Routes } from '@angular/router';\nimport { Menus } from '@juice-js/core';\nimport { normalizeBasePath } from './core/options';\n\nfunction page(path: string, title: string, load: Routes[number]['loadComponent']): Routes[number] {\n return { path, title: `${title} · Juice Observability`, loadComponent: load };\n}\n\n/**\n * The pages, investigation first (Console requirements §4): services, traces, topology, logs and metrics; alerts and\n * rules after. Detail pages are deep links (§17) and carry the environment and time range in their query parameters.\n * The host mounts them at its `basePath` (see {@link provideJuiceObservability}) and adds its own guards.\n */\nexport const OBSERVABILITY_ROUTES: Routes = [\n page('', 'Overview', () => import('./pages/overview.page').then(m => m.OverviewPage)),\n page('services', 'Services', () => import('./pages/services.page').then(m => m.ServicesPage)),\n page('services/:id', 'Service', () => import('./pages/service.page').then(m => m.ServicePage)),\n page('traces', 'Traces', () => import('./pages/traces.page').then(m => m.TracesPage)),\n page('traces/:traceId', 'Trace', () => import('./pages/trace.page').then(m => m.TracePage)),\n page('topology', 'Dependencies', () => import('./pages/topology.page').then(m => m.TopologyPage)),\n page('logs', 'Logs', () => import('./pages/logs.page').then(m => m.LogsPage)),\n page('metrics', 'Metrics', () => import('./pages/metrics.page').then(m => m.MetricsPage)),\n page('resources', 'Resources', () => import('./pages/resources.page').then(m => m.ResourcesPage)),\n page('resources/:id', 'Resource', () => import('./pages/resource.page').then(m => m.ResourcePage)),\n page('alerts', 'Alerts', () => import('./pages/alerts.page').then(m => m.AlertsPage)),\n page('alerts/:id', 'Alert', () => import('./pages/alert.page').then(m => m.AlertPage)),\n page('rules', 'Rules', () => import('./pages/rules.page').then(m => m.RulesPage)),\n page('notifications', 'Notifications', () => import('./pages/notifications.page').then(m => m.NotificationsPage)),\n page('silences', 'Silences', () => import('./pages/silences.page').then(m => m.SilencesPage)),\n page('incidents', 'Incidents', () => import('./pages/incidents.page').then(m => m.IncidentsPage)),\n page('incidents/:id', 'Incident', () => import('./pages/incident.page').then(m => m.IncidentPage)),\n page('timeline', 'Timeline', () => import('./pages/timeline.page').then(m => m.TimelinePage)),\n page('load-runs', 'Load runs', () => import('./pages/load-runs.page').then(m => m.LoadRunsPage)),\n];\n\n/** The side menu entries (juice-layout), investigation pages first, linking under `basePath`. */\nexport function observabilityMenus(basePath = '/', order = 1): Menus {\n const base = normalizeBasePath(basePath);\n const link = (path: string) => (base === '/' ? `/${path}` : path ? `${base}/${path}` : base);\n return [\n { id: 'overview', label: 'Overview', icon: 'dashboard', routerLink: link('') },\n { id: 'services', label: 'Services', icon: 'hub', routerLink: link('services') },\n { id: 'traces', label: 'Traces', icon: 'timeline', routerLink: link('traces') },\n { id: 'topology', label: 'Dependencies', icon: 'account_tree', routerLink: link('topology') },\n { id: 'logs', label: 'Logs', icon: 'notes', routerLink: link('logs') },\n { id: 'metrics', label: 'Metrics', icon: 'show_chart', routerLink: link('metrics') },\n { id: 'resources', label: 'Resources', icon: 'dns', routerLink: link('resources') },\n { id: 'alerts', label: 'Alerts', icon: 'notifications', routerLink: link('alerts') },\n { id: 'incidents', label: 'Incidents', icon: 'emergency', routerLink: link('incidents') },\n { id: 'rules', label: 'Rules', icon: 'rule', routerLink: link('rules') },\n { id: 'silences', label: 'Silences', icon: 'notifications_paused', routerLink: link('silences') },\n { id: 'notifications', label: 'Notifications', icon: 'campaign', routerLink: link('notifications') },\n { id: 'timeline', label: 'Timeline', icon: 'history', routerLink: link('timeline') },\n { id: 'load-runs', label: 'Load runs', icon: 'speed', routerLink: link('load-runs') },\n ].map((menu, index) => ({ ...menu, order: order + index }));\n}\n"],"mappings":";;;;;;AAeA,MAAa,wBAAwB,IAAI,eAAqC,yBAAyB;CACrG,YAAY;CACZ,gBAAgB;EAAE,SAAS;EAAI,UAAU;EAAK,WAAW;CAAI;AAC9D,CAAA;AAGD,SAAgB,0BAA0B,UAAyC,CAAA,GAAE;CACnF,OAAO,yBAAyB,CAC9B;EACE,SAAS;EACT,UAAU;GACR,SAAS,QAAQ,WAAW;GAC5B,UAAU,QAAQ,YAAY;GAC9B,WAAW,QAAQ,aAAa;EACF;CACjC,CACF,CAAA;AACH;AAGA,SAAgB,kBAAkB,UAAgB;CAChD,MAAM,UAAU,SAAS,KAAI,CAAE,CAAC,QAAQ,cAAc,EAAE;CACxD,OAAO,UAAU,IAAI,YAAY;AACnC;AAIA,IAAa,qBAAb,MAAa,mBAAkB;CACZ,UAAU,OAAO,qBAAqB;CAC9C,OAAO,kBAAkB,KAAK,QAAQ,QAAQ;CAGvD,GAAG,GAAG,UAAmB;EAAe,OAAO,CAAC,KAAK,MAAM,GAAG,QAAQ;CAAG;CAGzE,MAAM,SAAkC;EACtC,IAAI,CAAC,WAAW,CAAC,KAAK,QAAQ,W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(services, traces, topology, logs, metrics, resources, alerts, rules) for an Angular app on juice-layout",
|
|
5
5
|
"author": "jack@creatorflow.io",
|
|
6
6
|
"license": "MIT",
|
|
@@ -237,6 +237,14 @@ export interface Delivery {
|
|
|
237
237
|
groupedInto: string | null;
|
|
238
238
|
escalationStep: number;
|
|
239
239
|
}
|
|
240
|
+
/** What a test send did; id is the webhook-id it carried. */
|
|
241
|
+
export interface ChannelTestResult {
|
|
242
|
+
id: string;
|
|
243
|
+
delivered: boolean;
|
|
244
|
+
statusCode: number | null;
|
|
245
|
+
error: string | null;
|
|
246
|
+
durationMs: number;
|
|
247
|
+
}
|
|
240
248
|
export interface AllowlistEntry {
|
|
241
249
|
destination: string;
|
|
242
250
|
ports: number[];
|
|
@@ -605,6 +613,8 @@ export declare class ApiService {
|
|
|
605
613
|
createChannel(body: unknown): Observable<Channel>;
|
|
606
614
|
updateChannel(id: string, body: unknown): Observable<Channel>;
|
|
607
615
|
deliveries(id: string, query?: Query): Observable<Page<Delivery>>;
|
|
616
|
+
testChannel(id: string): Observable<ChannelTestResult>;
|
|
617
|
+
retryDelivery(channelId: string, deliveryId: string): Observable<Delivery>;
|
|
608
618
|
allowlist(): Observable<Page<AllowlistEntry>>;
|
|
609
619
|
putAllowlist(destination: string, ports: number[]): Observable<AllowlistEntry>;
|
|
610
620
|
removeAllowlist(destination: string): Observable<void>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"juice-js-observability-notifications.page-BDqb10C6.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 @if (c.managedBy !== 'config') { <button mat-button type=\"button\" [attr.data-testid]=\"'channel-edit-' + c.key\" (click)=\"editChannel(c)\">Change</button> }\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></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 </tr>\n } @empty { <tr><td colspan=\"5\" class=\"jc-muted\">Nothing sent yet.</td></tr> }\n </tbody>\n </table>\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 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 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"],"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;AAiJlL,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,CAA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