Commit 38524f51 authored by Dietmar Maurer's avatar Dietmar Maurer

add icons for snapshots

parent 8304868e
...@@ -84,6 +84,18 @@ ...@@ -84,6 +84,18 @@
background-image:url(../images/drive-harddisk.png); background-image:url(../images/drive-harddisk.png);
} }
.x-tree-node-snapshot,
.x-grid-tree-node-expanded .x-tree-node-snapshot
{
background-image:url(../images/snapshot.png);
}
.x-tree-node-now,
.x-grid-tree-node-expanded .x-tree-node-now
{
background-image:url(../images/now.png);
}
.pve-itype-icon-pool, .pve-itype-icon-pool,
.x-tree-node-pool, .x-tree-node-pool,
.x-grid-tree-pool-expanded .x-tree-node-pool .x-grid-tree-pool-expanded .x-tree-node-pool
......
...@@ -19,6 +19,8 @@ GNOME_IMAGES = \ ...@@ -19,6 +19,8 @@ GNOME_IMAGES = \
computer.png computer.png
IMAGES = ${GNOME_IMAGES} \ IMAGES = ${GNOME_IMAGES} \
snapshot.png \
now.png \
computer-on.png \ computer-on.png \
memory.png \ memory.png \
processor.png \ processor.png \
......
...@@ -19,6 +19,11 @@ Ext.define('PVE.qemu.SnapshotTree', { ...@@ -19,6 +19,11 @@ Ext.define('PVE.qemu.SnapshotTree', {
Ext.Array.each(response.result.data, function(item) { Ext.Array.each(response.result.data, function(item) {
item.leaf = true; item.leaf = true;
item.children = []; item.children = [];
if (item.name === '__current') {
item.iconCls = 'x-tree-node-now';
} else {
item.iconCls = 'x-tree-node-snapshot';
}
idhash[item.name] = item; idhash[item.name] = item;
}); });
...@@ -118,7 +123,10 @@ Ext.define('PVE.qemu.SnapshotTree', { ...@@ -118,7 +123,10 @@ Ext.define('PVE.qemu.SnapshotTree', {
animate: false, animate: false,
selModel: sm, selModel: sm,
tbar: [ me.rollbackBtn, me.deleteBtn ], tbar: [ me.rollbackBtn, me.deleteBtn ],
fields: ['name', 'description' ], fields: [
'name', 'description',
{ name: 'snaptime', type: 'date', dateFormat: 'timestamp' }
],
columns: [ columns: [
{ {
xtype: 'treecolumn', xtype: 'treecolumn',
...@@ -127,12 +135,19 @@ Ext.define('PVE.qemu.SnapshotTree', { ...@@ -127,12 +135,19 @@ Ext.define('PVE.qemu.SnapshotTree', {
width: 200, width: 200,
renderer: function(value, metaData, record) { renderer: function(value, metaData, record) {
if (value === '__current') { if (value === '__current') {
return "CWD"; return "NOW";
} else { } else {
return value; return value;
} }
} }
}, },
{
xtype: 'datecolumn',
text: gettext('Date'),
dataIndex: 'snaptime',
format: 'Y-m-d H:i:s',
width: 120
},
{ {
text: gettext('Description'), text: gettext('Description'),
dataIndex: 'description', dataIndex: 'description',
...@@ -148,7 +163,7 @@ Ext.define('PVE.qemu.SnapshotTree', { ...@@ -148,7 +163,7 @@ Ext.define('PVE.qemu.SnapshotTree', {
] ]
}); });
me.callParent(); me.callParent();
me.on('show', me.reload); me.on('show', me.reload);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment