X-Git-Url: http://git.onelab.eu/?p=sface.git;a=blobdiff_plain;f=sface%2Fscreens%2Fmainscreen.py;h=a4351855aeb254435702a3c4210a105948a6ed87;hp=23926065c567d3309dde8b4a75ec5b8f56bbefa8;hb=ce5e4c9baaac18e6e3afe3de2316c71990c20cca;hpb=b64036ac10d8faf553f8faa2d43aa0717dba5b6b;ds=sidebyside diff --git a/sface/screens/mainscreen.py b/sface/screens/mainscreen.py index 2392606..a435185 100644 --- a/sface/screens/mainscreen.py +++ b/sface/screens/mainscreen.py @@ -287,6 +287,20 @@ class NodeFilterProxyModel(QSortFilterProxyModel): return False return True + def lessThan(self, left, right): + l_str = str(left.data().toString()) + r_str = str(right.data().toString()) + + # make sure default_tags appears before everything else + if l_str.startswith(default_tags): + return True + + if r_str.startswith(default_tags): + return False + + return (l_str < r_str) + + class SliceWidget(QWidget): def __init__(self, parent): QWidget.__init__(self, parent) @@ -612,10 +626,14 @@ class SliceWidget(QWidget): self.nodeView.appendRow(nodeItem, tagstring, membership=tag_status['in'], kind = "attribute") for node in sliver_nodes: + nodeType = None + if ("hardware_types" in node): + hardware_types = [x["name"] for x in node["hardware_types"]] + nodeType = ",".join(hardware_types) nodeItem = self.nodeView.appendRow(networkItem, node["component_name"], nodeStatus=node.get("boot_state", ""), - #nodeType=node.get("rspec.get_node_sliver_type(node, network), + nodeType=nodeType, membership=node_status['in'], kind="node") @@ -629,10 +647,14 @@ class SliceWidget(QWidget): kind="attribute") for node in available_nodes: + nodeType = None + if ("hardware_types" in node): + hardware_types = [x["name"] for x in node["hardware_types"]] + nodeType = ",".join(hardware_types) self.nodeView.appendRow(networkItem, node["component_name"], nodeStatus = node.get("boot_state", ""), - #nodeType= resources.get_node_sliver_type(node, network), + nodeType=nodeType, membership=node_status['out'], kind="node")