]> git.proxmox.com Git - proxmox-backup.git/blame - www/datastore/Panel.js
ui: move prune and gc widget to config
[proxmox-backup.git] / www / datastore / Panel.js
CommitLineData
c0ac2074
DC
1Ext.define('PBS.DataStorePanel', {
2 extend: 'Ext.tab.Panel',
3 alias: 'widget.pbsDataStorePanel',
4 mixins: ['Proxmox.Mixin.CBind'],
5
6 cbindData: function(initalConfig) {
7 let me = this;
8 return {
9 aclPath: `/datastore/${me.datastore}`,
10 };
11 },
12
1dceaed1
DC
13 stateId: 'pbs-datastore-panel',
14 stateful: true,
15
16 stateEvents: ['tabchange'],
17
18 applyState: function(state) {
19 let me = this;
240b2ffb 20 if (state.tab !== undefined && me.rendered) {
1dceaed1 21 me.setActiveTab(state.tab);
240b2ffb
DC
22 } else if (state.tab) {
23 // if we are not rendered yet, defer setting the activetab
a502bc56 24 setTimeout(() => me.setActiveTab(state.tab), 10);
1dceaed1
DC
25 }
26 },
27
28 getState: function() {
29 let me = this;
30 return {
31 tab: me.getActiveTab().getItemId(),
32 };
33 },
34
c0ac2074
DC
35 border: false,
36 defaults: {
37 border: false,
38 },
39
31112c79
DM
40 tools: [PBS.Utils.get_help_tool("datastore_intro")],
41
c0ac2074
DC
42 items: [
43 {
68931742
DC
44 xtype: 'pbsDataStoreSummary',
45 title: gettext('Summary'),
46 itemId: 'summary',
028d0a13 47 iconCls: 'fa fa-book',
3ea14859
DC
48 cbind: {
49 datastore: '{datastore}',
50 },
51 },
52 {
68931742
DC
53 xtype: 'pbsDataStoreContent',
54 itemId: 'content',
028d0a13 55 iconCls: 'fa fa-th',
c0ac2074
DC
56 cbind: {
57 datastore: '{datastore}',
58 },
59 },
1a0d3d11 60 {
8e07e44a 61 xtype: 'pbsPruneAndGC',
68931742 62 itemId: 'prunegc',
028d0a13
DC
63 iconCls: 'fa fa-trash-o',
64 cbind: {
65 datastore: '{datastore}',
66 },
67 },
68 {
69 iconCls: 'fa fa-refresh',
70 itemId: 'syncjobs',
71 xtype: 'pbsSyncJobView',
72 cbind: {
73 datastore: '{datastore}',
74 },
75 },
76 {
77 iconCls: 'fa fa-check-circle',
78 itemId: 'verifyjobs',
79 xtype: 'pbsVerifyJobView',
1a0d3d11
DM
80 cbind: {
81 datastore: '{datastore}',
82 },
83 },
b614b29b
TL
84 {
85 xtype: 'pbsDatastoreOptionView',
86 itemId: 'options',
87 title: gettext('Options'),
88 iconCls: 'fa fa-cog',
89 cbind: {
90 datastore: '{datastore}',
91 },
92 },
c0ac2074
DC
93 {
94 itemId: 'acl',
95 xtype: 'pbsACLView',
028d0a13 96 iconCls: 'fa fa-unlock',
c0ac2074
DC
97 cbind: {
98 aclPath: '{aclPath}',
33612525 99 datastore: '{datastore}',
c0ac2074
DC
100 },
101 },
102 ],
103
104 initComponent: function() {
105 let me = this;
58f950c5 106 me.title = `${gettext("Datastore")}: ${me.datastore}`;
240b2ffb
DC
107 // remove invalid activeTab settings
108 if (me.activeTab && !me.items.some((item) => item.itemId === me.activeTab)) {
109 delete me.activeTab;
110 }
c0ac2074
DC
111 me.callParent();
112 },
113});