]>
git.proxmox.com Git - pve-manager.git/blob - www/manager6/storage/BackupView.js
1 Ext
.define('PVE.storage.BackupView', {
2 extend
: 'PVE.storage.ContentView',
4 alias
: 'widget.pveStorageBackupView',
6 initComponent: function() {
9 var nodename
= me
.nodename
= me
.pveSelNode
.data
.node
;
11 throw "no node name specified";
14 var storage
= me
.storage
= me
.pveSelNode
.data
.storage
;
16 throw "no storage ID specified";
19 me
.content
= 'backup';
21 var sm
= me
.sm
= Ext
.create('Ext.selection.RowModel', {});
23 var reload = function() {
27 let pruneButton
= Ext
.create('Proxmox.button.Button', {
28 text
: gettext('Prune group'),
31 setBackupGroup: function(backup
) {
33 let name
= backup
.text
;
34 let vmid
= backup
.vmid
;
35 let format
= backup
.format
;
38 if (name
.startsWith('vzdump-lxc-') || format
=== "pbs-ct") {
40 } else if (name
.startsWith('vzdump-qemu-') || format
=== "pbs-vm") {
45 this.setText(gettext('Prune group') + ` ${vmtype}/${vmid}`);
48 this.setDisabled(false);
52 this.setText(gettext('Prune group'));
55 this.setDisabled(true);
57 handler: function(b
, e
, rec
) {
58 let win
= Ext
.create('PVE.window.Prune', {
62 backup_type
: this.vmtype
,
65 win
.on('destroy', reload
);
69 me
.on('selectionchange', function(model
, srecords
, eOpts
) {
70 if (srecords
.length
=== 1) {
71 pruneButton
.setBackupGroup(srecords
[0].data
);
73 pruneButton
.setBackupGroup(null);
79 xtype
: 'proxmoxButton',
80 text
: gettext('Restore'),
83 handler: function(b
, e
, rec
) {
85 if (PVE
.Utils
.volume_is_qemu_backup(rec
.data
.volid
, rec
.data
.format
)) {
87 } else if (PVE
.Utils
.volume_is_lxc_backup(rec
.data
.volid
, rec
.data
.format
)) {
93 var win
= Ext
.create('PVE.window.Restore', {
95 volid
: rec
.data
.volid
,
96 volidText
: PVE
.Utils
.render_storage_content(rec
.data
.volid
, {}, rec
),
100 win
.on('destroy', reload
);
104 xtype
: 'proxmoxButton',
105 text
: gettext('Show Configuration'),
108 handler: function(b
,e
,rec
) {
109 var win
= Ext
.create('PVE.window.BackupConfig', {
110 volume
: rec
.data
.volid
,
111 pveSelNode
: me
.pveSelNode