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
|
@ -663,15 +663,18 @@ Ext.define('PBS.Utils', {
|
||||||
|
|
||||||
let [type, message] = PBS.Utils.parseMaintenanceMode(mode);
|
let [type, message] = PBS.Utils.parseMaintenanceMode(mode);
|
||||||
|
|
||||||
|
let extra = '';
|
||||||
|
|
||||||
|
if (activeTasks !== undefined) {
|
||||||
const conflictingTasks = activeTasks.write + (type === 'offline' ? activeTasks.read : 0);
|
const conflictingTasks = activeTasks.write + (type === 'offline' ? activeTasks.read : 0);
|
||||||
|
|
||||||
let extra = '';
|
|
||||||
if (conflictingTasks > 0) {
|
if (conflictingTasks > 0) {
|
||||||
extra += '| <i class="fa fa-spinner fa-pulse fa-fw"></i> ';
|
extra += '| <i class="fa fa-spinner fa-pulse fa-fw"></i> ';
|
||||||
extra += Ext.String.format(gettext('{0} conflicting tasks still active.'), conflictingTasks);
|
extra += Ext.String.format(gettext('{0} conflicting tasks still active.'), conflictingTasks);
|
||||||
} else {
|
} else {
|
||||||
extra += '<i class="fa fa-check"></i>';
|
extra += '<i class="fa fa-check"></i>';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (message) {
|
if (message) {
|
||||||
extra += ` ("${message}")`;
|
extra += ` ("${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