From ef3f60e180100a52779c7749151cab1e723e5914 Mon Sep 17 00:00:00 2001 From: Andrew Date: Sun, 21 May 2023 20:06:01 -0400 Subject: [PATCH 1/2] Add command to default actions --- app/frontend/templates/panel/server_schedule_edit.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/frontend/templates/panel/server_schedule_edit.html b/app/frontend/templates/panel/server_schedule_edit.html index 94e2d948..c85c4c35 100644 --- a/app/frontend/templates/panel/server_schedule_edit.html +++ b/app/frontend/templates/panel/server_schedule_edit.html @@ -273,6 +273,9 @@ if ($("#difficulty").val() == "reaction"){ formDataObject.interval_type = "reaction"; } + if ($("action").val() != "command"){ + formDataObject.command = formDataObject.action + "_server"; + } if (formDataObject.cron_string != ""){ formDataObject.interval_type = ''; } @@ -280,8 +283,6 @@ // Format the plain form data as JSON let formDataJsonString = JSON.stringify(formDataObject, replacer); - console.log(formDataJsonString); - let res = await fetch(`/api/v2/servers/${serverId}/tasks/`, { method: 'POST', headers: { @@ -317,6 +318,9 @@ if ($("#difficulty").val() == "reaction"){ formDataObject.interval_type = "reaction"; } + if ($("#action").val() != "command"){ + formDataObject.command = formDataObject.action + "_server"; + } if (formDataObject.cron_string != ""){ formDataObject.interval_type = ''; } From e013dcc97e7193d0db1933ce4ce5c0f3315c39f0 Mon Sep 17 00:00:00 2001 From: Zedifus Date: Tue, 23 May 2023 01:16:53 +0100 Subject: [PATCH 2/2] Update changelog !586 --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aafad1de..8d2540c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,9 +3,9 @@ ### New features TBD ### Bug fixes -TBD +- Fix task scheduling where a command was not sent to the DB ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/586)) ### Tweaks -- Improve the UI on several areas of the Crafty Panel ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/547)) +- Improve the UI on several areas of the Crafty Panel ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/547)) ### Lang TBD