[pve-devel] [PATCH manager 05/19] use TimeView and TimeEdit from widget toolkit

Dominik Csapak d.csapak at proxmox.com
Thu Dec 21 13:36:08 CET 2017


Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/Makefile         |  2 --
 www/manager6/node/Config.js   |  3 ++-
 www/manager6/node/TimeEdit.js | 39 -----------------------------
 www/manager6/node/TimeView.js | 57 -------------------------------------------
 4 files changed, 2 insertions(+), 99 deletions(-)
 delete mode 100644 www/manager6/node/TimeEdit.js
 delete mode 100644 www/manager6/node/TimeView.js

diff --git a/www/manager6/Makefile b/www/manager6/Makefile
index f9b6deb4..da01f71c 100644
--- a/www/manager6/Makefile
+++ b/www/manager6/Makefile
@@ -120,8 +120,6 @@ JSSRC= 				                 	\
 	node/Disks.js					\
 	node/DNSEdit.js					\
 	node/DNSView.js					\
-	node/TimeView.js				\
-	node/TimeEdit.js				\
 	node/StatusView.js				\
 	node/Summary.js					\
 	node/ServiceView.js				\
diff --git a/www/manager6/node/Config.js b/www/manager6/node/Config.js
index 1b1cc801..5ead4878 100644
--- a/www/manager6/node/Config.js
+++ b/www/manager6/node/Config.js
@@ -178,7 +178,8 @@ Ext.define('PVE.node.Config', {
 		    title: gettext('Time'),
 		    itemId: 'time',
 		    groups: ['services'],
-		    xtype: 'pveNodeTimeView',
+		    nodename: nodename,
+		    xtype: 'proxmoxNodeTimeView',
 		    iconCls: 'fa fa-clock-o'
 		});
 	}
diff --git a/www/manager6/node/TimeEdit.js b/www/manager6/node/TimeEdit.js
deleted file mode 100644
index 62d3c211..00000000
--- a/www/manager6/node/TimeEdit.js
+++ /dev/null
@@ -1,39 +0,0 @@
-Ext.define('PVE.node.TimeEdit', {
-    extend: 'PVE.window.Edit',
-    alias: ['widget.pveNodeTimeEdit'],
-
-    initComponent : function() {
-	var me = this;
-
-	var nodename = me.pveSelNode.data.node;
-	if (!nodename) {
-	    throw "no node name specified";
-	}
-
-	Ext.applyIf(me, {
-	    subject: gettext('Time zone'),
-	    url: "/api2/extjs/nodes/" + nodename + "/time",
-	    fieldDefaults: {
-		labelWidth: 70
-            },
-	    width: 400,
-	    items: {
-		xtype: 'combo',
-		fieldLabel: gettext('Time zone'),
-		name: 'timezone',
-		queryMode: 'local',
-		store: Ext.create('PVE.data.TimezoneStore'),
-		valueField: 'zone',
-		displayField: 'zone',
-		triggerAction: 'all',
-		forceSelection: true,
-		editable: false,
-		allowBlank: false
-	    }
-	});
-
-	me.callParent();
-
-	me.load();
-    }
-});
diff --git a/www/manager6/node/TimeView.js b/www/manager6/node/TimeView.js
deleted file mode 100644
index 20c83106..00000000
--- a/www/manager6/node/TimeView.js
+++ /dev/null
@@ -1,57 +0,0 @@
-Ext.define('PVE.node.TimeView', {
-    extend: 'PVE.grid.ObjectGrid',
-    alias: ['widget.pveNodeTimeView'],
-
-    initComponent : function() {
-	var me = this;
-
-	var nodename = me.pveSelNode.data.node;
-	if (!nodename) {
-	    throw "no node name specified";
-	}
-
-	var tzoffset = (new Date()).getTimezoneOffset()*60000;
-	var renderlocaltime = function(value) {
-	    var servertime = new Date((value * 1000) + tzoffset);
-	    return Ext.Date.format(servertime, 'Y-m-d H:i:s');
-	};
-
-	var run_editor = function() {
-	    var win = Ext.create('PVE.node.TimeEdit', {
-		pveSelNode: me.pveSelNode
-	    });
-	    win.show();
-	};
-
-	Ext.apply(me, {
-	    url: "/api2/json/nodes/" + nodename + "/time",
-	    cwidth1: 150,
-	    interval: 1000,
-	    rows: {
-		timezone: { 
-		    header: gettext('Time zone'), 
-		    required: true
-		},
-		localtime: { 
-		    header: gettext('Server time'), 
-		    required: true, 
-		    renderer: renderlocaltime 
-		}
-	    },
-	    tbar: [ 
-		{
-		    text: gettext("Edit"),
-		    handler: run_editor
-		}
-	    ],
-	    listeners: {
-		itemdblclick: run_editor
-	    }
-	});
-
-	me.callParent();
-
-	me.on('activate', me.rstore.startUpdate);
-	me.on('destroy', me.rstore.stopUpdate);	
-    }
-});
-- 
2.11.0





More information about the pve-devel mailing list