ui: tape/BackupJobs.js - render task scheduling status
This commit is contained in:
50
www/Utils.js
50
www/Utils.js
@ -188,6 +188,56 @@ Ext.define('PBS.Utils', {
|
||||
return fingerprint.substring(0, 23);
|
||||
},
|
||||
|
||||
render_task_status: function(value, metadata, record) {
|
||||
if (!record.data['last-run-upid']) {
|
||||
return '-';
|
||||
}
|
||||
|
||||
if (!record.data['last-run-endtime']) {
|
||||
metadata.tdCls = 'x-grid-row-loading';
|
||||
return '';
|
||||
}
|
||||
|
||||
let parsed = Proxmox.Utils.parse_task_status(value);
|
||||
let text = value;
|
||||
let icon = '';
|
||||
switch (parsed) {
|
||||
case 'unknown':
|
||||
icon = 'question faded';
|
||||
text = Proxmox.Utils.unknownText;
|
||||
break;
|
||||
case 'error':
|
||||
icon = 'times critical';
|
||||
text = Proxmox.Utils.errorText + ': ' + value;
|
||||
break;
|
||||
case 'warning':
|
||||
icon = 'exclamation warning';
|
||||
break;
|
||||
case 'ok':
|
||||
icon = 'check good';
|
||||
text = gettext("OK");
|
||||
}
|
||||
|
||||
return `<i class="fa fa-${icon}"></i> ${text}`;
|
||||
},
|
||||
|
||||
render_next_task_run: function(value, metadat, record) {
|
||||
if (!value) return '-';
|
||||
|
||||
let now = new Date();
|
||||
let next = new Date(value*1000);
|
||||
|
||||
if (next < now) {
|
||||
return gettext('pending');
|
||||
}
|
||||
return Proxmox.Utils.render_timestamp(value);
|
||||
},
|
||||
|
||||
render_optional_timestamp: function(value, metadata, record) {
|
||||
if (!value) return '-';
|
||||
return Proxmox.Utils.render_timestamp(value);
|
||||
},
|
||||
|
||||
parse_datastore_worker_id: function(type, id) {
|
||||
let result;
|
||||
let res;
|
||||
|
Reference in New Issue
Block a user