diff --git a/lang/el.lang.json b/lang/el.lang.json index b8290392..3560f57a 100644 --- a/lang/el.lang.json +++ b/lang/el.lang.json @@ -384,7 +384,10 @@ "EnableAutoScroll": "Ενεργοποίηση αυτόματης κύλισης", "ClearConsole": "Εκκαθάριση κονσόλας", "CopyToClipboard": "Αντιγραφή στο πρόχειρο", - "Download": "Download" + "Download": "Download", + "RegularExpression": "Regular Expression", + "Lines": "{lines} Lines", + "LogLevel": "Log Level ({cnt})" }, "inverterchannelinfo": { "String": "Είσοδος {num}", diff --git a/lang/es.lang.json b/lang/es.lang.json index 86b24c46..f79ff997 100644 --- a/lang/es.lang.json +++ b/lang/es.lang.json @@ -384,7 +384,10 @@ "EnableAutoScroll": "Habilitar Desplazamiento Automático", "ClearConsole": "Limpiar Consola", "CopyToClipboard": "Copiar al Portapapeles", - "Download": "Download" + "Download": "Download", + "RegularExpression": "Regular Expression", + "Lines": "{lines} Lines", + "LogLevel": "Log Level ({cnt})" }, "inverterchannelinfo": { "String": "Cadena {num}", diff --git a/lang/it.lang.json b/lang/it.lang.json index 2075bfa7..c3d0872a 100644 --- a/lang/it.lang.json +++ b/lang/it.lang.json @@ -384,7 +384,10 @@ "EnableAutoScroll": "Abilita AutoScroll", "ClearConsole": "Pulisci Console", "CopyToClipboard": "Copia nella clipboard", - "Download": "Download" + "Download": "Download", + "RegularExpression": "Regular Expression", + "Lines": "{lines} Lines", + "LogLevel": "Log Level ({cnt})" }, "inverterchannelinfo": { "String": "Stringa {num}", diff --git a/lang/pl.lang.json b/lang/pl.lang.json index dfea40f4..6aad45d8 100644 --- a/lang/pl.lang.json +++ b/lang/pl.lang.json @@ -384,7 +384,10 @@ "EnableAutoScroll": "Włącz automatyczne przewijani", "ClearConsole": "Wyczyść konsolę", "CopyToClipboard": "Kopiuj do schowka", - "Download": "Download" + "Download": "Download", + "RegularExpression": "Regular Expression", + "Lines": "{lines} Lines", + "LogLevel": "Log Level ({cnt})" }, "inverterchannelinfo": { "String": "Numer panelu {num}", diff --git a/webapp/src/locales/de.json b/webapp/src/locales/de.json index 52c8e13f..e8a855e4 100644 --- a/webapp/src/locales/de.json +++ b/webapp/src/locales/de.json @@ -369,7 +369,10 @@ "EnableAutoScroll": "Automatisches Scrollen aktivieren", "ClearConsole": "Konsole leeren", "CopyToClipboard": "In die Zwischenablage kopieren", - "Download": "Herunterladen" + "Download": "Herunterladen", + "RegularExpression": "Regulärer Ausdruck", + "Lines": "{lines} Zeilen", + "LogLevel": "Protokollierungsstufe ({cnt})" }, "inverterchannelinfo": { "String": "String {num}", diff --git a/webapp/src/locales/en.json b/webapp/src/locales/en.json index 9f6e06d9..318b1607 100644 --- a/webapp/src/locales/en.json +++ b/webapp/src/locales/en.json @@ -369,7 +369,10 @@ "EnableAutoScroll": "Enable Auto Scroll", "ClearConsole": "Clear Console", "CopyToClipboard": "Copy to clipboard", - "Download": "Download" + "Download": "Download", + "RegularExpression": "Regular Expression", + "Lines": "{lines} Lines", + "LogLevel": "Log Level ({cnt})" }, "inverterchannelinfo": { "String": "String {num}", diff --git a/webapp/src/locales/fr.json b/webapp/src/locales/fr.json index caab46e7..b5606ea9 100644 --- a/webapp/src/locales/fr.json +++ b/webapp/src/locales/fr.json @@ -351,7 +351,10 @@ "EnableAutoScroll": "Activer le défilement automatique", "ClearConsole": "Vider la console", "CopyToClipboard": "Copier dans le presse-papiers", - "Download": "Download" + "Download": "Download", + "RegularExpression": "Regular Expression", + "Lines": "{lines} Lines", + "LogLevel": "Log Level ({cnt})" }, "inverterchannelinfo": { "String": "Ligne {num}", diff --git a/webapp/src/views/ConsoleInfoView.vue b/webapp/src/views/ConsoleInfoView.vue index 5f944c4c..cbe7daac 100644 --- a/webapp/src/views/ConsoleInfoView.vue +++ b/webapp/src/views/ConsoleInfoView.vue @@ -1,8 +1,85 @@ @@ -45,17 +110,24 @@ import BasePage from '@/components/BasePage.vue'; import CardElement from '@/components/CardElement.vue'; import { authUrl } from '@/utils/authentication'; +import { BIconClipboard, BIconDownload, BIconFilter, BIconSearch, BIconTrash } from 'bootstrap-icons-vue'; import { defineComponent } from 'vue'; interface LogLine { text: string; timestamp: Date; + level: string; } export default defineComponent({ components: { BasePage, CardElement, + BIconDownload, + BIconClipboard, + BIconTrash, + BIconFilter, + BIconSearch, }, data() { return { @@ -63,6 +135,8 @@ export default defineComponent({ heartInterval: 0, dataLoading: true, autoScroll: true, + activeLevels: ['error', 'warning', 'info', 'debug', 'verbose'], + searchText: '', lines: [] as LogLine[], buffer: '', levelMap: { @@ -81,6 +155,15 @@ export default defineComponent({ unmounted() { this.closeSocket(); }, + computed: { + filteredLines(): LogLine[] { + return this.lines.filter((line) => { + const regexp = new RegExp(this.searchText, 'i'); + const found = regexp.test(line.text); + return this.activeLevels.includes(line.level) && found; + }); + }, + }, methods: { initSocket() { console.log('Starting connection to WebSocket Server'); @@ -104,6 +187,7 @@ export default defineComponent({ this.lines.push({ text: line, timestamp: new Date(), // assign time of message arrival + level: this.getLineClass(line), }); this.$nextTick(() => { if (this.autoScroll) { @@ -189,7 +273,7 @@ export default defineComponent({ this.buffer = ''; }, copyConsole() { - const content = this.lines + const content = this.filteredLines .map((line) => `[${this.formatTimestamp(line.timestamp)}] ${line.text}`) .join('\n'); navigator.clipboard @@ -202,7 +286,7 @@ export default defineComponent({ }); }, exportConsole() { - const content = this.lines + const content = this.filteredLines .map((line) => `[${this.formatTimestamp(line.timestamp)}] ${line.text}`) .join('\n'); const timestamp = this.getFileTimestamp(); @@ -234,7 +318,7 @@ export default defineComponent({ }); -