/*
- * Copyright (C) 2017 "IoT.bzh"
+ * Copyright (C) 2015-2020 "IoT.bzh"
* Author: José Bollo <jose.bollo@iot.bzh>
*
* Licensed under the Apache License, Version 2.0 (the "License");
at("param-host").value = document.location.hostname;
at("param-port").value = document.location.port;
var args = new URLSearchParams(document.location.search.substring(1));
- at("param-token").value = args.get("x-afb-token") || args.get("token") || "hello";
+ at("param-token").value = args.get("x-afb-token") || args.get("token") || "HELLO";
document.onbeforeunload = on_disconnect;
name: api_name
};
api.node.API = api;
- api.node.dataset.api = api_name;
+ api.node.dataset.apiname = api_name;
api.vnode = get(".verbs", api.node);
get(".name", api.node).textContent = api_name;
var s = get(".verbosity select", api.node);
function set_trace_box(node, clear) {
var api = node;
- while (api && !api.dataset.api)
+ while (api && !api.dataset.apiname)
api = api.parentElement;
- var tag = api.dataset.api + "/" + node.dataset.trace;
+ var tag = api.dataset.apiname + "/" + node.dataset.trace;
var value = false;
for_all_nodes(node, "input", function(n){ if (n.checked) value = n.value; });
if (clear)
if (value != "no") {
var spec = {tag: tag, name: "trace"};
spec[node.dataset.trace] = value;
- if (api.dataset.api != "*")
- spec.api = api.dataset.api;
+ if (api.dataset.apiname != "*")
+ spec.apiname = api.dataset.apiname;
do_call("monitor/trace", {add: spec});
}
}
x.className = x.className + " " + type;
get(".time", x).textContent = data.time;
get(".tag", x).textContent = ({
- request: function(r) { return r.api + "/" + r.verb + " [" + r.index + "] " + r.action; },
+ request: function(r,d) { return r.api + "/" + r.verb + " [" + r.index + "] " + r.action + (r.action == 'reply' ? ' '+d.data.error : ''); },
service: function(r) { return r.api + "@" + r.action; },
daemon: function(r) { return r.api + ":" + r.action; },
event: function(r) { return r.name + "!" + r.action; },
global: function(r) { return "$" + r.action; },
- })[type](desc);
+ })[type](desc,data);
var tab = makeobj(desc, 4);
if ("data" in data)
makeobjitem(tab, 2, "data", data.data);