Skip to content
Browse files

Merge pull request #3 from objectiser/CT

Added logic to set error/warning icon on task nodes, and also not displa...
  • Loading branch information...
2 parents 58c29a3 + 99fcc8a commit a6a91a76058b0ae945bd3997d921370395c6f3a7 objectiser committed Nov 30, 2012
Showing with 19 additions and 2 deletions.
  1. +19 −2 gadgets/src/main/webapp/calltrace-gadget/gadget.xml
View
21 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 a6a91a7

Please sign in to comment.
Something went wrong with that request. Please try again.