Browse Source

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>
pull/8142/head
Alasdair Macmillan 2 days ago
committed by GitHub
parent
commit
41d079a316
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      weed/admin/static/js/modal-alerts.js
  2. 11
      weed/admin/view/app/maintenance_workers.templ
  3. 2
      weed/admin/view/app/maintenance_workers_templ.go

1
weed/admin/static/js/modal-alerts.js

@ -7,7 +7,6 @@
* showConfirm('Delete this?', function() { }); * showConfirm('Delete this?', function() { });
*/ */
<<<<<<< HEAD
(function () { (function () {
'use strict'; 'use strict';

11
weed/admin/view/app/maintenance_workers.templ

@ -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) {

2
weed/admin/view/app/maintenance_workers_templ.go
File diff suppressed because it is too large
View File

Loading…
Cancel
Save