summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2017-08-25 00:22:43 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2017-08-25 00:22:43 +0200
commitb5a4f1433c69651c79f29353139a3aa54dd25c85 (patch)
tree3d76cf72743477e3b49611523930fc85fb8c83fd
parent99f9504a15ff302c4aa6842ad2f5095263c23c3f (diff)
monitoring: updated demo with dark theme
Change-Id: Ibb77655cd614553bf0090bf5ffa64180d1279f8b Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r--test/monitoring/iot-bzh-logo-small.png (renamed from test/iot-bzh-logo-small.png)bin14449 -> 14449 bytes
-rw-r--r--test/monitoring/monitor-base.css179
-rw-r--r--test/monitoring/monitor-demo.css280
-rw-r--r--test/monitoring/monitor-pastel.css (renamed from test/monitoring/monitor.css)126
-rw-r--r--test/monitoring/monitor.html3
-rw-r--r--test/monitoring/monitor.js8
6 files changed, 469 insertions, 127 deletions
diff --git a/test/iot-bzh-logo-small.png b/test/monitoring/iot-bzh-logo-small.png
index 2c3b2aef..2c3b2aef 100644
--- a/test/iot-bzh-logo-small.png
+++ b/test/monitoring/iot-bzh-logo-small.png
Binary files differ
diff --git a/test/monitoring/monitor-base.css b/test/monitoring/monitor-base.css
new file mode 100644
index 00000000..a394a44c
--- /dev/null
+++ b/test/monitoring/monitor-base.css
@@ -0,0 +1,179 @@
+/*******************************************************************/
+/* top */
+body {
+ position: fixed;
+ top: 0px;
+ bottom: 0px;
+ left: 0px;
+ right: 0px;
+}
+
+body.on #params,
+body.off #controls,
+body.off #logmsg-box { display: none; }
+
+/*******************************************************************/
+/* head */
+#head {
+ position: relative;
+}
+
+#logo {
+ float: left;
+}
+
+#connected {
+ float: right;
+}
+
+/*******************************************************************/
+/* connection area */
+
+/*******************************************************************/
+/* main area */
+
+#work {
+ position: relative;
+ top: 0px;
+ bottom: 0px;
+ left: 0px;
+ right: 0px;
+}
+
+#main {
+ position: relative;
+ top: 0px;
+ bottom: 0px;
+ left: 0px;
+ right: 0px;
+}
+
+.fillfix {
+ width: 100%;
+ height: 100%;
+}
+
+#controls {
+ position: absolute;
+ width: 250px;
+ left: 0px;
+ top: 0px;
+ bottom: 0px;
+ overflow: auto;
+ margin-bottom: 75px;
+}
+
+#logmsg-box {
+ position: absolute;
+ width: 250px;
+ right: 0px;
+ top: 0px;
+ bottom: 0px;
+ font-size: smaller;
+ overflow: auto;
+ margin-bottom: 75px;
+}
+
+#trace-events {
+ overflow: auto;
+ position: absolute;
+ right: 250px;
+ left: 250px;
+ top: 0px;
+ bottom: 0px;
+ margin-bottom: 75px;
+}
+
+/*******************************************************************/
+/* setting for apis */
+
+/*******************************************************************/
+/* setting of verbs */
+
+/*******************************************************************/
+/* setting for traces */
+
+#apis .trace-evt {
+ visibility: hidden;
+ display: none;
+}
+
+/*******************************************************************/
+/* tiny button */
+
+/*******************************************************************/
+/* display of logmsg */
+
+/*******************************************************************/
+/* close box */
+.close {
+ float: right;
+}
+
+/*******************************************************************/
+/* open / close */
+.opclo { float: right; }
+.api > .opclo { float: left; }
+
+.closed > .closedoff { visibility: hidden; display: none; }
+
+.opened > .closedon { visibility: hidden; display: none; }
+
+/*******************************************************************/
+/* setting for traceevents */
+
+.traceevent {
+ position: relative;
+}
+
+.traceevent.closed {
+ overflow: hidden;
+}
+
+.traceevent .time {
+ float: left;
+}
+
+.traceevent.closed:hover {
+ overflow: visible;
+ z-index: 100;
+ position: relative;
+}
+
+.traceevent.closed:not(:hover) .content {
+ display: none;
+}
+
+.traceevent.closed:hover .content {
+ display: block;
+ background: inherit;
+ left: 40%;
+ max-width: 55%;
+ position: absolute;
+}
+
+.traceevent {
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+.traceevent table.object tr td:nth-child(2) {
+ -webkit-user-select: text;
+ -moz-user-select: text;
+ -ms-user-select: text;
+ user-select: text;
+}
+
+/*******************************************************************/
+/* json format */
+
+/*******************************************************************/
+/* clear fix */
+
+.clearfix::after {
+ content: "";
+ clear: both;
+ display: table;
+}
diff --git a/test/monitoring/monitor-demo.css b/test/monitoring/monitor-demo.css
new file mode 100644
index 00000000..b14ac1a7
--- /dev/null
+++ b/test/monitoring/monitor-demo.css
@@ -0,0 +1,280 @@
+/*******************************************************************/
+/* top */
+body {
+ margin: 2px;
+ background: url(content-background-car-wide.png) center/cover;
+ color: cyan;
+ font-family: "Lucida Console", Monaco, monospace;
+}
+
+/*******************************************************************/
+/* head */
+
+#logo {
+ background: url(iot-bzh-logo-small.png) center/contain no-repeat;
+ height: 60px;
+ width: 200px;
+}
+
+#title {
+ text-align: center;
+ font-weight: bolder;
+ font-size: 40px;
+ padding: 10px;
+ margin: auto;
+}
+
+#connected {
+ margin: 5px;
+ padding: 10px;
+ border: solid 4px;
+ border-radius: 7px;
+}
+
+#connected.ok { color: #8f8; }
+#connected.error { color: #f44; }
+
+/*******************************************************************/
+/* connection area */
+
+
+#params {
+ border: dashed 4px red;
+ padding: 10px;
+ margin: 10px;
+ border-radius: 0px 50px;
+}
+
+#connect {
+ float: right;
+ margin: 20px;
+}
+
+/*******************************************************************/
+/* main area */
+
+#global {
+ background: #ff5;
+}
+
+.expert {
+ text-align: center;
+ font-weight: bolder;
+ font-size: larger;
+ text-decoration: underline;
+}
+
+#trace-events {
+ margin-left: 10px;
+ margin-right: 10px;
+}
+
+/*******************************************************************/
+/* setting for apis */
+
+#controls .api {
+ margin: 2px;
+ padding: 5px;
+ color: #ff5;
+ border: solid 2px;
+ border-radius: 7px;
+}
+#controls .api .opclo { background-color: #ff5; }
+
+#controls #apis .api { color: #fa5; }
+#controls #apis .api .opclo { background-color: #fa5; }
+
+#controls .api .name {
+ text-align: center;
+ font-weight: bolder;
+ font-size: larger;
+ text-decoration: underline;
+}
+
+#controls .api .desc {
+ text-align: center;
+}
+
+#controls .api .verb {
+ margin-left: 5px;
+}
+
+/*******************************************************************/
+/* setting of verbs */
+.verb .name {
+ font-weight: bolder;
+ text-decoration: underline;
+}
+
+.verb .desc {
+ font-size: smaller;
+}
+
+.verb .perm {
+ font-size: 8px;
+ text-align: right;
+ color: blue;
+}
+
+/*******************************************************************/
+/* setting for traces */
+
+.trace-box {
+ margin: 1px;
+ padding: 1px 1px 1px 10px;
+ border: solid 1px;
+ border-radius: 10px 0px;
+ font-size: smaller;
+}
+
+.trace-title {
+ font-weight: bolder;
+}
+.trace-item {
+ margin-left: 10px;
+}
+
+/*******************************************************************/
+/* tiny button */
+.x-button {
+ font-size: larger;
+ text-align: center;
+ margin: 5px;
+ padding: 10px;
+ border: dashed 2px #888;
+ border-radius: 0px 10px;
+ font-weight: bolder;
+}
+
+.x-button:hover {
+ border: solid 2px #aaa;
+}
+
+.x-button:active {
+ border: solid 4px cyan;
+ padding: 8px;
+}
+
+/*******************************************************************/
+/* display of logmsg */
+.logmsg {
+ margin-right: 2px;
+ margin-bottom: 3px;
+ padding: 2px;
+ font-size: smaller;
+ min-height: 20px;
+ border-radius: 3px;
+ border: solid 1px #f44; /* red by default */
+}
+
+.logmsg.call { border-color: #ee3; }
+.logmsg.retok { border-color: #8e8; }
+.logmsg.event { border-color: #d6f; }
+.logmsg.error { border-color: #f66; }
+.logmsg.trace { border-color: #aaa; }
+
+.logmsg .tag { text-align: center; color: black; font-weight: bolder; margin: -2px -2px 1px -2px; }
+.logmsg.call .tag { background: #ee3; }
+.logmsg.retok .tag { background: #8e8; }
+.logmsg.event .tag { background: #d6f; }
+.logmsg.error .tag { background: #f66; }
+.logmsg.trace .tag { background: #aaa; }
+
+/*******************************************************************/
+/* close box */
+.close {
+ width: 10;
+ height: 10;
+ background-image: url(cross.png);
+ background-size: contain;
+}
+
+/*******************************************************************/
+/* open / close */
+
+.opclo { width: 10; height: 10; background-size: contain; background-color: cyan; border-radius: 3px; padding: 2px; }
+
+.closed > .opclo { background-image: url(down.png); }
+.opened > .opclo { background-image: url(up.png); }
+
+/*******************************************************************/
+/* setting for traceevents */
+
+.traceevent {
+ margin: 1px;
+ padding: 2px;
+ min-height: 14px;
+ border: solid 1px;
+ border-radius: 0px 5px 5px 5px;
+}
+
+/*
+.traceevent.request, .trace-box.request { background: #ffd: }
+.traceevent.daemon, .trace-box.daemon { background: #fdf; }
+.traceevent.service, .trace-box.service { background: #ddf; }
+.traceevent.event, .trace-box.event { background: #dfd; }
+*/
+.traceevent.request, .trace-box.request { color: #ff0; }
+.traceevent.daemon, .trace-box.daemon { color: #66f; }
+.traceevent.service, .trace-box.service { color: #0f0; }
+.traceevent.event, .trace-box.event { color: #f0d; }
+
+.traceevent.closed {
+ max-height: 16px;
+}
+
+.traceevent .time {
+ height: 16px;
+ margin: -2px 8px 2px -2px;
+ padding: 1px 3px;
+ background: black;
+ color: white;
+ font-weight: bolder;
+}
+
+.traceevent .tag {
+ font-weight: bolder;
+}
+
+.traceevent.closed:hover .content {
+ margin: 5px;
+ padding: 5px;
+ border: solid 1px;
+ border-radius: 0px 5px 5px 5px;
+ box-shadow: 10px 10px #dd8;
+ background-color: rgba(0,0,0,0.8);
+}
+
+.traceevent table.object tr td:nth-child(1) {
+ text-align: right;
+ font-weight: bolder;
+ text-decoration: underline;
+}
+
+.traceevent table.object tr td:nth-child(2) {
+/*
+ border: solid 1px black;
+*/
+ background-color: rgba(0,0,0,0.4);
+ padding: 0px 4px;
+}
+
+.traceevent table {
+ color: cyan;
+}
+
+/*******************************************************************/
+/* aesthetic clue */
+.select {
+ padding: 0px;
+}
+
+/*******************************************************************/
+/* json format */
+
+.json.string { color: #fff; }
+.json.number { color: #ec0; }
+.json.boolean { color: #0f0; }
+.json.null { color: #0f0; }
+.json.key { color: #99f; }
+
diff --git a/test/monitoring/monitor.css b/test/monitoring/monitor-pastel.css
index ff7fd305..4de3730e 100644
--- a/test/monitoring/monitor.css
+++ b/test/monitoring/monitor-pastel.css
@@ -2,26 +2,10 @@
/* top */
body {
margin: 0px;
- position: fixed;
- top: 0px;
- bottom: 0px;
- left: 0px;
- right: 0px;
}
-body.on #params,
-body.off #controls,
-body.off #logmsg-box { display: none; }
-
/*******************************************************************/
/* head */
-#head {
- position: relative;
-}
-
-#logo {
- float: left;
-}
#title {
font-weight: bolder;
@@ -31,7 +15,6 @@ body.off #logmsg-box { display: none; }
}
#connected {
- float: right;
margin: 5px;
padding: 10px;
border: solid 2px black;
@@ -66,62 +49,10 @@ body.off #logmsg-box { display: none; }
/*******************************************************************/
/* main area */
-#work {
- position: relative;
- top: 0px;
- bottom: 0px;
- left: 0px;
- right: 0px;
-}
-
-#main {
- position: relative;
- top: 0px;
- bottom: 0px;
- left: 0px;
- right: 0px;
-}
-
-.fillfix {
- width: 100%;
- height: 100%;
-}
-
-#controls {
- position: absolute;
- width: 250px;
- left: 0px;
- top: 0px;
- bottom: 0px;
- overflow: auto;
- margin-bottom: 75px;
-}
-
-#logmsg-box {
- position: absolute;
- width: 250px;
- right: 0px;
- top: 0px;
- bottom: 0px;
- font-size: smaller;
- overflow: auto;
- margin-bottom: 75px;
-}
-
#global {
background: #ff5;
}
-#trace-events {
- overflow: auto;
- position: absolute;
- right: 250px;
- left: 250px;
- top: 0px;
- bottom: 0px;
- margin-bottom: 75px;
-}
-
.expert {
text-align: center;
font-weight: bolder;
@@ -138,7 +69,6 @@ body.off #logmsg-box { display: none; }
border: solid 1px black;
background: #ff5;
border-radius: 7px;
- overflow: auto;
}
#controls #apis .api {
@@ -195,11 +125,6 @@ body.off #logmsg-box { display: none; }
margin-left: 10px;
}
-#apis .trace-evt {
- visibility: hidden;
- display: none;
-}
-
/*******************************************************************/
/* tiny button */
.x-button {
@@ -244,7 +169,6 @@ body.off #logmsg-box { display: none; }
/*******************************************************************/
/* close box */
.close {
- float: right;
width: 16;
height: 16;
background-image: url(cross.png);
@@ -253,21 +177,17 @@ body.off #logmsg-box { display: none; }
/*******************************************************************/
/* open / close */
-.opclo { float: right; width: 16; height: 16; }
-.api > .opclo { float: left; width: 16; height: 16; background: #feb; border: solid 1px black; border-radius: 4px; }
-.closed > .opclo { background-image: url(down.png); background-size: contain; }
-.opened > .opclo { background-image: url(up.png); background-size: contain; }
+.opclo { width: 16; height: 16; background-size: contain; }
+.api > .opclo { background: #feb; border: solid 1px black; border-radius: 4px; }
-.closed > .closedoff { visibility: hidden; display: none; }
-
-.opened > .closedon { visibility: hidden; display: none; }
+.closed > .opclo { background-image: url(down.png); }
+.opened > .opclo { background-image: url(up.png); }
/*******************************************************************/
/* setting for traceevents */
.traceevent {
- position: relative;
margin: 1px;
padding: 2px;
min-height: 16px;
@@ -282,38 +202,22 @@ body.off #logmsg-box { display: none; }
.traceevent.closed {
max-height: 16px;
- overflow: hidden;
}
.traceevent .time {
height: 16px;
margin: -2px 8px 2px -2px;
padding: 1px 3px;
- float: left;
background: black;
color: white;
font-weight: bolder;
}
-.traceevent.closed:hover {
- overflow: visible;
- z-index: 100;
- position: relative;
-}
-
-.traceevent.closed:not(:hover) .content {
- display: none;
-}
-
.traceevent.closed:hover .content {
- display: block;
- background: inherit;
margin: 5px;
padding: 5px;
border: solid 1px black;
border-radius: 0px 5px 5px 5px;
- left: 50%;
- position: absolute;
box-shadow: 10px 10px grey;
}
@@ -327,20 +231,6 @@ body.off #logmsg-box { display: none; }
padding: 0px 4px;
}
-.traceevent {
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
-}
-
-.traceevent table.object tr td:nth-child(2) {
- -webkit-user-select: text;
- -moz-user-select: text;
- -ms-user-select: text;
- user-select: text;
-}
-
/*******************************************************************/
/* aesthetic clue */
.select {
@@ -356,11 +246,3 @@ body.off #logmsg-box { display: none; }
.json.null { color: magenta; }
.json.key { color: red; }
-/*******************************************************************/
-/* clear fix */
-
-.clearfix::after {
- content: "";
- clear: both;
- display: table;
-}
diff --git a/test/monitoring/monitor.html b/test/monitoring/monitor.html
index 1a1d49cb..763bef2f 100644
--- a/test/monitoring/monitor.html
+++ b/test/monitoring/monitor.html
@@ -1,7 +1,8 @@
<html>
<head>
<title>Monitoring</title>
- <link href="monitor.css" rel="stylesheet">
+ <link href="monitor-base.css" rel="stylesheet">
+ <link href="monitor-demo.css" rel="stylesheet">
<script type="text/javascript" src="underscore-min.js"></script>
<script type="text/javascript" src="AFB.js"></script>
<script type="text/javascript" src="monitor.js"></script>
diff --git a/test/monitoring/monitor.js b/test/monitoring/monitor.js
index c4f24a00..6926260f 100644
--- a/test/monitoring/monitor.js
+++ b/test/monitoring/monitor.js
@@ -164,15 +164,15 @@ function on_error_apis(obj) {
function do_call(api_verb, request, onsuccess, onerror) {
var call = api_verb + "(" + JSON.stringify(request, null, 1) + ")";
- add_logmsg(call, "", "call");
+ add_logmsg("send request", call, "call");
ws.call(api_verb, request).then(
function(obj){
- add_logmsg(call + " SUCCESS:", JSON.stringify(obj, null, 1), "retok");
+ add_logmsg("receive success", call + " -> " + JSON.stringify(obj, null, 1), "retok");
if (onsuccess)
onsuccess(obj);
},
function(obj){
- add_logmsg(call + " ERROR:", JSON.stringify(obj, null, 1), "reterr");
+ add_logmsg("receive error", call + " -> ", JSON.stringify(obj, null, 1), "reterr");
if (onerror)
onerror(obj);
});
@@ -377,7 +377,7 @@ function gottraceevent(obj) {
})[type](desc);
var tab = makeobj(desc, 4);
if ("data" in data)
- makeobjitem(tab, 1, "data", data.data);
+ makeobjitem(tab, 2, "data", data.data);
get(".content", x).append(tab);
trace_events_node.append(x);
}