Browse Source

out-error + all raw

master
lefteris 4 years ago
parent
commit
fc41cceabc
  1. 11
      src/components/doclive/AdhocView.vue
  2. 43
      src/components/doclive/runLlo.vue

11
src/components/doclive/AdhocView.vue

@ -76,8 +76,8 @@
</b-col> </b-col>
</b-row> </b-row>
<div class="codemirror"> <div class="codemirror2">
<div v-if="history" class="table2"> <div v-if="history" class="table3">
<h2>History of all app logs</h2> <h2>History of all app logs</h2>
<vuetable <vuetable
ref="vuetable" ref="vuetable"
@ -748,7 +748,7 @@ h2 {
padding-top: 50px; padding-top: 50px;
max-width: 100%; max-width: 100%;
} }
.table2 { .table3 {
min-height: 320px; min-height: 320px;
max-width: 100%; max-width: 100%;
overflow: auto; overflow: auto;
@ -758,7 +758,7 @@ h2 {
max-width: 900px; max-width: 900px;
min-height: 500px; min-height: 500px;
} }
.codemirror { .codemirror2 {
min-height: 600px; min-height: 600px;
box-shadow: 3px 3px 10px 10px rgba(0, 0, 0, 0.281); box-shadow: 3px 3px 10px 10px rgba(0, 0, 0, 0.281);
margin-top: 10px; margin-top: 10px;
@ -777,4 +777,7 @@ h2 {
padding: 10px; padding: 10px;
margin: 10px; margin: 10px;
} }
.pagi {
height: 40px;
}
</style> </style>

43
src/components/doclive/runLlo.vue

@ -405,9 +405,10 @@ export default {
} else if (param == 2) { } else if (param == 2) {
var container = this.$el.querySelector("#mongologs"); var container = this.$el.querySelector("#mongologs");
container.scrollTop = container.scrollHeight; container.scrollTop = container.scrollHeight;
} else { } else if (param == 3) {
console.log("moving scroll bar of raw logs");
var container = this.$el.querySelector("#rawlogs"); var container = this.$el.querySelector("#rawlogs");
container.scrollTOp = container.scrollHeight; container.scrollTop = container.scrollHeight;
} }
}, },
async getuser(token) { async getuser(token) {
@ -657,7 +658,7 @@ export default {
created() { created() {
//var logintoken = new URL(location.href).searchParams.get("token"); //var logintoken = new URL(location.href).searchParams.get("token");
var logintoken = new URL( var logintoken = new URL(
"https://api-client.swarmlab.io:8088/?token=06227b41168224d853a1863d3195cff946f15217" "https://api-client.swarmlab.io:8088/?token=191f43c5b28084805e7f7b66ceed9c2657a817a3"
).searchParams.get("token"); ).searchParams.get("token");
this.logintoken = logintoken; this.logintoken = logintoken;
// === We get the user + check for the token if exists // === We get the user + check for the token if exists
@ -916,13 +917,28 @@ export default {
log: val, log: val,
}); });
this.rawdata = val; if (val.source == "stdout") {
val.source = '<div class="outtype" >' + val.source + "</div>";
} else {
val.source = '<div class="errtype" >' + val.source + "</div>";
}
this.rawdata.push(val);
if (val.log.includes("app_name")) { if (val.log.includes("app_name")) {
var test = JSON.parse(val.log); var test = JSON.parse(val.log);
if (test.type == "out") {
test.type = '<div class="outtype" >' + test.type + "</div>";
} else if (test.type == "err") {
test.type = '<div class="errtype" >' + test.type + "</div>";
}
this.localData.push(test); this.localData.push(test);
} else if (val.container_name == "/mongo") { } else if (val.container_name == "/mongo") {
this.mongodata.push(JSON.parse(val.log)); var tmp = JSON.parse(val.log);
if (tmp.s == "I") {
tmp.s = '<div class="outtype" >' + tmp.s + "</div>";
} else {
tmp.s = '<div class="errtype" >' + tmp.s + "</div>";
}
this.mongodata.push(tmp);
//msg //msg
var tmplog = JSON.parse(val.log); var tmplog = JSON.parse(val.log);
@ -934,7 +950,7 @@ export default {
var tmp = { var tmp = {
message: msg2, message: msg2,
timestamp: time, timestamp: time,
type: "out - mongo", type: "<div class= 'outtype'>out - mongo</div>",
process_id: "Unknown", process_id: "Unknown",
app_name: "Mongo", app_name: "Mongo",
}; };
@ -946,13 +962,22 @@ export default {
}; };
</script> </script>
<style scoped> <style>
.table2 { .table2 {
overflow: auto; overflow: auto;
max-height: 400px; max-height: 400px;
min-width: 100%; min-width: 100%;
} }
.outtype {
color: rgb(0, 0, 0) !important;
background-color: rgba(13, 233, 13, 0.411) !important;
padding: 5px;
}
.errtype {
color: white;
background-color: rgb(197, 29, 29);
padding: 5px;
}
h2 { h2 {
background-color: dimgray; background-color: dimgray;
padding: 10px; padding: 10px;

Loading…
Cancel
Save