From 033317e0a79f5a9f208b7792a1c5d47f11aeca4c Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Tue, 17 Oct 2023 16:38:46 +0200 Subject: [PATCH] [Extensions UI] Passing `config_file` to the configuration tab. --- .../src/components/panels/Extensions/Config.vue | 6 ++++++ .../src/components/panels/Extensions/Extension.vue | 8 +++++++- .../src/components/panels/Extensions/Index.vue | 12 ++++++++++-- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/platypush/backend/http/webapp/src/components/panels/Extensions/Config.vue b/platypush/backend/http/webapp/src/components/panels/Extensions/Config.vue index d67b8596f..966cba396 100644 --- a/platypush/backend/http/webapp/src/components/panels/Extensions/Config.vue +++ b/platypush/backend/http/webapp/src/components/panels/Extensions/Config.vue @@ -18,17 +18,23 @@ export default { components: { CopyButton, }, + props: { extension: { type: Object, required: true, }, + + configFile: { + type: String, + }, }, computed: { highlightedConfigSnippet() { return hljs.highlight( 'yaml', + `# Add this configuration template to ${this.configFile}\n` + this.extension.config_snippet, ).value.trim() }, diff --git a/platypush/backend/http/webapp/src/components/panels/Extensions/Extension.vue b/platypush/backend/http/webapp/src/components/panels/Extensions/Extension.vue index 2e7e1e5ac..49c960e91 100644 --- a/platypush/backend/http/webapp/src/components/panels/Extensions/Extension.vue +++ b/platypush/backend/http/webapp/src/components/panels/Extensions/Extension.vue @@ -26,7 +26,9 @@
- +
@@ -54,6 +56,10 @@ export default { type: Object, required: true, }, + + configFile: { + type: String, + }, }, data() { diff --git a/platypush/backend/http/webapp/src/components/panels/Extensions/Index.vue b/platypush/backend/http/webapp/src/components/panels/Extensions/Index.vue index 4567601d6..3a311f4a7 100644 --- a/platypush/backend/http/webapp/src/components/panels/Extensions/Index.vue +++ b/platypush/backend/http/webapp/src/components/panels/Extensions/Index.vue @@ -24,7 +24,8 @@
- +
@@ -32,7 +33,8 @@
- +
@@ -59,6 +61,7 @@ export default { backends: {}, filter: '', selectedExtension: null, + configFile: null, } }, @@ -127,9 +130,14 @@ export default { this.loading = false } }, + + async loadConfigFile() { + this.configFile = await this.request('config.get_config_file') + }, }, mounted() { + this.loadConfigFile() this.loadExtensions() bus.on('update:extension', (ext) => this.onInput(ext, false)) this.$nextTick(() => this.$refs.filter.focus())