]>
git.proxmox.com Git - proxmox-backup.git/blob - www/NavigationTree.js
1 Ext
.define('PBS.store.NavigationStore', {
2 extend
: 'Ext.data.TreeStore',
4 storeId
: 'NavigationStore',
10 text
: gettext('Dashboard'),
11 iconCls
: 'fa fa-tachometer',
16 text
: gettext('Configuration'),
17 iconCls
: 'fa fa-gears',
18 path
: 'pbsSystemConfiguration',
22 text
: gettext('User Management'),
23 iconCls
: 'fa fa-user',
28 text
: gettext('Permissions'),
29 iconCls
: 'fa fa-unlock',
34 text
: gettext('Data Store'),
35 iconCls
: 'fa fa-archive',
36 path
: 'pbsDataStoreConfig',
40 text
: gettext('Subscription'),
41 iconCls
: 'fa fa-support',
42 path
: 'pbsSubscription',
48 text
: gettext('Administration'),
49 iconCls
: 'fa fa-wrench',
50 path
: 'pbsServerAdministration',
57 Ext
.define('PBS.view.main.NavigationTree', {
58 extend
: 'Ext.list.Tree',
59 xtype
: 'navigationtree',
62 xclass
: 'Ext.app.ViewController',
64 init: function(view
) {
66 view
.rstore
= Ext
.create('Proxmox.data.UpdateStore', {
69 storeid
: 'pbs-datastore-list',
70 model
: 'pbs-datastore-list'
73 view
.rstore
.on('load', this.onLoad
, this);
74 view
.on('destroy', view
.rstore
.stopUpdate
);
77 onLoad: function(store
, records
, success
) {
78 var view
= this.getView();
80 let root
= view
.getStore().getRoot();
82 if (!root
.findChild('path', 'pbsDataStoreStatus', false)) {
84 text
: gettext('Data Store'),
86 iconCls
: 'fa fa-archive',
87 path
: 'pbsDataStoreStatus',
92 var list
= root
.findChild('path', 'pbsDataStoreStatus', false);
93 var length
= records
.length
;
95 for (var i
= 0; i
< length
; i
++) {
96 var name
= records
[i
].id
;
97 lookup_hash
[name
] = true;
98 if (!list
.findChild('text', name
, false)) {
101 path
: 'pbsDataStoreContent:' + name
,
102 iconCls
: 'fa fa-database',
109 list
.eachChild(function(node
) {
110 var name
= node
.data
.text
;
111 if (!lookup_hash
[name
]) {
112 erase_list
.push(node
);
116 Ext
.Array
.forEach(erase_list
, function(node
) { node
.erase(); });
121 select: function(path
) {
123 var item
= me
.getStore().findRecord('path', path
, 0, false, true, true);
124 me
.setSelection(item
);
129 expanderFirst
: false,
130 store
: 'NavigationStore',