|
|
@ -7,90 +7,142 @@ |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="row"> |
|
|
|
<div class="col-6"> |
|
|
|
|
|
|
|
<div class="col-6"> |
|
|
|
<div class="input-group input-group-sm sm-6"> |
|
|
|
<input type="text" |
|
|
|
class="form-control" |
|
|
|
aria-label="Small" aria-describedby="inputGroup-sizing-sm" |
|
|
|
placeholder="Filter your LOG searches by tags" |
|
|
|
v-model="search.tag" |
|
|
|
@keyup.enter="setFilter" |
|
|
|
<!-- --------------------------------------------------------- --> |
|
|
|
<!-- -------- date satrt----------------------------------- --> |
|
|
|
<!-- --------------------------------------------------------- --> |
|
|
|
<div class="input-group input-group-sm mb-3"> |
|
|
|
<div class="input-group-prepend"> |
|
|
|
<button class="btn btn-outline-secondary" |
|
|
|
type="button" |
|
|
|
>Start date </button> |
|
|
|
</div> |
|
|
|
<date-picker |
|
|
|
type="date" |
|
|
|
autocomplete="off" |
|
|
|
v-model="search.datestart" |
|
|
|
format="YYYY-MM-DD" |
|
|
|
lang="en" |
|
|
|
> |
|
|
|
</date-picker> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> <!-- col --> |
|
|
|
<div class="col-6"> |
|
|
|
|
|
|
|
<div class="col-6"> |
|
|
|
<div class="input-group input-group-sm sm-6"> |
|
|
|
<input type="text" |
|
|
|
class="form-control" |
|
|
|
aria-label="Small" aria-describedby="inputGroup-sizing-sm" |
|
|
|
placeholder="Filter your LOG searches by files" |
|
|
|
v-model="search.file" |
|
|
|
@keyup.enter="setFilter" |
|
|
|
<!-- --------------------------------------------------------- --> |
|
|
|
<!-- -------- date ----------------------------------- --> |
|
|
|
<!-- --------------------------------------------------------- --> |
|
|
|
<div class="input-group input-group-sm mb-3"> |
|
|
|
<div class="input-group-prepend"> |
|
|
|
<button class="btn btn-outline-secondary" |
|
|
|
type="button" |
|
|
|
>End date </button> |
|
|
|
</div> |
|
|
|
<date-picker |
|
|
|
type="date" |
|
|
|
autocomplete="off" |
|
|
|
v-model="search.dateend" |
|
|
|
format="YYYY-MM-DD" |
|
|
|
lang="en" |
|
|
|
> |
|
|
|
</date-picker> |
|
|
|
|
|
|
|
<div class="input-group-append"> |
|
|
|
<button |
|
|
|
class="btn btn-outline-primary" |
|
|
|
round |
|
|
|
type="button" |
|
|
|
@click="setFilter"> |
|
|
|
Go</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> <!-- col --> |
|
|
|
|
|
|
|
</div> <!-- row --> |
|
|
|
|
|
|
|
|
|
|
|
<div class="row"> |
|
|
|
<div class="col-12"> |
|
|
|
<div class="col-6"> |
|
|
|
|
|
|
|
<div class="input-group input-group-sm sm-6"> |
|
|
|
<div class="input-group-prepend"> |
|
|
|
<button |
|
|
|
class="btn btn-outline-secondary" |
|
|
|
round |
|
|
|
type="button" |
|
|
|
|
|
|
|
<div class="form-control custom-control custom-switch custom-control-inline"> |
|
|
|
<input type="checkbox" class="custom-control-input" id="log_logerror" |
|
|
|
v-model="logcheck.error" |
|
|
|
> |
|
|
|
Search |
|
|
|
</button> |
|
|
|
<label class="custom-control-label" for="log_logerror">Error</label> |
|
|
|
</div> |
|
|
|
|
|
|
|
<input type="text" |
|
|
|
class="form-control" |
|
|
|
aria-label="Small" aria-describedby="inputGroup-sizing-sm" |
|
|
|
placeholder="Search" |
|
|
|
v-model="search.app" |
|
|
|
@keyup.enter="setFilter" |
|
|
|
<div class="form-control custom-control custom-switch custom-control-inline"> |
|
|
|
<input type="checkbox" class="custom-control-input" id="log_output" |
|
|
|
v-model="logcheck.output" |
|
|
|
data-size="large" |
|
|
|
data-toggle="toggle" |
|
|
|
> |
|
|
|
<label class="custom-control-label" for="log_output">Output</label> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="form-control custom-control custom-switch custom-control-inline"> |
|
|
|
<input type="checkbox" class="custom-control-input" id="log_log" |
|
|
|
v-model="logcheck.log" |
|
|
|
> |
|
|
|
<label class="custom-control-label" for="log_log">Log</label> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> <!-- col --> |
|
|
|
|
|
|
|
<div class="col-5"> |
|
|
|
<div class="input-group input-group-sm sm-5 justify-content-end "> |
|
|
|
<div class="input-group-prepend"> |
|
|
|
<div class="input-group-append"> |
|
|
|
<button |
|
|
|
class="btn btn-outline-primary" |
|
|
|
class="btn btn-outline-warning" |
|
|
|
round |
|
|
|
type="button" |
|
|
|
@click="setFilter"> |
|
|
|
Go</button> |
|
|
|
@click="Clearlog"> |
|
|
|
Clear</button> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="input-group-append"> |
|
|
|
<button class="btn btn-outline-secondary" |
|
|
|
<button |
|
|
|
class="btn btn-outline-primary" |
|
|
|
round |
|
|
|
type="button" |
|
|
|
@click="resetFilter"> |
|
|
|
Reset</button> |
|
|
|
@click="Hotlog"> |
|
|
|
Hot_log</button> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> <!-- col --> |
|
|
|
|
|
|
|
<div class="col-1"> |
|
|
|
</div> <!-- col --> |
|
|
|
|
|
|
|
</div> <!-- row --> |
|
|
|
|
|
|
|
|
|
|
|
<div class="row"> |
|
|
|
<div class="row rowlog overflow-auto"> |
|
|
|
<div class="col-12" |
|
|
|
v-for="item in log_path" |
|
|
|
> |
|
|
|
|
|
|
|
<b-row |
|
|
|
class="border-bottom" |
|
|
|
v-if="logview(item) === true" |
|
|
|
> |
|
|
|
<b-col cols="2"> |
|
|
|
<span class="badge badge-danger badge-pill" |
|
|
|
style="cursor: pointer" |
|
|
|
@click="clearLog(item)" |
|
|
|
@click="clearLog()" |
|
|
|
>Clear</span> |
|
|
|
</b-col> |
|
|
|
|
|
|
@ -124,9 +176,13 @@ import {mapState, mapGetters, mapActions,dispatch} from 'vuex' |
|
|
|
import Vue from 'vue' |
|
|
|
import store from '@/store/index' |
|
|
|
import JSZip from 'jszip'; |
|
|
|
import DatePicker from 'vue2-datepicker' |
|
|
|
import 'vue2-datepicker/index.css'; |
|
|
|
import { DateTime } from "luxon"; |
|
|
|
import FileSaver from 'file-saver'; |
|
|
|
export default { |
|
|
|
components: { |
|
|
|
DatePicker |
|
|
|
}, |
|
|
|
data () { |
|
|
|
return { |
|
|
@ -135,10 +191,18 @@ export default { |
|
|
|
log_path_lenghtstatus:[], |
|
|
|
loglenghttotal:32, |
|
|
|
search: { |
|
|
|
tag: "", |
|
|
|
file: "", |
|
|
|
app: "" |
|
|
|
datestart: "", |
|
|
|
dateend: "", |
|
|
|
log: "", |
|
|
|
output: "", |
|
|
|
error: "" |
|
|
|
}, |
|
|
|
logcheck: { |
|
|
|
log: true, |
|
|
|
error: true, |
|
|
|
output: true |
|
|
|
}, |
|
|
|
selected: [], |
|
|
|
showlloedit:true, |
|
|
|
issocket:'close', |
|
|
|
socketdata:'', |
|
|
@ -148,6 +212,37 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
Hotlog() { |
|
|
|
this.Clearlog() |
|
|
|
var restapi = "off" |
|
|
|
var logrestapi = store.dispatch("pipelineLLO/setRestapi",{ |
|
|
|
restapi:restapi |
|
|
|
}) |
|
|
|
}, |
|
|
|
Clearlog() { |
|
|
|
var log = store.dispatch("pipelineLLO/RMmongolog") |
|
|
|
this.log_path = [] |
|
|
|
//var mongolog = store.getters['pipelineLLO/getmongolog']; |
|
|
|
//console.log("rmmongolog "+JSON.stringify(mongolog)) |
|
|
|
}, |
|
|
|
logview(item) { |
|
|
|
//console.log('path ' + JSON.stringify(item)) |
|
|
|
if(this.logcheck.log){ |
|
|
|
if(item.endsWith('-log')){ |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
if(this.logcheck.error){ |
|
|
|
if(item.endsWith('-error')){ |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
if(this.logcheck.output){ |
|
|
|
if(item.endsWith('-output')){ |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
async selectPath(path) { |
|
|
|
console.log('path ' + JSON.stringify(path)) |
|
|
|
var statuslenght = this.log_path_lenght[path] |
|
|
@ -167,7 +262,42 @@ export default { |
|
|
|
|
|
|
|
}, |
|
|
|
async setFilter() { |
|
|
|
console.log(JSON.stringify(this.logdata)) |
|
|
|
console.log(JSON.stringify(this.search)) |
|
|
|
var dd = this.search.datestart |
|
|
|
console.log(dd) |
|
|
|
console.log('new '+DateTime.fromISO(dd)) |
|
|
|
console.log('new1 '+DateTime.fromObject(dd).toISODate()) |
|
|
|
var restapi = "on" |
|
|
|
var logrestapi = await store.dispatch("pipelineLLO/setRestapi",{ |
|
|
|
restapi:restapi |
|
|
|
}) |
|
|
|
var swarmlabname = new URL(location.href).searchParams.get('pipelinename'); |
|
|
|
var log = await store.dispatch("pipelineLLO/get_log",{ |
|
|
|
search:this.search, |
|
|
|
swarmlabname:swarmlabname |
|
|
|
}) |
|
|
|
var mongolog = store.getters['pipelineLLO/getmongolog']; |
|
|
|
console.log("paramp "+JSON.stringify(mongolog)) |
|
|
|
//var mlog = mongolog.data.data |
|
|
|
|
|
|
|
//this.$root.$emit('GREP_on_data',mongolog.data.data) |
|
|
|
|
|
|
|
// list files from data |
|
|
|
this.log_path = [...new Set(mongolog.map(item => item.tailed_path))]; |
|
|
|
var loglenght = '' |
|
|
|
for (let item of this.log_path) { |
|
|
|
loglenght = mongolog.filter(item1 => item1.tailed_path === item).length; |
|
|
|
Vue.set(this.log_path_lenght, item, loglenght); |
|
|
|
if(loglenght > this.loglenghttotal){ |
|
|
|
// ------------------------------------- |
|
|
|
// Save store |
|
|
|
// ------------------------------------- |
|
|
|
var ltotal1 = store.dispatch("pipelineLLO/taillog",{ |
|
|
|
path:item |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
async resetFilter() { |
|
|
|
console.log(JSON.stringify(this.logdata)) |
|
|
@ -515,5 +645,9 @@ export default { |
|
|
|
font-family: monospace; |
|
|
|
height: 750px; |
|
|
|
} |
|
|
|
.rowlog { |
|
|
|
display: flex; /* equal height of the children */ |
|
|
|
height: 470px; |
|
|
|
} |
|
|
|
|
|
|
|
</style> |
|
|
|