[pve-devel] [PATCH manager 18/20] gui: ceph: leave osd selected after reloading

Dominik Csapak d.csapak at proxmox.com
Tue Jun 4 14:47:57 CEST 2019


Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/ceph/OSD.js | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/www/manager6/ceph/OSD.js b/www/manager6/ceph/OSD.js
index 6c5cb498..708ba274 100644
--- a/www/manager6/ceph/OSD.js
+++ b/www/manager6/ceph/OSD.js
@@ -356,9 +356,20 @@ Ext.define('PVE.node.CephOsdTree', {
 		},
 		success: function(response, opts) {
 		    var data = response.result.data;
+		    var selected = me.getSelection();
+		    var name;
+		    if (selected.length) {
+			name = selected[0].data.name;
+		    }
 		    sm.deselectAll();
 		    me.setRootNode(data.root);
 		    me.expandAll();
+		    if (name) {
+			var node = me.getRootNode().findChild('name', name, true);
+			if (node) {
+			    me.setSelection([node]);
+			}
+		    }
 		    // extract noout flag
 		    if (data.flags && data.flags.search(/noout/) !== -1) {
 			noout = true;
-- 
2.11.0





More information about the pve-devel mailing list