]> git.proxmox.com Git - pve-manager.git/blobdiff - www/manager6/ceph/Config.js
ui: eslint: fix various spacing related issues
[pve-manager.git] / www / manager6 / ceph / Config.js
index 49a0317607e703493d62e348fbecf7adbf6b9b41..7f07f15f0f17b7d1e5c5c2e1c7e69e88e5df33f3 100644 (file)
@@ -1,23 +1,95 @@
+Ext.define('PVE.node.CephConfigDb', {
+    extend: 'Ext.grid.Panel',
+    alias: 'widget.pveNodeCephConfigDb',
+
+    border: false,
+    store: {
+       proxy: {
+           type: 'proxmox',
+       },
+    },
+
+    columns: [
+       {
+           dataIndex: 'section',
+           text: 'WHO',
+           width: 100,
+       },
+       {
+           dataIndex: 'mask',
+           text: 'MASK',
+           hidden: true,
+           width: 80,
+       },
+       {
+           dataIndex: 'level',
+           hidden: true,
+           text: 'LEVEL',
+       },
+       {
+           dataIndex: 'name',
+           flex: 1,
+           text: 'OPTION',
+       },
+       {
+           dataIndex: 'value',
+           flex: 1,
+           text: 'VALUE',
+       },
+       {
+           dataIndex: 'can_update_at_runtime',
+           text: 'Runtime Updatable',
+           hidden: true,
+           width: 80,
+           renderer: Proxmox.Utils.format_boolean,
+       },
+    ],
+
+    initComponent: function() {
+        var me = this;
+
+       var nodename = me.pveSelNode.data.node;
+       if (!nodename) {
+           throw "no node name specified";
+       }
+
+       me.store.proxy.url = '/api2/json/nodes/' + nodename + '/ceph/configdb';
+
+       me.callParent();
+
+       Proxmox.Utils.monStoreErrors(me, me.getStore());
+       me.getStore().load();
+    },
+});
 Ext.define('PVE.node.CephConfig', {
     extend: 'Ext.panel.Panel',
-    alias: ['widget.pveNodeCephConfig'],
+    alias: 'widget.pveNodeCephConfig',
 
     bodyStyle: 'white-space:pre',
     bodyPadding: 5,
+    border: false,
     scrollable: true,
     load: function() {
        var me = this;
 
-       PVE.Utils.API2Request({
+       Proxmox.Utils.API2Request({
            url: me.url,
            waitMsgTarget: me,
            failure: function(response, opts) {
                me.update(gettext('Error') + " " + response.htmlStatus);
+               var msg = response.htmlStatus;
+               PVE.Utils.showCephInstallOrMask(me.ownerCt, msg, me.pveSelNode.data.node,
+                   function(win) {
+                       me.mon(win, 'cephInstallWindowClosed', function() {
+                           me.load();
+                       });
+                   },
+               );
            },
            success: function(response, opts) {
                var data = response.result.data;
                me.update(Ext.htmlEncode(data));
-           }
+           },
        });
     },
 
@@ -34,81 +106,49 @@ Ext.define('PVE.node.CephConfig', {
            listeners: {
                activate: function() {
                    me.load();
-               }
-           }
+               },
+           },
        });
 
        me.callParent();
 
        me.load();
-    }
+    },
 });
 
-Ext.define('PVE.node.Ceph', {
-    extend: 'PVE.panel.SubConfig',
-    alias: ['widget.pveNodeCeph'],
-
-    minTabWidth: 80,
-    configPrefix: 'ceph',
+Ext.define('PVE.node.CephConfigCrush', {
+    extend: 'Ext.panel.Panel',
+    alias: 'widget.pveNodeCephConfigCrush',
 
-    initComponent: function() {
-        var me = this;
+    onlineHelp: 'chapter_pveceph',
 
-       var nodename = me.pveSelNode.data.node;
-       if (!nodename) {
-           throw "no node name specified";
-       }
-
-       Ext.apply(me, {
-           defaults: {
-               border: false,
-               pveSelNode: me.pveSelNode
-           },
-           items: [
-               {
-                   xtype: 'pveNodeCephStatus',
-                   title: gettext('Status'),
-                   itemId: 'status'
-               },
-               {
-                   xtype: 'pveNodeCephConfig',
-                   title: gettext('Config'),
-                   itemId: 'config'
-               },
-               {
-                   xtype: 'pveNodeCephMonList',
-                   title: gettext('Monitor'),
-                   itemId: 'monlist'
-               },
-               {
-                   xtype: 'pveNodeCephDiskList',
-                   title: gettext('Disks'),
-                   itemId: 'disklist'
-               },
-               {
-                   xtype: 'pveNodeCephOsdTree',
-                   title: 'OSD',
-                   itemId: 'osdtree'
-               },
-               {
-                   xtype: 'pveNodeCephPoolList',
-                   title: gettext('Pools'),
-                   itemId: 'pools'
-               },
-               {
-                   title: 'Crush',
-                   xtype: 'pveNodeCephCrushMap',
-                   itemId: 'crushmap'
-               },
-               {
-                   title: gettext('Log'),
-                   itemId: 'log',
-                   xtype: 'pveLogView',
-                   url: "/api2/extjs/nodes/" + nodename + "/ceph/log"
-               }
-           ],
-       });
+    layout: 'border',
+    items: [{
+           title: gettext('Configuration'),
+           xtype: 'pveNodeCephConfig',
+           region: 'center',
+       },
+       {
+           title: 'Crush Map', // do not localize
+           xtype: 'pveNodeCephCrushMap',
+           region: 'east',
+           split: true,
+           width: '50%',
+       },
+       {
+           title: gettext('Configuration Database'),
+           xtype: 'pveNodeCephConfigDb',
+           region: 'south',
+           split: true,
+           weight: -30,
+           height: '50%',
+    }],
 
+    initComponent: function() {
+       var me = this;
+       me.defaults = {
+           pveSelNode: me.pveSelNode,
+       };
        me.callParent();
-    }
+    },
 });