Browse Source

redis ok - more style fixes

master
lefteris 4 years ago
parent
commit
3b14e7ed28
  1. 16
      src/components/doclive/AdhocView.vue
  2. 73
      src/components/doclive/runLlo.vue

16
src/components/doclive/AdhocView.vue

@ -78,7 +78,7 @@
<div class="codemirror2"> <div class="codemirror2">
<div v-if="history" class="table3"> <div v-if="history" class="table3">
<h2>History of all app logs</h2> <h2>History of all app logs (redis, readmongo, dummy)</h2>
<vuetable <vuetable
ref="vuetable" ref="vuetable"
:api-url="api_url" :api-url="api_url"
@ -121,7 +121,7 @@
</div> </div>
<div class="highch" v-show="chartstatus"> <div class="highch" v-show="chartstatus">
<h2>HighChart with log sum Data</h2> <h2>HighChart with log sum Data (all)</h2>
<div class="input-group-append"> <div class="input-group-append">
<button <button
type="button" type="button"
@ -250,7 +250,7 @@ export default {
}, },
{ {
name: "type", name: "type",
sortField: "type", // sortField: "type",
titleClass: "center aligned", titleClass: "center aligned",
width: "10%", width: "10%",
}, },
@ -261,6 +261,7 @@ export default {
{ {
name: "app_name", name: "app_name",
visible: true, visible: true,
sortField: "app_name",
title: '<span class="orange"></span>App Name', title: '<span class="orange"></span>App Name',
}, },
// 'timestamp', // 'timestamp',
@ -437,10 +438,13 @@ export default {
var appout = res.data.appout; var appout = res.data.appout;
var apperror = res.data.apperror; var apperror = res.data.apperror;
var redis = res.data.redis; var redis = res.data.redis;
var dumout = res.data.dumout;
var dumerr = res.data.dumerr;
if (params == 1) { if (params == 1) {
this.chartOptions.series[0].data = [appout, apperror]; this.chartOptions.series[0].data = [appout, apperror];
this.chartOptions.series[1].data = [mongol, 0]; this.chartOptions.series[1].data = [mongol, 0];
this.chartOptions.series[2].data = [redis, 0]; this.chartOptions.series[2].data = [redis, 0];
this.chartOptions.series[3].data = [dumout, dumerr];
} else { } else {
this.chartOptions.series.push( this.chartOptions.series.push(
{ {
@ -452,8 +456,12 @@ export default {
data: [mongol, mongoerror], data: [mongol, mongoerror],
}, },
{ {
name: "redis", name: "Redis",
data: [redis, 0], data: [redis, 0],
},
{
name: "Dummy",
data: [dumout, dumerr],
} }
); );
} }

73
src/components/doclive/runLlo.vue

@ -182,7 +182,7 @@
</div> </div>
<!-- col --> <!-- col -->
<div v-if="onEvent" class="logs"> <div v-if="onEvent" class="logs">
<h2>ON-event logs for all apps (Simplified)</h2> <h2>ON-event logs for all apps (Simplified - ALL)</h2>
<div class="input-group-append"> <div class="input-group-append">
<button <button
class="btn btn-outline-primary" class="btn btn-outline-primary"
@ -205,7 +205,7 @@
</div> </div>
</div> </div>
<div v-if="mongoraw" class="logs"> <div v-if="mongoraw" class="logs">
<h2>ON-event logs for MongoDB (RAW)</h2> <h2>ON-event logs for MongoDB only (RAW)</h2>
<div class="input-group-append"> <div class="input-group-append">
<button <button
class="btn btn-outline-primary" class="btn btn-outline-primary"
@ -228,7 +228,7 @@
</div> </div>
</div> </div>
<div v-if="raw" class="logs"> <div v-if="raw" class="logs">
<h2>ON-event logs (RAW)</h2> <h2>ON-event logs (RAW - ALL)</h2>
<div class="input-group-append"> <div class="input-group-append">
<button <button
class="btn btn-outline-primary" class="btn btn-outline-primary"
@ -274,6 +274,7 @@ export default {
}, },
data() { data() {
return { return {
hover: false,
css: CssConfig, css: CssConfig,
fields: [ fields: [
{ {
@ -348,8 +349,8 @@ export default {
], ],
fields3: [ fields3: [
{ {
name: "_id", name: "container_id",
title: "ID", title: "Container_id",
}, },
{ {
name: "container_name", name: "container_name",
@ -658,7 +659,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=191f43c5b28084805e7f7b66ceed9c2657a817a3" "https://api-client.swarmlab.io:8088/?token=117ec26cc66cfba79b048cec800a610b00922b2a"
).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
@ -906,6 +907,7 @@ export default {
async message(val) { async message(val) {
console.log(" socket message " + JSON.stringify(val)); console.log(" socket message " + JSON.stringify(val));
}, },
// Lefos --- socket event to add the data to the right tables
async logsend(val) { async logsend(val) {
// ==== LEFOS // ==== LEFOS
console.log(" socket message " + JSON.stringify(val)); console.log(" socket message " + JSON.stringify(val));
@ -917,12 +919,17 @@ export default {
log: val, log: val,
}); });
// Change color of source for ALL RAW table to be able to see the error logs easy
if (val.source == "stdout") { if (val.source == "stdout") {
val.source = '<div class="outtype" >' + val.source + "</div>"; val.source = '<div class="outtype" >' + val.source + "</div>";
} else { } else {
val.source = '<div class="errtype" >' + val.source + "</div>"; val.source = '<div class="errtype" >' + val.source + "</div>";
} }
val.container_id = '<div class="conid">' + val.container_id + "</div>";
this.rawdata.push(val); this.rawdata.push(val);
// Check if the log is by a node_service and change color of the type field
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") { if (test.type == "out") {
@ -931,14 +938,18 @@ export default {
test.type = '<div class="errtype" >' + test.type + "</div>"; test.type = '<div class="errtype" >' + test.type + "</div>";
} }
this.localData.push(test); this.localData.push(test);
} else if (val.container_name == "/mongo") { } //check if the log is by the mongodb and change color
else if (val.container_name == "/mongo") {
// ========== push data for raw table ============
var tmp = JSON.parse(val.log); var tmp = JSON.parse(val.log);
if (tmp.s == "I") { if (tmp.s == "I") {
tmp.s = '<div class="outtype" >' + tmp.s + "</div>"; tmp.s = '<div class="outtype" >' + tmp.s + "</div>";
} else { } else {
tmp.s = '<div class="errtype" >' + tmp.s + "</div>"; tmp.s = '<div class="errtype" >' + tmp.s + "</div>";
} }
tmp.t = '<div class="mongod">' + JSON.stringify(tmp.t) + "</div>";
this.mongodata.push(tmp); this.mongodata.push(tmp);
// ===========
//msg //msg
var tmplog = JSON.parse(val.log); var tmplog = JSON.parse(val.log);
@ -950,12 +961,24 @@ export default {
var tmp = { var tmp = {
message: msg2, message: msg2,
timestamp: time, timestamp: time,
type: "<div class= 'outtype'>out - mongo</div>", type: "<div class= 'outtype'>out</div>",
process_id: "Unknown", process_id: "Unknown",
app_name: "Mongo", app_name: "Mongo",
}; };
this.localData.push(tmp); this.localData.push(tmp);
console.log("HEY " + JSON.stringify(test)); console.log("HEY " + JSON.stringify(test));
} else if (val.container_name == "/redisserver") {
var tmplog = val;
//timestamp
var time = tmplog.time;
var tmp = {
message: tmplog.log,
timestamp: time,
type: "<div class= 'outtype'>out</div>",
process_id: "Unknown",
app_name: "redis",
};
this.localData.push(tmp);
} }
}, },
}, },
@ -1004,4 +1027,38 @@ button {
padding: 10px 10px 10px 10px; padding: 10px 10px 10px 10px;
margin: 10px 10px 10px 0px; margin: 10px 10px 10px 0px;
} }
.conid {
overflow: hidden;
text-overflow: ellipsis;
padding: 5px;
width: 120px;
/* position: relative; */
display: inline-block;
}
.conid:hover {
transition: 0.7s;
width: 100%;
background-color: rgb(63, 61, 61);
color: #fff;
border-radius: 6px;
padding: 5px;
}
.mongod {
overflow: hidden;
text-overflow: ellipsis;
padding: 5px;
width: 120px;
height: 100px;
/* position: relative; */
display: inline-block;
}
.mongod:hover {
transition: 0.7s;
width: 100%;
background-color: rgb(63, 61, 61);
color: #fff;
border-radius: 6px;
padding: 5px;
}
</style> </style>

Loading…
Cancel
Save