[pve-devel] [PATCH manager 4/4] added basic ability to install ceph via gui

Tim Marx t.marx at proxmox.com
Thu Jan 10 13:54:33 CET 2019


Signed-off-by: Tim Marx <t.marx at proxmox.com>
---
 www/manager6/Makefile              |  1 +
 www/manager6/ceph/Status.js        | 14 ++++++++++++-
 www/manager6/window/CephInstall.js | 42 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 56 insertions(+), 1 deletion(-)
 create mode 100644 www/manager6/window/CephInstall.js

diff --git a/www/manager6/Makefile b/www/manager6/Makefile
index e75f0de6..c4dcb786 100644
--- a/www/manager6/Makefile
+++ b/www/manager6/Makefile
@@ -83,6 +83,7 @@ JSSRC= 				                 	\
 	window/BackupConfig.js				\
 	window/Settings.js				\
 	window/StartupEdit.js				\
+	window/CephInstall.js				\
 	panel/NotesView.js				\
 	grid/ResourceGrid.js				\
 	grid/PoolMembers.js				\
diff --git a/www/manager6/ceph/Status.js b/www/manager6/ceph/Status.js
index 78fa1cf8..59cf1ac7 100644
--- a/www/manager6/ceph/Status.js
+++ b/www/manager6/ceph/Status.js
@@ -308,7 +308,19 @@ Ext.define('PVE.node.CephStatus', {
 	me.version = me.sp.get('ceph-version');
 	me.change_version(me.version);
 
-	Proxmox.Utils.monStoreErrors(me,me.store);
+	me.mon(me.store.proxy, 'exception', function (proxy, response) {
+
+	    if (response.statusText === "binary not installed: /usr/bin/ceph-mon"){
+		me.store.stopUpdate();
+		me.el.mask(gettext("Ceph not installed"), ['pve-static-mask']);
+
+		var win = Ext.create('PVE.ceph.Install', {
+		    nodename: nodename
+		});
+		win.show();
+	    }
+	});
+
 	me.mon(me.store, 'load', me.updateAll, me);
 	me.on('destroy', me.store.stopUpdate);
 	me.store.startUpdate();
diff --git a/www/manager6/window/CephInstall.js b/www/manager6/window/CephInstall.js
new file mode 100644
index 00000000..d621b7b9
--- /dev/null
+++ b/www/manager6/window/CephInstall.js
@@ -0,0 +1,42 @@
+Ext.define('PVE.ceph.Install', {
+    extend: 'Ext.window.Window',
+
+    width: 300,
+    title: gettext('Install Ceph'),
+
+    nodename: undefined,
+    cephVersion: 'luminous',
+
+    initComponent: function () {
+	var me = this;
+	if (!me.nodename) {
+	    throw "no node name specified";
+	}
+
+	me.items = [
+	    {
+		html: '<p>' + gettext('Ceph is not installed on this node.') +
+		gettext('Would you like to install it now?')+'</p>',
+		border: false,
+		padding: 5
+	    }
+	];
+
+	me.buttons = [
+	    {
+		xtype: 'pveConsoleButton',
+		disabled: Proxmox.UserName !== 'root at pam',
+		text: gettext('Install Ceph-') + me.cephVersion,
+		consoleType: 'cmd',
+		cmd: "pveceph install --version " + me.cephVersion,
+		nodename: me.nodename
+	   }
+	];
+
+	Ext.applyIf(me, {
+		modal: true,
+		border: false
+	});
+	me.callParent();
+    }
+});
-- 
2.11.0




More information about the pve-devel mailing list