Browse Source

final

master
lefteris 3 years ago
parent
commit
d3ea40b69f
  1. 35
      swarmlab-app/src/run/app.js

35
swarmlab-app/src/run/app.js

@ -173,7 +173,10 @@ app.get("/length", cors(corsOptions), (req, res) => {
else if (tmp.s == "W" || tmp.s == "E") return "err"; //count every warning and error log else if (tmp.s == "W" || tmp.s == "E") return "err"; //count every warning and error log
} else if (value.tag.includes("node")) { } else if (value.tag.includes("node")) {
if (IsJsonString(value.log)) var test = JSON.parse(value.log); if (IsJsonString(value.log)) var test = JSON.parse(value.log);
else return "none"; else {
if (value.source == "stdout") return "out";
else return "err";
}
var type = test.type; var type = test.type;
if (type == "out") return "out"; if (type == "out") return "out";
@ -383,6 +386,7 @@ app.get("/test2", cors(corsOptions), (req, res) => {
var obj = JSON.parse(JSON.stringify(result)); var obj = JSON.parse(JSON.stringify(result));
obj.forEach((value) => { obj.forEach((value) => {
var test = IsJsonString(value.log);
if (value.tag.includes("node") && IsJsonString(value.log)) { if (value.tag.includes("node") && IsJsonString(value.log)) {
var tmp = JSON.parse(value.log); var tmp = JSON.parse(value.log);
var container_name = value.container_name; var container_name = value.container_name;
@ -414,6 +418,35 @@ app.get("/test2", cors(corsOptions), (req, res) => {
) { ) {
jsonfinal.push(tmp2); jsonfinal.push(tmp2);
} }
} else if (value.tag.includes("node") && test == false) {
//console.error("EDW EIMAI!!!!");
var tmptype;
if (value.source == "stdout") {
tmptype = '<div class="outtype" >' + "out" + "</div>";
} else if (value.source == "stderr") {
tmptype = '<div class="errtype" >' + "err" + "</div>";
}
var tmp2 = {
message: value.log,
timestamp: value.time,
type: tmptype,
process_id: "-",
app_name: value.container_name,
};
if (
logtext != "" &&
tmp2.message.includes(logtext) &&
(value.container_name == selected || selected == "All")
) {
jsonfinal.push(tmp2);
} else if (logtext != "" && !value.log.includes(logtext)) {
//console.error("lathos sinthiki");
} else if (
logtext == "" &&
(value.container_name == selected || selected == "All")
) {
jsonfinal.push(tmp2);
}
} else if ( } else if (
value.tag.includes("redis") && value.tag.includes("redis") &&
(value.container_name == selected || selected == "All") (value.container_name == selected || selected == "All")

Loading…
Cancel
Save