ui: form/DataStoreSelector: show maintenance mode in selector
to not having to query the activeTasks everywhere, change the renderer to omit the check/spinner when no activeTasks are given Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
8af1fa5477
commit
c15b058db7
17
www/Utils.js
17
www/Utils.js
|
@ -663,14 +663,17 @@ Ext.define('PBS.Utils', {
|
||||||
|
|
||||||
let [type, message] = PBS.Utils.parseMaintenanceMode(mode);
|
let [type, message] = PBS.Utils.parseMaintenanceMode(mode);
|
||||||
|
|
||||||
const conflictingTasks = activeTasks.write + (type === 'offline' ? activeTasks.read : 0);
|
|
||||||
|
|
||||||
let extra = '';
|
let extra = '';
|
||||||
if (conflictingTasks > 0) {
|
|
||||||
extra += '| <i class="fa fa-spinner fa-pulse fa-fw"></i> ';
|
if (activeTasks !== undefined) {
|
||||||
extra += Ext.String.format(gettext('{0} conflicting tasks still active.'), conflictingTasks);
|
const conflictingTasks = activeTasks.write + (type === 'offline' ? activeTasks.read : 0);
|
||||||
} else {
|
|
||||||
extra += '<i class="fa fa-check"></i>';
|
if (conflictingTasks > 0) {
|
||||||
|
extra += '| <i class="fa fa-spinner fa-pulse fa-fw"></i> ';
|
||||||
|
extra += Ext.String.format(gettext('{0} conflicting tasks still active.'), conflictingTasks);
|
||||||
|
} else {
|
||||||
|
extra += '<i class="fa fa-check"></i>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (message) {
|
if (message) {
|
||||||
|
|
|
@ -29,6 +29,15 @@ Ext.define('PBS.form.DataStoreSelector', {
|
||||||
renderer: Ext.String.htmlEncode,
|
renderer: Ext.String.htmlEncode,
|
||||||
flex: 1,
|
flex: 1,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
header: gettext('Maintenance'),
|
||||||
|
sortable: true,
|
||||||
|
dataIndex: 'maintenance',
|
||||||
|
renderer: (value) => {
|
||||||
|
return PBS.Utils.renderMaintenance(value);
|
||||||
|
},
|
||||||
|
flex: 1,
|
||||||
|
}
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue