From e614ec577ee52a3b183de4c04a983bbf76daacc6 Mon Sep 17 00:00:00 2001 From: Julian Stirling Date: Sun, 13 Jul 2025 10:26:01 +0100 Subject: [PATCH] Expose server version strings in webapp. --- .../aboutComponents/statusPane.vue | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/webapp/src/components/tabContentComponents/aboutComponents/statusPane.vue b/webapp/src/components/tabContentComponents/aboutComponents/statusPane.vue index 47cf4463..6314666f 100644 --- a/webapp/src/components/tabContentComponents/aboutComponents/statusPane.vue +++ b/webapp/src/components/tabContentComponents/aboutComponents/statusPane.vue @@ -25,7 +25,8 @@
Server Version:
- v{{ app_version() }} + {{ version }}
+ ({{ version_source }})

@@ -66,11 +67,40 @@ export default { name: "StatusPane", components: { ActionButton }, + data: function() { + return { + version: undefined, + version_source: undefined + } + }, + + async mounted() { + let version_data = await this.readThingProperty( + "settings", + "version_data" + ); + this.version = version_data.version; + this.version_source = this.truncate(version_data.version_source); + + }, + computed: { things: function() { return this.$store.getters["wot/thingDescriptions"]; } }, + + methods: { + truncate(string, max_length=15) { + if (!(typeof string === 'string' || string instanceof String)) { + return string; + } + if (string.length <= max_length) { + return string; + } + return string.slice(0, max_length - 3) + "..."; + } + } };