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
8304868e
Commit
8304868e
authored
Sep 10, 2012
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add snapshot rollback and delete buttons
parent
52586927
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
5 deletions
+63
-5
SnapshotTree.js
www/manager/qemu/SnapshotTree.js
+63
-5
No files found.
www/manager/qemu/SnapshotTree.js
View file @
8304868e
...
...
@@ -5,8 +5,6 @@ Ext.define('PVE.qemu.SnapshotTree', {
reload
:
function
()
{
var
me
=
this
;
console
.
log
(
"
RELOAD
"
);
PVE
.
Utils
.
API2Request
({
url
:
'
/nodes/
'
+
me
.
nodename
+
'
/qemu/
'
+
me
.
vmid
+
'
/snapshot
'
,
waitMsgTarget
:
me
,
...
...
@@ -35,8 +33,6 @@ Ext.define('PVE.qemu.SnapshotTree', {
}
});
console
.
dir
(
root
);
me
.
setRootNode
(
root
);
}
});
...
...
@@ -55,11 +51,73 @@ Ext.define('PVE.qemu.SnapshotTree', {
throw
"
no VM ID specified
"
;
}
var
sm
=
Ext
.
create
(
'
Ext.selection.RowModel
'
,
{});
me
.
rollbackBtn
=
new
PVE
.
button
.
Button
({
text
:
gettext
(
'
Rollback
'
),
disabled
:
true
,
selModel
:
sm
,
enableFn
:
function
(
record
)
{
return
record
&&
record
.
data
&&
record
.
data
.
name
&&
record
.
data
.
name
!==
'
__current
'
;
},
handler
:
function
(
btn
,
event
)
{
var
rec
=
sm
.
getSelection
()[
0
];
if
(
!
rec
)
{
return
;
}
var
snapname
=
rec
.
data
.
name
;
PVE
.
Utils
.
API2Request
({
url
:
'
/nodes/
'
+
me
.
nodename
+
'
/qemu/
'
+
me
.
vmid
+
'
/snapshot/
'
+
snapname
+
'
/rollback
'
,
method
:
'
POST
'
,
waitMsgTarget
:
me
,
callback
:
function
()
{
me
.
reload
();
},
failure
:
function
(
response
,
opts
)
{
Ext
.
Msg
.
alert
(
gettext
(
'
Error
'
),
response
.
htmlStatus
);
}
});
}
});
me
.
deleteBtn
=
new
PVE
.
button
.
Button
({
text
:
gettext
(
'
Delete
'
),
disabled
:
true
,
selModel
:
sm
,
confirmMsg
:
gettext
(
'
Are you sure you want to remove this entry
'
),
enableFn
:
function
(
record
)
{
return
record
&&
record
.
data
&&
record
.
data
.
name
&&
record
.
data
.
name
!==
'
__current
'
;
},
handler
:
function
(
btn
,
event
)
{
var
rec
=
sm
.
getSelection
()[
0
];
if
(
!
rec
)
{
return
;
}
var
snapname
=
rec
.
data
.
name
;
PVE
.
Utils
.
API2Request
({
url
:
'
/nodes/
'
+
me
.
nodename
+
'
/qemu/
'
+
me
.
vmid
+
'
/snapshot/
'
+
snapname
,
method
:
'
DELETE
'
,
waitMsgTarget
:
me
,
callback
:
function
()
{
me
.
reload
();
},
failure
:
function
(
response
,
opts
)
{
Ext
.
Msg
.
alert
(
gettext
(
'
Error
'
),
response
.
htmlStatus
);
}
});
}
});
Ext
.
apply
(
me
,
{
layout
:
'
fit
'
,
rootVisible
:
false
,
animate
:
false
,
selModel
:
sm
,
tbar
:
[
me
.
rollbackBtn
,
me
.
deleteBtn
],
fields
:
[
'
name
'
,
'
description
'
],
columns
:
[
{
...
...
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