From 2443e3fe4b26b0eee04e203482aa4534384f8e15 Mon Sep 17 00:00:00 2001 From: itsikkes Date: Sat, 13 Aug 2016 19:37:49 +0300 Subject: [PATCH] mark living monkeys in the UI --- monkey_island/cc/admin/ui/index.html | 1 + monkey_island/cc/admin/ui/js/monkeys-admin.js | 21 ++++++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/monkey_island/cc/admin/ui/index.html b/monkey_island/cc/admin/ui/index.html index c39a1072b..d312114e2 100644 --- a/monkey_island/cc/admin/ui/index.html +++ b/monkey_island/cc/admin/ui/index.html @@ -102,6 +102,7 @@
  • - tunnel
  • - scan
  • - patient zero
  • +
  • - living monkey
  • diff --git a/monkey_island/cc/admin/ui/js/monkeys-admin.js b/monkey_island/cc/admin/ui/js/monkeys-admin.js index 86bf5b62d..b0b6dee22 100644 --- a/monkey_island/cc/admin/ui/js/monkeys-admin.js +++ b/monkey_island/cc/admin/ui/js/monkeys-admin.js @@ -42,6 +42,9 @@ const EDGE_COLOR_PARENT = "red"; const EDGE_COLOR_TUNNEL = "blue"; const EDGE_COLOR_SCAN = "gray"; +const NODE_MANUAL_RUN_COLOR = "red"; +const NODE_ALIVE_STROKECOLOR = "#aeeaae"; + // General options // If variable from local storage != null, assign it, otherwise set it's default value. @@ -193,6 +196,14 @@ function updateMonkeys() { index = getMonkeyIndex(new_monkeys[i].guid); if(index != -1) { monkeys[index] = new_monkeys[i]; + monNode = getNode(monkeys[index].id); + if (!monkeys[index].dead) { + monNode.font.strokeWidth = 1; + monNode.font.strokeColor = NODE_ALIVE_STROKECOLOR; + } + else { + monNode.font.strokeWidth = 0; + } } else { @@ -238,7 +249,7 @@ function createNodes() { function createMonkeyNode(monkey) { var title = undefined; - var font = undefined; + var font = {}; var img = "monkey"; if (monkey.description) { @@ -252,15 +263,19 @@ function createMonkeyNode(monkey) { img = ICONS_DIR + img + ICONS_EXT; if (monkey.parent == null) { - font = { color: 'red' }; + font['color'] = NODE_MANUAL_RUN_COLOR; } else { for (var i=0; i