@juice-js/observability 1.1.0-alpha.28 → 1.1.0-alpha.30
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-agent.page-VsTEvbSN.mjs → juice-js-observability-agent.page-CKcuCUVP.mjs} +153 -17
- package/fesm2022/juice-js-observability-agent.page-CKcuCUVP.mjs.map +1 -0
- package/fesm2022/{juice-js-observability-agents.page-C9WjP1nl.mjs → juice-js-observability-agents.page-Ch-tBwQO.mjs} +2 -2
- package/fesm2022/{juice-js-observability-agents.page-C9WjP1nl.mjs.map → juice-js-observability-agents.page-Ch-tBwQO.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-alert.page-79qA1Wqg.mjs → juice-js-observability-alert.page-BNlH9IdQ.mjs} +2 -2
- package/fesm2022/{juice-js-observability-alert.page-79qA1Wqg.mjs.map → juice-js-observability-alert.page-BNlH9IdQ.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-alerts.page-DVqDxYSq.mjs → juice-js-observability-alerts.page-BNmez0Ak.mjs} +2 -2
- package/fesm2022/{juice-js-observability-alerts.page-DVqDxYSq.mjs.map → juice-js-observability-alerts.page-BNmez0Ak.mjs.map} +1 -1
- package/fesm2022/juice-js-observability-approvals.page-DBLw-vl1.mjs +387 -0
- package/fesm2022/juice-js-observability-approvals.page-DBLw-vl1.mjs.map +1 -0
- package/fesm2022/{juice-js-observability-incident.page-CayeZdF_.mjs → juice-js-observability-incident.page-C2ZK3MRh.mjs} +2 -2
- package/fesm2022/{juice-js-observability-incident.page-CayeZdF_.mjs.map → juice-js-observability-incident.page-C2ZK3MRh.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-incidents.page-Bx7afoIh.mjs → juice-js-observability-incidents.page-DhC3BkBo.mjs} +2 -2
- package/fesm2022/{juice-js-observability-incidents.page-Bx7afoIh.mjs.map → juice-js-observability-incidents.page-DhC3BkBo.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-load-runs.page-ByWrvCra.mjs → juice-js-observability-load-runs.page-DVuO4zFp.mjs} +3 -3
- package/fesm2022/{juice-js-observability-load-runs.page-ByWrvCra.mjs.map → juice-js-observability-load-runs.page-DVuO4zFp.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-logs.page-DMRfXnA-.mjs → juice-js-observability-logs.page-PXWQMcvL.mjs} +3 -3
- package/fesm2022/{juice-js-observability-logs.page-DMRfXnA-.mjs.map → juice-js-observability-logs.page-PXWQMcvL.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-metrics.page-D3xK5mgs.mjs → juice-js-observability-metrics.page-Ctm_EEFb.mjs} +3 -3
- package/fesm2022/{juice-js-observability-metrics.page-D3xK5mgs.mjs.map → juice-js-observability-metrics.page-Ctm_EEFb.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-notifications.page-BvUjV46Y.mjs → juice-js-observability-notifications.page-CtcV3Ei4.mjs} +2 -2
- package/fesm2022/{juice-js-observability-notifications.page-BvUjV46Y.mjs.map → juice-js-observability-notifications.page-CtcV3Ei4.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-overview.page-56xVtAo2.mjs → juice-js-observability-overview.page-BRGpTOyc.mjs} +3 -3
- package/fesm2022/{juice-js-observability-overview.page-56xVtAo2.mjs.map → juice-js-observability-overview.page-BRGpTOyc.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-resource.page-CRSA-zpR.mjs → juice-js-observability-resource.page-O4GGdirR.mjs} +2 -2
- package/fesm2022/{juice-js-observability-resource.page-CRSA-zpR.mjs.map → juice-js-observability-resource.page-O4GGdirR.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-resources.page-BW7W5Wy2.mjs → juice-js-observability-resources.page-B_AVPpes.mjs} +2 -2
- package/fesm2022/{juice-js-observability-resources.page-BW7W5Wy2.mjs.map → juice-js-observability-resources.page-B_AVPpes.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-rules.page-uKeK44Iz.mjs → juice-js-observability-rules.page-CWaADAe4.mjs} +3 -3
- package/fesm2022/{juice-js-observability-rules.page-uKeK44Iz.mjs.map → juice-js-observability-rules.page-CWaADAe4.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-service.page-D7-Wbc5P.mjs → juice-js-observability-service.page-DRj1GO0Q.mjs} +2 -2
- package/fesm2022/{juice-js-observability-service.page-D7-Wbc5P.mjs.map → juice-js-observability-service.page-DRj1GO0Q.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-services.page-CNarlAgr.mjs → juice-js-observability-services.page-BbFbbvyH.mjs} +3 -3
- package/fesm2022/{juice-js-observability-services.page-CNarlAgr.mjs.map → juice-js-observability-services.page-BbFbbvyH.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-silences.page-DBBZBZ0a.mjs → juice-js-observability-silences.page-CoTqfGxY.mjs} +2 -2
- package/fesm2022/{juice-js-observability-silences.page-DBBZBZ0a.mjs.map → juice-js-observability-silences.page-CoTqfGxY.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-telemetry-B98lekF2.mjs → juice-js-observability-telemetry-DVwUTHSz.mjs} +2 -2
- package/fesm2022/{juice-js-observability-telemetry-B98lekF2.mjs.map → juice-js-observability-telemetry-DVwUTHSz.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-timeline.page-DhU78o_M.mjs → juice-js-observability-timeline.page-CFSigOgk.mjs} +2 -2
- package/fesm2022/{juice-js-observability-timeline.page-DhU78o_M.mjs.map → juice-js-observability-timeline.page-CFSigOgk.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-topology.page-CVdoBph4.mjs → juice-js-observability-topology.page-BDfNpiql.mjs} +2 -2
- package/fesm2022/{juice-js-observability-topology.page-CVdoBph4.mjs.map → juice-js-observability-topology.page-BDfNpiql.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-trace.page-C-icZvAo.mjs → juice-js-observability-trace.page-CdW09ADY.mjs} +2 -2
- package/fesm2022/{juice-js-observability-trace.page-C-icZvAo.mjs.map → juice-js-observability-trace.page-CdW09ADY.mjs.map} +1 -1
- package/fesm2022/{juice-js-observability-traces.page-c8CoI2AY.mjs → juice-js-observability-traces.page-CMuItN_m.mjs} +3 -3
- package/fesm2022/{juice-js-observability-traces.page-c8CoI2AY.mjs.map → juice-js-observability-traces.page-CMuItN_m.mjs.map} +1 -1
- package/fesm2022/juice-js-observability.mjs +285 -118
- package/fesm2022/juice-js-observability.mjs.map +1 -1
- package/package.json +1 -1
- package/types/juice-js-observability.d.ts +91 -2
- package/fesm2022/juice-js-observability-agent.page-VsTEvbSN.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"juice-js-observability-alerts.page-
|
|
1
|
+
{"version":3,"file":"juice-js-observability-alerts.page-BNmez0Ak.mjs","names":[],"sources":["../../../../projects/juice-js/observability/src/lib/pages/alerts.page.ts"],"sourcesContent":["import { LinkPipe } from '../core/options';\nimport { ChangeDetectionStrategy, Component, computed, inject, input } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\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 } from '../shared/format';\nimport { ContextBar } from '../shared/ui';\nimport { cursorList } from '../shared/paging';\nimport { problemText } from '../shared/telemetry';\n\n/** Alerts, newest first (Console requirements §14), filtered by state; 100 at a time, with the next on request. */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [LinkPipe, RouterLink, MatButtonModule, MatProgressBarModule, ContextBar, AgoPipe],\n template: `\n <jc-context-bar><h1>Alerts</h1>\n @for (s of states; track s) {\n <a class=\"jc-chip\" [class.jc-selected]=\"s === (state() ?? 'firing')\" [routerLink]=\"['alerts'] | jcLink\" [queryParams]=\"ctx.keep({ state: s })\">{{ s }}</a>\n }\n </jc-context-bar>\n @if (alerts.first.isLoading()) { <mat-progress-bar mode=\"indeterminate\" /> }\n @if (alerts.first.error()) { <p class=\"jc-error\">{{ error() }}</p> }\n <table class=\"jc-table\">\n <thead><tr><th>Severity</th><th>Rule</th><th>Subject</th><th>State</th><th>Value</th><th>Fired</th><th>Acknowledged</th></tr></thead>\n <tbody>\n @for (a of alerts.items(); track a.id) {\n <tr>\n <td><span class=\"jc-badge\" [class.jc-health-unhealthy]=\"a.severity === 'Critical'\" [class.jc-health-degraded]=\"a.severity === 'Warning'\">{{ a.severity }}</span></td>\n <td><a [routerLink]=\"['alerts', a.id] | jcLink\" [queryParams]=\"ctx.keep()\">{{ a.rule }}</a></td>\n <td>{{ a.subjectKey }}</td>\n <td>{{ a.state }}@if (a.noData) { <span class=\"jc-muted\" title=\"The last evaluation had too few samples; the state is kept\"> · no data</span> }</td>\n <td>{{ a.lastValue ?? '—' }}</td>\n <td>{{ a.firedAt | ago }}</td>\n <td>{{ a.acknowledgedBy ?? '—' }}</td>\n </tr>\n } @empty { @if (alerts.first.hasValue()) { <tr><td colspan=\"7\" class=\"jc-muted\">No {{ state() ?? 'firing' }} alerts.</td></tr> } }\n </tbody>\n </table>\n @if (alerts.items().length > 0) {\n <div class=\"jc-more\">\n <span class=\"jc-muted\">{{ alerts.items().length }} {{ state() ?? 'firing' }} alert{{ alerts.items().length === 1 ? '' : 's' }}{{ alerts.hasMore() ? ', newest first' : '' }}</span>\n @if (alerts.hasMore()) {\n <button mat-button (click)=\"alerts.more()\" [disabled]=\"alerts.loadingMore()\">{{ alerts.loadingMore() ? 'Loading…' : 'Load more' }}</button>\n }\n @if (alerts.moreError()) { <span class=\"jc-error\">{{ moreError() }}</span> }\n </div>\n }`,\n})\nexport class AlertsPage {\n protected readonly ctx = inject(ContextService);\n private readonly api = inject(ApiService);\n protected readonly states = ['firing', 'pending', 'resolved'];\n readonly state = input<string>();\n protected readonly alerts = cursorList(\n () => ({ state: this.state() ?? 'firing', environment: this.ctx.environment() }), params => params, q => this.api.alerts(q));\n protected readonly error = computed(() => problemText(this.alerts.first.error()));\n protected readonly moreError = computed(()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AA;IAAA,MAAA,GAAA;IAAA,UAAA;IAAA,QAAA,CAAA,WAAA;IAAA,UAAA,CAAA,aAAA,WAAA;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,MAAvE;IAAQ,MAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAiE;IAAO,MAAA;GAAA;EAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAmC/E,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAU,YAAA,CAAA;EArCtB,MAAA;EAAU,MAAA,CAAA;GACT,iBAAiB,wBAAwB;GACzC,SAAS;IAAC;IAAU;IAAY;IAAiB;IAAsB;IAAY;GAAO;GAC1F,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiCX,CAAA"}
|
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
import { ApiService, ApprovalCount, ContextService, LinkPipe } from "./juice-js-observability.mjs";
|
|
2
|
+
import { c as ContextBar, g as AgoPipe, h as apiResource, o as problemText } from "./juice-js-observability-telemetry-DVwUTHSz.mjs";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import { ChangeDetectionStrategy, Component, computed, effect, inject, signal } from "@angular/core";
|
|
5
|
+
import { RouterLink } from "@angular/router";
|
|
6
|
+
import { DatePipe } from "@angular/common";
|
|
7
|
+
import * as i1 from "@angular/forms";
|
|
8
|
+
import { FormsModule } from "@angular/forms";
|
|
9
|
+
import * as i2 from "@angular/material/button";
|
|
10
|
+
import { MatButtonModule } from "@angular/material/button";
|
|
11
|
+
import { MatFormFieldModule } from "@angular/material/form-field";
|
|
12
|
+
import * as i4 from "@angular/material/input";
|
|
13
|
+
import { MatInputModule } from "@angular/material/input";
|
|
14
|
+
import * as i5 from "@angular/material/progress-bar";
|
|
15
|
+
import { MatProgressBarModule } from "@angular/material/progress-bar";
|
|
16
|
+
import * as i3 from "@angular/material/select";
|
|
17
|
+
var ApprovalsPage = class ApprovalsPage {
|
|
18
|
+
ctx = inject(ContextService);
|
|
19
|
+
api = inject(ApiService);
|
|
20
|
+
approvalCount = inject(ApprovalCount);
|
|
21
|
+
busy = signal(null, ...ngDevMode ? [{ debugName: "busy" }] : /* istanbul ignore next */ []);
|
|
22
|
+
comments = signal({}, ...ngDevMode ? [{ debugName: "comments" }] : /* istanbul ignore next */ []);
|
|
23
|
+
errors = signal({}, ...ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []);
|
|
24
|
+
pending = apiResource({ stream: () => this.api.actionRequests({ state: "Pending" }) });
|
|
25
|
+
recent = apiResource({ stream: () => this.api.actionRequests({ limit: 30 }) });
|
|
26
|
+
decided = computed(() => (this.recent.value()?.items ?? []).filter((r) => r.state !== "Pending"), ...ngDevMode ? [{ debugName: "decided" }] : /* istanbul ignore next */ []);
|
|
27
|
+
error = computed(() => problemText(this.pending.error()), ...ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []);
|
|
28
|
+
constructor() {
|
|
29
|
+
effect((onCleanup) => {
|
|
30
|
+
this.pending.value();
|
|
31
|
+
const timer = setTimeout(() => {
|
|
32
|
+
this.pending.reload();
|
|
33
|
+
this.recent.reload();
|
|
34
|
+
}, 1e4);
|
|
35
|
+
onCleanup(() => clearTimeout(timer));
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
describe(r) {
|
|
39
|
+
return Object.entries(r.parameters ?? {}).map(([k, v]) => `${k}=${typeof v === "string" ? v : JSON.stringify(v)}`).join(", ");
|
|
40
|
+
}
|
|
41
|
+
comment(id, text) {
|
|
42
|
+
this.comments.update((c) => ({
|
|
43
|
+
...c,
|
|
44
|
+
[id]: text
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
decide(r, call) {
|
|
48
|
+
this.busy.set(r.id);
|
|
49
|
+
this.errors.update((e) => ({
|
|
50
|
+
...e,
|
|
51
|
+
[r.id]: ""
|
|
52
|
+
}));
|
|
53
|
+
call.subscribe({
|
|
54
|
+
next: () => {
|
|
55
|
+
this.busy.set(null);
|
|
56
|
+
this.pending.reload();
|
|
57
|
+
this.recent.reload();
|
|
58
|
+
this.approvalCount.refresh();
|
|
59
|
+
},
|
|
60
|
+
error: (e) => {
|
|
61
|
+
this.busy.set(null);
|
|
62
|
+
const status = e.status;
|
|
63
|
+
const text = status === 403 && r.policy === "SecondPerson" ? `An admin other than ${r.requestedBy} has to approve this.` : status === 403 ? "Deciding needs the admin role." : problemText(e);
|
|
64
|
+
this.errors.update((x) => ({
|
|
65
|
+
...x,
|
|
66
|
+
[r.id]: text
|
|
67
|
+
}));
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
approve(r) {
|
|
72
|
+
this.decide(r, this.api.approveRequest(r.id, (this.comments()[r.id] ?? "").trim()));
|
|
73
|
+
}
|
|
74
|
+
reject(r) {
|
|
75
|
+
const comment = (this.comments()[r.id] ?? "").trim();
|
|
76
|
+
if (!comment) {
|
|
77
|
+
this.errors.update((e) => ({
|
|
78
|
+
...e,
|
|
79
|
+
[r.id]: "Say why in the comment."
|
|
80
|
+
}));
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
this.decide(r, this.api.rejectRequest(r.id, comment));
|
|
84
|
+
}
|
|
85
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
86
|
+
minVersion: "12.0.0",
|
|
87
|
+
version: "22.2.4",
|
|
88
|
+
ngImport: i0,
|
|
89
|
+
type: ApprovalsPage,
|
|
90
|
+
deps: [],
|
|
91
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
92
|
+
});
|
|
93
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
94
|
+
minVersion: "17.0.0",
|
|
95
|
+
version: "22.2.4",
|
|
96
|
+
type: ApprovalsPage,
|
|
97
|
+
isStandalone: true,
|
|
98
|
+
selector: "ng-component",
|
|
99
|
+
ngImport: i0,
|
|
100
|
+
template: `
|
|
101
|
+
<jc-context-bar><h1>Approvals</h1></jc-context-bar>
|
|
102
|
+
@if (pending.isLoading() && !pending.value()) { <mat-progress-bar mode="indeterminate" /> }
|
|
103
|
+
@if (pending.error()) { <p class="jc-error">{{ error() }}</p> }
|
|
104
|
+
|
|
105
|
+
<section class="jc-card" data-testid="approvals-pending">
|
|
106
|
+
<h2>Waiting</h2>
|
|
107
|
+
@for (r of pending.value()?.items ?? []; track r.id) {
|
|
108
|
+
<div class="jc-list-row" [attr.data-testid]="'approval-' + r.id">
|
|
109
|
+
<div>
|
|
110
|
+
<strong>{{ r.action }}</strong> on <a [routerLink]="['agents', r.agentId] | jcLink" [queryParams]="ctx.keep()">{{ r.hostname }}</a>
|
|
111
|
+
<span class="jc-badge" [class.jc-health-unhealthy]="r.risk === 'High'" [class.jc-health-degraded]="r.risk !== 'High'">{{ r.risk }} risk</span>
|
|
112
|
+
@if (describe(r); as d) { <div class="jc-mono jc-small">{{ d }}</div> }
|
|
113
|
+
<div class="jc-small">{{ r.requestedBy }}, {{ r.requestedAt | ago }}: {{ r.reason }}</div>
|
|
114
|
+
@if (r.target || r.alertId) { <div class="jc-small" data-testid="approval-target">For {{ r.alertId ? 'a firing alert' : '' }}{{ r.alertId && r.target ? ' on ' : '' }}{{ r.target ? r.target.type.toLowerCase() + ' health' : '' }}: approving checks, on fresh evidence, that it's still broken, and recovery is confirmed from health after.</div> }
|
|
115
|
+
<div class="jc-muted jc-small">{{ r.policy === 'SecondPerson' ? 'Needs an admin other than ' + r.requestedBy : 'Needs an admin' }}. Expires {{ r.expiresAt | date: 'HH:mm' }}.</div>
|
|
116
|
+
</div>
|
|
117
|
+
<form class="jc-form" (ngSubmit)="approve(r)">
|
|
118
|
+
<mat-form-field subscriptSizing="dynamic" class="jc-field-md"><mat-label>Comment</mat-label>
|
|
119
|
+
<input matInput [name]="'comment-' + r.id" [attr.data-testid]="'approval-comment-' + r.id" maxlength="500" [ngModel]="comments()[r.id] ?? ''" (ngModelChange)="comment(r.id, $event)">
|
|
120
|
+
</mat-form-field>
|
|
121
|
+
<button mat-flat-button type="submit" [attr.data-testid]="'approve-' + r.id" [disabled]="busy() === r.id">Approve</button>
|
|
122
|
+
<button mat-stroked-button type="button" [attr.data-testid]="'reject-' + r.id" [disabled]="busy() === r.id" (click)="reject(r)">Reject</button>
|
|
123
|
+
@if (errors()[r.id]; as e) { <span class="jc-error" [attr.data-testid]="'approval-error-' + r.id">{{ e }}</span> }
|
|
124
|
+
</form>
|
|
125
|
+
</div>
|
|
126
|
+
} @empty { <p class="jc-muted" data-testid="approvals-none">Nothing is waiting for approval.</p> }
|
|
127
|
+
</section>
|
|
128
|
+
|
|
129
|
+
<section class="jc-card">
|
|
130
|
+
<h2>Decided lately</h2>
|
|
131
|
+
<table class="jc-table" data-testid="approvals-decided">
|
|
132
|
+
<thead><tr><th>Asked</th><th>Action</th><th>By</th><th>Decision</th></tr></thead>
|
|
133
|
+
<tbody>
|
|
134
|
+
@for (r of decided(); track r.id) {
|
|
135
|
+
<tr>
|
|
136
|
+
<td class="jc-nowrap">{{ r.requestedAt | date: 'MMM d, HH:mm' }}</td>
|
|
137
|
+
<td><strong>{{ r.action }}</strong> on <a [routerLink]="['agents', r.agentId] | jcLink" [queryParams]="ctx.keep()">{{ r.hostname }}</a></td>
|
|
138
|
+
<td>{{ r.requestedBy }}</td>
|
|
139
|
+
<td>{{ r.state }}@if (r.decidedBy) { by {{ r.decidedBy }} }@if (r.command) { · command {{ r.command.state }} }@if (r.verification === 'Verified') { · recovery confirmed }@if (r.verification === 'NotVerified') { · <span class="jc-error">recovery not confirmed</span> }@if (r.verification === 'Verifying') { · watching health }@if (r.comment) { <div class="jc-small">{{ r.comment }}</div> }</td>
|
|
140
|
+
</tr>
|
|
141
|
+
} @empty { <tr><td colspan="4" class="jc-muted">None yet.</td></tr> }
|
|
142
|
+
</tbody>
|
|
143
|
+
</table>
|
|
144
|
+
</section>`,
|
|
145
|
+
isInline: true,
|
|
146
|
+
dependencies: [
|
|
147
|
+
{
|
|
148
|
+
kind: "directive",
|
|
149
|
+
type: RouterLink,
|
|
150
|
+
selector: "[routerLink]",
|
|
151
|
+
inputs: [
|
|
152
|
+
"target",
|
|
153
|
+
"queryParams",
|
|
154
|
+
"fragment",
|
|
155
|
+
"queryParamsHandling",
|
|
156
|
+
"state",
|
|
157
|
+
"info",
|
|
158
|
+
"relativeTo",
|
|
159
|
+
"preserveFragment",
|
|
160
|
+
"skipLocationChange",
|
|
161
|
+
"replaceUrl",
|
|
162
|
+
"browserUrl",
|
|
163
|
+
"routerLink"
|
|
164
|
+
]
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
kind: "ngmodule",
|
|
168
|
+
type: FormsModule
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
kind: "directive",
|
|
172
|
+
type: i1.ɵNgNoValidate,
|
|
173
|
+
selector: "form:not([ngNoForm]):not([ngNativeValidate])"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
kind: "directive",
|
|
177
|
+
type: i1.DefaultValueAccessor,
|
|
178
|
+
selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
kind: "directive",
|
|
182
|
+
type: i1.NgControlStatus,
|
|
183
|
+
selector: "[formControlName],[ngModel],[formControl]"
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
kind: "directive",
|
|
187
|
+
type: i1.NgControlStatusGroup,
|
|
188
|
+
selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
kind: "directive",
|
|
192
|
+
type: i1.MaxLengthValidator,
|
|
193
|
+
selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]",
|
|
194
|
+
inputs: ["maxlength"]
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
kind: "directive",
|
|
198
|
+
type: i1.NgModel,
|
|
199
|
+
selector: "[ngModel]:not([formControlName]):not([formControl])",
|
|
200
|
+
inputs: [
|
|
201
|
+
"name",
|
|
202
|
+
"disabled",
|
|
203
|
+
"ngModel",
|
|
204
|
+
"ngModelOptions"
|
|
205
|
+
],
|
|
206
|
+
outputs: ["ngModelChange"],
|
|
207
|
+
exportAs: ["ngModel"]
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
kind: "directive",
|
|
211
|
+
type: i1.NgForm,
|
|
212
|
+
selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]",
|
|
213
|
+
inputs: ["ngFormOptions"],
|
|
214
|
+
outputs: ["ngSubmit"],
|
|
215
|
+
exportAs: ["ngForm"]
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
kind: "ngmodule",
|
|
219
|
+
type: MatButtonModule
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
kind: "component",
|
|
223
|
+
type: i2.MatButton,
|
|
224
|
+
selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ",
|
|
225
|
+
inputs: ["matButton"],
|
|
226
|
+
exportAs: ["matButton", "matAnchor"]
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
kind: "ngmodule",
|
|
230
|
+
type: MatFormFieldModule
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
kind: "component",
|
|
234
|
+
type: i3.MatFormField,
|
|
235
|
+
selector: "mat-form-field",
|
|
236
|
+
inputs: [
|
|
237
|
+
"hideRequiredMarker",
|
|
238
|
+
"color",
|
|
239
|
+
"floatLabel",
|
|
240
|
+
"appearance",
|
|
241
|
+
"subscriptSizing",
|
|
242
|
+
"hintLabel"
|
|
243
|
+
],
|
|
244
|
+
exportAs: ["matFormField"]
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
kind: "directive",
|
|
248
|
+
type: i3.MatLabel,
|
|
249
|
+
selector: "mat-label"
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
kind: "ngmodule",
|
|
253
|
+
type: MatInputModule
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
kind: "directive",
|
|
257
|
+
type: i4.MatInput,
|
|
258
|
+
selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]",
|
|
259
|
+
inputs: [
|
|
260
|
+
"disabled",
|
|
261
|
+
"id",
|
|
262
|
+
"placeholder",
|
|
263
|
+
"name",
|
|
264
|
+
"required",
|
|
265
|
+
"type",
|
|
266
|
+
"errorStateMatcher",
|
|
267
|
+
"aria-describedby",
|
|
268
|
+
"value",
|
|
269
|
+
"readonly",
|
|
270
|
+
"disabledInteractive"
|
|
271
|
+
],
|
|
272
|
+
exportAs: ["matInput"]
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
kind: "ngmodule",
|
|
276
|
+
type: MatProgressBarModule
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
kind: "component",
|
|
280
|
+
type: i5.MatProgressBar,
|
|
281
|
+
selector: "mat-progress-bar",
|
|
282
|
+
inputs: [
|
|
283
|
+
"color",
|
|
284
|
+
"value",
|
|
285
|
+
"bufferValue",
|
|
286
|
+
"mode"
|
|
287
|
+
],
|
|
288
|
+
outputs: ["animationEnd"],
|
|
289
|
+
exportAs: ["matProgressBar"]
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
kind: "component",
|
|
293
|
+
type: ContextBar,
|
|
294
|
+
selector: "jc-context-bar"
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
kind: "pipe",
|
|
298
|
+
type: LinkPipe,
|
|
299
|
+
name: "jcLink"
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
kind: "pipe",
|
|
303
|
+
type: DatePipe,
|
|
304
|
+
name: "date"
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
kind: "pipe",
|
|
308
|
+
type: AgoPipe,
|
|
309
|
+
name: "ago"
|
|
310
|
+
}
|
|
311
|
+
],
|
|
312
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
313
|
+
});
|
|
314
|
+
};
|
|
315
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
316
|
+
minVersion: "12.0.0",
|
|
317
|
+
version: "22.2.4",
|
|
318
|
+
ngImport: i0,
|
|
319
|
+
type: ApprovalsPage,
|
|
320
|
+
decorators: [{
|
|
321
|
+
type: Component,
|
|
322
|
+
args: [{
|
|
323
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
324
|
+
imports: [
|
|
325
|
+
LinkPipe,
|
|
326
|
+
RouterLink,
|
|
327
|
+
DatePipe,
|
|
328
|
+
FormsModule,
|
|
329
|
+
MatButtonModule,
|
|
330
|
+
MatFormFieldModule,
|
|
331
|
+
MatInputModule,
|
|
332
|
+
MatProgressBarModule,
|
|
333
|
+
ContextBar,
|
|
334
|
+
AgoPipe
|
|
335
|
+
],
|
|
336
|
+
template: `
|
|
337
|
+
<jc-context-bar><h1>Approvals</h1></jc-context-bar>
|
|
338
|
+
@if (pending.isLoading() && !pending.value()) { <mat-progress-bar mode="indeterminate" /> }
|
|
339
|
+
@if (pending.error()) { <p class="jc-error">{{ error() }}</p> }
|
|
340
|
+
|
|
341
|
+
<section class="jc-card" data-testid="approvals-pending">
|
|
342
|
+
<h2>Waiting</h2>
|
|
343
|
+
@for (r of pending.value()?.items ?? []; track r.id) {
|
|
344
|
+
<div class="jc-list-row" [attr.data-testid]="'approval-' + r.id">
|
|
345
|
+
<div>
|
|
346
|
+
<strong>{{ r.action }}</strong> on <a [routerLink]="['agents', r.agentId] | jcLink" [queryParams]="ctx.keep()">{{ r.hostname }}</a>
|
|
347
|
+
<span class="jc-badge" [class.jc-health-unhealthy]="r.risk === 'High'" [class.jc-health-degraded]="r.risk !== 'High'">{{ r.risk }} risk</span>
|
|
348
|
+
@if (describe(r); as d) { <div class="jc-mono jc-small">{{ d }}</div> }
|
|
349
|
+
<div class="jc-small">{{ r.requestedBy }}, {{ r.requestedAt | ago }}: {{ r.reason }}</div>
|
|
350
|
+
@if (r.target || r.alertId) { <div class="jc-small" data-testid="approval-target">For {{ r.alertId ? 'a firing alert' : '' }}{{ r.alertId && r.target ? ' on ' : '' }}{{ r.target ? r.target.type.toLowerCase() + ' health' : '' }}: approving checks, on fresh evidence, that it's still broken, and recovery is confirmed from health after.</div> }
|
|
351
|
+
<div class="jc-muted jc-small">{{ r.policy === 'SecondPerson' ? 'Needs an admin other than ' + r.requestedBy : 'Needs an admin' }}. Expires {{ r.expiresAt | date: 'HH:mm' }}.</div>
|
|
352
|
+
</div>
|
|
353
|
+
<form class="jc-form" (ngSubmit)="approve(r)">
|
|
354
|
+
<mat-form-field subscriptSizing="dynamic" class="jc-field-md"><mat-label>Comment</mat-label>
|
|
355
|
+
<input matInput [name]="'comment-' + r.id" [attr.data-testid]="'approval-comment-' + r.id" maxlength="500" [ngModel]="comments()[r.id] ?? ''" (ngModelChange)="comment(r.id, $event)">
|
|
356
|
+
</mat-form-field>
|
|
357
|
+
<button mat-flat-button type="submit" [attr.data-testid]="'approve-' + r.id" [disabled]="busy() === r.id">Approve</button>
|
|
358
|
+
<button mat-stroked-button type="button" [attr.data-testid]="'reject-' + r.id" [disabled]="busy() === r.id" (click)="reject(r)">Reject</button>
|
|
359
|
+
@if (errors()[r.id]; as e) { <span class="jc-error" [attr.data-testid]="'approval-error-' + r.id">{{ e }}</span> }
|
|
360
|
+
</form>
|
|
361
|
+
</div>
|
|
362
|
+
} @empty { <p class="jc-muted" data-testid="approvals-none">Nothing is waiting for approval.</p> }
|
|
363
|
+
</section>
|
|
364
|
+
|
|
365
|
+
<section class="jc-card">
|
|
366
|
+
<h2>Decided lately</h2>
|
|
367
|
+
<table class="jc-table" data-testid="approvals-decided">
|
|
368
|
+
<thead><tr><th>Asked</th><th>Action</th><th>By</th><th>Decision</th></tr></thead>
|
|
369
|
+
<tbody>
|
|
370
|
+
@for (r of decided(); track r.id) {
|
|
371
|
+
<tr>
|
|
372
|
+
<td class="jc-nowrap">{{ r.requestedAt | date: 'MMM d, HH:mm' }}</td>
|
|
373
|
+
<td><strong>{{ r.action }}</strong> on <a [routerLink]="['agents', r.agentId] | jcLink" [queryParams]="ctx.keep()">{{ r.hostname }}</a></td>
|
|
374
|
+
<td>{{ r.requestedBy }}</td>
|
|
375
|
+
<td>{{ r.state }}@if (r.decidedBy) { by {{ r.decidedBy }} }@if (r.command) { · command {{ r.command.state }} }@if (r.verification === 'Verified') { · recovery confirmed }@if (r.verification === 'NotVerified') { · <span class="jc-error">recovery not confirmed</span> }@if (r.verification === 'Verifying') { · watching health }@if (r.comment) { <div class="jc-small">{{ r.comment }}</div> }</td>
|
|
376
|
+
</tr>
|
|
377
|
+
} @empty { <tr><td colspan="4" class="jc-muted">None yet.</td></tr> }
|
|
378
|
+
</tbody>
|
|
379
|
+
</table>
|
|
380
|
+
</section>`
|
|
381
|
+
}]
|
|
382
|
+
}],
|
|
383
|
+
ctorParameters: () => []
|
|
384
|
+
});
|
|
385
|
+
export { ApprovalsPage };
|
|
386
|
+
|
|
387
|
+
//# sourceMappingURL=juice-js-observability-approvals.page-DBLw-vl1.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"juice-js-observability-approvals.page-DBLw-vl1.mjs","names":[],"sources":["../../../../projects/juice-js/observability/src/lib/pages/approvals.page.ts"],"sourcesContent":["import { LinkPipe } from '../core/options';\nimport { ChangeDetectionStrategy, Component, computed, effect, inject, signal } from '@angular/core';\nimport { DatePipe } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\nimport { RouterLink } from '@angular/router';\nimport { Observable } from 'rxjs';\nimport { ApiService } from '../core/api.service';\nimport { ApprovalCount } from '../core/approval-count';\nimport { ContextService } from '../core/context.service';\nimport { ActionRequest } from '../core/models';\nimport { AgoPipe } from '../shared/format';\nimport { apiResource } from '../shared/resource';\nimport { problemText } from '../shared/telemetry';\nimport { ContextBar } from '../shared/ui';\n\n/**\n * Requests waiting for approval, across every agent (roadmap Phase 8), and the ones decided lately. Admins approve or reject; under a\n * second-person policy, not their own. Approving signs the command and the agent runs it at its next poll.\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [LinkPipe, RouterLink, DatePipe, FormsModule, MatButtonModule, MatFormFieldModule, MatInputModule, MatProgressBarModule, ContextBar, AgoPipe],\n template: `\n <jc-context-bar><h1>Approvals</h1></jc-context-bar>\n @if (pending.isLoading() && !pending.value()) { <mat-progress-bar mode=\"indeterminate\" /> }\n @if (pending.error()) { <p class=\"jc-error\">{{ error() }}</p> }\n\n <section class=\"jc-card\" data-testid=\"approvals-pending\">\n <h2>Waiting</h2>\n @for (r of pending.value()?.items ?? []; track r.id) {\n <div class=\"jc-list-row\" [attr.data-testid]=\"'approval-' + r.id\">\n <div>\n <strong>{{ r.action }}</strong> on <a [routerLink]=\"['agents', r.agentId] | jcLink\" [queryParams]=\"ctx.keep()\">{{ r.hostname }}</a>\n <span class=\"jc-badge\" [class.jc-health-unhealthy]=\"r.risk === 'High'\" [class.jc-health-degraded]=\"r.risk !== 'High'\">{{ r.risk }} risk</span>\n @if (describe(r); as d) { <div class=\"jc-mono jc-small\">{{ d }}</div> }\n <div class=\"jc-small\">{{ r.requestedBy }}, {{ r.requestedAt | ago }}: {{ r.reason }}</div>\n @if (r.target || r.alertId) { <div class=\"jc-small\" data-testid=\"approval-target\">For {{ r.alertId ? 'a firing alert' : '' }}{{ r.alertId && r.target ? ' on ' : '' }}{{ r.target ? r.target.type.toLowerCase() + ' health' : '' }}: approving checks, on fresh evidence, that it's still broken, and recovery is confirmed from health after.</div> }\n <div class=\"jc-muted jc-small\">{{ r.policy === 'SecondPerson' ? 'Needs an admin other than ' + r.requestedBy : 'Needs an admin' }}. Expires {{ r.expiresAt | date: 'HH:mm' }}.</div>\n </div>\n <form class=\"jc-form\" (ngSubmit)=\"approve(r)\">\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-md\"><mat-label>Comment</mat-label>\n <input matInput [name]=\"'comment-' + r.id\" [attr.data-testid]=\"'approval-comment-' + r.id\" maxlength=\"500\" [ngModel]=\"comments()[r.id] ?? ''\" (ngModelChange)=\"comment(r.id, $event)\">\n </mat-form-field>\n <button mat-flat-button type=\"submit\" [attr.data-testid]=\"'approve-' + r.id\" [disabled]=\"busy() === r.id\">Approve</button>\n <button mat-stroked-button type=\"button\" [attr.data-testid]=\"'reject-' + r.id\" [disabled]=\"busy() === r.id\" (click)=\"reject(r)\">Reject</button>\n @if (errors()[r.id]; as e) { <span class=\"jc-error\" [attr.data-testid]=\"'approval-error-' + r.id\">{{ e }}</span> }\n </form>\n </div>\n } @empty { <p class=\"jc-muted\" data-testid=\"approvals-none\">Nothing is waiting for approval.</p> }\n </section>\n\n <section class=\"jc-card\">\n <h2>Decided lately</h2>\n <table class=\"jc-table\" data-testid=\"approvals-decided\">\n <thead><tr><th>Asked</th><th>Action</th><th>By</th><th>Decision</th></tr></thead>\n <tbody>\n @for (r of decided(); track r.id) {\n <tr>\n <td class=\"jc-nowrap\">{{ r.requestedAt | date: 'MMM d, HH:mm' }}</td>\n <td><strong>{{ r.action }}</strong> on <a [routerLink]=\"['agents', r.agentId] | jcLink\" [queryParams]=\"ctx.keep()\">{{ r.hostname }}</a></td>\n <td>{{ r.requestedBy }}</td>\n <td>{{ r.state }}@if (r.decidedBy) { by {{ r.decidedBy }} }@if (r.command) { · command {{ r.command.state }} }@if (r.verification === 'Verified') { · recovery confirmed }@if (r.verification === 'NotVerified') { · <span class=\"jc-error\">recovery not confirmed</span> }@if (r.verification === 'Verifying') { · watching health }@if (r.comment) { <div class=\"jc-small\">{{ r.comment }}</div> }</td>\n </tr>\n } @empty { <tr><td colspan=\"4\" class=\"jc-muted\">None yet.</td></tr> }\n </tbody>\n </table>\n </section>`,\n})\nexport class ApprovalsPage {\n protected readonly ctx = inject(ContextService);\n private readonly api = inject(ApiService);\n private readonly approvalCount = inject(ApprovalCount);\n protected readonly busy = signal<string | null>(null);\n protected readonly comments = signal<Record<string, string>>({});\n protected readonly errors = signal<Record<string, string>>({});\n\n protected readonly pending = apiResource({ stream: () => this.api.actionRequests({ state: 'Pending' }) });\n private readonly recent = apiResource({ stream: () => this.api.actionRequests({ limit: 30 }) });\n protected readonly decided = computed(() => (this.recent.value()?.items ?? []).filter(r => r.state !== 'Pending'));\n protected readonly error = computed(() => problemText(this.pending.error()));\n\n constructor() {\n // Others ask and decide too: look again every 10 seconds.\n effect(onCleanup => {\n this.pending.value();\n const timer = setTimeout(() => { this.pending.reload(); this.recent.reload(); }, 10_000);\n onCleanup(() => clearTimeout(timer));\n });\n }\n\n protected describe(r: ActionRequest): string {\n return Object.entries(r.parameters ?? {}).map(([k, v]) => `${k}=${typeof v === 'string' ? v : JSON.stringify(v)}`).join(', ');\n }\n\n protected comment(id: string, text: string) { this.comments.update(c => ({ ...c, [id]: text })); }\n\n private decide(r: ActionRequest, call: Observable<ActionRequest>) {\n this.busy.set(r.id);\n this.errors.update(e => ({ ...e, [r.id]: '' }));\n call.subscribe({\n next: () => { this.busy.set(null); this.pending.reload(); this.recent.reload(); this.approvalCount.refresh(); },\n error: e => {\n this.busy.set(null);\n const status = (e as { status?: number }).status;\n const text = status === 403 && r.policy === 'SecondPerson' ? `An admin other than ${r.requestedBy} has to approve this.`\n : status === 403 ? 'Deciding needs the admin role.' : problemText(e);\n this.errors.update(x => ({ ...x, [r.id]: text }));\n },\n });\n }\n\n protected approve(r: ActionRequest) { this.decide(r, this.api.approveRequest(r.id, (this.comments()[r.id] ?? '').trim())); }\n\n protected reject(r: ActionRequest) {\n const comment = (this.comments()[r.id] ?? '').trim();\n if (!comment) { this.errors.update(e => ({ ...e, [r.id]: 'Say why in the comment.' })); return; }\n this.decide(r, this.api.rejectRequest(r.id, comment));\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAwEA,IAAa,gBAAb,MAAa,cAAa;CACL,MAAM,OAAO,cAAc;CAC7B,MAAM,OAAO,UAAU;CACvB,gBAAgB,OAAO,aAAa;CAClC,OAAO,OAAsB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAClC,WAAW,OAA+B,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAC7C,SAAS,OAA+B,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAE3C,UAAU,YAAY,EAAE,cAAc,KAAK,IAAI,eAAe,EAAE,OAAO,UAAS,CAAE,EAAC,CAAE;CACvF,SAAS,YAAY,EAAE,cAAc,KAAK,IAAI,eAAe,EAAE,OAAO,GAAE,CAAE,EAAC,CAAE;CAC3E,UAAU,gBAAgB,KAAK,OAAO,MAAK,CAAE,EAAE,SAAS,CAAA,EAAA,CAAI,QAAO,MAAK,EAAE,UAAU,SAAS,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAC/F,QAAQ,eAAe,YAAY,KAAK,QAAQ,MAAK,CAAE,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,QA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A;GACT,iBAAiB,wBAAwB;GACzC,SAAS;IAAC;IAAU;IAAY;IAAU;IAAa;IAAiB;IAAoB;IAAgB;IAAsB;IAAY;GAAO;GACrJ,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6CX,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApiService, ContextService, LinkPipe } from "./juice-js-observability.mjs";
|
|
2
|
-
import { c as ContextBar, h as apiResource, o as problemText } from "./juice-js-observability-telemetry-
|
|
2
|
+
import { c as ContextBar, h as apiResource, o as problemText } from "./juice-js-observability-telemetry-DVwUTHSz.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";
|
|
@@ -397,4 +397,4 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
397
397
|
});
|
|
398
398
|
export { IncidentPage };
|
|
399
399
|
|
|
400
|
-
//# sourceMappingURL=juice-js-observability-incident.page-
|
|
400
|
+
//# sourceMappingURL=juice-js-observability-incident.page-C2ZK3MRh.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"juice-js-observability-incident.page-CayeZdF_.mjs","names":[],"sources":["../../../../projects/juice-js/observability/src/lib/pages/incident.page.ts"],"sourcesContent":["import { LinkPipe } from '../core/options';\nimport { ChangeDetectionStrategy, Component, computed, inject, input, signal } from '@angular/core';\nimport { DatePipe } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\nimport { RouterLink } from '@angular/router';\nimport { Observable } from 'rxjs';\nimport { ApiService } from '../core/api.service';\nimport { ContextService } from '../core/context.service';\nimport { IncidentEvent } from '../core/models';\nimport { apiResource } from '../shared/resource';\nimport { problemText } from '../shared/telemetry';\nimport { ContextBar } from '../shared/ui';\n\nconst MOVES: Record<string, string[]> = {\n Open: ['Investigating', 'Mitigated', 'Resolved'],\n Investigating: ['Mitigated', 'Resolved'],\n Mitigated: ['Investigating', 'Resolved'],\n Resolved: ['Investigating'],\n};\n\n/** One incident: its state and the moves from it, its alerts, and who did what. Resolving it changes no alert, and says so if some are still open. */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [LinkPipe, RouterLink, DatePipe, FormsModule, MatButtonModule, MatFormFieldModule, MatInputModule, MatProgressBarModule, ContextBar],\n template: `\n <jc-context-bar>\n <a [routerLink]=\"['incidents'] | jcLink\" [queryParams]=\"ctx.keep()\" class=\"jc-crumb\">Incidents</a><span class=\"jc-crumb-sep\">›</span>\n <h1>{{ detail.value()?.incident?.title ?? '…' }}</h1>\n </jc-context-bar>\n @if (detail.isLoading()) { <mat-progress-bar mode=\"indeterminate\" /> }\n @if (detail.error()) { <p class=\"jc-error\">{{ error() }}</p> }\n @if (detail.value(); as d) {\n <div class=\"jc-summary\">\n <span class=\"jc-badge\" [class.jc-health-unhealthy]=\"d.incident.severity === 'Critical'\" [class.jc-health-degraded]=\"d.incident.severity === 'Warning'\">{{ d.incident.severity }}</span>\n <strong data-testid=\"incident-state\">{{ d.incident.state }}</strong>\n <span class=\"jc-muted\">Opened by {{ d.incident.createdBy }} {{ d.incident.createdAt | date: 'MMM d, HH:mm' }}</span>\n </div>\n @if (d.incident.state !== 'Resolved' && d.openAlerts > 0) {\n <p class=\"jc-notice\" data-testid=\"incident-open-alerts\">{{ d.openAlerts }} of its alerts {{ d.openAlerts === 1 ? 'is' : 'are' }} still open. Resolving the incident won't change them.</p>\n }\n <section class=\"jc-card\">\n <h2>Move or note</h2>\n <form class=\"jc-form\" (ngSubmit)=\"note()\">\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-wide\"><mat-label>Comment or note</mat-label><input matInput name=\"text\" data-testid=\"incident-text\" [(ngModel)]=\"text\" maxlength=\"2000\"></mat-form-field>\n <button mat-stroked-button type=\"submit\" data-testid=\"incident-note\" [disabled]=\"sending()\">Add note</button>\n @for (m of moves(d.incident.state); track m) {\n <button mat-flat-button type=\"button\" [attr.data-testid]=\"'incident-move-' + m\" [disabled]=\"sending()\" (click)=\"move(m)\">{{ d.incident.state === 'Resolved' ? 'Reopen' : m }}</button>\n }\n @if (actionError()) { <span class=\"jc-error\" data-testid=\"incident-action-error\">{{ actionError() }}</span> }\n </form>\n </section>\n <section class=\"jc-card\" data-testid=\"incident-alerts\">\n <h2>Alerts</h2>\n <table class=\"jc-table\"><tbody>\n @for (a of d.alerts; track a.id) {\n <tr>\n <td><a [routerLink]=\"['alerts', a.id] | jcLink\" [queryParams]=\"ctx.keep()\">{{ a.rule }}</a></td>\n <td>{{ a.subjectKey }}</td><td>{{ a.severity }}</td><td>{{ a.state }}</td>\n <td class=\"jc-row-actions\"><button mat-button type=\"button\" (click)=\"removeAlert(a.id)\">Remove</button></td>\n </tr>\n } @empty { <tr><td class=\"jc-muted\">None. Open an alert and use “Open an incident”, or add one through the API.</td></tr> }\n </tbody></table>\n </section>\n <section class=\"jc-card\" data-testid=\"incident-events\">\n <h2>What happened</h2>\n <table class=\"jc-table\"><tbody>\n @for (e of d.events; track $index) {\n <tr>\n <td class=\"jc-nowrap\">{{ e.at | date: 'MMM d, HH:mm:ss' }}</td>\n <td>{{ e.actor }}</td>\n <td><strong>{{ describe(e) }}</strong>@if (e.text) { <div>{{ e.text }}</div> }</td>\n </tr>\n }\n </tbody></table>\n </section>\n }`,\n})\nexport class IncidentPage {\n protected readonly ctx = inject(ContextService);\n private readonly api = inject(ApiService);\n readonly id = input.required<string>();\n protected text = '';\n protected readonly sending = signal(false);\n protected readonly actionError = signal('');\n\n protected readonly detail = apiResource({ params: () => this.id(), stream: ({ params }) => this.api.incident(params) });\n protected readonly error = computed(() => problemText(this.detail.error()));\n\n protected moves(state: string): string[] { return MOVES[state] ?? []; }\n\n protected describe(e: IncidentEvent): string {\n switch (e.type) {\n case 'created': return 'Opened';\n case 'state': return `${e.from} → ${e.to}`;\n case 'note': return 'Note';\n case 'alert_added': return 'Alert added';\n case 'alert_removed': return 'Alert removed';\n default: return e.type;\n }\n }\n\n private run<T>(request: Observable<T>) {\n this.sending.set(true);\n this.actionError.set('');\n request.subscribe({\n next: () => { this.sending.set(false); this.text = ''; this.detail.reload(); },\n error: e => { this.sending.set(false); this.actionError.set((e as { status?: number }).status === 403 ? 'This needs the operator or admin role.' : problemText(e)); },\n });\n }\n\n protected move(to: string) { this.run(this.api.moveIncident(this.id(), to, this.text)); }\n protected note() { this.run(this.api.addIncidentNote(this.id(), this.text)); }\n protected removeAlert(alertId: string) { this.run(this.api.removeIncidentAlert(this.id(), alertId)); }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAiBA,MAAM,QAAkC;CACtC,MAAM;EAAC;EAAiB;EAAa;CAAU;CAC/C,eAAe,CAAC,aAAa,UAAU;CACvC,WAAW,CAAC,iBAAiB,UAAU;CACvC,UAAU,CAAC,eAAe;AAC3B;AA2DD,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;CAC5B,OAAO;CACE,UAAU,OAAO,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CACvB,cAAc,OAAO,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CAExB,SAAS,YAAY;EAAE,cAAc,KAAK,GAAE;EAAI,SAAS,EAAE,aAAa,KAAK,IAAI,SAAS,MAAM;CAAC,CAAE;CACnG,QAAQ,eAAe,YAAY,KAAK,OAAO,MAAK,CAAE,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA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,UAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;GAAc;GAAA;IAAA,MAAA;IAAA,MAAA,GAAA;IAAA,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;IAAA;IAAA,UAAA,CAAA,UAAA;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,MAAlI;IAAQ,MAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAc;IAAQ,MAAA;GAAA;EAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAsD7B,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAY,YAAA,CAAA;EAxDxB,MAAA;EAAU,MAAA,CAAA;GACT,iBAAiB,wBAAwB;GACzC,SAAS;IAAC;IAAU;IAAY;IAAU;IAAa;IAAiB;IAAoB;IAAgB;IAAsB;GAAU;GAC5I,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoDX,CAAA"}
|
|
1
|
+
{"version":3,"file":"juice-js-observability-incident.page-C2ZK3MRh.mjs","names":[],"sources":["../../../../projects/juice-js/observability/src/lib/pages/incident.page.ts"],"sourcesContent":["import { LinkPipe } from '../core/options';\nimport { ChangeDetectionStrategy, Component, computed, inject, input, signal } from '@angular/core';\nimport { DatePipe } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\nimport { RouterLink } from '@angular/router';\nimport { Observable } from 'rxjs';\nimport { ApiService } from '../core/api.service';\nimport { ContextService } from '../core/context.service';\nimport { IncidentEvent } from '../core/models';\nimport { apiResource } from '../shared/resource';\nimport { problemText } from '../shared/telemetry';\nimport { ContextBar } from '../shared/ui';\n\nconst MOVES: Record<string, string[]> = {\n Open: ['Investigating', 'Mitigated', 'Resolved'],\n Investigating: ['Mitigated', 'Resolved'],\n Mitigated: ['Investigating', 'Resolved'],\n Resolved: ['Investigating'],\n};\n\n/** One incident: its state and the moves from it, its alerts, and who did what. Resolving it changes no alert, and says so if some are still open. */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [LinkPipe, RouterLink, DatePipe, FormsModule, MatButtonModule, MatFormFieldModule, MatInputModule, MatProgressBarModule, ContextBar],\n template: `\n <jc-context-bar>\n <a [routerLink]=\"['incidents'] | jcLink\" [queryParams]=\"ctx.keep()\" class=\"jc-crumb\">Incidents</a><span class=\"jc-crumb-sep\">›</span>\n <h1>{{ detail.value()?.incident?.title ?? '…' }}</h1>\n </jc-context-bar>\n @if (detail.isLoading()) { <mat-progress-bar mode=\"indeterminate\" /> }\n @if (detail.error()) { <p class=\"jc-error\">{{ error() }}</p> }\n @if (detail.value(); as d) {\n <div class=\"jc-summary\">\n <span class=\"jc-badge\" [class.jc-health-unhealthy]=\"d.incident.severity === 'Critical'\" [class.jc-health-degraded]=\"d.incident.severity === 'Warning'\">{{ d.incident.severity }}</span>\n <strong data-testid=\"incident-state\">{{ d.incident.state }}</strong>\n <span class=\"jc-muted\">Opened by {{ d.incident.createdBy }} {{ d.incident.createdAt | date: 'MMM d, HH:mm' }}</span>\n </div>\n @if (d.incident.state !== 'Resolved' && d.openAlerts > 0) {\n <p class=\"jc-notice\" data-testid=\"incident-open-alerts\">{{ d.openAlerts }} of its alerts {{ d.openAlerts === 1 ? 'is' : 'are' }} still open. Resolving the incident won't change them.</p>\n }\n <section class=\"jc-card\">\n <h2>Move or note</h2>\n <form class=\"jc-form\" (ngSubmit)=\"note()\">\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-wide\"><mat-label>Comment or note</mat-label><input matInput name=\"text\" data-testid=\"incident-text\" [(ngModel)]=\"text\" maxlength=\"2000\"></mat-form-field>\n <button mat-stroked-button type=\"submit\" data-testid=\"incident-note\" [disabled]=\"sending()\">Add note</button>\n @for (m of moves(d.incident.state); track m) {\n <button mat-flat-button type=\"button\" [attr.data-testid]=\"'incident-move-' + m\" [disabled]=\"sending()\" (click)=\"move(m)\">{{ d.incident.state === 'Resolved' ? 'Reopen' : m }}</button>\n }\n @if (actionError()) { <span class=\"jc-error\" data-testid=\"incident-action-error\">{{ actionError() }}</span> }\n </form>\n </section>\n <section class=\"jc-card\" data-testid=\"incident-alerts\">\n <h2>Alerts</h2>\n <table class=\"jc-table\"><tbody>\n @for (a of d.alerts; track a.id) {\n <tr>\n <td><a [routerLink]=\"['alerts', a.id] | jcLink\" [queryParams]=\"ctx.keep()\">{{ a.rule }}</a></td>\n <td>{{ a.subjectKey }}</td><td>{{ a.severity }}</td><td>{{ a.state }}</td>\n <td class=\"jc-row-actions\"><button mat-button type=\"button\" (click)=\"removeAlert(a.id)\">Remove</button></td>\n </tr>\n } @empty { <tr><td class=\"jc-muted\">None. Open an alert and use “Open an incident”, or add one through the API.</td></tr> }\n </tbody></table>\n </section>\n <section class=\"jc-card\" data-testid=\"incident-events\">\n <h2>What happened</h2>\n <table class=\"jc-table\"><tbody>\n @for (e of d.events; track $index) {\n <tr>\n <td class=\"jc-nowrap\">{{ e.at | date: 'MMM d, HH:mm:ss' }}</td>\n <td>{{ e.actor }}</td>\n <td><strong>{{ describe(e) }}</strong>@if (e.text) { <div>{{ e.text }}</div> }</td>\n </tr>\n }\n </tbody></table>\n </section>\n }`,\n})\nexport class IncidentPage {\n protected readonly ctx = inject(ContextService);\n private readonly api = inject(ApiService);\n readonly id = input.required<string>();\n protected text = '';\n protected readonly sending = signal(false);\n protected readonly actionError = signal('');\n\n protected readonly detail = apiResource({ params: () => this.id(), stream: ({ params }) => this.api.incident(params) });\n protected readonly error = computed(() => problemText(this.detail.error()));\n\n protected moves(state: string): string[] { return MOVES[state] ?? []; }\n\n protected describe(e: IncidentEvent): string {\n switch (e.type) {\n case 'created': return 'Opened';\n case 'state': return `${e.from} → ${e.to}`;\n case 'note': return 'Note';\n case 'alert_added': return 'Alert added';\n case 'alert_removed': return 'Alert removed';\n default: return e.type;\n }\n }\n\n private run<T>(request: Observable<T>) {\n this.sending.set(true);\n this.actionError.set('');\n request.subscribe({\n next: () => { this.sending.set(false); this.text = ''; this.detail.reload(); },\n error: e => { this.sending.set(false); this.actionError.set((e as { status?: number }).status === 403 ? 'This needs the operator or admin role.' : problemText(e)); },\n });\n }\n\n protected move(to: string) { this.run(this.api.moveIncident(this.id(), to, this.text)); }\n protected note() { this.run(this.api.addIncidentNote(this.id(), this.text)); }\n protected removeAlert(alertId: string) { this.run(this.api.removeIncidentAlert(this.id(), alertId)); }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAiBA,MAAM,QAAkC;CACtC,MAAM;EAAC;EAAiB;EAAa;CAAU;CAC/C,eAAe,CAAC,aAAa,UAAU;CACvC,WAAW,CAAC,iBAAiB,UAAU;CACvC,UAAU,CAAC,eAAe;AAC3B;AA2DD,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;CAC5B,OAAO;CACE,UAAU,OAAO,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CACvB,cAAc,OAAO,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CAExB,SAAS,YAAY;EAAE,cAAc,KAAK,GAAE;EAAI,SAAS,EAA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AAA,GAAA;IAAA,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;IAAA;IAAA,UAAA,CAAA,cAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAA,GAAA;IAAA,UAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;GAAc;GAAA;IAAA,MAAA;IAAA,MAAA,GAAA;IAAA,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;IAAA;IAAA,UAAA,CAAA,UAAA;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,MAAlI;IAAQ,MAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAc;IAAQ,MAAA;GAAA;EAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAsD7B,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAY,YAAA,CAAA;EAxDxB,MAAA;EAAU,MAAA,CAAA;GACT,iBAAiB,wBAAwB;GACzC,SAAS;IAAC;IAAU;IAAY;IAAU;IAAa;IAAiB;IAAoB;IAAgB;IAAsB;GAAU;GAC5I,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoDX,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApiService, ContextService, LinkPipe, OBSERVABILITY_OPTIONS } from "./juice-js-observability.mjs";
|
|
2
|
-
import { c as ContextBar, h as apiResource, o as problemText } from "./juice-js-observability-telemetry-
|
|
2
|
+
import { c as ContextBar, h as apiResource, o as problemText } from "./juice-js-observability-telemetry-DVwUTHSz.mjs";
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
import { ChangeDetectionStrategy, Component, computed, inject, input, signal } from "@angular/core";
|
|
5
5
|
import { Router, RouterLink } from "@angular/router";
|
|
@@ -435,4 +435,4 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
435
435
|
});
|
|
436
436
|
export { IncidentsPage };
|
|
437
437
|
|
|
438
|
-
//# sourceMappingURL=juice-js-observability-incidents.page-
|
|
438
|
+
//# sourceMappingURL=juice-js-observability-incidents.page-DhC3BkBo.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"juice-js-observability-incidents.page-
|
|
1
|
+
{"version":3,"file":"juice-js-observability-incidents.page-DhC3BkBo.mjs","names":[],"sources":["../../../../projects/juice-js/observability/src/lib/pages/incidents.page.ts"],"sourcesContent":["import { LinkPipe } from '../core/options';\nimport { ChangeDetectionStrategy, Component, OnInit, computed, inject, input, signal } from '@angular/core';\nimport { DatePipe } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { MatButtonModule } from '@angular/material/button';\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 { Router, RouterLink } from '@angular/router';\nimport { ApiService } from '../core/api.service';\nimport { ContextService } from '../core/context.service';\nimport { OBSERVABILITY_OPTIONS } from '../core/options';\nimport { apiResource } from '../shared/resource';\nimport { problemText } from '../shared/telemetry';\nimport { ContextBar } from '../shared/ui';\n\n/** Operational work grouped across alerts: what's being handled, by state, and starting a new one, usually from an alert. */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [LinkPipe, RouterLink, DatePipe, FormsModule, MatButtonModule, MatFormFieldModule, MatInputModule, MatProgressBarModule, MatSelectModule, ContextBar],\n template: `\n <jc-context-bar>\n <h1>Incidents</h1>\n <span class=\"jc-spacer\"></span>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>State</mat-label>\n <mat-select [ngModel]=\"state()\" (ngModelChange)=\"state.set($event)\" name=\"state\">\n <mat-option value=\"\">Any</mat-option><mat-option value=\"open\">Open</mat-option><mat-option value=\"investigating\">Investigating</mat-option><mat-option value=\"mitigated\">Mitigated</mat-option><mat-option value=\"resolved\">Resolved</mat-option>\n </mat-select>\n </mat-form-field>\n </jc-context-bar>\n @if (incidents.isLoading()) { <mat-progress-bar mode=\"indeterminate\" /> }\n @if (incidents.error()) { <p class=\"jc-error\">{{ error() }}</p> }\n <section class=\"jc-card\">\n <h2>New incident</h2>\n <form class=\"jc-form\" data-testid=\"incident-form\" (ngSubmit)=\"create()\">\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-wide\"><mat-label>Title</mat-label><input matInput name=\"titleField\" data-testid=\"incident-title\" [(ngModel)]=\"titleField\" maxlength=\"200\"></mat-form-field>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"jc-field-sm\"><mat-label>Severity</mat-label>\n <mat-select name=\"severity\" [(ngModel)]=\"severity\"><mat-option value=\"\">As its worst alert</mat-option><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-wide\"><mat-label>Note</mat-label><input matInput name=\"note\" [(ngModel)]=\"note\" maxlength=\"2000\"></mat-form-field>\n @if (alert()) { <span class=\"jc-muted jc-small\" data-testid=\"incident-with-alert\">With the alert you came from.</span> }\n <div class=\"jc-form-actions\">\n <button mat-flat-button type=\"submit\" data-testid=\"incident-save\" [disabled]=\"saving()\">Open incident</button>\n @if (saveError()) { <span class=\"jc-error\" data-testid=\"incident-error\">{{ saveError() }}</span> }\n </div>\n </form>\n </section>\n <table class=\"jc-table\" data-testid=\"incidents\">\n <thead><tr><th>Incident</th><th>Severity</th><th>State</th><th>Opened</th><th>By</th><th>Last change</th></tr></thead>\n <tbody>\n @for (i of incidents.value()?.items ?? []; track i.id) {\n <tr>\n <td><a [routerLink]=\"['incidents', i.id] | jcLink\" [queryParams]=\"ctx.keep({ alert: null, title: null })\">{{ i.title }}</a></td>\n <td>{{ i.severity }}</td>\n <td>{{ i.state }}</td>\n <td class=\"jc-nowrap\">{{ i.createdAt | date: 'MMM d, HH:mm' }}</td>\n <td>{{ i.createdBy }}</td>\n <td class=\"jc-nowrap\">{{ i.updatedAt | date: 'MMM d, HH:mm' }}</td>\n </tr>\n } @empty { <tr><td colspan=\"6\" class=\"jc-muted\">No incidents.</td></tr> }\n </tbody>\n </table>`,\n})\nexport class IncidentsPage implements OnInit {\n protected readonly ctx = inject(ContextService);\n private readonly api = inject(ApiService);\n private readonly router = inject(Router);\n private readonly base = inject(OBSERVABILITY_OPTIONS).basePath;\n /** From an alert's \"Open an incident\". */\n readonly alert = input<string>();\n readonly title = input<string>();\n protected readonly state = signal('');\n protected readonly saving = signal(false);\n protected readonly saveError = signal('');\n protected titleField = '';\n protected severity = '';\n protected note = '';\n\n protected readonly incidents = apiResource({ params: () => this.state(), stream: ({ params }) => this.api.incidents({ state: params }) });\n protected readonly error = computed(() => problemText(this.incidents.error()));\n\n ngOnInit() { this.titleField = this.title() ?? ''; }\n\n protected create() {\n this.saving.set(true);\n this.saveError.set('');\n const alert = this.alert();\n this.api.createIncident({ title: this.titleField, severity: this.severity || undefined, note: this.note, alertIds: alert ? [alert] : [] }).subscribe({\n next: incident => {\n this.saving.set(false);\n const base = (this.base ?? '/').replace(/\\/$/, '');\n void this.router.navigate([`${base}/incidents/${incident.id}`], { queryParams: this.ctx.keep({ alert: null, title: null }) });\n },\n error: e => { this.saving.set(false); this.saveError.set((e as { status?: number }).status === 403 ? 'Opening an incident needs the operator or admin role.' : problemText(e)); },\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgEA,IAAa,gBAAb,MAAa,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AAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;IAAA;IAAA,SAAA;KAAA;KAAA;KAAA;KAAA;KAAA;IAAA;IAAA,UAAA,CAAA,WAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAA,GAAA;IAAA,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;IAAA;IAAA,SAAA,CAAA,mBAAA;IAAA,UAAA,CAAA,WAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAU,UAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAnJ;IAAQ,MAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAc;IAAQ,MAAA;GAAA;EAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AA4C7B,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAa,YAAA,CAAA;EA9CzB,MAAA;EAAU,MAAA,CAAA;GACT,iBAAiB,wBAAwB;GACzC,SAAS;IAAC;IAAU;IAAY;IAAU;IAAa;IAAiB;IAAoB;IAAgB;IAAsB;IAAiB;GAAU;GAC7J,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0CX,CAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ApiService, ContextService, LinkPipe } from "./juice-js-observability.mjs";
|
|
2
|
-
import { c as ContextBar, h as apiResource, o as problemText } from "./juice-js-observability-telemetry-
|
|
2
|
+
import { c as ContextBar, h as apiResource, o as problemText } from "./juice-js-observability-telemetry-DVwUTHSz.mjs";
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
import { ChangeDetectionStrategy, Component, computed, inject, input } from "@angular/core";
|
|
5
|
-
import { forkJoin, of } from "rxjs";
|
|
6
5
|
import { Router, RouterLink } from "@angular/router";
|
|
6
|
+
import { forkJoin, of } from "rxjs";
|
|
7
7
|
import * as i1 from "@angular/material/progress-bar";
|
|
8
8
|
import { MatProgressBarModule } from "@angular/material/progress-bar";
|
|
9
9
|
const MAX_COMPARED = 4;
|
|
@@ -346,4 +346,4 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
346
346
|
});
|
|
347
347
|
export { LoadRunsPage };
|
|
348
348
|
|
|
349
|
-
//# sourceMappingURL=juice-js-observability-load-runs.page-
|
|
349
|
+
//# sourceMappingURL=juice-js-observability-load-runs.page-DVuO4zFp.mjs.map
|