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
52586927
Commit
52586927
authored
Sep 10, 2012
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add snapshot tree to GUI
parent
4fc7afdf
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
108 additions
and
0 deletions
+108
-0
Makefile
www/manager/Makefile
+1
-0
StateProvider.js
www/manager/StateProvider.js
+1
-0
Config.js
www/manager/qemu/Config.js
+8
-0
SnapshotTree.js
www/manager/qemu/SnapshotTree.js
+98
-0
No files found.
www/manager/Makefile
View file @
52586927
...
...
@@ -100,6 +100,7 @@ JSSRC= \
qemu/StartupEdit.js
\
qemu/ScsiHwEdit.js
\
qemu/Options.js
\
qemu/SnapshotTree.js
\
qemu/Config.js
\
qemu/CreateWizard.js
\
openvz/StatusView.js
\
...
...
www/manager/StateProvider.js
View file @
52586927
...
...
@@ -49,6 +49,7 @@ Ext.define('PVE.StateProvider', {
hprefix
:
'
v1
'
,
compDict
:
{
snapshot
:
29
,
ha
:
28
,
support
:
27
,
pool
:
26
,
...
...
www/manager/qemu/Config.js
View file @
52586927
...
...
@@ -152,6 +152,14 @@ Ext.define('PVE.qemu.Config', {
});
}
if
(
caps
.
vms
[
'
VM.Snapshot
'
])
{
me
.
items
.
push
({
title
:
gettext
(
'
Snapshots
'
),
xtype
:
'
pveQemuSnapshotTree
'
,
itemId
:
'
snapshot
'
});
}
if
(
caps
.
vms
[
'
Permissions.Modify
'
])
{
me
.
items
.
push
({
xtype
:
'
pveACLView
'
,
...
...
www/manager/qemu/SnapshotTree.js
0 → 100644
View file @
52586927
Ext
.
define
(
'
PVE.qemu.SnapshotTree
'
,
{
extend
:
'
Ext.tree.Panel
'
,
alias
:
[
'
widget.pveQemuSnapshotTree
'
],
reload
:
function
()
{
var
me
=
this
;
console
.
log
(
"
RELOAD
"
);
PVE
.
Utils
.
API2Request
({
url
:
'
/nodes/
'
+
me
.
nodename
+
'
/qemu/
'
+
me
.
vmid
+
'
/snapshot
'
,
waitMsgTarget
:
me
,
method
:
'
GET
'
,
failure
:
function
(
response
,
opts
)
{
PVE
.
Utils
.
setErrorMask
(
me
,
response
.
htmlStatus
);
},
success
:
function
(
response
,
opts
)
{
var
idhash
=
{};
var
root
=
{
name
:
'
__root
'
,
expanded
:
true
,
children
:
[]
};
Ext
.
Array
.
each
(
response
.
result
.
data
,
function
(
item
)
{
item
.
leaf
=
true
;
item
.
children
=
[];
idhash
[
item
.
name
]
=
item
;
});
Ext
.
Array
.
each
(
response
.
result
.
data
,
function
(
item
)
{
if
(
item
.
parent
&&
idhash
[
item
.
parent
])
{
var
parent_item
=
idhash
[
item
.
parent
];
parent_item
.
children
.
push
(
item
);
parent_item
.
leaf
=
false
;
parent_item
.
expanded
=
true
;
}
else
{
root
.
children
.
push
(
item
);
}
});
console
.
dir
(
root
);
me
.
setRootNode
(
root
);
}
});
},
initComponent
:
function
()
{
var
me
=
this
;
me
.
nodename
=
me
.
pveSelNode
.
data
.
node
;
if
(
!
me
.
nodename
)
{
throw
"
no node name specified
"
;
}
me
.
vmid
=
me
.
pveSelNode
.
data
.
vmid
;
if
(
!
me
.
vmid
)
{
throw
"
no VM ID specified
"
;
}
Ext
.
apply
(
me
,
{
layout
:
'
fit
'
,
rootVisible
:
false
,
animate
:
false
,
fields
:
[
'
name
'
,
'
description
'
],
columns
:
[
{
xtype
:
'
treecolumn
'
,
text
:
gettext
(
'
Name
'
),
dataIndex
:
'
name
'
,
width
:
200
,
renderer
:
function
(
value
,
metaData
,
record
)
{
if
(
value
===
'
__current
'
)
{
return
"
CWD
"
;
}
else
{
return
value
;
}
}
},
{
text
:
gettext
(
'
Description
'
),
dataIndex
:
'
description
'
,
flex
:
1
,
renderer
:
function
(
value
,
metaData
,
record
)
{
if
(
record
.
data
.
name
===
'
__current
'
)
{
return
gettext
(
"
You are here!
"
);
}
else
{
return
value
;
}
}
}
]
});
me
.
callParent
();
me
.
on
(
'
show
'
,
me
.
reload
);
}
});
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