]>
Commit | Line | Data |
---|---|---|
45071714 DM |
1 | Ext.define('PVE.storage.Browser', { |
2 | extend: 'PVE.panel.Config', | |
3 | alias: 'widget.PVE.storage.Browser', | |
4 | ||
c8802a60 | 5 | onlineHelp: 'chapter_storage', |
565a68be | 6 | |
45071714 DM |
7 | initComponent: function() { |
8 | var me = this; | |
9 | ||
10 | var nodename = me.pveSelNode.data.node; | |
11 | if (!nodename) { | |
12 | throw "no node name specified"; | |
13 | } | |
14 | ||
15 | var storeid = me.pveSelNode.data.storage; | |
16 | if (!storeid) { | |
17 | throw "no storage ID specified"; | |
18 | } | |
19 | ||
45071714 DM |
20 | |
21 | me.items = [ | |
22 | { | |
232c96e0 DC |
23 | title: gettext('Summary'), |
24 | xtype: 'pveStorageSummary', | |
7ccbcc6c | 25 | iconCls: 'fa fa-book', |
45071714 DM |
26 | itemId: 'summary' |
27 | } | |
28 | ]; | |
29 | ||
232c96e0 DC |
30 | var caps = Ext.state.Manager.get('GuiCap'); |
31 | ||
45071714 | 32 | Ext.apply(me, { |
177de3de | 33 | title: Ext.String.format(gettext("Storage {0} on node {1}"), |
45071714 DM |
34 | "'" + storeid + "'", "'" + nodename + "'"), |
35 | hstateid: 'storagetab' | |
36 | }); | |
37 | ||
38 | if (caps.storage['Datastore.Allocate']) { | |
39 | me.items.push({ | |
232c96e0 DC |
40 | xtype: 'pveStorageContentView', |
41 | title: gettext('Content'), | |
7ccbcc6c | 42 | iconCls: 'fa fa-th', |
45071714 DM |
43 | itemId: 'content' |
44 | }); | |
45 | } | |
46 | ||
47 | if (caps.storage['Permissions.Modify']) { | |
48 | me.items.push({ | |
232c96e0 DC |
49 | xtype: 'pveACLView', |
50 | title: gettext('Permissions'), | |
7ccbcc6c | 51 | iconCls: 'fa fa-unlock', |
45071714 DM |
52 | itemId: 'permissions', |
53 | path: '/storage/' + storeid | |
54 | }); | |
55 | } | |
56 | ||
57 | me.callParent(); | |
58 | } | |
59 | }); |