modal: true,
+ layout: {
+ type: 'vbox',
+ align: 'stretch',
+ },
+ width: 800,
+ height: 500,
+ minWidth: 400,
+ minHeight: 300,
+ bodyPadding: 5,
+ title: gettext('S.M.A.R.T. Values'),
+
items: [
{
xtype: 'gridpanel',
itemId: 'smarts',
reserveScrollbar: true,
columns: [
- { text: 'ID', dataIndex: 'id', width: 50 },
- { text: gettext('Attribute'), flex: 1, dataIndex: 'name', renderer: Ext.String.htmlEncode },
- { text: gettext('Value'), dataIndex: 'raw', renderer: Ext.String.htmlEncode },
- { text: gettext('Normalized'), dataIndex: 'value', width: 60 },
- { text: gettext('Threshold'), dataIndex: 'threshold', width: 60 },
- { text: gettext('Worst'), dataIndex: 'worst', width: 60 },
- { text: gettext('Flags'), dataIndex: 'flags' },
- { text: gettext('Failing'), dataIndex: 'fail', renderer: Ext.String.htmlEncode },
+ {
+ text: 'ID',
+ dataIndex: 'id',
+ width: 50,
+ },
+ {
+ text: gettext('Attribute'),
+ dataIndex: 'name',
+ flex: 1,
+ renderer: Ext.String.htmlEncode,
+ },
+ {
+ text: gettext('Value'),
+ dataIndex: 'raw',
+ renderer: Ext.String.htmlEncode,
+ },
+ {
+ text: gettext('Normalized'),
+ dataIndex: 'value',
+ width: 60,
+ },
+ {
+ text: gettext('Threshold'),
+ dataIndex: 'threshold',
+ width: 60,
+ },
+ {
+ text: gettext('Worst'),
+ dataIndex: 'worst',
+ width: 60,
+ },
+ {
+ text: gettext('Flags'),
+ dataIndex: 'flags',
+ },
+ {
+ text: gettext('Failing'),
+ dataIndex: 'fail',
+ renderer: Ext.String.htmlEncode,
+ },
],
},
{
},
],
- layout: {
- type: 'vbox',
- align: 'stretch',
- },
- width: 800,
- height: 500,
- minWidth: 600,
- minHeight: 400,
- bodyPadding: 5,
- title: gettext('S.M.A.R.T. Values'),
-
initComponent: function() {
var me = this;
});
me.callParent();
- var grid = me.down('#smarts');
- var text = me.down('#text');
+
+ let grid = me.down('#smarts');
Proxmox.Utils.monStoreErrors(grid, me.store);
me.mon(me.store, 'load', function(s, records, success) {
if (success && records.length > 0) {
- var rec = records[0];
+ let rec = records[0];
if (rec.data.type === 'text') {
grid.setVisible(false);
- text.setVisible(true);
- text.setHtml(Ext.String.htmlEncode(rec.data.text));
+
+ me.down('#text').setHtml(Ext.String.htmlEncode(rec.data.text));
+ me.down('#text').setVisible(true);
} else {
grid.setVisible(true);
- text.setVisible(false);
+ me.down('#textContainer').setVisible(false);
grid.setStore(rec.attributes());
}
}