From aa5861587da2f71e761ec33591febfd712b231be Mon Sep 17 00:00:00 2001 From: sadnub Date: Sun, 27 Mar 2022 07:50:30 -0400 Subject: [PATCH] rework task create/modify/delete/running and fix checks tests --- src/api/tasks.js | 6 +++--- src/components/agents/AutomatedTasksTab.vue | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/api/tasks.js b/src/api/tasks.js index 5d72999..28480a1 100644 --- a/src/api/tasks.js +++ b/src/api/tasks.js @@ -26,7 +26,7 @@ export async function removeTask(id) { return data } -export async function runTask(id) { - const { data } = await axios.post(`${baseUrl}/${id}/run/`) +export async function runTask(id, payload) { + const { data } = await axios.post(`${baseUrl}/${id}/run/`, payload) return data -} \ No newline at end of file +} diff --git a/src/components/agents/AutomatedTasksTab.vue b/src/components/agents/AutomatedTasksTab.vue index 95f9a8b..a178799 100644 --- a/src/components/agents/AutomatedTasksTab.vue +++ b/src/components/agents/AutomatedTasksTab.vue @@ -188,7 +188,7 @@ - + Passing @@ -230,7 +230,7 @@ > Awaiting output - {{ formatDate(props.row.task_result.last_run) }} + {{ formatDate(props.row.task_result.last_run) }} Has not run yet {{ props.row.schedule }} @@ -378,7 +378,7 @@ export default { loading.value = true; try { - const result = await runTask(task.id); + const result = await runTask(task.id, task.policy ? { agent_id: selectedAgent.value } : {}); notifySuccess(result); } catch (e) { console.error(e);