Merge branch 'bugfix/task-scheduling' into 'dev'

Add command to default actions

See merge request crafty-controller/crafty-4!586
This commit is contained in:
Iain Powrie 2023-05-23 00:20:23 +00:00
commit dfef879ef4
2 changed files with 8 additions and 4 deletions

View File

@ -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
<br><br>

View File

@ -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 = '';
}