proxmox-backup/www/NavigationTree.js
Thomas Lamprecht 84b9eced26 ui: add simple dashboard
just a starting point, code ported initially over from PMG, some
minor things are handled differently though, we have not multiple
nodes (for now) so it's very 'localhost' centric.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-12-18 17:29:07 +01:00

61 lines
1.1 KiB
JavaScript

Ext.define('PBS.store.NavigationStore', {
extend: 'Ext.data.TreeStore',
storeId: 'NavigationStore',
root: {
expanded: true,
children: [
{
text: gettext('Dashboard'),
iconCls: 'fa fa-tachometer',
path: 'pbsDashboard',
leaf: true
},
{
text: gettext('Configuration'),
iconCls: 'fa fa-gears',
path: 'pbsSystemConfiguration',
expanded: true,
children: [
{
text: gettext('Data Store'),
iconCls: 'fa fa-envelope-o',
path: 'pbsDataStoreConfig',
leaf: true
},
{
text: gettext('Subscription'),
iconCls: 'fa fa-support',
path: 'pbsSubscription',
leaf: true
}
]
},
{
text: gettext('Administration'),
iconCls: 'fa fa-wrench',
path: 'pbsServerAdministration',
leaf: true
}
]
}
});
Ext.define('PBS.view.main.NavigationTree', {
extend: 'Ext.list.Tree',
xtype: 'navigationtree',
select: function(path) {
var me = this;
var item = me.getStore().findRecord('path', path, 0, false, true, true);
me.setSelection(item);
},
animation: false,
expanderOnly: true,
expanderFirst: false,
store: 'NavigationStore',
ui: 'nav'
});