allowBlank: false,
listeners: {
change: function(f, value) {
+ let storage = f.getStore().findRecord('storage', value);
+ if (storage) {
+ let isPbs = storage.data.type === 'pbs';
+ me.getColumns().forEach((column) => {
+ if (column.dataIndex === 'verification') {
+ column.setHidden(!isPbs);
+ }
+ });
+ }
setStorage(value);
}
}
dataIndex: 'vmid',
hidden: true,
},
+ {
+ header: gettext('Comment'),
+ dataIndex: 'comment',
+ width: 100,
+ renderer: Ext.htmlEncode,
+ },
+ {
+ header: gettext('Verify State'),
+ dataIndex: 'verification',
+ renderer: function(v) {
+ let i = (cls, txt) => `<i class="fa fa-fw fa-${cls}"></i> ${txt}`;
+ if (v === undefined || v === null) {
+ return i('question-circle-o warning', gettext('None'));
+ }
+ let tip = ""
+ let txt = gettext('Failed');
+ let iconCls = 'times critical';
+ if (v.state === 'ok') {
+ txt = gettext('OK');
+ iconCls = 'check good';
+ let now = Date.now() / 1000;
+ let task = Proxmox.Utils.parse_task_upid(v.upid);
+ if (now - v.starttime > 30 * 24 * 60 * 60) {
+ tip = `Last verify task over 30 days ago: ${verify_time}`;
+ iconCls = 'check warning';
+ }
+ }
+ return `<span data-qtip="${tip}"> ${i(iconCls, txt)} </span>`;
+ }
+ }
]
});
width: 100,
renderer: Proxmox.Utils.format_size,
dataIndex: 'size'
+ },
+ {
+ header: gettext('Comment'),
+ width: 100,
+ renderer: Ext.htmlEncode,
+ dataIndex: 'comment',
}
],
listeners: {
extend: 'Ext.data.Model',
fields: [
'volid', 'content', 'format', 'size', 'used', 'vmid',
- 'channel', 'id', 'lun',
+ 'channel', 'id', 'lun', 'comment', 'verification',
{
name: 'text',
convert: function(value, record) {