mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2025-01-18 17:15:13 +01:00
Add command to default actions
This commit is contained in:
parent
cbfa40ce8d
commit
ef3f60e180
@ -273,6 +273,9 @@
|
|||||||
if ($("#difficulty").val() == "reaction"){
|
if ($("#difficulty").val() == "reaction"){
|
||||||
formDataObject.interval_type = "reaction";
|
formDataObject.interval_type = "reaction";
|
||||||
}
|
}
|
||||||
|
if ($("action").val() != "command"){
|
||||||
|
formDataObject.command = formDataObject.action + "_server";
|
||||||
|
}
|
||||||
if (formDataObject.cron_string != ""){
|
if (formDataObject.cron_string != ""){
|
||||||
formDataObject.interval_type = '';
|
formDataObject.interval_type = '';
|
||||||
}
|
}
|
||||||
@ -280,8 +283,6 @@
|
|||||||
// Format the plain form data as JSON
|
// Format the plain form data as JSON
|
||||||
let formDataJsonString = JSON.stringify(formDataObject, replacer);
|
let formDataJsonString = JSON.stringify(formDataObject, replacer);
|
||||||
|
|
||||||
console.log(formDataJsonString);
|
|
||||||
|
|
||||||
let res = await fetch(`/api/v2/servers/${serverId}/tasks/`, {
|
let res = await fetch(`/api/v2/servers/${serverId}/tasks/`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
@ -317,6 +318,9 @@
|
|||||||
if ($("#difficulty").val() == "reaction"){
|
if ($("#difficulty").val() == "reaction"){
|
||||||
formDataObject.interval_type = "reaction";
|
formDataObject.interval_type = "reaction";
|
||||||
}
|
}
|
||||||
|
if ($("#action").val() != "command"){
|
||||||
|
formDataObject.command = formDataObject.action + "_server";
|
||||||
|
}
|
||||||
if (formDataObject.cron_string != ""){
|
if (formDataObject.cron_string != ""){
|
||||||
formDataObject.interval_type = '';
|
formDataObject.interval_type = '';
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user