[pve-devel] [PATCH manager v2 0/5] cluster create/join UI

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Apr 4 14:36:42 CEST 2018


Second iteration of the WebUI Cluster Create, Join series[1].

Changes between v1 and v2 are described in each respective patch.

Look at [1] for the v1 cover letter. Dominik comments, and a bit more,
should be addressed now. While 4/5 is not my ideal looking UI, it's simple
and works, we can enhance it just fine later, so if the code is OK this
could be committed now.

NOTE: You'll still need to build widget toolkit from git and pve-cluster
with my autoflush patch (not yet applied, pull it from pve-devel) on top.
It work else too, but you won't get a really nice user experience when
joining, without those.

I included the full diff between this and the last version below inline, so
that it should be very easy to see what changed.

cheers,
Thomas

[1]: https://pve.proxmox.com/pipermail/pve-devel/2018-March/031293.html

Thomas Lamprecht (5):
  dc: add simple cluster panel
  dc/Cluster: allow cluster create over WebUI
  dc/Cluster: allow to get join information
  ui: add cluster join window POC
  ui: silence auth failures during cluster join

 www/manager6/Makefile          |   2 +
 www/manager6/Workspace.js      |   2 +-
 www/manager6/dc/Cluster.js     | 264 ++++++++++++++++++++++++++++++++++
 www/manager6/dc/ClusterEdit.js | 311 +++++++++++++++++++++++++++++++++++++++++
 www/manager6/dc/Config.js      |  13 +-
 5 files changed, 587 insertions(+), 5 deletions(-)
 create mode 100644 www/manager6/dc/Cluster.js
 create mode 100644 www/manager6/dc/ClusterEdit.js

-- 
2.14.2

--

$ git diff ui_cluster_addcreate_singlepanel
diff --git a/www/manager6/dc/Cluster.js b/www/manager6/dc/Cluster.js
index 11e24c66..b048f9bc 100644
--- a/www/manager6/dc/Cluster.js
+++ b/www/manager6/dc/Cluster.js
@@ -59,6 +59,7 @@ Ext.define('PVE.ClusterAdministration', {
 			model: 'pve-cluster-info'
 		    });
 		    view.store.on('load', this.onLoad, this);
+		    view.on('destroy', view.store.stopUpdate);
 		},
 
 		onLoad: function(store, records, success) {
@@ -187,7 +188,7 @@ Ext.define('PVE.ClusterAdministration', {
 		},
 		{
 		    xtype: 'displayfield',
-		    value: gettext('No cluster configured'),
+		    value: gettext('Standalone node - no cluster defined'),
 		    bind: {
 			hidden: '{isInCluster}'
 		    },
@@ -202,20 +203,24 @@ Ext.define('PVE.ClusterAdministration', {
 		xclass: 'Ext.app.ViewController',
 
 		init: function(view) {
-		    view.setStore(Ext.create('Proxmox.data.UpdateStore', {
+		    view.rstore = Ext.create('Proxmox.data.UpdateStore', {
 			autoLoad: true,
 			xtype: 'update',
 			interval: 5 * 1000,
 			autoStart: true,
 			storeid: 'pve-cluster-nodes',
-			model: 'pve-cluster-nodes',
+			model: 'pve-cluster-nodes'
+		    });
+		    view.setStore(Ext.create('Proxmox.data.DiffStore', {
+			rstore: view.rstore,
 			sorters: {
 			    property: 'nodeid',
 			    order: 'DESC'
 			}
 		    }));
+		    Proxmox.Utils.monStoreErrors(view, view.rstore);
 		    view.store.on('load', this.onLoad, this);
-		    //Proxmox.Utils.monStoreErrors(view, view.getStore());
+		    view.on('destroy', view.rstore.stopUpdate);
 		},
 
 		onLoad: function(store, records, success) {
@@ -227,13 +232,6 @@ Ext.define('PVE.ClusterAdministration', {
 		    vm.set('nodecount', records.length);
 		}
 	    },
-	    /*tbar: [
-		{
-		    text: gettext('Isolate Node'),
-		    reference: 'isolateButton',
-		    hidden: true // TODO
-		}
-	    ],*/
 	    columns: [
 		{
 		    header: gettext('Nodename'),
diff --git a/www/manager6/dc/ClusterEdit.js b/www/manager6/dc/ClusterEdit.js
index 81e6532d..bdf1ae69 100644
--- a/www/manager6/dc/ClusterEdit.js
+++ b/www/manager6/dc/ClusterEdit.js
@@ -17,6 +17,7 @@ Ext.define('PVE.ClusterCreateWindow', {
 	{
 	    xtype: 'textfield',
 	    fieldLabel: gettext('Cluster Name'),
+	    allowBlank: false,
 	    name: 'clustername'
 	},
 	{
@@ -37,6 +38,7 @@ Ext.define('PVE.ClusterInfoWindow', {
 
     width: 800,
     modal: true,
+    resizable: false,
     title: gettext('Cluster Join Information'),
 
     joinInfo: {



More information about the pve-devel mailing list