Add WebSocket Log feature to Services Status View
- Introduced a WebSocket Log section in the Services Status View, allowing users to view real-time logs. - Updated localization files for both German and English to include WebSocket Log messages. - Enhanced the UI with a button to open the WebSocket Log dialog, improving user interaction and monitoring capabilities.
This commit is contained in:
@@ -51,7 +51,12 @@
|
||||
|
||||
<!-- Daemon Connections -->
|
||||
<div v-if="daemonStatus === 'connected'" class="connections-section">
|
||||
<h3>{{ $t('admin.servicesStatus.daemon.connections.title') }}</h3>
|
||||
<div class="section-header">
|
||||
<h3>{{ $t('admin.servicesStatus.daemon.connections.title') }}</h3>
|
||||
<button @click="openWebSocketLogDialog" class="log-button">
|
||||
{{ $t('admin.servicesStatus.daemon.websocketLog.showLog') }}
|
||||
</button>
|
||||
</div>
|
||||
<div v-if="connections.length === 0" class="no-connections">
|
||||
<p>{{ $t('admin.servicesStatus.daemon.connections.none') }}</p>
|
||||
</div>
|
||||
@@ -91,6 +96,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- WebSocket Log Dialog -->
|
||||
<WebSocketLogDialog ref="webSocketLogDialog" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -98,11 +106,13 @@
|
||||
import { mapState, mapGetters } from 'vuex';
|
||||
import SimpleTabs from '@/components/SimpleTabs.vue';
|
||||
import apiClient from '@/utils/axios.js';
|
||||
import WebSocketLogDialog from '@/dialogues/admin/WebSocketLogDialog.vue';
|
||||
|
||||
export default {
|
||||
name: 'ServicesStatusView',
|
||||
components: {
|
||||
SimpleTabs
|
||||
SimpleTabs,
|
||||
WebSocketLogDialog
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -271,6 +281,11 @@ export default {
|
||||
const minutes = Math.floor((seconds % 3600) / 60);
|
||||
return `${hours}h ${minutes}m`;
|
||||
}
|
||||
},
|
||||
openWebSocketLogDialog() {
|
||||
if (this.$refs.webSocketLogDialog) {
|
||||
this.$refs.webSocketLogDialog.open();
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -364,10 +379,31 @@ export default {
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
.connections-section h3 {
|
||||
.section-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.section-header h3 {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.log-button {
|
||||
padding: 8px 16px;
|
||||
background: #1976d2;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.log-button:hover {
|
||||
background: #1565c0;
|
||||
}
|
||||
|
||||
.no-connections {
|
||||
padding: 20px;
|
||||
text-align: center;
|
||||
|
||||
Reference in New Issue
Block a user