Browse Source

layout fix

master
lefteris 4 years ago
parent
commit
f34cb4f897
  1. 3
      gitpush.sh
  2. 161
      src/components/DocLive.vue
  3. 111
      src/components/doclive/AdhocView.vue
  4. 28
      src/components/doclive/runLlo.vue

3
gitpush.sh

@ -0,0 +1,3 @@
git add .
git commit -m "layout fix"
git push origin

161
src/components/DocLive.vue

@ -1,26 +1,28 @@
<template> <template>
<div> <div>
<!-- menou --> <!-- menou -->
<div class="row" <div class="row" v-show="showmenou == 1">
v-show="showmenou == 1"
>
<div class="col-3"> <div class="col-3">
<div class="input-group-append"> <div class="input-group-append">
<button type="button" <button
type="button"
round round
v-if="columnviewdefault == '0'" v-if="columnviewdefault == '0'"
class="ti-layout-sidebar-none btn btn-outline-info btn-sm" class="ti-layout-sidebar-none btn btn-outline-info btn-sm"
@click="fullscreen('max')"> @click="fullscreen('max')"
Max-Notebook View </button> >
Max-Notebook View
</button>
<button type="button" <button
type="button"
round round
v-if="columnviewdefault == '1'" v-if="columnviewdefault == '1'"
class="ti-layout-sidebar-right btn btn-outline-info btn-sm" class="ti-layout-sidebar-right btn btn-outline-info btn-sm"
@click="fullscreen('min')"> @click="fullscreen('min')"
Min-Notebook View</button> >
Min-Notebook View
</button>
</div> </div>
</div> </div>
@ -30,45 +32,41 @@
<div class="col-3"> <div class="col-3">
<div class="input-group-prepend"> <div class="input-group-prepend">
<button type="button" <button
type="button"
round round
v-if="columncodedefault == '0'" v-if="columncodedefault == '0'"
class="ti-layout-sidebar-none btn btn-outline-info btn-sm" class="ti-layout-sidebar-none btn btn-outline-info btn-sm"
style="float: right;" style="float: right;"
@click="fullscreen('codemax')"> @click="fullscreen('codemax')"
Max-Code View </button> >
Max-Code View
</button>
<button type="button" <button
type="button"
round round
v-if="columncodedefault == '1'" v-if="columncodedefault == '1'"
style="float: right;" style="float: right;"
class="ti-layout-sidebar-left btn btn-outline-info btn-sm" class="ti-layout-sidebar-left btn btn-outline-info btn-sm"
@click="fullscreen('codemin')"> @click="fullscreen('codemin')"
Min-Code View</button> >
Min-Code View
</button>
</div> </div>
</div> </div>
</div> </div>
<!-- menou --> <!-- menou -->
<div class="row"> <div class="row">
<div :class="columnview"> <div :class="columnview">
<ad-hoc <ad-hoc style="background-color: #f8f9fa"> </ad-hoc>
style="background-color: #f8f9fa"
>
</ad-hoc>
</div> </div>
<div :class="columncode"> <div :class="columncode">
<run-llo <run-llo style="background-color: #f8f9fa"> </run-llo>
style="background-color: #f8f9fa"
>
</run-llo>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
@ -77,12 +75,11 @@ import RunLlo from "./doclive/runLlo.vue";
import AdHoc from "./doclive/AdhocView.vue"; import AdHoc from "./doclive/AdhocView.vue";
export default { export default {
name: 'DocLive', name: "DocLive",
props: { props: {},
},
components: { components: {
RunLlo, RunLlo,
AdHoc AdHoc,
}, },
data() { data() {
return { return {
@ -92,71 +89,71 @@ export default {
showmenou: 1, showmenou: 1,
columnviewdefault: 0, columnviewdefault: 0,
columncodedefault: 0, columncodedefault: 0,
columnview : 'col-7 order-first', columnview: "col-7 order-first",
columncode : 'col-5 order-last', columncode: "col-5 order-last",
tutorMenou: 'student' tutorMenou: "student",
} };
},
created: function () {
}, },
created: function() {},
mounted() { mounted() {
this.$root.$on('LLOshowmenounotebooks', () => { this.$root.$on("LLOshowmenounotebooks", () => {
this.showmenou = 1 this.showmenou = 1;
}), }),
this.$root.$on('lloshowchallengehistory', (llo,active) => { this.$root.$on("lloshowchallengehistory", (llo, active) => {
this.showhistory = 1 this.showhistory = 1;
}) });
}, },
beforeDestroy() { beforeDestroy() {
this.$root.$off('LLOshowmenounotebooks'), this.$root.$off("LLOshowmenounotebooks"),
this.$root.$off('lloshowchallengehistory') // working this.$root.$off("lloshowchallengehistory"); // working
}, },
methods: { methods: {
fullscreen(action) { fullscreen(action) {
if(action == 'max'){ if (action == "max") {
this.columnview = 'col-11 order-first' this.columnview = "col-11 order-first";
this.columncode = 'col-1 order-last' this.columncode = "col-1 order-last";
this.columnviewdefault = 1 this.columnviewdefault = 1;
this.columncodedefault = 0 this.columncodedefault = 0;
//set height iframe //set height iframe
this.$root.$emit('LLOresizemenounotebooks','max') this.$root.$emit("LLOresizemenounotebooks", "max");
console.log(this.columnview) console.log(this.columnview);
} } else if (action == "min") {
else if(action == 'min'){ this.columnview = "col-7 order-first";
this.columnview = 'col-7 order-first' this.columncode = "col-5 order-last";
this.columncode = 'col-5 order-last' this.columnviewdefault = 0;
this.columnviewdefault = 0 this.columncodedefault = 1;
this.columncodedefault = 1
//set height iframe //set height iframe
this.$root.$emit('LLOresizemenounotebooks','min') this.$root.$emit("LLOresizemenounotebooks", "min");
console.log(this.columnview) console.log(this.columnview);
} } else if (action == "codemax") {
else if(action == 'codemax'){ this.columnview = "col-1 order-first";
this.columnview = 'col-1 order-first' this.columncode = "col-11 order-last";
this.columncode = 'col-11 order-last' this.columnviewdefault = 0;
this.columnviewdefault = 0 this.columncodedefault = 1;
this.columncodedefault = 1 console.log(this.columnview);
console.log(this.columnview) } else if (action == "codemin") {
} this.columnview = "col-7 order-first";
else if(action == 'codemin'){ this.columncode = "col-5 order-last";
this.columnview = 'col-7 order-first' this.columnviewdefault = 1;
this.columncode = 'col-5 order-last' this.columncodedefault = 0;
this.columnviewdefault = 1 this.$root.$emit("LLOresizemenounotebooks", "min");
this.columncodedefault = 0 console.log(this.columnview);
this.$root.$emit('LLOresizemenounotebooks','min')
console.log(this.columnview)
} }
}, },
async onAction(action) { async onAction(action) {
this.tutorMenou='tutor' this.tutorMenou = "tutor";
//this.tutorMenou='student' //this.tutorMenou='student'
} },
} },
};
}
</script> </script>
<!-- Add "scoped" attribute to limit CSS to this component only --> <!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped> <style scoped>
.col-7 {
max-width: 48%;
}
.col-5 {
max-width: 50%;
}
</style> </style>

111
src/components/doclive/AdhocView.vue

@ -4,32 +4,10 @@
<b-col cols="12" sm="12" md="12"> <b-col cols="12" sm="12" md="12">
<b-row> <b-row>
<b-col cols="4"> <b-col cols="4">
<div class="input-group input-group-sm sm-3"> <div
<!-- class="input-group input-group-sm sm-3"
<select style="padding-top: 10px;"
class="custom-select custom-select-sm " >
@change="setKeymap"
v-model="selected">
<option
v-for="option in options"
v-bind:value="option.value">
{{ option.text }}
</option>
</select>
<div class="input-group-append">
<button type="button"
round
class="btn btn-outline-info btn-sm"
v-if="cmOptions.keyMap == 'sublime'"
@click="infoFilter">
i</button>
</div>
-->
</div>
</b-col>
<b-col cols="3">
<div class="input-group input-group-sm sm-3">
<button <button
type="button" type="button"
round round
@ -51,6 +29,16 @@
> >
{{ this.alllogs }} {{ this.alllogs }}
</button> </button>
<button
type="button"
round
disable
class="btn btn-outline-info btn-sm"
v-if="socketonline"
@click="showChart"
>
{{ this.chartbut }}
</button>
</div> </div>
<button <button
type="button" type="button"
@ -64,6 +52,10 @@
</div> </div>
</b-col> </b-col>
<b-col cols="3">
<div class="input-group input-group-sm sm-3"></div>
</b-col>
<b-col cols="5"> <b-col cols="5">
<div <div
class="input-group input-group-sm d-flex justify-content-end" class="input-group input-group-sm d-flex justify-content-end"
@ -86,6 +78,7 @@
<div class="codemirror"> <div class="codemirror">
<div v-if="history" class="table2"> <div v-if="history" class="table2">
<h2>History of all app logs</h2>
<vuetable <vuetable
ref="vuetable" ref="vuetable"
:api-url="api_url" :api-url="api_url"
@ -107,7 +100,12 @@
> >
</vuetable> </vuetable>
</div> </div>
<div v-if="history" class="vuetable-pagination ui basic segment grid"> <br />
<div class="pagi">
<div
v-if="history"
class="vuetable-pagination ui basic segment grid"
>
<vuetable-pagination-info <vuetable-pagination-info
ref="paginationInfo" ref="paginationInfo"
:css="css.paginationInfo" :css="css.paginationInfo"
@ -120,16 +118,16 @@
> >
</vuetable-pagination> </vuetable-pagination>
</div> </div>
</div>
<div class="highch" v-if="history"> <div class="highch" v-show="chartstatus">
<transition name="bounce" appear> <h2>HighChart with log sum Data</h2>
<highcharts <highcharts
class="hc" class="hc"
:options="chartOptions" :options="chartOptions"
:callback="callback" :callback="callback"
ref="chart" ref="chart"
></highcharts> ></highcharts>
</transition>
</div> </div>
</div> </div>
</b-col> </b-col>
@ -200,6 +198,8 @@ export default {
}, },
data() { data() {
return { return {
chartstatus: false,
chartbut: "Show HighChart",
chartOptions: { chartOptions: {
title: { title: {
text: "Length of logs chart", text: "Length of logs chart",
@ -213,11 +213,11 @@ export default {
type: "column", type: "column",
}, },
xAxis: { xAxis: {
categories: ["JobjLogs", "jobj_console"], categories: ["Out Logs", "Error Logs"],
}, },
yAxis: { yAxis: {
title: { title: {
text: "Count", text: "Counter",
}, },
}, },
series: [], series: [],
@ -302,7 +302,7 @@ export default {
}, },
}, },
], ],
alllogs: "Show all logs", alllogs: "Show app logs",
socketonline: false, socketonline: false,
tryConsole: false, tryConsole: false,
history: false, history: false,
@ -423,14 +423,16 @@ export default {
//this.console = store.getters["statsmodule/getCountConsole"]; //this.console = store.getters["statsmodule/getCountConsole"];
// var JobjLogs = store.getters["statsmodule/getCountLogs"]; // var JobjLogs = store.getters["statsmodule/getCountLogs"];
// var jobj_console = store.getters["statsmodule/getCountConsole"]; // var jobj_console = store.getters["statsmodule/getCountConsole"];
var one = 1;
var two = 2;
this.chartOptions.series.push( this.chartOptions.series.push(
{ {
name: "swarm-app-Stats", name: "Readmongo service",
data: ["1", "2"], data: [one, two],
}, },
{ {
name: "swarm-app-Stats2", name: "MongoDB",
data: ["1", "2"], data: [one, two],
} }
); );
}, },
@ -438,12 +440,21 @@ export default {
// send to runLLO // send to runLLO
this.$root.$emit("SERVER_socket_connect"); this.$root.$emit("SERVER_socket_connect");
}, },
showChart() {
if (this.chartstatus == false) {
this.chartstatus = true;
this.chartbut = "Hide HighChart";
} else {
this.chartstatus = false;
this.chartbut = "Show HighChart";
}
},
showHistory() { showHistory() {
if (this.history == false) { if (this.history == false) {
this.history = true; this.history = true;
this.alllogs = "Hide all logs"; this.alllogs = "Hide app logs";
} else { } else {
this.alllogs = "Show all logs"; this.alllogs = "Show app logs";
this.history = false; this.history = false;
} }
}, },
@ -701,18 +712,38 @@ export default {
</script> </script>
<style scoped> <style scoped>
h2 {
background-color: dimgray;
padding: 10px;
color: white;
margin-top: 20px;
border-radius: 5px;
}
.highch { .highch {
padding-top: 50px; padding-top: 50px;
max-width: 900px;
} }
.table2 { .table2 {
min-height: 320px; min-height: 320px;
max-width: 900px;
overflow: auto; overflow: auto;
} }
.CodeMirror { .CodeMirror {
font-family: monospace; font-family: monospace;
height: 550px; max-width: 900px;
min-height: 500px;
}
.codemirror {
min-height: 500px;
} }
.orange { .orange {
color: rgb(167, 110, 6); color: rgb(167, 110, 6);
} }
.pagi {
max-width: 900px;
}
.btn {
padding: 10px;
margin: 10px;
}
</style> </style>

28
src/components/doclive/runLlo.vue

@ -182,8 +182,8 @@
</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="table2"> <div v-if="onEvent" class="table2">
<h1>App Logs - Simplified (ON EVENT)</h1>
<vuetable <vuetable
ref="vuetable" ref="vuetable"
:api-mode="false" :api-mode="false"
@ -192,10 +192,10 @@
:css="css.table" :css="css.table"
> >
</vuetable> </vuetable>
<hr />
</div> </div>
<h2 v-if="onEvent">ON-event logs for MongoDB (RAW)</h2>
<div v-if="onEvent" class="table2"> <div v-if="onEvent" class="table2">
<h1>Mongo Logs - RAW (More details - ON EVENT)</h1>
<vuetable <vuetable
ref="vuetable" ref="vuetable"
:api-mode="false" :api-mode="false"
@ -234,7 +234,9 @@ export default {
{ {
name: "message", name: "message",
title: "Log", title: "Log",
width: "10%",
visible: true, visible: true,
dataClass: "center aligned",
}, },
{ {
name: "timestamp", name: "timestamp",
@ -278,7 +280,7 @@ export default {
}, },
{ {
name: "id", name: "id",
visible: true, visible: false,
}, },
{ {
name: "ctx", name: "ctx",
@ -563,7 +565,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=741662728073939963b63bb0b90da41e706333e6" "https://api-client.swarmlab.io:8088/?token=5b39802077f68ac7499066391067e10535a7053a"
).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
@ -851,19 +853,23 @@ export default {
</script> </script>
<style scoped> <style scoped>
.table {
min-height: 0px;
max-width: 600px;
}
.table2 { .table2 {
overflow: auto; overflow: auto;
max-height: 400px;
min-width: 100%;
}
h2 {
background-color: dimgray;
padding: 10px;
color: white;
margin-top: 20px;
border-radius: 5px;
width: 100%;
} }
.CodeMirror { .CodeMirror {
font-family: monospace; font-family: monospace;
height: 750px;
} }
.rowlog { .rowlog {
display: flex; /* equal height of the children */ display: flex; /* equal height of the children */
height: 470px;
} }
</style> </style>

Loading…
Cancel
Save