From 2fe91054e31e56ff36a1d156b63eb246a75e1f18 Mon Sep 17 00:00:00 2001 From: Md Afiq Iskandar Date: Tue, 24 Jun 2025 11:13:12 +0800 Subject: [PATCH] Implement Plugin Manager: Add new pages for managing plugins, including store, installed plugins, and upload functionality. Update navigation to include Plugin Manager section. Enhance RsTab component to handle empty tab states. Remove unused ticket model from Prisma schema. --- components/RsTab.vue | 6 +- navigation/index.js | 22 + pages/devtool/plugin-manager/index.vue | 396 ++++++++ .../plugin-manager/installed/index.vue | 593 ++++++++++++ pages/devtool/plugin-manager/store/[slug].vue | 879 ++++++++++++++++++ pages/devtool/plugin-manager/store/index.vue | 485 ++++++++++ pages/devtool/plugin-manager/upload/index.vue | 516 ++++++++++ prisma/schema.prisma | 11 - 8 files changed, 2894 insertions(+), 14 deletions(-) create mode 100644 pages/devtool/plugin-manager/index.vue create mode 100644 pages/devtool/plugin-manager/installed/index.vue create mode 100644 pages/devtool/plugin-manager/store/[slug].vue create mode 100644 pages/devtool/plugin-manager/store/index.vue create mode 100644 pages/devtool/plugin-manager/upload/index.vue diff --git a/components/RsTab.vue b/components/RsTab.vue index cf9fc3b..7198969 100644 --- a/components/RsTab.vue +++ b/components/RsTab.vue @@ -25,11 +25,11 @@ const props = defineProps({ // Slots const slots = useSlots(); -const tabs = ref(slots.default().map((tab) => tab.props)); -const selectedTitle = ref(tabs.value[0]["title"]); +const tabs = ref(slots.default().map((tab) => tab.props).filter(Boolean)); +const selectedTitle = ref(tabs.value.length > 0 && tabs.value[0] ? tabs.value[0]["title"] : ""); tabs.value.forEach((tab) => { - if (typeof tab.active !== "undefined") { + if (tab && typeof tab.active !== "undefined") { selectedTitle.value = tab.title; } }); diff --git a/navigation/index.js b/navigation/index.js index ed66b1c..eef5bfa 100644 --- a/navigation/index.js +++ b/navigation/index.js @@ -75,6 +75,28 @@ export default [ "path": "/devtool/api-editor", "icon": "material-symbols:api-rounded", "child": [] + }, + { + "title": "Plugin Manager", + "icon": "mdi:puzzle", + "child": [ + { + "title": "Dashboard", + "path": "/devtool/plugin-manager" + }, + { + "title": "Plugin Store", + "path": "/devtool/plugin-manager/store" + }, + { + "title": "My Plugins", + "path": "/devtool/plugin-manager/installed" + }, + { + "title": "Upload Plugin", + "path": "/devtool/plugin-manager/upload" + } + ] } ], "meta": { diff --git a/pages/devtool/plugin-manager/index.vue b/pages/devtool/plugin-manager/index.vue new file mode 100644 index 0000000..ed4d4c7 --- /dev/null +++ b/pages/devtool/plugin-manager/index.vue @@ -0,0 +1,396 @@ + + + \ No newline at end of file diff --git a/pages/devtool/plugin-manager/installed/index.vue b/pages/devtool/plugin-manager/installed/index.vue new file mode 100644 index 0000000..aee2d60 --- /dev/null +++ b/pages/devtool/plugin-manager/installed/index.vue @@ -0,0 +1,593 @@ + + + \ No newline at end of file diff --git a/pages/devtool/plugin-manager/store/[slug].vue b/pages/devtool/plugin-manager/store/[slug].vue new file mode 100644 index 0000000..60e9b35 --- /dev/null +++ b/pages/devtool/plugin-manager/store/[slug].vue @@ -0,0 +1,879 @@ + + + + + \ No newline at end of file diff --git a/pages/devtool/plugin-manager/store/index.vue b/pages/devtool/plugin-manager/store/index.vue new file mode 100644 index 0000000..ff0701f --- /dev/null +++ b/pages/devtool/plugin-manager/store/index.vue @@ -0,0 +1,485 @@ + + + \ No newline at end of file diff --git a/pages/devtool/plugin-manager/upload/index.vue b/pages/devtool/plugin-manager/upload/index.vue new file mode 100644 index 0000000..2ef32dd --- /dev/null +++ b/pages/devtool/plugin-manager/upload/index.vue @@ -0,0 +1,516 @@ + + + \ No newline at end of file diff --git a/prisma/schema.prisma b/prisma/schema.prisma index f8ffc9f..34d2c01 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -99,14 +99,3 @@ model site_settings { settingModifiedDate DateTime? @db.DateTime(0) siteLoginLogo String? @db.VarChar(500) } - -model ticket { - ticketId Int @id @default(autoincrement()) - title String - description String - dueDate DateTime - priority String @default("medium") - status String @default("pending") - createdAt DateTime @default(now()) - updatedAt DateTime -}