]> git.proxmox.com Git - pve-manager.git/blob - www/manager6/ceph/Config.js
ui: ceph config: use new ceph/cfg/ API endpoints
[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/cfg/db';
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 success: function(response, opts) {
90 var data = response.result.data;
91 me.update(Ext.htmlEncode(data));
92 },
93 });
94 },
95
96 initComponent: function() {
97 var me = this;
98
99 var nodename = me.pveSelNode.data.node;
100 if (!nodename) {
101 throw "no node name specified";
102 }
103
104 Ext.apply(me, {
105 url: '/nodes/' + nodename + '/ceph/cfg/raw',
106 listeners: {
107 activate: function() {
108 me.load();
109 },
110 },
111 });
112
113 me.callParent();
114
115 me.load();
116 },
117 });
118
119 Ext.define('PVE.node.CephConfigCrush', {
120 extend: 'Ext.panel.Panel',
121 alias: 'widget.pveNodeCephConfigCrush',
122
123 onlineHelp: 'chapter_pveceph',
124
125 layout: 'border',
126 items: [{
127 title: gettext('Configuration'),
128 xtype: 'pveNodeCephConfig',
129 region: 'center',
130 },
131 {
132 title: 'Crush Map', // do not localize
133 xtype: 'pveNodeCephCrushMap',
134 region: 'east',
135 split: true,
136 width: '50%',
137 },
138 {
139 title: gettext('Configuration Database'),
140 xtype: 'pveNodeCephConfigDb',
141 region: 'south',
142 split: true,
143 weight: -30,
144 height: '50%',
145 }],
146
147 initComponent: function() {
148 var me = this;
149 me.defaults = {
150 pveSelNode: me.pveSelNode,
151 };
152 me.callParent();
153 },
154 });