Skip to content
This repository has been archived by the owner on Aug 21, 2018. It is now read-only.

Commit

Permalink
Added ability to visualize release status.
Browse files Browse the repository at this point in the history
  • Loading branch information
xebialabs-se committed Aug 24, 2017
1 parent fe73821 commit 923463e
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 9 deletions.
Binary file modified images/designtime-overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/runtime-overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/main/app/img/completerelease.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/main/app/img/failedrelease.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion src/main/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
<div class="content-under-header">
<div class="relationship-legend-bar">
<span><img src="static/7.0/relationships/img/pin.svg" class="relationship-legend-icon"/><span class="relationship-legend">Current {{$ctrl.currentStart}}</span></span>
<span ng-if="$ctrl.currentStart != 'template'"><img src="static/7.0/relationships/img/release.svg" class="relationship-legend-icon"/><span class="relationship-legend">Release</span></span>
<span ng-if="$ctrl.currentStart != 'template'"><img src="static/7.0/relationships/img/release.svg" class="relationship-legend-icon"/><span class="relationship-legend">Release in progress</span></span>
<span ng-if="$ctrl.currentStart != 'template'"><img src="static/7.0/relationships/img/failedrelease.svg" class="relationship-legend-icon"/><span class="relationship-legend">Failed release</span></span>
<span ng-if="$ctrl.currentStart != 'template'"><img src="static/7.0/relationships/img/completerelease.svg" class="relationship-legend-icon"/><span class="relationship-legend">Completed release</span></span>
<span><img src="static/7.0/relationships/img/template.svg" class="relationship-legend-icon"/><span class="relationship-legend">Template</span></span>
</div>
<div>
Expand Down
4 changes: 4 additions & 0 deletions src/main/app/relationships/graph.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ export default class GraphController {
if (n.kind == "template") {
n.itemStyle = { normal: templateStyle, emphasis: templateStyle};
n.symbolSize= 28;
} else if (n.status == "FAILING" || n.status == "FAILED" || n.status == "ABORTED") {
n.itemStyle = { normal: { color: "#A94442"}, emphasis: { color: "#A94442"}};
} else if (n.status == "COMPLETED") {
n.itemStyle = { normal: { color: "#5DAE3F"}, emphasis: { color: "#5DAE3F"}};
} else {
n.itemStyle = { normal: { color: "#0099CC"}, emphasis: { color: "#0099CC"}};
}
Expand Down
14 changes: 6 additions & 8 deletions src/main/jython/relationships/fetch_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
from com.xebialabs.deployit.exception import NotFoundException

class Node(object):
def __init__(self, name, id, kind):
def __init__(self, name, id, kind, status):
self.name = name
self.id = id
self.kind = kind

self.status = status

class Edge(object):
def __init__(self, source_id, target_id, name, curve=0):
Expand Down Expand Up @@ -40,8 +40,8 @@ def add_edge(self, source_id, target_id, task_name):

self.edges.append(Edge(source_id, target_id, task_name, curve))

def add_node(self, name, id, kind):
node = Node(name, id, kind)
def add_node(self, name, id, kind, status):
node = Node(name, id, kind, status)
self.nodes.append(node)
self.processed_nodes.append(id)
return node
Expand All @@ -52,7 +52,7 @@ def node_processed(self, id):
def to_dict(self):
dict = {"nodes": [], "edges": []}
for n in self.nodes:
dict["nodes"].append({"name": n.id, "label": n.name, "kind": n.kind})
dict["nodes"].append({"name": n.id, "label": n.name, "kind": n.kind, "status": str(n.status)})
for e in self.edges:
dict["edges"].append({"source": e.source, "target": e.target, "label": e.name, "curve": e.curve,
"cardinality": e.cardinality})
Expand Down Expand Up @@ -80,7 +80,7 @@ def analyse(id, graph):
if not graph.node_processed(id):
release = read(id)
kind = "template" if str(release.status) == "TEMPLATE" else "release"
node = graph.add_node(release.title, id, kind)
node = graph.add_node(release.title, id, kind, release.status)
[process_tasks(p.tasks, graph, node) for p in release.phases]


Expand All @@ -92,8 +92,6 @@ def read(id):



#releaseId = request.query['releaseId']

id=request.query["id"]
id = id.replace("-", "/")
graph = Graph()
Expand Down

0 comments on commit 923463e

Please sign in to comment.