]> git.proxmox.com Git - pve-manager.git/blob - www/manager6/ceph/Config.js
gui: ceph configdb: fix store load
[pve-manager.git] / www / manager6 / ceph / Config.js
1 Ext.define('PVE.node.CephConfigDb', {
2 extend: 'Ext.grid.Panel',
3 alias: 'widget.pveNodeCephConfigDb',
4
5 border: false,
6 store: {
7 proxy: {
8 type: 'proxmox'
9 }
10 },
11
12 columns: [
13 {
14 dataIndex: 'section',
15 text: 'WHO',
16 width: 100,
17 },
18 {
19 dataIndex: 'mask',
20 text: 'MASK',
21 hidden: true,
22 width: 80,
23 },
24 {
25 dataIndex: 'level',
26 hidden: true,
27 text: 'LEVEL',
28 },
29 {
30 dataIndex: 'name',
31 flex: 1,
32 text: 'OPTION',
33 },
34 {
35 dataIndex: 'value',
36 flex: 1,
37 text: 'VALUE',
38 },
39 {
40 dataIndex: 'can_update_at_runtime',
41 text: 'Runtime Updatable',
42 hidden: true,
43 width: 80,
44 renderer: Proxmox.Utils.format_boolean
45 },
46 ],
47
48 initComponent: function() {
49 var me = this;
50
51 var nodename = me.pveSelNode.data.node;
52 if (!nodename) {
53 throw "no node name specified";
54 }
55
56 me.store.proxy.url = '/api2/json/nodes/' + nodename + '/ceph/configdb';
57
58 me.callParent();
59
60 Proxmox.Utils.monStoreErrors(me, me.getStore());
61 me.getStore().load();
62 }
63 });
64 Ext.define('PVE.node.CephConfig', {
65 extend: 'Ext.panel.Panel',
66 alias: 'widget.pveNodeCephConfig',
67
68 bodyStyle: 'white-space:pre',
69 bodyPadding: 5,
70 border: false,
71 scrollable: true,
72 load: function() {
73 var me = this;
74
75 Proxmox.Utils.API2Request({
76 url: me.url,
77 waitMsgTarget: me,
78 failure: function(response, opts) {
79 me.update(gettext('Error') + " " + response.htmlStatus);
80 var msg = response.htmlStatus;
81 PVE.Utils.showCephInstallOrMask(me.ownerCt, msg, me.pveSelNode.data.node,
82 function(win){
83 me.mon(win, 'cephInstallWindowClosed', function(){
84 me.load();
85 });
86 }
87 );
88
89 },
90 success: function(response, opts) {
91 var data = response.result.data;
92 me.update(Ext.htmlEncode(data));
93 }
94 });
95 },
96
97 initComponent: function() {
98 var me = this;
99
100 var nodename = me.pveSelNode.data.node;
101 if (!nodename) {
102 throw "no node name specified";
103 }
104
105 Ext.apply(me, {
106 url: '/nodes/' + nodename + '/ceph/config',
107 listeners: {
108 activate: function() {
109 me.load();
110 }
111 }
112 });
113
114 me.callParent();
115
116 me.load();
117 }
118 });
119
120 Ext.define('PVE.node.CephConfigCrush', {
121 extend: 'Ext.panel.Panel',
122 alias: 'widget.pveNodeCephConfigCrush',
123
124 onlineHelp: 'chapter_pveceph',
125
126 layout: 'border',
127 items: [{
128 title: gettext('Configuration'),
129 xtype: 'pveNodeCephConfig',
130 region: 'center'
131 },
132 {
133 title: 'Crush Map', // do not localize
134 xtype: 'pveNodeCephCrushMap',
135 region: 'east',
136 split: true,
137 width: '50%'
138 },
139 {
140 title: gettext('Configuration Database'),
141 xtype: 'pveNodeCephConfigDb',
142 region: 'south',
143 split: true,
144 weight: -30,
145 height: '50%'
146 }],
147
148 initComponent: function() {
149 var me = this;
150 me.defaults = {
151 pveSelNode: me.pveSelNode
152 };
153 me.callParent();
154 }
155 });