From a65d297997d4b0e6d2ab87d3f03642d7ecf5a392 Mon Sep 17 00:00:00 2001 From: cgfhtw Date: Mon, 24 Oct 2022 16:01:02 +0200 Subject: [PATCH] use FHC_JS_DATA_STORAGE_OBJECT for apiurl --- public/js/components/Dashboard/Dashboard.js | 15 +++++++++------ .../composables/Dashboard/CachedWidgetLoader.js | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/public/js/components/Dashboard/Dashboard.js b/public/js/components/Dashboard/Dashboard.js index 8b58b6efc..b36e11bde 100644 --- a/public/js/components/Dashboard/Dashboard.js +++ b/public/js/components/Dashboard/Dashboard.js @@ -4,17 +4,21 @@ import CachedWidgetLoader from "../../composables/Dashboard/CachedWidgetLoader.j import ObjectUtils from "../../composables/ObjectUtils.js"; export default { + components: { + DashboardSection, + DashboardWidgetPicker + }, props: [ - "dashboard", - "apiurl" + "dashboard" ], data: () => ({ sections: [], widgets: null }), - components: { - DashboardSection, - DashboardWidgetPicker + computed: { + apiurl() { + return FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + '/dashboard'; + } }, methods: { widgetAdd(section_name, widget) { @@ -117,7 +121,6 @@ export default { } }, created() { - CachedWidgetLoader.setPath(this.apiurl + '/Widget'); axios.get(this.apiurl + '/Config', {params:{ db: this.dashboard }}).then(res => { diff --git a/public/js/composables/Dashboard/CachedWidgetLoader.js b/public/js/composables/Dashboard/CachedWidgetLoader.js index e0eb39710..3ebe6ddcb 100644 --- a/public/js/composables/Dashboard/CachedWidgetLoader.js +++ b/public/js/composables/Dashboard/CachedWidgetLoader.js @@ -1,6 +1,6 @@ let __widgets = {}; let __widgetsStarted = {}; -let __path = ''; +let __path = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + '/dashboard/Widget'; export default { getWidget(id) {