[pve-devel] [PATCH manager 3/4] use new statusview for storage
Dominik Csapak
d.csapak at proxmox.com
Tue Oct 4 16:29:22 CEST 2016
to better fit with the rest
Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
www/manager6/storage/StatusView.js | 97 +++++++++++++++++---------------------
www/manager6/storage/Summary.js | 10 ++--
2 files changed, 51 insertions(+), 56 deletions(-)
diff --git a/www/manager6/storage/StatusView.js b/www/manager6/storage/StatusView.js
index 58d63aa..a2ef302 100644
--- a/www/manager6/storage/StatusView.js
+++ b/www/manager6/storage/StatusView.js
@@ -1,70 +1,61 @@
Ext.define('PVE.storage.StatusView', {
- extend: 'PVE.grid.ObjectGrid',
+ extend: 'PVE.panel.StatusView',
alias: 'widget.pveStorageStatusView',
- disabled: true,
+ height: 230,
title: gettext('Status'),
- cwidth1: 150,
- interval: 30000,
- rows : {
- disable: {
- header: gettext('Enabled'),
- required: true,
+
+ defaults: {
+ xtype: 'pveInfoWidget',
+ padding: '0 30 5 30',
+ width: 770
+ },
+ items: [
+ {
+ xtype: 'box',
+ height: 30
+ },
+ {
+ itemId: 'enabled',
+ title: gettext('Enabled'),
+ printBar: false,
+ textField: 'disabled',
renderer: PVE.Utils.format_neg_boolean
},
- active: {
- header: gettext('Active'),
- required: true,
+ {
+ itemId: 'active',
+ title: gettext('Active'),
+ printBar: false,
+ textField: 'active',
renderer: PVE.Utils.format_boolean
},
- content: {
- header: gettext('Content'),
- required: true,
+ {
+ itemId: 'content',
+ title: gettext('Content'),
+ printBar: false,
+ textField: 'content',
renderer: PVE.Utils.format_content_types
},
- type: {
- header: gettext('Type'),
- required: true,
+ {
+ itemId: 'type',
+ title: gettext('Type'),
+ printBar: false,
+ textField: 'type',
renderer: PVE.Utils.format_storage_type
},
- shared: {
- header: gettext('Shared'),
- required: true,
- renderer: PVE.Utils.format_boolean
- },
- total: {
- header: gettext('Size'),
- required: true,
- renderer: PVE.Utils.render_size
- },
- used: {
- header: gettext('Used'),
- required: true,
- renderer: PVE.Utils.render_size
+ {
+ xtype: 'box',
+ height: 10
},
- avail: {
- header: gettext('Avail'),
- required: true,
- renderer: PVE.Utils.render_size
+ {
+ itemId: 'usage',
+ title: gettext('Usage'),
+ valueField: 'used',
+ maxField: 'total'
}
- },
- initComponent : function() {
- var me = this;
-
- var nodename = me.pveSelNode.data.node;
- if (!nodename) {
- throw "no node name specified";
- }
-
- var storage = me.pveSelNode.data.storage;
- if (!storage) {
- throw "no storage ID specified";
- }
-
- Ext.apply(me, {
- url: "/api2/json/nodes/" + nodename + "/storage/" + storage + "/status"
- });
+ ],
- me.callParent();
+ updateTitle: function() {
+ return;
}
});
diff --git a/www/manager6/storage/Summary.js b/www/manager6/storage/Summary.js
index 7f0e4df..2101549 100644
--- a/www/manager6/storage/Summary.js
+++ b/www/manager6/storage/Summary.js
@@ -5,7 +5,7 @@ Ext.define('PVE.storage.Summary', {
bodyPadding: 10,
defaults: {
style: {'padding-top':'10px'},
- width: 800
+ width: 770
},
tbar: [
'->',
@@ -26,13 +26,17 @@ Ext.define('PVE.storage.Summary', {
throw "no storage ID specified";
}
+ var rstore = Ext.create('PVE.data.ObjectStore', {
+ url: "/api2/json/nodes/" + nodename + "/storage/" + storage + "/status",
+ interval: 1000
+ });
+
var statusview = Ext.create('PVE.storage.StatusView', {
pveSelNode: me.pveSelNode,
+ rstore: rstore,
style: {'padding-top':'0px'}
});
- var rstore = statusview.rstore;
-
var rrdstore = Ext.create('PVE.data.RRDStore', {
rrdurl: "/api2/json/nodes/" + nodename + "/storage/" + storage + "/rrddata"
});
--
2.1.4
More information about the pve-devel
mailing list