From 77f3ce0e39e5b1baa0434bfc8f96acc60ad35f26 Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Wed, 11 Mar 2020 23:12:29 +0100 Subject: [PATCH] Display logger conf with json components --- src/csui/LoggerUi.vue | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/csui/LoggerUi.vue b/src/csui/LoggerUi.vue index 61c1cb2..34c41a5 100644 --- a/src/csui/LoggerUi.vue +++ b/src/csui/LoggerUi.vue @@ -50,6 +50,10 @@ +
+ +
+
@@ -130,8 +134,12 @@ import { mapState } from 'vuex'; import Logger from '../ext/lib/Logger'; import Comms from '../ext/lib/comms/Comms'; import IO from '../common/js/IO'; +import JsonObject from '../common/components/JsonEditor/JsonObject'; export default { + components: { + JsonObject, + }, data() { return { showLoggerUi: false, @@ -141,6 +149,7 @@ export default { }, parsedSettings: '', lastSettings: {}, + currentSettings: {}, confHasError: false, logStringified: '', } @@ -187,11 +196,13 @@ export default { async getLoggerSettings() { this.lastSettings = await Logger.getConfig() || {}; this.parsedSettings = JSON.stringify(this.lastSettings, null, 2) || ''; + this.currentSettings = JSON.parse(JSON.stringify(this.lastSettings)); }, updateSettings(val) { try { this.parsedSettings = JSON.stringify(JSON.parse(val.target.textContent.trim()), null, 2); this.lastSettings = JSON.parse(val.target.textContent.trim()); + this.currentSettings = JSON.parse(JSON.stringify(this.lastSettings)); this.confHasError = false; } catch (e) { this.confHasError = true; @@ -368,4 +379,11 @@ pre { background-color: #884420; } +.json-level-indent { + padding-left: 2em !important; +} +.item-key { + color: #fa6; +} +