|
|
@ -18,48 +18,63 @@ |
|
|
|
> |
|
|
|
online |
|
|
|
</button> |
|
|
|
<div v-if="socketonline"> |
|
|
|
<div v-if="socketonline"></div> |
|
|
|
<button |
|
|
|
type="button" |
|
|
|
round |
|
|
|
disable |
|
|
|
class="btn btn-outline-info btn-sm" |
|
|
|
v-if="socketonline" |
|
|
|
@click="showHistory" |
|
|
|
v-else |
|
|
|
@click="socketconnect" |
|
|
|
> |
|
|
|
{{ this.alllogs }} |
|
|
|
socket disconnected |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
</b-col> |
|
|
|
|
|
|
|
<b-col cols="3"> |
|
|
|
<div class="input-group input-group-sm sm-3"> |
|
|
|
<div v-if="socketonline" class="search-wrapper"> |
|
|
|
<label class="filters" for="search">Search a log:</label> |
|
|
|
<input |
|
|
|
id="search" |
|
|
|
type="text" |
|
|
|
v-model="searchparam" |
|
|
|
placeholder="Log" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
<label class="filters" for="list">Pick a service:</label> |
|
|
|
<select class="filters" id="list" v-model="selected"> |
|
|
|
<option selected value="All">All</option> |
|
|
|
<option v-for="item in this.items" v-bind:value="item.name"> |
|
|
|
{{ item.name }} |
|
|
|
</option> |
|
|
|
</select> |
|
|
|
<button |
|
|
|
type="button" |
|
|
|
round |
|
|
|
disable |
|
|
|
class="btn btn-outline-info btn-sm" |
|
|
|
v-if="socketonline" |
|
|
|
@click="showChart" |
|
|
|
@click="showHistory" |
|
|
|
> |
|
|
|
{{ this.chartbut }} |
|
|
|
{{ this.alllogs }} |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
</b-col> |
|
|
|
|
|
|
|
<b-col cols="5"> |
|
|
|
<div class="input-group input-group-sm d-flex justify-content-end"> |
|
|
|
<button |
|
|
|
type="button" |
|
|
|
round |
|
|
|
disable |
|
|
|
class="btn btn-outline-info btn-sm" |
|
|
|
v-else |
|
|
|
@click="socketconnect" |
|
|
|
v-if="socketonline" |
|
|
|
@click="showChart" |
|
|
|
> |
|
|
|
socket disconnected |
|
|
|
{{ this.chartbut }} |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
</b-col> |
|
|
|
|
|
|
|
<b-col cols="3"> |
|
|
|
<div class="input-group input-group-sm sm-3"></div> |
|
|
|
</b-col> |
|
|
|
|
|
|
|
<b-col cols="5"> |
|
|
|
<div |
|
|
|
class="input-group input-group-sm d-flex justify-content-end" |
|
|
|
></div> |
|
|
|
<div class="input-group input-group-sm d-flex justify-content-end"> |
|
|
|
<div class="input-group-append"> |
|
|
|
<button |
|
|
@ -89,6 +104,8 @@ |
|
|
|
:show-sort-icons="true" |
|
|
|
:multi-sort="multiSort" |
|
|
|
:per-page="perpage" |
|
|
|
:append-params="extraparams" |
|
|
|
table-height="300px" |
|
|
|
pagination-path="links.pagination" |
|
|
|
detail-row-id="id" |
|
|
|
wrapper-class="vuetable-wrapper" |
|
|
@ -209,6 +226,11 @@ export default { |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
items: [], |
|
|
|
extraparams: { |
|
|
|
logtext: "", |
|
|
|
}, |
|
|
|
searchparam: "", |
|
|
|
chartstatus: false, |
|
|
|
chartbut: "Show HighChart", |
|
|
|
chartOptions: { |
|
|
@ -240,12 +262,13 @@ export default { |
|
|
|
title: "Log", |
|
|
|
sortField: "message", |
|
|
|
visible: true, |
|
|
|
width: "45%%", |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "timestamp", |
|
|
|
title: "Time", |
|
|
|
sortField: "time", |
|
|
|
width: "20%", |
|
|
|
width: "25%", |
|
|
|
visible: true, |
|
|
|
}, |
|
|
|
{ |
|
|
@ -256,13 +279,16 @@ export default { |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "process_id", |
|
|
|
title: "P_ID", |
|
|
|
visible: true, |
|
|
|
width: "5%", |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "app_name", |
|
|
|
visible: true, |
|
|
|
sortField: "app_name", |
|
|
|
title: '<span class="orange"></span>App Name', |
|
|
|
width: "15%", |
|
|
|
}, |
|
|
|
// 'timestamp', |
|
|
|
// 'type', |
|
|
@ -314,7 +340,7 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
alllogs: "Show app logs", |
|
|
|
alllogs: "Search", |
|
|
|
socketonline: false, |
|
|
|
tryConsole: false, |
|
|
|
history: false, |
|
|
@ -385,7 +411,7 @@ export default { |
|
|
|
LearningObject: "", |
|
|
|
showllo: true, |
|
|
|
showlloedit: true, |
|
|
|
selected: "sublime", |
|
|
|
selected: "All", |
|
|
|
options: [ |
|
|
|
{ text: "vim", value: "vim" }, |
|
|
|
{ text: "sublime", value: "sublime" }, |
|
|
@ -481,13 +507,26 @@ export default { |
|
|
|
this.chartbut = "Show HighChart"; |
|
|
|
} |
|
|
|
}, |
|
|
|
async getServices() { |
|
|
|
await axios.get("http://localhost:3000/services").then((res) => { |
|
|
|
res.data.forEach((val) => { |
|
|
|
//console.log(val); |
|
|
|
this.items.push({ |
|
|
|
name: val, |
|
|
|
}); |
|
|
|
}); |
|
|
|
// this.items.push({ |
|
|
|
// name: "All", |
|
|
|
// }); |
|
|
|
}); |
|
|
|
}, |
|
|
|
showHistory() { |
|
|
|
this.extraparams.logtext = this.searchparam; |
|
|
|
this.extraparams.selected = this.selected; |
|
|
|
if (this.history == false) { |
|
|
|
this.history = true; |
|
|
|
this.alllogs = "Hide app logs"; |
|
|
|
} else { |
|
|
|
this.alllogs = "Show app logs"; |
|
|
|
this.history = false; |
|
|
|
this.$refs.vuetable.refresh(); |
|
|
|
} |
|
|
|
}, |
|
|
|
onPaginationData(paginationData) { |
|
|
@ -740,11 +779,13 @@ export default { |
|
|
|
).searchParams.get("token"); |
|
|
|
|
|
|
|
this.swarmlabname = new URL(location.href).searchParams.get("pipelinename"); |
|
|
|
|
|
|
|
this.getServices(); |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
|
|
|
|
|
<style scoped> |
|
|
|
<style sc oped> |
|
|
|
h2 { |
|
|
|
background-color: dimgray; |
|
|
|
padding: 10px; |
|
|
@ -756,11 +797,6 @@ h2 { |
|
|
|
padding-top: 50px; |
|
|
|
max-width: 100%; |
|
|
|
} |
|
|
|
.table3 { |
|
|
|
min-height: 320px; |
|
|
|
max-width: 100%; |
|
|
|
overflow: auto; |
|
|
|
} |
|
|
|
.CodeMirror { |
|
|
|
font-family: monospace; |
|
|
|
max-width: 900px; |
|
|
@ -788,4 +824,12 @@ h2 { |
|
|
|
.pagi { |
|
|
|
height: 40px; |
|
|
|
} |
|
|
|
#search { |
|
|
|
padding: 0px 5px 5px 5px; |
|
|
|
|
|
|
|
margin: 0px 0px 10px 10px; |
|
|
|
} |
|
|
|
.filters { |
|
|
|
margin: 0px 0px 0px 10px; |
|
|
|
} |
|
|
|
</style> |
|
|
|