mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-05-02 19:05:13 +00:00
disk smart: code/indentation cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
18b79e39cf
commit
7eb1fb18ad
@ -4,6 +4,17 @@ Ext.define('Proxmox.window.DiskSmart', {
|
|||||||
|
|
||||||
modal: true,
|
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: [
|
items: [
|
||||||
{
|
{
|
||||||
xtype: 'gridpanel',
|
xtype: 'gridpanel',
|
||||||
@ -16,14 +27,46 @@ Ext.define('Proxmox.window.DiskSmart', {
|
|||||||
itemId: 'smarts',
|
itemId: 'smarts',
|
||||||
reserveScrollbar: true,
|
reserveScrollbar: true,
|
||||||
columns: [
|
columns: [
|
||||||
{ text: 'ID', dataIndex: 'id', width: 50 },
|
{
|
||||||
{ text: gettext('Attribute'), flex: 1, dataIndex: 'name', renderer: Ext.String.htmlEncode },
|
text: 'ID',
|
||||||
{ text: gettext('Value'), dataIndex: 'raw', renderer: Ext.String.htmlEncode },
|
dataIndex: 'id',
|
||||||
{ text: gettext('Normalized'), dataIndex: 'value', width: 60 },
|
width: 50,
|
||||||
{ text: gettext('Threshold'), dataIndex: 'threshold', width: 60 },
|
},
|
||||||
{ text: gettext('Worst'), dataIndex: 'worst', width: 60 },
|
{
|
||||||
{ text: gettext('Flags'), dataIndex: 'flags' },
|
text: gettext('Attribute'),
|
||||||
{ text: gettext('Failing'), dataIndex: 'fail', renderer: Ext.String.htmlEncode },
|
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,
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -60,17 +103,6 @@ Ext.define('Proxmox.window.DiskSmart', {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
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() {
|
initComponent: function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
|
||||||
@ -92,20 +124,21 @@ Ext.define('Proxmox.window.DiskSmart', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
me.callParent();
|
me.callParent();
|
||||||
var grid = me.down('#smarts');
|
|
||||||
var text = me.down('#text');
|
let grid = me.down('#smarts');
|
||||||
|
|
||||||
Proxmox.Utils.monStoreErrors(grid, me.store);
|
Proxmox.Utils.monStoreErrors(grid, me.store);
|
||||||
me.mon(me.store, 'load', function(s, records, success) {
|
me.mon(me.store, 'load', function(s, records, success) {
|
||||||
if (success && records.length > 0) {
|
if (success && records.length > 0) {
|
||||||
var rec = records[0];
|
let rec = records[0];
|
||||||
if (rec.data.type === 'text') {
|
if (rec.data.type === 'text') {
|
||||||
grid.setVisible(false);
|
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 {
|
} else {
|
||||||
grid.setVisible(true);
|
grid.setVisible(true);
|
||||||
text.setVisible(false);
|
me.down('#textContainer').setVisible(false);
|
||||||
grid.setStore(rec.attributes());
|
grid.setStore(rec.attributes());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user