Permalink
Browse files

Added logic to set error/warning icon on task nodes, and also not dis…

…play duration/percentage on task nodes if they are undefined (similar to call nodes)
  • Loading branch information...
1 parent 58c29a3 commit 99fcc8ad8c661cb57bc7bf430025abed1cbde03e objectiser committed Nov 30, 2012
Showing with 19 additions and 2 deletions.
  1. +19 −2 gadgets/src/main/webapp/calltrace-gadget/gadget.xml
@@ -100,13 +100,19 @@
}
} else {
- treeObject["title"] = getTruncatedTitle(task.description) + " [" + task.duration + "ms] (" + task.percentage + "%)";
+ treeObject["title"] = getTaskTypeTitle(task);
treeObject["isFolder"] = false;
treeObject['description'] = task.description;
treeObject['duration'] = task.duration;
treeObject['percentage'] = task.percentage;
treeObject['type'] = task.type;
- treeObject['addClass'] = 'task';
+ if (task.status == "Warning") {
+ treeObject['addClass'] = 'warning';
+ } else if (task.status == "Fail") {
+ treeObject['addClass'] = 'error';
+ } else {
+ treeObject['addClass'] = 'task';
+ }
}
if (task.properties != undefined) {
@@ -136,6 +142,17 @@
return title;
}
+ function getTaskTypeTitle(task) {
+ var title = getTruncatedTitle(task.description);
+ if (task.duration != undefined) {
+ title = title + "[" + task.duration + "ms]";
+ }
+ if (task.percentage != undefined) {
+ title = title + "(" + task.percentage + "%)";
+ }
+ return title;
+ }
+
function initialiseTree(data) {
// Attach the dynatree widget to an existing <div id="tree"> element
// and pass the tree options as an argument to the dynatree() function:

0 comments on commit 99fcc8a

Please sign in to comment.