Dependency map, impact preview in maintenance, and a calmer Alerts page
- Map: a Dependencies view showing what would go down with a picked box and what it relies on - Maintenance: lists what depends on a target and can silence those too (same time, audited); the recurring form and update drawer show the same note - Alerts: a headline on where things stand, held-back alerts nested under their cause, severity edge on rows; caused-by now carries the explaining alert's id Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ec9c2f73f0
commit
9caa414829
19 files changed
+944
-40
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import ImpactNote from "../components/ImpactNote";
|
||||
import {
|
||||
api,
|
||||
type CurrentUser,
|
||||
@@ -46,6 +47,8 @@ export default function Maintenance({ user }: { user: CurrentUser }) {
|
||||
const [aliasBusy, setAliasBusy] = useState(false);
|
||||
const [aliasError, setAliasError] = useState<string | null>(null);
|
||||
const [targets, setTargets] = useState<MaintenanceTargets | null>(null);
|
||||
// Whether what depends on the chosen target is silenced along with it (offered once the target is known to have dependents).
|
||||
const [withDependents, setWithDependents] = useState(true);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const [now, setNow] = useState(() => Date.now());
|
||||
|
||||
@@ -144,15 +147,17 @@ export default function Maintenance({ user }: { user: CurrentUser }) {
|
||||
setError(null);
|
||||
setBusy(true);
|
||||
try {
|
||||
await api.maintenance.start({
|
||||
const res = await api.maintenance.start({
|
||||
targetType: targetType as MaintenanceTargetType,
|
||||
targetId: Number(id),
|
||||
minutes,
|
||||
reason: reason.trim() || undefined,
|
||||
withDependents: withDependents || undefined,
|
||||
});
|
||||
setTarget("");
|
||||
setReason("");
|
||||
toast.success("Maintenance started. Alerts for it are silenced until it ends.");
|
||||
const also = res.alsoSilenced?.length ?? 0;
|
||||
toast.success(also > 0 ? `Maintenance started, and on ${also} thing${also === 1 ? "" : "s"} that depend on it. Alerts for them are silenced until it ends.` : "Maintenance started. Alerts for it are silenced until it ends.");
|
||||
load();
|
||||
announceChange();
|
||||
} catch (err) {
|
||||
@@ -316,6 +321,11 @@ export default function Maintenance({ user }: { user: CurrentUser }) {
|
||||
onChange={(e) => setReason(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
{(target.startsWith("server:") || target.startsWith("integration:")) && (
|
||||
<div className="col-12">
|
||||
<ImpactNote targets={[{ type: target.split(":")[0], id: Number(target.split(":")[1]) }]} silence={{ value: withDependents, onChange: setWithDependents }} />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div className="card-footer">
|
||||
<button type="submit" className="btn btn-primary" disabled={busy || !target}>
|
||||
|
||||
Reference in new issue
Block a user