]>
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('Data Store'),
23 iconCls
: 'fa fa-archive',
24 path
: 'pbsDataStoreConfig',
28 text
: gettext('Subscription'),
29 iconCls
: 'fa fa-support',
30 path
: 'pbsSubscription',
36 text
: gettext('Administration'),
37 iconCls
: 'fa fa-wrench',
38 path
: 'pbsServerAdministration',
45 Ext
.define('PBS.view.main.NavigationTree', {
46 extend
: 'Ext.list.Tree',
47 xtype
: 'navigationtree',
50 xclass
: 'Ext.app.ViewController',
52 init: function(view
) {
54 view
.rstore
= Ext
.create('Proxmox.data.UpdateStore', {
57 storeid
: 'pbs-datastore-list',
58 model
: 'pbs-datastore-list'
61 view
.rstore
.on('load', this.onLoad
, this);
62 view
.on('destroy', view
.rstore
.stopUpdate
);
65 onLoad: function(store
, records
, success
) {
66 var view
= this.getView();
68 let root
= view
.getStore().getRoot();
70 if (!root
.findChild('path', 'pbsDataStoreStatus', false)) {
72 text
: gettext('Data Store'),
74 iconCls
: 'fa fa-archive',
75 path
: 'pbsDataStoreStatus',
80 var list
= root
.findChild('path', 'pbsDataStoreStatus', false);
81 var length
= records
.length
;
83 for (var i
= 0; i
< length
; i
++) {
84 var name
= records
[i
].id
;
85 lookup_hash
[name
] = true;
86 if (!list
.findChild('text', name
, false)) {
89 path
: 'pbsDataStoreContent:' + name
,
90 iconCls
: 'fa fa-database',
97 list
.eachChild(function(node
) {
98 var name
= node
.data
.text
;
99 if (!lookup_hash
[name
]) {
100 erase_list
.push(node
);
104 Ext
.Array
.forEach(erase_list
, function(node
) { node
.erase(); });
109 select: function(path
) {
111 var item
= me
.getStore().findRecord('path', path
, 0, false, true, true);
112 me
.setSelection(item
);
117 expanderFirst
: false,
118 store
: 'NavigationStore',