]> git.proxmox.com Git - pve-manager.git/blame - www/manager6/data/PermPathStore.js
ui: followup: add missing semicolon
[pve-manager.git] / www / manager6 / data / PermPathStore.js
CommitLineData
cd84df4c 1Ext.define('PVE.data.PermPathStore', {
3b1cb257
DC
2 extend: 'Ext.data.Store',
3 alias: 'store.pvePermPath',
d6d084dc 4 fields: ['value'],
3b1cb257
DC
5 autoLoad: false,
6 data: [
d6d084dc
TL
7 { 'value': '/' },
8 { 'value': '/access' },
80e364cc
DC
9 { 'value': '/access/groups' },
10 { 'value': '/access/realm' },
d6d084dc
TL
11 { 'value': '/nodes' },
12 { 'value': '/pool' },
f28f6113 13 { 'value': '/sdn/zones' },
d6d084dc
TL
14 { 'value': '/storage' },
15 { 'value': '/vms' },
3b1cb257
DC
16 ],
17
18 constructor: function(config) {
19 var me = this;
20
21 config = config || {};
22
23 me.callParent([config]);
24
baed2b7c 25 let donePaths = {};
3b1cb257
DC
26 me.suspendEvents();
27 PVE.data.ResourceStore.each(function(record) {
baed2b7c 28 let path;
3b1cb257 29 switch (record.get('type')) {
baed2b7c 30 case 'node': path = '/nodes/' + record.get('text');
3b1cb257 31 break;
baed2b7c 32 case 'qemu': path = '/vms/' + record.get('vmid');
3b1cb257 33 break;
baed2b7c 34 case 'lxc': path = '/vms/' + record.get('vmid');
3b1cb257 35 break;
f28f6113
AD
36 case 'sdn': path = '/sdn/zones/' + record.get('sdn');
37 break;
baed2b7c 38 case 'storage': path = '/storage/' + record.get('storage');
3b1cb257 39 break;
baed2b7c 40 case 'pool': path = '/pool/' + record.get('pool');
3b1cb257
DC
41 break;
42 }
baed2b7c
TL
43 if (path !== undefined && !donePaths[path]) {
44 me.add({ value: path });
45 donePaths[path] = 1;
46 }
3b1cb257
DC
47 });
48 me.resumeEvents();
49
50 me.fireEvent('refresh', me);
51 me.fireEvent('datachanged', me);
52
53 me.sort({
54 property: 'value',
d6d084dc 55 direction: 'ASC',
3b1cb257 56 });
d6d084dc 57 },
3b1cb257 58});