Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pve-manager
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
pve-manager
Commits
67ef4210
Commit
67ef4210
authored
Oct 19, 2011
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve qemu backup dialog
parent
23237d94
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
108 additions
and
31 deletions
+108
-31
Backup.js
www/manager/qemu/Backup.js
+107
-30
Config.js
www/manager/qemu/Config.js
+1
-1
No files found.
www/manager/qemu/Backup.js
View file @
67ef4210
Ext
.
define
(
'
PVE.qemu.Backup
'
,
{
extend
:
'
Ext.window.Window
'
,
resizable
:
false
,
initComponent
:
function
()
{
var
me
=
this
;
if
(
!
me
.
nodename
)
{
throw
"
no node name specified
"
;
}
if
(
!
me
.
vmid
)
{
throw
"
no VM ID specified
"
;
}
var
storagesel
=
Ext
.
create
(
'
PVE.form.StorageSelector
'
,
{
nodename
:
me
.
nodename
,
name
:
'
storage
'
,
value
:
me
.
storage
,
fieldLabel
:
'
Storage
'
,
storageContent
:
'
backup
'
,
allowBlank
:
false
});
me
.
formPanel
=
Ext
.
create
(
'
Ext.form.Panel
'
,
{
bodyPadding
:
10
,
border
:
false
,
fieldDefaults
:
{
labelWidth
:
100
,
anchor
:
'
100%
'
},
items
:
[
storagesel
,
{
xtype
:
'
pvecheckbox
'
,
name
:
'
compress
'
,
uncheckedValue
:
0
,
value
:
1
,
fieldLabel
:
'
Compress
'
},
{
xtype
:
'
pvecheckbox
'
,
name
:
'
snapshot
'
,
uncheckedValue
:
0
,
value
:
1
,
fieldLabel
:
'
Snapshot mode
'
}
]
});
var
form
=
me
.
formPanel
.
getForm
();
var
submitBtn
=
Ext
.
create
(
'
Ext.Button
'
,
{
text
:
'
Backup
'
,
handler
:
function
(){
var
storage
=
storagesel
.
getValue
();
var
msg
=
'
Start backup to storage "
'
+
storage
+
'
"
'
;
var
values
=
form
.
getValues
();
console
.
dir
(
me
.
vmid
,
me
.
nodename
,
values
.
online
);
PVE
.
Utils
.
API2Request
({
url
:
'
/nodes/
'
+
me
.
nodename
+
'
/vzdump
'
,
params
:
{
storage
:
storage
,
vmid
:
me
.
vmid
,
compress
:
values
.
compress
,
snapshot
:
values
.
snapshot
},
method
:
'
POST
'
,
failure
:
function
(
response
,
opts
)
{
Ext
.
Msg
.
alert
(
'
Error
'
,
response
.
htmlStatus
);
},
success
:
function
(
response
,
options
)
{
var
upid
=
response
.
result
.
data
;
var
win
=
Ext
.
create
(
'
PVE.window.TaskViewer
'
,
{
upid
:
upid
});
win
.
show
();
me
.
close
();
}
});
}
});
Ext
.
apply
(
me
,
{
title
:
"
Backup VM
"
+
me
.
vmid
,
width
:
350
,
modal
:
true
,
layout
:
'
auto
'
,
border
:
false
,
items
:
[
me
.
formPanel
],
buttons
:
[
submitBtn
],
});
me
.
callParent
();
}
});
Ext
.
define
(
'
PVE.qemu.BackupView
'
,
{
extend
:
'
Ext.grid.GridPanel
'
,
alias
:
[
'
widget.pveQemuBackup
'
],
alias
:
[
'
widget.pveQemuBackup
View
'
],
initComponent
:
function
()
{
...
...
@@ -58,38 +158,15 @@ Ext.define('PVE.qemu.Backup', {
var
backup_btn
=
new
Ext
.
Button
({
text
:
'
Backup now
'
,
handler
:
function
(){
var
storage
=
storagesel
.
getValue
();
var
msg
=
'
Start backup to storage "
'
+
storage
+
'
"
'
;
Ext
.
Msg
.
confirm
(
'
Backup Confirmation
'
,
msg
,
function
(
btn
)
{
if
(
btn
!==
'
yes
'
)
{
return
;
}
PVE
.
Utils
.
API2Request
({
url
:
'
/nodes/
'
+
nodename
+
'
/vzdump
'
,
params
:
{
storage
:
storage
,
handler
:
function
()
{
var
win
=
Ext
.
create
(
'
PVE.qemu.Backup
'
,
{
nodename
:
nodename
,
vmid
:
vmid
,
compress
:
1
,
snapshot
:
1
},
method
:
'
POST
'
,
failure
:
function
(
response
,
opts
)
{
Ext
.
Msg
.
alert
(
'
Error
'
,
response
.
htmlStatus
);
},
success
:
function
(
response
,
options
)
{
var
upid
=
response
.
result
.
data
;
var
win
=
Ext
.
create
(
'
PVE.window.TaskViewer
'
,
{
upid
:
upid
storage
:
storagesel
.
getValue
()
});
win
.
show
();
}
});
});
}
});
var
restore_btn
=
new
Ext
.
Button
({
text
:
'
Restore
'
,
...
...
www/manager/qemu/Config.js
View file @
67ef4210
...
...
@@ -46,7 +46,7 @@ Ext.define('PVE.qemu.Config', {
vmid
:
vmid
},
{
xtype
:
'
pveQemuBackup
'
,
xtype
:
'
pveQemuBackup
View
'
,
title
:
'
Backup
'
,
itemId
:
'
backup
'
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment