Commit d30bec0a authored by Dietmar Maurer's avatar Dietmar Maurer

use different icons for running servers

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