]>
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('Data Store'),
29 iconCls
: 'fa fa-archive',
30 path
: 'pbsDataStoreConfig',
34 text
: gettext('Subscription'),
35 iconCls
: 'fa fa-support',
36 path
: 'pbsSubscription',
42 text
: gettext('Administration'),
43 iconCls
: 'fa fa-wrench',
44 path
: 'pbsServerAdministration',
51 Ext
.define('PBS.view.main.NavigationTree', {
52 extend
: 'Ext.list.Tree',
53 xtype
: 'navigationtree',
56 xclass
: 'Ext.app.ViewController',
58 init: function(view
) {
60 view
.rstore
= Ext
.create('Proxmox.data.UpdateStore', {
63 storeid
: 'pbs-datastore-list',
64 model
: 'pbs-datastore-list'
67 view
.rstore
.on('load', this.onLoad
, this);
68 view
.on('destroy', view
.rstore
.stopUpdate
);
71 onLoad: function(store
, records
, success
) {
72 var view
= this.getView();
74 let root
= view
.getStore().getRoot();
76 if (!root
.findChild('path', 'pbsDataStoreStatus', false)) {
78 text
: gettext('Data Store'),
80 iconCls
: 'fa fa-archive',
81 path
: 'pbsDataStoreStatus',
86 var list
= root
.findChild('path', 'pbsDataStoreStatus', false);
87 var length
= records
.length
;
89 for (var i
= 0; i
< length
; i
++) {
90 var name
= records
[i
].id
;
91 lookup_hash
[name
] = true;
92 if (!list
.findChild('text', name
, false)) {
95 path
: 'pbsDataStoreContent:' + name
,
96 iconCls
: 'fa fa-database',
103 list
.eachChild(function(node
) {
104 var name
= node
.data
.text
;
105 if (!lookup_hash
[name
]) {
106 erase_list
.push(node
);
110 Ext
.Array
.forEach(erase_list
, function(node
) { node
.erase(); });
115 select: function(path
) {
117 var item
= me
.getStore().findRecord('path', path
, 0, false, true, true);
118 me
.setSelection(item
);
123 expanderFirst
: false,
124 store
: 'NavigationStore',