diff options
author | José Bollo <jose.bollo@iot.bzh> | 2017-08-31 13:43:31 +0200 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2017-08-31 13:43:31 +0200 |
commit | 80444c55e5debc4807df81342e537b5a4e6c4971 (patch) | |
tree | 00127e6d311ed1fb8907b8ce0fc6a3cdb896329a /test/monitoring | |
parent | 11e2d4395056c7bd2a618b4fa7ffdd70af05d14e (diff) |
verbosity: fixes split verbosity level 1 in 2 levels
The names wasn't correctly reported by monitor
Change-Id: Id382d7fdc3bb56c8c11c865439e7e18c257df3a2
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'test/monitoring')
-rw-r--r-- | test/monitoring/monitor.html | 1 | ||||
-rw-r--r-- | test/monitoring/monitor.js | 54 |
2 files changed, 30 insertions, 25 deletions
diff --git a/test/monitoring/monitor.html b/test/monitoring/monitor.html index e9572ba8..22f090ed 100644 --- a/test/monitoring/monitor.html +++ b/test/monitoring/monitor.html @@ -135,6 +135,7 @@ <span>Verbosity:</span> <select class="select"> <option value="error">error</option> + <option value="warning">warning</option> <option value="notice">notice</option> <option value="info">info</option> <option value="debug">debug</option> diff --git a/test/monitoring/monitor.js b/test/monitoring/monitor.js index bee87e4b..22d71824 100644 --- a/test/monitoring/monitor.js +++ b/test/monitoring/monitor.js @@ -296,32 +296,36 @@ function on_got_apis(obj) { for_all_nodes(api.node, ".trace-box", update_trace_box); } apis[api_name] = api; - get(".desc", api.node).textContent = api_desc.info.description || ""; - _.each(api_desc.paths, function(verb_desc, path_name){ - var verb_name = path_name.substring(1); - var verb = api.verbs[verb_name]; - if (!verb) { - verb = { - node: document.importNode(t_verb, true), - name: verb_name, - api: api - }; - verb.node.VERB = verb; - verb.node.dataset.verb = verb_name; - api.verbs[verb_name] = verb; - get(".name", verb.node).textContent = verb_name; - var g = verb_desc.get ||{}; - var r = g["responses"] || {}; - var t = r["200"] || {}; - var d = t.description || ""; - get(".desc", verb.node).textContent = d; - if (show_perms) { - var p = g["x-permissions"] || ""; - get(".perm", verb.node).textContent = p ? JSON.stringify(p, null, 1) : ""; + if (api_desc == null) { + get(".desc", api.node).textContent = "?? unrecoverable ??"; + } else { + get(".desc", api.node).textContent = api_desc.info.description || ""; + _.each(api_desc.paths, function(verb_desc, path_name){ + var verb_name = path_name.substring(1); + var verb = api.verbs[verb_name]; + if (!verb) { + verb = { + node: document.importNode(t_verb, true), + name: verb_name, + api: api + }; + verb.node.VERB = verb; + verb.node.dataset.verb = verb_name; + api.verbs[verb_name] = verb; + get(".name", verb.node).textContent = verb_name; + var g = verb_desc.get ||{}; + var r = g["responses"] || {}; + var t = r["200"] || {}; + var d = t.description || ""; + get(".desc", verb.node).textContent = d; + if (show_perms) { + var p = g["x-permissions"] || ""; + get(".perm", verb.node).textContent = p ? JSON.stringify(p, null, 1) : ""; + } + api.vnode.append(verb.node); } - api.vnode.append(verb.node); - } - }); + }); + } apis_node.append(api.node); }); inhibit = false; |