Browse Source

latest

master
lefteris 4 years ago
parent
commit
1701b085b4
  1. 1
      src/components/DocLive.vue
  2. 58
      src/components/doclive/AdhocView.vue
  3. 90
      src/components/doclive/runLlo.vue

1
src/components/DocLive.vue

@ -154,6 +154,7 @@ export default {
max-width: 48%; max-width: 48%;
} }
.col-5 { .col-5 {
flex: 0 0 50%;
max-width: 50%; max-width: 50%;
} }
</style> </style>

58
src/components/doclive/AdhocView.vue

@ -66,7 +66,7 @@
type="button" type="button"
round round
class="btn btn-outline-warning btn-sm" class="btn btn-outline-warning btn-sm"
v-if="tryConsole" v-if="socketonline"
@click="clear()" @click="clear()"
> >
Clear Clear
@ -122,6 +122,16 @@
<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</h2>
<div class="input-group-append">
<button
type="button"
round
class="btn btn-outline-warning btn-sm"
@click="callback(1)"
>
Refresh
</button>
</div>
<highcharts <highcharts
class="hc" class="hc"
:options="chartOptions" :options="chartOptions"
@ -184,6 +194,7 @@ import "codemirror/addon/display/placeholder";
import { Chart } from "highcharts-vue"; import { Chart } from "highcharts-vue";
import Highcharts from "highcharts"; import Highcharts from "highcharts";
import exportingInit from "highcharts/modules/exporting"; import exportingInit from "highcharts/modules/exporting";
import axios from "axios";
exportingInit(Highcharts); exportingInit(Highcharts);
@ -419,25 +430,31 @@ export default {
}; };
}, },
methods: { methods: {
callback(params) { async callback(params) {
//this.console = store.getters["statsmodule/getCountConsole"]; var res = await axios.get("http://localhost:3000/length");
// var JobjLogs = store.getters["statsmodule/getCountLogs"]; var mongol = res.data.mongolength;
// var jobj_console = store.getters["statsmodule/getCountConsole"]; var appout = res.data.appout;
var one = 1; var apperror = res.data.apperror;
var two = 2; if (params == 1) {
this.chartOptions.series.push( this.chartOptions.series[0].data = [appout, apperror];
{ this.chartOptions.series[1].data = [mongol, 0];
name: "Readmongo service", } else {
data: [one, two], this.chartOptions.series.push(
}, {
{ name: "Readmongo service",
name: "MongoDB", data: [appout, apperror],
data: [one, two], },
} {
); name: "MongoDB",
data: [mongol, 0],
}
);
}
}, },
socketconnect() { socketconnect() {
//asd
// send to runLLO // send to runLLO
console.log("socketcoonect adhoc");
this.$root.$emit("SERVER_socket_connect"); this.$root.$emit("SERVER_socket_connect");
}, },
showChart() { showChart() {
@ -623,6 +640,7 @@ export default {
}, },
computed: { computed: {
codemirror() { codemirror() {
//test
return this.$refs.myCm.codemirror; return this.$refs.myCm.codemirror;
}, },
}, },
@ -735,6 +753,12 @@ h2 {
} }
.codemirror { .codemirror {
min-height: 500px; min-height: 500px;
box-shadow: 3px 3px 10px 10px rgba(0, 0, 0, 0.281);
margin-top: 10px;
margin-bottom: 40px;
margin-right: 10px;
margin-left: 10px;
padding: 5px;
} }
.orange { .orange {
color: rgb(167, 110, 6); color: rgb(167, 110, 6);

90
src/components/doclive/runLlo.vue

@ -182,28 +182,50 @@
</b-row> </b-row>
</div> </div>
<!-- col --> <!-- col -->
<h2 v-if="onEvent">ON-event logs for all apps (Simplified)</h2> <div v-if="onEvent" class="logs">
<div v-if="onEvent" class="table2"> <h2>ON-event logs for all apps (Simplified)</h2>
<vuetable <div class="input-group-append">
ref="vuetable" <button
:api-mode="false" class="btn btn-outline-primary"
:data="localData" round
:fields="fields" type="button"
:css="css.table" @click="scroll(1)"
> >
</vuetable> Scroll to Bottom
</div> </button>
</div>
<div id="applogs" class="table2">
<vuetable
ref="vuetable"
:api-mode="false"
:data="localData"
:fields="fields"
:css="css.table"
>
</vuetable>
</div>
<h2 v-if="onEvent">ON-event logs for MongoDB (RAW)</h2> <h2>ON-event logs for MongoDB (RAW)</h2>
<div v-if="onEvent" class="table2"> <div class="input-group-append">
<vuetable <button
ref="vuetable" class="btn btn-outline-primary"
:api-mode="false" round
:data="mongodata" type="button"
:fields="fields2" @click="scroll(2)"
:css="css.table" >
> Scroll to Bottom
</vuetable> </button>
</div>
<div id="mongologs" class="table2">
<vuetable
ref="vuetable"
:api-mode="false"
:data="mongodata"
:fields="fields2"
:css="css.table"
>
</vuetable>
</div>
</div> </div>
</div> </div>
<!-- row --> <!-- row -->
@ -330,6 +352,15 @@ export default {
}; };
}, },
methods: { methods: {
scroll(param) {
if (param == 1) {
var container = this.$el.querySelector("#applogs");
container.scrollTop = container.scrollHeight;
} else {
var container = this.$el.querySelector("#mongologs");
container.scrollTop = container.scrollHeight;
}
},
async getuser(token) { async getuser(token) {
var data = await this.checktoken(token); var data = await this.checktoken(token);
console.log("User: " + data.user + " Token: " + data.token); console.log("User: " + data.user + " Token: " + data.token);
@ -461,14 +492,17 @@ export default {
console.log(JSON.stringify(this.logdata)); console.log(JSON.stringify(this.logdata));
}, },
async socketopen() { async socketopen() {
console.log("inside socketopen()");
this.$socket.client.open(); this.$socket.client.open();
}, },
async socketauthenticate() { async socketauthenticate() {
var tokentmp = store.getters["pipelineLLO/gettoken"]; var tokentmp = this.logintoken;
// pernaw hardcoded to token // pernaw hardcoded to token
console.log("Inside socket authenticate");
this.$socket.client.emit("authenticate", tokentmp); this.$socket.client.emit("authenticate", tokentmp);
}, },
async socketreconnect() { async socketreconnect() {
console.log("inside socketreconnect() --- sending to socketopen()");
var log = await this.socketopen(); var log = await this.socketopen();
this.socketauthenticate(); this.socketauthenticate();
}, },
@ -520,6 +554,7 @@ export default {
// from AdhocView // from AdhocView
this.$root.$on("SERVER_socket_connect", (v) => { this.$root.$on("SERVER_socket_connect", (v) => {
this.$nextTick(function() { this.$nextTick(function() {
console.log("socket recconect inside runllo");
this.socketreconnect(); this.socketreconnect();
}); });
}); });
@ -565,7 +600,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=5b39802077f68ac7499066391067e10535a7053a" "https://api-client.swarmlab.io:8088/?token=95bbe80eeae557be3e4e9fa25109bf2187f2c313"
).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
@ -608,6 +643,7 @@ export default {
// send to AdhocView // send to AdhocView
this.$root.$emit("SERVER_socket_status", "on"); this.$root.$emit("SERVER_socket_status", "on");
this.getuser(logintoken); this.getuser(logintoken);
//asd
}, },
/** /**
* *
@ -871,5 +907,13 @@ h2 {
} }
.rowlog { .rowlog {
display: flex; /* equal height of the children */ display: flex; /* equal height of the children */
min-height: 500px;
box-shadow: 3px 3px 10px 10px rgba(0, 0, 0, 0.281);
margin-bottom: 40px;
margin-top: 20px;
padding: 5px;
}
.logs {
width: 100%;
} }
</style> </style>

Loading…
Cancel
Save