This repository was archived by the owner on Jul 26, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -129,6 +129,13 @@ class="h-10 bg-blue-500 text-white rounded-md px-4 py-2 m-2 hover:bg-blue-600 fo
129
129
<input placeholder="Count" type="number" name="count"
130
130
id="Count-input"
131
131
class="my-2 p-2 dark:bg-gray-900 bg-gray-100 flex border dark:border-gray-900 border-gray-100 rounded px-2 appearance-none outline-none w-full dark:text-white text-gray-900 focus:ring-2 focus:ring-blue-600">
132
+
133
+ <label class="inline-flex items-center mt-3">
134
+ <input type="checkbox" name="start" class="form-checkbox h-5 w-5"
135
+ checked><span
136
+ class="ml-2 dark:text-white text-gray-900">Start on create</span>
137
+ </label>
138
+
132
139
</div>
133
140
</div>
134
141
<button type="submit"
Original file line number Diff line number Diff line change 104
104
105
105
if (isset ($ _POST ['action ' ])) {
106
106
if (!main::validCSRF ()) {
107
- header ('Location: ' . main::getUrl () . "/tasks?action&success=false&message=csrfFailed " );
107
+ header ('Location: ' . main::getUrl () . "/tasks/ " . $ task_name . " ?action&success=false&message=csrfFailed " );
108
108
die ();
109
109
}
110
110
// FUNCTIONS
111
111
112
112
if ($ _POST ['action ' ] == "stopService " AND isset ($ _POST ['service_id ' ])){
113
113
$ response = $ main ::buildDefaultRequest ("service/ " .$ _POST ['service_id ' ], "DELETE " );
114
- header ('Location: ' . main::getUrl () . "/tasks?action&success=true&message=stopService " );
114
+ header ('Location: ' . main::getUrl () . "/tasks/ " . $ task_name . " ?action&success=true&message=stopService " );
115
115
}
116
116
if ($ _POST ['action ' ] == "startService " AND isset ($ _POST ['count ' ])){
117
117
$ i = $ _POST ['count ' ];
118
118
while ($ i != 0 ) {
119
119
$ i -= 1 ;
120
- $ response = $ main ::buildDefaultRequest ("service/create " , params: $ task_name );
121
- print_r ($ response );
120
+ $ response = $ main ::buildDefaultRequest ("service/create " , params: json_encode (array ("start " => isset ($ _POST ['start ' ]), "serviceTaskName " => $ task_name )));
122
121
}
122
+ header ('Location: ' . main::getUrl () . "/tasks/ " .$ task_name ."?action&success=true&message=startService " );
123
123
}
124
124
}
125
125
137
137
138
138
$ ticket = main::buildDefaultRequest ("wsTicket " );
139
139
if (!$ ticket ['success ' ]) {
140
- header ('Location: ' . main::getUrl () . "/tasks?action&success=false&message=notFound " );
140
+ header ('Location: ' . main::getUrl () . "/tasks/ " . $ task_name . " ?action&success=false&message=notFound " );
141
141
die ();
142
142
}
143
143
You can’t perform that action at this time.
0 commit comments