Fix Javascript merge issue and UI worker detail display bug (#8135)
* Fix previous merge issues in Javascript Signed-off-by: Alasdair Macmillan <aimmac23@gmail.com> * Fix issue where worker detail doesn't display without tasks --------- Signed-off-by: Alasdair Macmillan <aimmac23@gmail.com>
This commit is contained in:
committed by
GitHub
parent
b1d63d0943
commit
41d079a316
@@ -7,7 +7,6 @@
|
|||||||
* showConfirm('Delete this?', function() { });
|
* showConfirm('Delete this?', function() { });
|
||||||
*/
|
*/
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
(function () {
|
(function () {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
|||||||
@@ -276,7 +276,7 @@ templ MaintenanceWorkers(data *dash.MaintenanceWorkersData) {
|
|||||||
'</div>' +
|
'</div>' +
|
||||||
'<hr>' +
|
'<hr>' +
|
||||||
'<h6>Current Tasks</h6>' +
|
'<h6>Current Tasks</h6>' +
|
||||||
(data.current_tasks.length === 0 ?
|
(data.current_tasks === null || data.current_tasks.length === 0 ?
|
||||||
'<p class="text-muted">No current tasks</p>' :
|
'<p class="text-muted">No current tasks</p>' :
|
||||||
data.current_tasks.map(task =>
|
data.current_tasks.map(task =>
|
||||||
'<div class="card mb-2">' +
|
'<div class="card mb-2">' +
|
||||||
@@ -311,15 +311,6 @@ templ MaintenanceWorkers(data *dash.MaintenanceWorkersData) {
|
|||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
showConfirm(`Are you sure you want to pause worker ${workerID}?`, function() {
|
|
||||||
const encodedWorkerId = encodeURIComponent(workerID);
|
|
||||||
fetch('/api/maintenance/workers/' + encodedWorkerId + '/pause', {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
}
|
|
||||||
>>>>>>> 5a7c74feac7c0b1dbab24446fbdbeddb8899c538
|
|
||||||
})
|
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user