feat(studio): clear-audit-log button on Audit page (v0.15.0)

Operators can now clear dev-noise from the audit log without
dropping to the CLI. Top-bar broom icon next to the filter
chips opens a two-field dialog (reviewer pre-filled from $USER,
reason required). On submit the hub call returns the purged
count + active channel; both are shown back in a snackbar.

Compliance-locked channels (beta/production) are refused
server-side; the dialog surfaces the rejection reason via a
friendly error message instead of the raw gRPC status string.

Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
flemming-it 2026-05-07 17:10:02 +02:00
parent 6e3c6df200
commit b32b4b5bda
5 changed files with 186 additions and 3 deletions

View file

@ -270,6 +270,23 @@ class HubService {
);
}
/// Wipe the audit log on the active channel and seed a fresh
/// `chain.reset` marker. Refused server-side on `beta` /
/// `production`; the gRPC error surfaces as an exception so
/// the caller can show the operator why it was blocked.
/// Returns `(purged, channel)` so the UI can confirm what
/// just happened.
Future<({int purged, String channel})> clearEventLog({
required String reviewer,
required String reason,
}) async {
final r = await _client.clearEventLog(
reviewer: reviewer,
reason: reason,
);
return (purged: r.purged.toInt(), channel: r.channel);
}
/// Active channel + per-channel daemon status snapshot.
Future<ChannelStatusSnapshot> channelStatus() async {
final r = await _client.channelStatus();