mirror of
https://git.proxmox.com/git/pmg-gui
synced 2025-08-15 21:55:56 +00:00
add RestoreWindow and use it
this adds a Restore window, where the user can choose what he wants to restore Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
75a6815975
commit
db13d7e3c5
@ -14,6 +14,57 @@ Ext.define('pmg-backup-list', {
|
|||||||
idProperty: 'filename'
|
idProperty: 'filename'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Ext.define('PMG.RestoreWindow', {
|
||||||
|
extend: 'Proxmox.window.Edit',
|
||||||
|
xtype: 'pmgRestoreWindow',
|
||||||
|
|
||||||
|
showProgress: true,
|
||||||
|
title: gettext('Restore'),
|
||||||
|
isCreate: true,
|
||||||
|
method: 'POST',
|
||||||
|
submitText: gettext('Restore'),
|
||||||
|
fieldDefaults: {
|
||||||
|
labelWidth: 150
|
||||||
|
},
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
xtype: 'proxmoxcheckbox',
|
||||||
|
name: 'config',
|
||||||
|
fieldLabel: gettext('System Configuration')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
xtype: 'proxmoxcheckbox',
|
||||||
|
name: 'database',
|
||||||
|
value: 1,
|
||||||
|
uncheckedValue: 0,
|
||||||
|
fieldLabel: gettext('Rule Database'),
|
||||||
|
listeners: {
|
||||||
|
change: function(cb, value) {
|
||||||
|
var me = this;
|
||||||
|
me.up().down('field[name=statistic]').setDisabled(!value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
xtype: 'proxmoxcheckbox',
|
||||||
|
name: 'statistic',
|
||||||
|
fieldLabel: gettext('Statistic')
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
initComponent: function() {
|
||||||
|
var me = this;
|
||||||
|
|
||||||
|
if (!me.filename) {
|
||||||
|
throw "no filename given";
|
||||||
|
}
|
||||||
|
|
||||||
|
me.url = "/nodes/" + Proxmox.NodeName + "/backup/" + encodeURIComponent(me.filename);
|
||||||
|
|
||||||
|
me.callParent();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
Ext.define('PMG.BackupRestore', {
|
Ext.define('PMG.BackupRestore', {
|
||||||
extend: 'Ext.grid.GridPanel',
|
extend: 'Ext.grid.GridPanel',
|
||||||
xtype: 'pmgBackupRestore',
|
xtype: 'pmgBackupRestore',
|
||||||
@ -52,22 +103,9 @@ Ext.define('PMG.BackupRestore', {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Proxmox.Utils.API2Request({
|
Ext.create('PMG.RestoreWindow', {
|
||||||
url: "/nodes/" + Proxmox.NodeName + "/backup/" + encodeURIComponent(rec.data.filename),
|
filename: rec.data.filename
|
||||||
method: 'POST',
|
}).show();
|
||||||
waitMsgTarget: me,
|
|
||||||
failure: function (response, opts) {
|
|
||||||
Ext.Msg.alert(gettext('Error'), response.htmlStatus);
|
|
||||||
},
|
|
||||||
success: function(response, opts) {
|
|
||||||
var upid = response.result.data;
|
|
||||||
|
|
||||||
var win = Ext.create('Proxmox.window.TaskViewer', {
|
|
||||||
upid: upid
|
|
||||||
});
|
|
||||||
win.show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onAfterRemove: function(btn, res) {
|
onAfterRemove: function(btn, res) {
|
||||||
|
Loading…
Reference in New Issue
Block a user