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
1d7b7f5a
Commit
1d7b7f5a
authored
Oct 20, 2011
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implement simple restore dialog
parent
404ff2c3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
1 deletion
+44
-1
OpenVZ.pm
PVE/API2/OpenVZ.pm
+3
-0
BackupView.js
www/manager/grid/BackupView.js
+41
-1
No files found.
PVE/API2/OpenVZ.pm
View file @
1d7b7f5a
...
...
@@ -245,6 +245,9 @@ __PACKAGE__->register_method({
if
(
PVE::Storage::
parse_volume_id
(
$ostemplate
,
1
))
{
$archive
=
PVE::Storage::
path
(
$stcfg
,
$ostemplate
);
}
else
{
raise_param_exc
({
archive
=>
"
Only root can pass arbitrary paths.
"
})
if
$user
ne
'
root@pam
';
$archive
=
abs_path
(
$ostemplate
);
}
die
"
can't find file '
$archive
'
\n
"
if
!
-
f
$archive
;
...
...
www/manager/grid/BackupView.js
View file @
1d7b7f5a
...
...
@@ -86,7 +86,47 @@ Ext.define('PVE.grid.BackupView', {
var
volid
=
rec
.
data
.
volid
;
console
.
log
(
"
RESRORE
"
+
volid
);
msg
=
'
Are you sure you want to restore from "
'
+
volid
+
'
"?
'
+
'
This will permanently erase current VM data.
'
;
Ext
.
Msg
.
confirm
(
'
Restore Confirmation
'
,
msg
,
function
(
btn
)
{
if
(
btn
!==
'
yes
'
)
{
return
;
}
var
url
;
var
params
=
{
vmid
:
vmid
,
force
:
1
};
if
(
vmtype
===
'
openvz
'
)
{
url
=
'
/nodes/
'
+
nodename
+
'
/openvz
'
;
params
.
ostemplate
=
volid
;
}
else
if
(
vmtype
===
'
qemu
'
)
{
url
=
'
/nodes/
'
+
nodename
+
'
/qemu
'
;
params
.
archive
=
volid
;
}
else
{
throw
'
unknown VM type
'
;
}
PVE
.
Utils
.
API2Request
({
url
:
url
,
params
:
params
,
method
:
'
POST
'
,
waitMsgTarget
:
me
,
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
();
}
});
});
}
});
...
...
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