feat(webui): add automation management view
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import type {
|
||||
AutomationsPayload,
|
||||
ChatSummary,
|
||||
CliAppsPayload,
|
||||
FilePreviewPayload,
|
||||
@@ -184,6 +185,34 @@ export async function fetchSessionAutomations(
|
||||
);
|
||||
}
|
||||
|
||||
export async function fetchAutomations(
|
||||
token: string,
|
||||
base: string = "",
|
||||
): Promise<AutomationsPayload> {
|
||||
return request<AutomationsPayload>(
|
||||
`${base}/api/webui/automations`,
|
||||
token,
|
||||
undefined,
|
||||
API_READ_TIMEOUT_MS,
|
||||
);
|
||||
}
|
||||
|
||||
export async function runAutomationAction(
|
||||
token: string,
|
||||
action: "enable" | "disable" | "delete" | "run",
|
||||
id: string,
|
||||
base: string = "",
|
||||
): Promise<AutomationsPayload> {
|
||||
const query = new URLSearchParams();
|
||||
query.set("id", id);
|
||||
return request<AutomationsPayload>(
|
||||
`${base}/api/webui/automations/${action}?${query}`,
|
||||
token,
|
||||
undefined,
|
||||
API_READ_TIMEOUT_MS,
|
||||
);
|
||||
}
|
||||
|
||||
export async function fetchSkills(
|
||||
token: string,
|
||||
base: string = "",
|
||||
|
||||
Reference in New Issue
Block a user