Add one-click export of biz-state collect commands.

Plan enabled monitoring items into concrete CLIs (with aux) and download as txt from the task detail modal.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-09-22 11:18:58 +08:00
parent 1fcd613bc6
commit 32deca1687
7 changed files with 446 additions and 1 deletions

View file

@ -14,6 +14,7 @@ import {
bizStateDeleteTask,
bizStateDiscover,
bizStateDownloadExport,
bizStateDownloadTaskCommands,
bizStateGetBatch,
bizStateGetBatchCommand,
bizStateGetTask,
@ -747,6 +748,19 @@ export function BizStatePage() {
await collectNowForTask(taskId, true);
};
const exportTaskCommands = async () => {
if (!taskId) return;
setBusy(true);
try {
await bizStateDownloadTaskCommands(taskId);
showOk(t("bizState.exportCommandsOk"));
} catch (e) {
showError(formatErr(e));
} finally {
setBusy(false);
}
};
const removeTask = async (id: string) => {
if (!window.confirm(t("bizState.confirmDelete"))) return;
setBusy(true);
@ -1666,6 +1680,14 @@ export function BizStatePage() {
>
{t("bizState.collectNow")}
</Button>
<Button
size="sm"
variant="secondary"
isDisabled={busy || !taskId}
onPress={() => void exportTaskCommands()}
>
{t("bizState.exportCommands")}
</Button>
<Button size="sm" variant="danger" isDisabled={busy} onPress={() => void removeTask(taskId)}>
{t("bizState.delete")}
</Button>