Commit d30bec0a authored by Dietmar Maurer's avatar Dietmar Maurer

use different icons for running servers

parent 19a22b7c
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
.pve-itype-icon-openvz, .pve-itype-icon-openvz,
.pve-itype-icon-openvz-running, .pve-itype-icon-openvz-running,
.pve-itype-icon-node, .pve-itype-icon-node,
.pve-itype-icon-node-running,
.pve-itype-icon-storage, .pve-itype-icon-storage,
.pve-itype-icon-itype .pve-itype-icon-itype
{ {
...@@ -53,7 +54,14 @@ ...@@ -53,7 +54,14 @@
.x-tree-node-server, .x-tree-node-server,
.x-grid-tree-node-expanded .x-tree-node-server .x-grid-tree-node-expanded .x-tree-node-server
{ {
background-image:url(../images/network-server.png); background-image:url(../images/network-server-off.png);
}
.pve-itype-icon-node-running,
.x-tree-node-server-running,
.x-grid-tree-node-expanded .x-tree-node-server-running
{
background-image:url(../images/network-server-on.png);
} }
.pve-itype-icon-storage, .pve-itype-icon-storage,
......
...@@ -16,6 +16,8 @@ IMAGES = ${GNOME_IMAGES} \ ...@@ -16,6 +16,8 @@ IMAGES = ${GNOME_IMAGES} \
memory.png \ memory.png \
processor.png \ processor.png \
proxmox_logo.png \ proxmox_logo.png \
network-server-on.png \
network-server-off.png \
blank.gif blank.gif
.PHONY: install .PHONY: install
......
...@@ -49,7 +49,7 @@ Ext.define('PVE.data.ResourceStore', { ...@@ -49,7 +49,7 @@ Ext.define('PVE.data.ResourceStore', {
hidden: true, hidden: true,
convert: function(value, record) { convert: function(value, record) {
var info = record.data; var info = record.data;
if (info.type === 'qemu' || info.type === 'openvz') { if (info.type === 'qemu' || info.type === 'openvz' || info.type === 'node') {
return (Ext.isNumeric(info.uptime) && (info.uptime > 0)); return (Ext.isNumeric(info.uptime) && (info.uptime > 0));
} else { } else {
return false; return false;
......
...@@ -81,8 +81,7 @@ Ext.define('PVE.tree.ResourceTree', { ...@@ -81,8 +81,7 @@ Ext.define('PVE.tree.ResourceTree', {
} }
}, },
// private setIconCls: function(info) {
addChildSorted: function(node, info) {
var me = this; var me = this;
var defaults = PVE.tree.ResourceTree.typeDefaults[info.type]; var defaults = PVE.tree.ResourceTree.typeDefaults[info.type];
...@@ -93,7 +92,15 @@ Ext.define('PVE.tree.ResourceTree', { ...@@ -93,7 +92,15 @@ Ext.define('PVE.tree.ResourceTree', {
info.iconCls = defaults.iconCls; info.iconCls = defaults.iconCls;
} }
} }
},
// private
addChildSorted: function(node, info) {
var me = this;
me.setIconCls(info);
var defaults;
if (info.groupbyid) { if (info.groupbyid) {
info.text = info.groupbyid; info.text = info.groupbyid;
if (info.type === 'type') { if (info.type === 'type') {
...@@ -242,14 +249,20 @@ Ext.define('PVE.tree.ResourceTree', { ...@@ -242,14 +249,20 @@ Ext.define('PVE.tree.ResourceTree', {
if (!item || changed) { if (!item || changed) {
//console.log("REM UID: " + key + " ITEM " + olditem.data.id); //console.log("REM UID: " + key + " ITEM " + olditem.data.id);
delete index[key]; if (olditem.isLeaf()) {
var parentNode = olditem.parentNode; delete index[key];
//var expanded = parentNode.isExpanded(); var parentNode = olditem.parentNode;
//if (expanded) parentNode.removeChild(olditem, true);
//parentNode.collapse(); } else {
parentNode.removeChild(olditem, true); if (item && changed) {
//if (expanded) olditem.beginEdit();
//parentNode.expand(); //console.log("REM UPDATE UID: " + key + " ITEM " + item.data.running);
var info = olditem.data;
Ext.apply(info, item.data);
me.setIconCls(info);
olditem.commit();
}
}
} }
} }
} }
......
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