]> git.proxmox.com Git - pve-manager.git/blame - www/manager6/data/PermPathStore.js
pve6to7: re-work output of description length check and add passes too
[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' },
9 { 'value': '/nodes' },
10 { 'value': '/pool' },
11 { 'value': '/storage' },
12 { 'value': '/vms' },
3b1cb257
DC
13 ],
14
15 constructor: function(config) {
16 var me = this;
17
18 config = config || {};
19
20 me.callParent([config]);
21
baed2b7c 22 let donePaths = {};
3b1cb257
DC
23 me.suspendEvents();
24 PVE.data.ResourceStore.each(function(record) {
baed2b7c 25 let path;
3b1cb257 26 switch (record.get('type')) {
baed2b7c 27 case 'node': path = '/nodes/' + record.get('text');
3b1cb257 28 break;
baed2b7c 29 case 'qemu': path = '/vms/' + record.get('vmid');
3b1cb257 30 break;
baed2b7c 31 case 'lxc': path = '/vms/' + record.get('vmid');
3b1cb257 32 break;
baed2b7c 33 case 'storage': path = '/storage/' + record.get('storage');
3b1cb257 34 break;
baed2b7c 35 case 'pool': path = '/pool/' + record.get('pool');
3b1cb257
DC
36 break;
37 }
baed2b7c
TL
38 if (path !== undefined && !donePaths[path]) {
39 me.add({ value: path });
40 donePaths[path] = 1;
41 }
3b1cb257
DC
42 });
43 me.resumeEvents();
44
45 me.fireEvent('refresh', me);
46 me.fireEvent('datachanged', me);
47
48 me.sort({
49 property: 'value',
d6d084dc 50 direction: 'ASC',
3b1cb257 51 });
d6d084dc 52 },
3b1cb257 53});