mirror of
https://github.com/hansjone/netx.git
synced 2026-10-12 14:10:49 +08:00
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:
parent
1fcd613bc6
commit
32deca1687
7 changed files with 446 additions and 1 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue