[pve-devel] r6517 - in pve-manager/pve2: . www/manager www/manager/dc

svn-commits at proxmox.com svn-commits at proxmox.com
Mon Aug 22 11:29:26 CEST 2011


Author: dietmar
Date: 2011-08-22 11:29:26 +0200 (Mon, 22 Aug 2011)
New Revision: 6517

Added:
   pve-manager/pve2/www/manager/dc/OptionView.js
Modified:
   pve-manager/pve2/ChangeLog
   pve-manager/pve2/www/manager/Makefile.am
   pve-manager/pve2/www/manager/dc/Config.js
Log:
 impl. datacenter options


Modified: pve-manager/pve2/ChangeLog
===================================================================
--- pve-manager/pve2/ChangeLog	2011-08-22 08:44:03 UTC (rev 6516)
+++ pve-manager/pve2/ChangeLog	2011-08-22 09:29:26 UTC (rev 6517)
@@ -1,3 +1,7 @@
+2011-08-22  Proxmox Support Team  <support at proxmox.com>
+
+	* www/manager/dc/OptionView.js: impl. datacenter options
+
 2011-08-17  Proxmox Support Team  <support at proxmox.com>
 
 	* lib/PVE/API2/Cluster.pm: impl. read/write datacenter.cfg

Modified: pve-manager/pve2/www/manager/Makefile.am
===================================================================
--- pve-manager/pve2/www/manager/Makefile.am	2011-08-22 08:44:03 UTC (rev 6516)
+++ pve-manager/pve2/www/manager/Makefile.am	2011-08-22 09:29:26 UTC (rev 6517)
@@ -87,6 +87,7 @@
 	storage/NFSEdit.js				\
 	storage/IScsiEdit.js				\
 	storage/LVMEdit.js				\
+	dc/OptionView.js				\
 	dc/StorageView.js				\
 	dc/UserEdit.js					\
 	dc/UserView.js					\

Modified: pve-manager/pve2/www/manager/dc/Config.js
===================================================================
--- pve-manager/pve2/www/manager/dc/Config.js	2011-08-22 08:44:03 UTC (rev 6516)
+++ pve-manager/pve2/www/manager/dc/Config.js	2011-08-22 09:29:26 UTC (rev 6517)
@@ -15,6 +15,11 @@
 		    html: 'summary '
 		},
 		{
+		    xtype: 'pveDcOptionView',
+		    title: 'Options',
+		    itemId: 'options'
+		},
+		{
 		    xtype: 'pveStorageView',
 		    title: 'Storage',
 		    itemId: 'storage'

Added: pve-manager/pve2/www/manager/dc/OptionView.js
===================================================================
--- pve-manager/pve2/www/manager/dc/OptionView.js	                        (rev 0)
+++ pve-manager/pve2/www/manager/dc/OptionView.js	2011-08-22 09:29:26 UTC (rev 6517)
@@ -0,0 +1,105 @@
+Ext.define('PVE.dc.KeyboardEdit', {
+    extend: 'PVE.window.Edit',
+
+    initComponent : function() {
+	var me = this;
+
+	Ext.applyIf(me, {
+	    title: "Edit keyboard settings",
+	    items: {
+		xtype: 'VNCKeyboardSelector',
+		name: 'keyboard',
+		value: '',
+		fieldLabel: 'Keyboard Layout'
+	    }
+	});
+
+	me.callParent();
+
+	me.load();
+    }
+});
+
+Ext.define('PVE.dc.OptionView', {
+    extend: 'PVE.grid.ObjectGrid',
+    alias: ['widget.pveDcOptionView'],
+
+    initComponent : function() {
+	var me = this;
+
+	var reload = function() {
+	    me.rstore.load();
+	};
+
+	var rows = {
+	    keyboard: { 
+		header: 'Keyboard', 
+		editor: 'PVE.dc.KeyboardEdit',
+		renderer: PVE.Utils.render_kvm_language,
+		required: true 
+	    },
+	    language: { 
+		header: 'GUI language', 
+		required: true 
+	    },
+	    http_proxy: { 
+		header: 'HTTP proxy', 
+		required: true 
+	    }
+	};
+
+	var run_editor = function() {
+	    var sm = me.getSelectionModel();
+	    var rec = sm.getSelection()[0];
+	    if (!rec) {
+		return;
+	    }
+
+	    var rowdef = rows[rec.data.key];
+	    if (!rowdef.editor) {
+		return;
+	    }
+	    
+	    var win = Ext.create(rowdef.editor, {
+		url: me.url,
+		confid: rec.data.key
+	    });
+	    win.show();
+	    win.on('destroy', reload);
+	};
+
+	var edit_btn = new Ext.Button({
+	    text: 'Edit',
+	    disabled: true,
+	    handler: run_editor
+	});
+
+	var set_button_status = function() {
+	    var sm = me.getSelectionModel();
+	    var rec = sm.getSelection()[0];
+
+	    if (!rec) {
+		edit_btn.disable();
+		return;
+	    }
+	    var rowdef = rows[rec.data.key];
+	    edit_btn.setDisabled(!rowdef.editor);
+	};
+
+	Ext.applyIf(me, {
+	    url: "/api2/extjs/cluster/options",
+	    cwidth1: 130,
+	    interval: 1000,
+	    tbar: [ edit_btn ],
+	    rows: rows,
+	    listeners: {
+		itemdblclick: run_editor,
+		selectionchange: set_button_status
+	    }
+	});
+
+	me.callParent();
+
+	me.on('show', reload);
+    }
+});




More information about the pve-devel mailing list