]> git.proxmox.com Git - pve-manager.git/commitdiff
dc/Cluster: allow cluster create over WebUI
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 4 Apr 2018 12:36:44 +0000 (14:36 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 5 Apr 2018 09:30:21 +0000 (11:30 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
www/manager6/Makefile
www/manager6/dc/Cluster.js
www/manager6/dc/ClusterEdit.js [new file with mode: 0644]

index 0796aa2cfb2f23bb860d5db158406d5a32d105e6..6daa259f8db93071139b1b8bdb2f1c638335a31d 100644 (file)
@@ -194,6 +194,7 @@ JSSRC=                                                      \
        dc/Config.js                                    \
        dc/NodeView.js                                  \
        dc/Cluster.js                                   \
+       dc/ClusterEdit.js                               \
        Workspace.js
 
 lint: ${JSSRC}
index 10e25bf07209260d0b87c093b5d1da21ad6aaae9..c38a2da571526991dc0ac6fbbbc32cd73ca10094 100644 (file)
@@ -90,7 +90,30 @@ Ext.define('PVE.ClusterAdministration', {
                        fp: nodeinfo.pve_fp
                    });
                },
+
+               onCreate: function() {
+                   var view = this.getView();
+                   view.store.stopUpdate();
+                   var win = Ext.create('PVE.ClusterCreateWindow', {
+                       autoShow: true,
+                       listeners: {
+                           destroy: function() {
+                               view.store.startUpdate();
+                           }
+                       }
+                   });
+               }
            },
+           tbar: [
+               {
+                   text: gettext('Create Cluster'),
+                   reference: 'createButton',
+                   handler: 'onCreate',
+                   bind: {
+                       disabled: '{isInCluster}'
+                   }
+               }
+           ],
            layout: 'hbox',
            bodyPadding: 5,
            items: [
diff --git a/www/manager6/dc/ClusterEdit.js b/www/manager6/dc/ClusterEdit.js
new file mode 100644 (file)
index 0000000..cef35f7
--- /dev/null
@@ -0,0 +1,32 @@
+/*jslint confusion: true*/
+Ext.define('PVE.ClusterCreateWindow', {
+    extend: 'Proxmox.window.Edit',
+    xtype: 'pveClusterCreateWindow',
+
+    title: gettext('Create Cluster'),
+    width: 600,
+
+    method: 'POST',
+    url: '/cluster/config',
+
+    isCreate: true,
+    subject: gettext('Cluster'),
+    showTaskViewer: true,
+
+    items: [
+       {
+           xtype: 'textfield',
+           fieldLabel: gettext('Cluster Name'),
+           allowBlank: false,
+           name: 'clustername'
+       },
+       {
+           xtype: 'proxmoxtextfield',
+           fieldLabel: gettext('Ring 0 Address'),
+           emptyText: gettext("Optional, defaults to IP resolved by node's hostname"),
+           name: 'ring0_addr',
+           skipEmptyText: true
+       }
+       // TODO: for advanced options: ring1_addr
+    ]
+});