[pve-devel] r5832 - in pve-manager/pve2/www/new: . panel
svn-commits at proxmox.com
svn-commits at proxmox.com
Wed Apr 20 09:16:54 CEST 2011
Author: dietmar
Date: 2011-04-20 09:16:54 +0200 (Wed, 20 Apr 2011)
New Revision: 5832
Modified:
pve-manager/pve2/www/new/StateProvider.js
pve-manager/pve2/www/new/panel/NodeConfig.js
Log:
use new Ext.state.LocalStorageProvider
Modified: pve-manager/pve2/www/new/StateProvider.js
===================================================================
--- pve-manager/pve2/www/new/StateProvider.js 2011-04-20 07:02:49 UTC (rev 5831)
+++ pve-manager/pve2/www/new/StateProvider.js 2011-04-20 07:16:54 UTC (rev 5832)
@@ -13,7 +13,7 @@
*/
Ext.define('PVE.StateProvider', {
- extend: 'Ext.state.Provider',
+ extend: 'Ext.state.LocalStorageProvider',
// private
setHV: function(name, newvalue, fireEvents) {
@@ -47,7 +47,7 @@
'ltab',
'ctab'
];
-
+
var defaults = {
view: 'server',
ltab: 'clog',
@@ -95,15 +95,10 @@
if (typeof self.UIState[name] != "undefined") {
data = { value: self.UIState[name] };
} else {
- var text = window.localStorage.getItem(name);
- if (typeof text == "undefined") {
- data = defaultValue;
- } else {
- data = Ext.decode(text);
- }
+ data = self.callParent(arguments);
}
- //console.log("GET " + name + " " + Ext.encode(data));
+ console.log("GET " + name + " " + Ext.encode(data));
return data;
},
@@ -113,11 +108,9 @@
if (typeof self.UIState[name] != "undefined") {
self.UIState[name] = null;
- } else {
- window.localStorage.removeItem(name);
}
- self.fireEvent("statechange", self, name, null);
+ self.callParent(arguments);
},
set: function(name, value){
@@ -131,8 +124,7 @@
Ext.History.add(htext);
}
} else {
- window.localStorage.setItem(name, Ext.encode(value));
- self.fireEvent("statechange", self, name, value);
- }
+ self.callParent(arguments);
+ }
}
});
\ No newline at end of file
Modified: pve-manager/pve2/www/new/panel/NodeConfig.js
===================================================================
--- pve-manager/pve2/www/new/panel/NodeConfig.js 2011-04-20 07:02:49 UTC (rev 5831)
+++ pve-manager/pve2/www/new/panel/NodeConfig.js 2011-04-20 07:16:54 UTC (rev 5832)
@@ -27,26 +27,26 @@
},
{
title: 'Network',
- id: 'network',
+ itemId: 'network',
html: 'network ' + nodename
},
{
title: 'DNS',
- id: 'dns',
+ itemId: 'dns',
//xtype: 'pveNodeDNSView',
//nodename: nodename
html: "DNS"
},
{
title: 'Time',
- id: 'time',
+ itemId: 'time',
//xtype: 'pveNodeTimeView',
//nodename: nodename
html: "time"
},
{
title: 'Tasks',
- id: 'tasks',
+ itemId: 'tasks',
//xtype: 'pveNodeTasks',
//nodename: nodename
html: "time"
More information about the pve-devel
mailing list