From 54960d84801e84ae82ff1957654ac8ab8783ab5b Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Thu, 17 Jul 2025 15:40:05 +0200 Subject: [PATCH] basics of an open data plugin (tmp in this repo) temporarily in the main repo while testing and playing around --- .../plugins/open_data_plugin/OpenDataPage.vue | 26 ++++++++++ .../model_editors/OpenDataFoodEditor.vue | 51 +++++++++++++++++++ vue3/src/plugins/open_data_plugin/plugin.ts | 32 ++++++++++++ 3 files changed, 109 insertions(+) create mode 100644 vue3/src/plugins/open_data_plugin/OpenDataPage.vue create mode 100644 vue3/src/plugins/open_data_plugin/components/model_editors/OpenDataFoodEditor.vue create mode 100644 vue3/src/plugins/open_data_plugin/plugin.ts diff --git a/vue3/src/plugins/open_data_plugin/OpenDataPage.vue b/vue3/src/plugins/open_data_plugin/OpenDataPage.vue new file mode 100644 index 000000000..6223ed9e0 --- /dev/null +++ b/vue3/src/plugins/open_data_plugin/OpenDataPage.vue @@ -0,0 +1,26 @@ + + + + + + \ No newline at end of file diff --git a/vue3/src/plugins/open_data_plugin/components/model_editors/OpenDataFoodEditor.vue b/vue3/src/plugins/open_data_plugin/components/model_editors/OpenDataFoodEditor.vue new file mode 100644 index 000000000..1a211dbfa --- /dev/null +++ b/vue3/src/plugins/open_data_plugin/components/model_editors/OpenDataFoodEditor.vue @@ -0,0 +1,51 @@ + + + + + \ No newline at end of file diff --git a/vue3/src/plugins/open_data_plugin/plugin.ts b/vue3/src/plugins/open_data_plugin/plugin.ts new file mode 100644 index 000000000..83f528700 --- /dev/null +++ b/vue3/src/plugins/open_data_plugin/plugin.ts @@ -0,0 +1,32 @@ +import {TandoorPlugin} from '@/types/Plugins.ts' +import {Model, registerModel} from "@/types/Models.ts"; +import {defineAsyncComponent} from "vue"; + +export const plugin: TandoorPlugin = { + name: 'Open Data Plugin', + routes: [ + {path: '/open-data/', component: () => import("@/plugins/open_data_plugin/OpenDataPage.vue"), name: 'OpenDataPage'}, + ] +} as TandoorPlugin + + +// define models below + +const TOpenDataFood = { + name: 'OpenDataFood', + localizationKey: 'Food', + localizationKeyDescription: 'FoodHelp', + icon: 'fa-solid fa-carrot', + + editorComponent: defineAsyncComponent(() => import(`@/plugins/open_data_plugin/components/model_editors/OpenDataFoodEditor.vue`)), + + isPaginated: false, + isMerge: false, + toStringKeys: ['name'], + + tableHeaders: [ + {title: 'Name', key: 'name'}, + {title: 'Actions', key: 'action', align: 'end'}, + ] +} as Model +registerModel(TOpenDataFood) \ No newline at end of file