Add dashboard health restart action (#38)
This commit is contained in:
@@ -35,6 +35,9 @@ export interface DashboardOverview {
|
||||
}>;
|
||||
fetchedAt: string | null;
|
||||
};
|
||||
operations?: {
|
||||
serviceRestarts: DashboardServiceRestart[];
|
||||
};
|
||||
inbox: Array<{
|
||||
id: string;
|
||||
groupKey: string;
|
||||
@@ -62,6 +65,16 @@ export interface DashboardOverview {
|
||||
}>;
|
||||
}
|
||||
|
||||
export interface DashboardServiceRestart {
|
||||
id: string;
|
||||
target: 'stack';
|
||||
requestedAt: string;
|
||||
completedAt: string | null;
|
||||
status: 'running' | 'success' | 'failed';
|
||||
services: string[];
|
||||
error?: string;
|
||||
}
|
||||
|
||||
export interface StatusSnapshot {
|
||||
serviceId: string;
|
||||
agentType: string;
|
||||
@@ -102,6 +115,7 @@ export interface DashboardTask {
|
||||
|
||||
export type DashboardTaskAction = 'pause' | 'resume' | 'cancel';
|
||||
export type DashboardInboxAction = 'run' | 'decline' | 'dismiss';
|
||||
export type DashboardServiceAction = 'restart';
|
||||
export type DashboardTaskScheduleType = 'cron' | 'interval' | 'once';
|
||||
export type DashboardTaskContextMode = 'group' | 'isolated';
|
||||
|
||||
@@ -232,6 +246,21 @@ export async function runInboxAction(
|
||||
});
|
||||
}
|
||||
|
||||
export async function runServiceAction(
|
||||
serviceId: 'stack',
|
||||
action: DashboardServiceAction,
|
||||
options: { requestId?: string } = {},
|
||||
): Promise<{
|
||||
ok: true;
|
||||
duplicate?: boolean;
|
||||
restart: DashboardServiceRestart;
|
||||
}> {
|
||||
return postJson(`/api/services/${encodeURIComponent(serviceId)}/actions`, {
|
||||
action,
|
||||
requestId: options.requestId,
|
||||
});
|
||||
}
|
||||
|
||||
export async function sendRoomMessage(
|
||||
roomJid: string,
|
||||
text: string,
|
||||
|
||||
Reference in New Issue
Block a user