Log Viewer: Add next/prev to log details popup & make it movable (#3172)
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>pull/3192/head
parent
a266cf03d4
commit
7133f9e79d
|
@ -112,15 +112,30 @@
|
||||||
</f7-popover>
|
</f7-popover>
|
||||||
|
|
||||||
<!-- Log Details Popup -->
|
<!-- Log Details Popup -->
|
||||||
<f7-popup id="logdetails-popup" close-on-escape close-by-backdrop-click>
|
<f7-popup id="logdetails-popup" ref="logDetailsPopup" close-on-escape close-by-backdrop-click @popup:open="popupOpened($refs.logDetailsPopup, $refs.logDetailsNavbar)" @popup:closed="cleanupMovablePopup">
|
||||||
<f7-page>
|
<f7-page>
|
||||||
<f7-navbar title="Log Details">
|
<f7-navbar title="Log Details" ref="logDetailsNavbar">
|
||||||
<f7-nav-right>
|
<f7-nav-right>
|
||||||
<f7-link class="popup-close">
|
<f7-link class="popup-close">
|
||||||
Close
|
Close
|
||||||
</f7-link>
|
</f7-link>
|
||||||
</f7-nav-right>
|
</f7-nav-right>
|
||||||
</f7-navbar>
|
</f7-navbar>
|
||||||
|
<f7-toolbar bottom class="toolbar-details">
|
||||||
|
<div class="display-flex justify-content-center" style="width: 100%">
|
||||||
|
<f7-link class="display-flex flex-direction-row margin-right" @click="selectedId = selectedId > 0 ? selectedId - 1 : 0">
|
||||||
|
<f7-icon f7="backward_fill" />
|
||||||
|
Previous
|
||||||
|
</f7-link>
|
||||||
|
<f7-link class="display-flex flex-direction-row margin-right" @click="selectedId = selectedId < tableData.length - 1 ? selectedId + 1 : tableData.length - 1">
|
||||||
|
Next
|
||||||
|
<f7-icon f7="forward_fill" />
|
||||||
|
</f7-link>
|
||||||
|
<f7-link class="display-flex flex-direction-row" @click="selectedId = tableData.length - 1">
|
||||||
|
<f7-icon f7="forward_end_fill" />
|
||||||
|
</f7-link>
|
||||||
|
</div>
|
||||||
|
</f7-toolbar>
|
||||||
|
|
||||||
<f7-list class="col wide">
|
<f7-list class="col wide">
|
||||||
<f7-list-item header="Time" :title="selectedLog.time + selectedLog.milliseconds" />
|
<f7-list-item header="Time" :title="selectedLog.time + selectedLog.milliseconds" />
|
||||||
|
@ -383,7 +398,10 @@
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import MovablePopupMixin from '@/pages/settings/movable-popup-mixin'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [MovablePopupMixin],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
stateConnected: false,
|
stateConnected: false,
|
||||||
|
@ -411,7 +429,7 @@ export default {
|
||||||
currentHighlightColorItemIndex: null,
|
currentHighlightColorItemIndex: null,
|
||||||
currentHighlightColor: '#FF5252',
|
currentHighlightColor: '#FF5252',
|
||||||
lastSequence: 0,
|
lastSequence: 0,
|
||||||
selectedLog: {},
|
selectedId: null,
|
||||||
colors: [
|
colors: [
|
||||||
'#FF0000', // Red
|
'#FF0000', // Red
|
||||||
'#00FF00', // Green
|
'#00FF00', // Green
|
||||||
|
@ -440,6 +458,9 @@ export default {
|
||||||
if (this.tableData.length >= this.maxEntries) return 'red'
|
if (this.tableData.length >= this.maxEntries) return 'red'
|
||||||
if (this.filterCount < this.tableData.length) return 'orange'
|
if (this.filterCount < this.tableData.length) return 'orange'
|
||||||
return 'green'
|
return 'green'
|
||||||
|
},
|
||||||
|
selectedLog () {
|
||||||
|
return this.tableData.find(entry => entry.id === this.selectedId) || {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -479,6 +500,11 @@ export default {
|
||||||
onPageBeforeOut () {
|
onPageBeforeOut () {
|
||||||
this.loggingStop()
|
this.loggingStop()
|
||||||
},
|
},
|
||||||
|
popupOpened (ref, navbar) {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.initializeMovablePopup(ref, navbar)
|
||||||
|
})
|
||||||
|
},
|
||||||
updateLogLevel (logger, value) {
|
updateLogLevel (logger, value) {
|
||||||
logger.level = value
|
logger.level = value
|
||||||
this.$oh.api.put('/rest/logging/' + logger.loggerName, logger)
|
this.$oh.api.put('/rest/logging/' + logger.loggerName, logger)
|
||||||
|
@ -557,7 +583,7 @@ export default {
|
||||||
return tr
|
return tr
|
||||||
},
|
},
|
||||||
onRowClick (entityId) {
|
onRowClick (entityId) {
|
||||||
this.selectedLog = this.filteredTableData[entityId]
|
this.selectedId = entityId
|
||||||
this.$f7.popup.open('#logdetails-popup')
|
this.$f7.popup.open('#logdetails-popup')
|
||||||
},
|
},
|
||||||
addLogEntry (logEntry) {
|
addLogEntry (logEntry) {
|
||||||
|
|
Loading…
Reference in New Issue