]>
Commit | Line | Data |
---|---|---|
7f17f744 DC |
1 | Ext.define('PBS.admin.Directorylist', { |
2 | extend: 'Ext.grid.Panel', | |
3 | xtype: 'pbsDirectoryList', | |
4 | ||
5 | stateful: true, | |
6 | stateId: 'grid-node-directory', | |
7 | ||
8 | emptyText: gettext('No Mount-Units found'), | |
9 | ||
10 | controller: { | |
11 | xclass: 'Ext.app.ViewController', | |
12 | ||
13 | createDirectory: function() { | |
14 | let me = this; | |
15 | Ext.create('PBS.window.CreateDirectory', { | |
16 | listeners: { | |
17 | destroy: function() { | |
18 | me.reload(); | |
19 | }, | |
20 | }, | |
21 | }).show(); | |
22 | }, | |
23 | ||
24 | reload: function() { | |
25 | let me = this; | |
26 | let store = me.getView().getStore(); | |
27 | store.load(); | |
28 | store.sort(); | |
29 | }, | |
30 | ||
31 | init: function(view) { | |
32 | let me = this; | |
33 | Proxmox.Utils.monStoreErrors(view, view.getStore(), true); | |
34 | me.reload(); | |
35 | }, | |
36 | }, | |
37 | ||
38 | ||
39 | rootVisible: false, | |
40 | useArrows: true, | |
41 | ||
42 | tbar: [ | |
43 | { | |
44 | text: gettext('Reload'), | |
45 | iconCls: 'fa fa-refresh', | |
46 | handler: 'reload', | |
47 | }, | |
48 | { | |
49 | text: gettext('Create') + ': Directory', | |
50 | handler: 'createDirectory', | |
51 | }, | |
52 | ], | |
53 | ||
54 | columns: [ | |
55 | { | |
56 | text: gettext('Path'), | |
57 | dataIndex: 'path', | |
58 | flex: 1, | |
59 | }, | |
60 | { | |
61 | header: gettext('Device'), | |
62 | flex: 1, | |
63 | dataIndex: 'device', | |
64 | }, | |
65 | { | |
66 | header: gettext('Filesystem'), | |
67 | width: 100, | |
68 | dataIndex: 'filesystem', | |
69 | }, | |
70 | { | |
71 | header: gettext('Options'), | |
72 | width: 100, | |
73 | dataIndex: 'options', | |
74 | }, | |
75 | { | |
76 | header: gettext('Unit File'), | |
77 | hidden: true, | |
78 | dataIndex: 'unitfile', | |
79 | }, | |
80 | ], | |
81 | ||
82 | store: { | |
83 | fields: ['path', 'device', 'filesystem', 'options', 'unitfile'], | |
84 | proxy: { | |
85 | type: 'proxmox', | |
86 | url: '/api2/json/nodes/localhost/disks/directory', | |
87 | }, | |
88 | sorters: 'path', | |
89 | }, | |
90 | }); |