]> git.proxmox.com Git - pve-manager.git/blob - www/manager6/storage/CephFSEdit.js
ui: rbd: cephfs: add keyring/secret field for external clusters
[pve-manager.git] / www / manager6 / storage / CephFSEdit.js
1 Ext.define('PVE.storage.CephFSInputPanel', {
2 extend: 'PVE.panel.StorageBase',
3 controller: 'cephstorage',
4
5 onlineHelp: 'storage_cephfs',
6
7 viewModel: {
8 type: 'cephstorage',
9 },
10
11 setValues: function(values) {
12 if (values.monhost) {
13 this.viewModel.set('pveceph', false);
14 this.lookupReference('pvecephRef').setValue(false);
15 this.lookupReference('pvecephRef').resetOriginalValue();
16 }
17 this.callParent([values]);
18 },
19
20 initComponent: function() {
21 var me = this;
22
23 if (!me.nodename) {
24 me.nodename = 'localhost';
25 }
26 me.type = 'cephfs';
27
28 me.column1 = [];
29
30 me.column1.push(
31 {
32 xtype: 'textfield',
33 name: 'monhost',
34 vtype: 'HostList',
35 value: '',
36 bind: {
37 disabled: '{pveceph}',
38 submitValue: '{!pveceph}',
39 hidden: '{pveceph}',
40 },
41 fieldLabel: 'Monitor(s)',
42 allowBlank: false,
43 },
44 {
45 xtype: 'displayfield',
46 reference: 'monhost',
47 bind: {
48 disabled: '{!pveceph}',
49 hidden: '{!pveceph}',
50 },
51 value: '',
52 fieldLabel: 'Monitor(s)',
53 },
54 {
55 xtype: me.isCreate ? 'textfield' : 'displayfield',
56 name: 'username',
57 value: 'admin',
58 bind: {
59 disabled: '{pveceph}',
60 submitValue: '{!pveceph}',
61 },
62 fieldLabel: gettext('User name'),
63 allowBlank: true,
64 },
65 );
66
67 if (me.isCreate) {
68 me.column1.push({
69 xtype: 'pveCephFSSelector',
70 nodename: me.nodename,
71 name: 'fs-name',
72 bind: {
73 disabled: '{!pveceph}',
74 submitValue: '{pveceph}',
75 hidden: '{!pveceph}',
76 },
77 fieldLabel: gettext('FS Name'),
78 allowBlank: false,
79 }, {
80 xtype: 'textfield',
81 nodename: me.nodename,
82 name: 'fs-name',
83 bind: {
84 disabled: '{pveceph}',
85 submitValue: '{!pveceph}',
86 hidden: '{pveceph}',
87 },
88 fieldLabel: gettext('FS Name'),
89 });
90 }
91
92 me.column2 = [
93 {
94 xtype: 'pveContentTypeSelector',
95 cts: ['backup', 'iso', 'vztmpl', 'snippets'],
96 fieldLabel: gettext('Content'),
97 name: 'content',
98 value: 'backup',
99 multiSelect: true,
100 allowBlank: false,
101 },
102 ];
103
104 me.columnB = [
105 {
106 xtype: me.isCreate ? 'textfield' : 'displayfield',
107 name: 'keyring',
108 fieldLabel: 'Secret',
109 value: me.isCreate ? '' : '***********',
110 allowBlank: false,
111 bind: {
112 hidden: '{pveceph}',
113 disabled: '{pveceph}',
114 },
115 },
116 {
117 xtype: 'proxmoxcheckbox',
118 name: 'pveceph',
119 reference: 'pvecephRef',
120 bind: {
121 disabled: '{!pvecephPossible}',
122 value: '{pveceph}',
123 },
124 checked: true,
125 uncheckedValue: 0,
126 submitValue: false,
127 hidden: !me.isCreate,
128 boxLabel: gettext('Use Proxmox VE managed hyper-converged cephFS'),
129 },
130 ];
131
132 me.callParent();
133 },
134 });