From 922f10145a3f529637e32d4d0dd583c2e413fe59 Mon Sep 17 00:00:00 2001 From: atif1019 Date: Tue, 22 Oct 2024 19:31:11 +0500 Subject: [PATCH 1/3] updated forawasome pkg to latest --- ui/package.json | 204 ++++++++++++++++++++++++------------------------ ui/src/main.ts | 149 ++++++++++++++++++----------------- ui/yarn.lock | 85 +++++++++++--------- 3 files changed, 224 insertions(+), 214 deletions(-) diff --git a/ui/package.json b/ui/package.json index 4c733a4ee1ad..2a64fc154ddb 100644 --- a/ui/package.json +++ b/ui/package.json @@ -3,115 +3,113 @@ "version": "0.0.0", "license": "AGPL v3", "scripts": { - "dev": "vite", - "build": "vue-tsc --noEmit && vite build --base=/opennms/ui/", - "build:dev": "vue-tsc --noEmit && vite build --base=/opennms/ui/ --minify false", - "watch": "vue-tsc --noEmit && vite build --base=/opennms/ui/ --watch", - "watch:dev": "vue-tsc --noEmit && vite build --base=/opennms/ui/ --minify false --watch", - "serve": "vite preview", - "test": "vitest run", - "lint": "eslint --ignore-path ../.gitignore --ext .ts,.vue .", - "lint:fix": "eslint --ignore-path ../.gitignore --ext .ts,.vue . --fix", - "format": "prettier --ignore-path ../.gitignore --write \"**/*.+(ts)\"" + "dev": "vite", + "build": "vue-tsc --noEmit && vite build --base=/opennms/ui/", + "build:dev": "vue-tsc --noEmit && vite build --base=/opennms/ui/ --minify false", + "watch": "vue-tsc --noEmit && vite build --base=/opennms/ui/ --watch", + "watch:dev": "vue-tsc --noEmit && vite build --base=/opennms/ui/ --minify false --watch", + "serve": "vite preview", + "test": "vitest run", + "lint": "eslint --ignore-path ../.gitignore --ext .ts,.vue .", + "lint:fix": "eslint --ignore-path ../.gitignore --ext .ts,.vue . --fix", + "format": "prettier --ignore-path ../.gitignore --write \"**/*.+(ts)\"" }, "dependencies": { - "@featherds/app-bar": "0.12.30", - "@featherds/app-layout": "0.12.30", - "@featherds/autocomplete": "0.12.30", - "@featherds/button": "0.12.30", - "@featherds/checkbox": "0.12.30", - "@featherds/chips": "0.12.30", - "@featherds/date-input": "0.12.30", - "@featherds/dialog": "0.12.30", - "@featherds/drawer": "0.12.30", - "@featherds/dropdown": "0.12.30", - "@featherds/expansion": "0.12.30", - "@featherds/icon": "0.12.30", - "@featherds/input": "0.12.30", - "@featherds/list": "0.12.30", - "@featherds/megamenu": "0.12.30", - "@featherds/menu": "0.12.30", - "@featherds/navigation-rail": "0.12.30", - "@featherds/pagination": "0.12.30", - "@featherds/progress": "0.12.30", - "@featherds/protected-input": "0.12.30", - "@featherds/radio": "0.12.30", - "@featherds/select": "0.12.30", - "@featherds/snackbar": "0.12.30", - "@featherds/styles": "0.12.30", - "@featherds/table": "0.12.30", - "@featherds/tabs": "0.12.30", - "@featherds/textarea": "0.12.30", - "@featherds/tooltip": "0.12.30", - "@featherds/utils": "0.12.30", - "@fortawesome/fontawesome-svg-core": "^6.4.2", - "@fortawesome/free-regular-svg-icons": "^6.5.1", - "@fortawesome/free-solid-svg-icons": "^6.4.2", - "@fortawesome/vue-fontawesome": "^3.0.6", - "@vueuse/core": "^9.13.0", - "ace-builds": "^1.32.6", - "axios": "^0.28.0", - "chart.js": "^3.9.1", - "chartjs-plugin-zoom": "^2.0.1", - "cronstrue": "^2.11.0", - "d3": "^7.8.5", - "date-fns": "^2.30.0", - "date-fns-tz": "^2.0.1", - "ip-regex": "^5.0.0", - "is-ip": "^5.0.1", - "is-valid-domain": "^0.1.6", - "leaflet": "^1.8.0", - "leaflet.markercluster": "^1.5.3", - "lodash": "^4.17.21", - "marked": "^12.0.2", - "pinia": "^2.1.6", - "rapidoc": "^9.3.4", - "sass": "^1.75.0", - "sass-loader": "^14.1.1", - "splitpanes": "^3.1.5", - "vite-svg-loader": "^4.0.0", - "vue": "^3.3.4", - "vue-diff": "^1.2.4", - "vue-router": "^4.2.4", - "vue3-ace-editor": "^2.2.4" + "@featherds/app-bar": "0.12.30", + "@featherds/app-layout": "0.12.30", + "@featherds/autocomplete": "0.12.30", + "@featherds/button": "0.12.30", + "@featherds/checkbox": "0.12.30", + "@featherds/chips": "0.12.30", + "@featherds/date-input": "0.12.30", + "@featherds/dialog": "0.12.30", + "@featherds/drawer": "0.12.30", + "@featherds/dropdown": "0.12.30", + "@featherds/expansion": "0.12.30", + "@featherds/icon": "0.12.30", + "@featherds/input": "0.12.30", + "@featherds/list": "0.12.30", + "@featherds/megamenu": "0.12.30", + "@featherds/menu": "0.12.30", + "@featherds/navigation-rail": "0.12.30", + "@featherds/pagination": "0.12.30", + "@featherds/progress": "0.12.30", + "@featherds/protected-input": "0.12.30", + "@featherds/radio": "0.12.30", + "@featherds/select": "0.12.30", + "@featherds/snackbar": "0.12.30", + "@featherds/styles": "0.12.30", + "@featherds/table": "0.12.30", + "@featherds/tabs": "0.12.30", + "@featherds/textarea": "0.12.30", + "@featherds/tooltip": "0.12.30", + "@featherds/utils": "0.12.30", + "@fortawesome/fontawesome-svg-core": "^6.6.0", + "@fortawesome/free-regular-svg-icons": "^6.6.0", + "@fortawesome/free-solid-svg-icons": "6.6.0", + "@fortawesome/vue-fontawesome": "^3.0.6", + "@vueuse/core": "^9.13.0", + "ace-builds": "^1.32.6", + "axios": "^0.27.2", + "chart.js": "^3.9.1", + "chartjs-plugin-zoom": "^2.0.1", + "cronstrue": "^2.11.0", + "d3": "^7.8.5", + "date-fns": "^2.30.0", + "date-fns-tz": "^2.0.1", + "ip-regex": "^5.0.0", + "is-ip": "^5.0.1", + "is-valid-domain": "^0.1.6", + "leaflet": "^1.8.0", + "leaflet.markercluster": "^1.5.3", + "lodash": "^4.17.21", + "marked": "^12.0.2", + "pinia": "^2.1.6", + "rapidoc": "^9.3.4", + "sass": "^1.75.0", + "sass-loader": "^14.1.1", + "splitpanes": "^3.1.5", + "vite-svg-loader": "^4.0.0", + "vue": "^3.3.4", + "vue-diff": "^1.2.4", + "vue-router": "^4.2.4", + "vue3-ace-editor": "^2.2.4" }, "devDependencies": { - "@pinia/testing": "^0.1.3", - "@types/d3": "^7.4.0", - "@types/diff": "^5.0.3", - "@types/leaflet": "^1.9.11", - "@types/leaflet.markercluster": "^1.5.1", - "@types/lodash": "^4.14.196", - "@types/marked": "^4.0.3", - "@types/node": ">=20", - "@types/splitpanes": "^2.2.1", - "@typescript-eslint/eslint-plugin": "^6.21.0", - "@typescript-eslint/parser": "^6.21.0", - "@vitejs/plugin-vue": "^4.0.0", - "@vue-leaflet/vue-leaflet": "^0.7.0", - "@vue/test-utils": "^2.4.5", - "diff": "^5.1.0", - "eslint": "^8.46.0", - "eslint-config-prettier": "^8.10.0", - "eslint-plugin-vue": "^9.22.0", - "happy-dom": "^9.20.3", - "prettier": "^3.2.5", - "typescript": "^5.4.5", - "unplugin-auto-import": "^0.17.5", - "unplugin-vue-components": "^0.26.0", - "vite": "^4.3.9", - "vitest": "^2.0.0", - "vitest-mock-extended": "^1.3.1", - "vue-eslint-parser": "^9.3.1", - "vue-tsc": "^1.6.5" + "@pinia/testing": "^0.1.3", + "@types/d3": "^7.4.0", + "@types/diff": "^5.0.3", + "@types/leaflet": "^1.9.11", + "@types/leaflet.markercluster": "^1.5.1", + "@types/lodash": "^4.14.196", + "@types/marked": "^4.0.3", + "@types/node": ">=20", + "@types/splitpanes": "^2.2.1", + "@typescript-eslint/eslint-plugin": "^6.21.0", + "@typescript-eslint/parser": "^6.21.0", + "@vitejs/plugin-vue": "^4.0.0", + "@vue-leaflet/vue-leaflet": "^0.7.0", + "@vue/test-utils": "^2.4.5", + "diff": "^5.1.0", + "eslint": "^8.46.0", + "eslint-config-prettier": "^8.10.0", + "eslint-plugin-vue": "^9.22.0", + "happy-dom": "^9.20.3", + "prettier": "^3.2.5", + "typescript": "^5.4.5", + "unplugin-auto-import": "^0.17.5", + "unplugin-vue-components": "^0.26.0", + "vite": "^4.3.9", + "vitest": "^2.0.0", + "vitest-mock-extended": "^1.3.1", + "vue-eslint-parser": "^9.3.1", + "vue-tsc": "^1.6.5" }, "engines": { - "node": ">=18", - "yarn": ">=1.22.18" + "node": ">=18", + "yarn": ">=1.22.18" }, "resolutions": { - "@antfu/utils": "^0.7.3", - "undici": "5.28.4", - "micromatch": "^4.0.8" + "@antfu/utils": "^0.7.3" } -} + } \ No newline at end of file diff --git a/ui/src/main.ts b/ui/src/main.ts index 37de39d1da8b..58fbbb4afe76 100644 --- a/ui/src/main.ts +++ b/ui/src/main.ts @@ -1,21 +1,21 @@ /// /// Licensed to The OpenNMS Group, Inc (TOG) under one or more -/// contributor license agreements. See the LICENSE.md file +/// contributor license agreements. See the LICENSE.md file /// distributed with this work for additional information /// regarding copyright ownership. /// /// TOG licenses this file to You under the GNU Affero General /// Public License Version 3 (the "License") or (at your option) -/// any later version. You may not use this file except in -/// compliance with the License. You may obtain a copy of the +/// any later version. You may not use this file except in +/// compliance with the License. You may obtain a copy of the /// License at: /// -/// https://www.gnu.org/licenses/agpl-3.0.txt +/// https://www.gnu.org/licenses/agpl-3.0.txt /// /// Unless required by applicable law or agreed to in writing, /// software distributed under the License is distributed on an /// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -/// either express or implied. See the License for the specific +/// either express or implied. See the License for the specific /// language governing permissions and limitations under the /// License. /// @@ -41,7 +41,7 @@ import 'vue-diff/dist/index.css' import dateFormatDirective from './directives/v-date' import { externalComponent, getJSPath } from './components/Plugin/utils' -import { library } from '@fortawesome/fontawesome-svg-core' +import { IconDefinition, library } from '@fortawesome/fontawesome-svg-core' // font-awesome import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome' @@ -50,48 +50,47 @@ import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome' // TODO: Move to separate fil // See: https://fontawesome.com/docs/web/use-with/vue/ and following import { - faArrowLeftLong, - faArrowRightLong, - faBell, - faBellSlash, - faCalendar, - faCircle, - faCogs, - faInfoCircle, - faSearch, - faKey, - faLifeRing, - faMinusCircle, - faPlus, - faPlusCircle, - faQuestionCircle, - faSignOut, - faUser, - faUsers +faArrowLeftLong, +faArrowRightLong, +faBell, +faBellSlash, +faCalendar, +faCircle, +faCogs, +faInfoCircle, +faSearch, +faKey, +faLifeRing, +faMinusCircle, +faPlus, +faPlusCircle, +faQuestionCircle, +faSignOut, +faUser, +faUsers } from '@fortawesome/free-solid-svg-icons' const icons = [ - faArrowLeftLong, - faArrowRightLong, - faBell, - faBellSlash, - faCalendar, - faCircle, - faCogs, - faPlusCircle, - faPlus, - faInfoCircle, - faKey, - faLifeRing, - faMinusCircle, - faQuestionCircle, - faSearch, - faSignOut, - faUser, - faUsers -] +faArrowLeftLong, +faArrowRightLong, +faBell, +faBellSlash, +faCalendar, +faCircle, +faCogs, +faPlusCircle, +faPlus, +faInfoCircle, +faKey, +faLifeRing, +faMinusCircle, +faQuestionCircle, +faSearch, +faSignOut, +faUser, +faUsers +] as IconDefinition[] library.add(...icons); - // let plugins use state mngmnt / router (window as any).Vue = Vue; (window as any).Pinia = Pinia; @@ -103,40 +102,40 @@ const baseUrl = import.meta.env.VITE_BASE_REST_URL const plugins = await API.getPlugins() for (const plugin of plugins) { - if (!isLegacyPlugin(plugin)) { - // add this plugin to routes - // - route 'name' is 'Plugin-extensionId'. Plugins should add their routes as children of this named route - // - route 'path' has the Plugin extensionId as part of the segment rather than as a parameter, - // so it will only match the uniquely-named plugin - // Legacy plugins will add their routes to the 'Plugin' route, but only one legacy plugin - // will work at a time - const routeRecord : RouteRecordRaw = - { - path: `/plugins/${plugin.extensionId}/:resourceRootPath/:moduleFileName`, - name: `Plugin-${plugin.extensionId}`, - props: route => ({ - extensionId: plugin.extensionId, - resourceRootPath: route.params.resourceRootPath, - moduleFileName: route.params.moduleFileName - }), - component: () => import('@/containers/Plugin.vue') - } +if (!isLegacyPlugin(plugin)) { +// add this plugin to routes +// - route 'name' is 'Plugin-extensionId'. Plugins should add their routes as children of this named route +// - route 'path' has the Plugin extensionId as part of the segment rather than as a parameter, +// so it will only match the uniquely-named plugin +// Legacy plugins will add their routes to the 'Plugin' route, but only one legacy plugin +// will work at a time +const routeRecord : RouteRecordRaw = +{ +path: `/plugins/${plugin.extensionId}/:resourceRootPath/:moduleFileName`, +name: `Plugin-${plugin.extensionId}`, +props: route => ({ +extensionId: plugin.extensionId, +resourceRootPath: route.params.resourceRootPath, +moduleFileName: route.params.moduleFileName +}), +component: () => import('@/containers/Plugin.vue') +} - router.addRoute(routeRecord) - } else { - console.warn(`Warning: plugin '${plugin.menuEntry}' is a legacy plugin. Plugin will not work if any other legacy UI plugins are installed.`) - } +router.addRoute(routeRecord) +} else { +console.warn(`Warning: plugin '${plugin.menuEntry}' is a legacy plugin. Plugin will not work if any other legacy UI plugins are installed.`) +} - const js = getJSPath(baseUrl, plugin.extensionId, plugin.resourceRootPath, plugin.moduleFileName) - await externalComponent(js) +const js = getJSPath(baseUrl, plugin.extensionId, plugin.resourceRootPath, plugin.moduleFileName) +await externalComponent(js) } createApp({ - render: () => h(App) +render: () => h(App) }) - .use(VueDiff) - .use(router) - .use(createPinia()) - .component('font-awesome-icon', FontAwesomeIcon) - .directive('date', dateFormatDirective) - .mount('#app') +.use(VueDiff) +.use(router) +.use(createPinia()) +.component('font-awesome-icon', FontAwesomeIcon) +.directive('date', dateFormatDirective) +.mount('#app') diff --git a/ui/yarn.lock b/ui/yarn.lock index 5387510cb593..fa583c9009ae 100644 --- a/ui/yarn.lock +++ b/ui/yarn.lock @@ -654,36 +654,31 @@ resolved "https://registry.yarnpkg.com/@featherds/utils/-/utils-0.12.30.tgz#ee7a1b1dab2d857241ea104a0793c3c54f008afc" integrity sha512-e1lRb1drFdbRpETK/UqqZUB+nbcecdIjvPzwvDIZrQdwDpJEsSGqS7lM8C0XaX7hvzNe09ogEI13yMk18vLrjA== -"@fortawesome/fontawesome-common-types@6.4.2": - version "6.4.2" - resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.4.2.tgz#1766039cad33f8ad87f9467b98e0d18fbc8f01c5" - integrity sha512-1DgP7f+XQIJbLFCTX1V2QnxVmpLdKdzzo2k8EmvDOePfchaIGQ9eCHj2up3/jNEbZuBqel5OxiaOJf37TWauRA== +"@fortawesome/fontawesome-common-types@6.6.0": + version "6.6.0" + resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.6.0.tgz#31ab07ca6a06358c5de4d295d4711b675006163f" + integrity sha512-xyX0X9mc0kyz9plIyryrRbl7ngsA9jz77mCZJsUkLl+ZKs0KWObgaEBoSgQiYWAsSmjz/yjl0F++Got0Mdp4Rw== -"@fortawesome/fontawesome-common-types@6.5.1": - version "6.5.1" - resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.5.1.tgz#fdb1ec4952b689f5f7aa0bffe46180bb35490032" - integrity sha512-GkWzv+L6d2bI5f/Vk6ikJ9xtl7dfXtoRu3YGE6nq0p/FFqA1ebMOAWg3XgRyb0I6LYyYkiAo+3/KrwuBp8xG7A== - -"@fortawesome/fontawesome-svg-core@^6.4.2": - version "6.4.2" - resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-6.4.2.tgz#37f4507d5ec645c8b50df6db14eced32a6f9be09" - integrity sha512-gjYDSKv3TrM2sLTOKBc5rH9ckje8Wrwgx1CxAPbN5N3Fm4prfi7NsJVWd1jklp7i5uSCVwhZS5qlhMXqLrpAIg== +"@fortawesome/fontawesome-svg-core@^6.6.0": + version "6.6.0" + resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-6.6.0.tgz#2a24c32ef92136e98eae2ff334a27145188295ff" + integrity sha512-KHwPkCk6oRT4HADE7smhfsKudt9N/9lm6EJ5BVg0tD1yPA5hht837fB87F8pn15D8JfTqQOjhKTktwmLMiD7Kg== dependencies: - "@fortawesome/fontawesome-common-types" "6.4.2" + "@fortawesome/fontawesome-common-types" "6.6.0" -"@fortawesome/free-regular-svg-icons@^6.5.1": - version "6.5.1" - resolved "https://registry.yarnpkg.com/@fortawesome/free-regular-svg-icons/-/free-regular-svg-icons-6.5.1.tgz#c98a91d2c9137ed54a7aa2362a916f46503e0627" - integrity sha512-m6ShXn+wvqEU69wSP84coxLbNl7sGVZb+Ca+XZq6k30SzuP3X4TfPqtycgUh9ASwlNh5OfQCd8pDIWxl+O+LlQ== +"@fortawesome/free-regular-svg-icons@^6.6.0": + version "6.6.0" + resolved "https://registry.yarnpkg.com/@fortawesome/free-regular-svg-icons/-/free-regular-svg-icons-6.6.0.tgz#fc49a947ac8dfd20403c9ea5f37f0919425bdf04" + integrity sha512-Yv9hDzL4aI73BEwSEh20clrY8q/uLxawaQ98lekBx6t9dQKDHcDzzV1p2YtBGTtolYtNqcWdniOnhzB+JPnQEQ== dependencies: - "@fortawesome/fontawesome-common-types" "6.5.1" + "@fortawesome/fontawesome-common-types" "6.6.0" -"@fortawesome/free-solid-svg-icons@^6.4.2": - version "6.4.2" - resolved "https://registry.yarnpkg.com/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-6.4.2.tgz#33a02c4cb6aa28abea7bc082a9626b7922099df4" - integrity sha512-sYwXurXUEQS32fZz9hVCUUv/xu49PEJEyUOsA51l6PU/qVgfbTb2glsTEaJngVVT8VqBATRIdh7XVgV1JF1LkA== +"@fortawesome/free-solid-svg-icons@6.6.0": + version "6.6.0" + resolved "https://registry.yarnpkg.com/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-6.6.0.tgz#061751ca43be4c4d814f0adbda8f006164ec9f3b" + integrity sha512-IYv/2skhEDFc2WGUcqvFJkeK39Q+HyPf5GHUrT/l2pKbtgEIv1al1TKd6qStR5OIwQdN1GZP54ci3y4mroJWjA== dependencies: - "@fortawesome/fontawesome-common-types" "6.4.2" + "@fortawesome/fontawesome-common-types" "6.6.0" "@fortawesome/vue-fontawesome@^3.0.6": version "3.0.6" @@ -1949,14 +1944,13 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== -axios@^0.28.0: - version "0.28.1" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.28.1.tgz#2a7bcd34a3837b71ee1a5ca3762214b86b703e70" - integrity sha512-iUcGA5a7p0mVb4Gm/sy+FSECNkPFT4y7wt6OM/CDpO/OnNCvSs3PoMG8ibrC9jRoGYU0gUK5pXVC4NPXq6lHRQ== +axios@^0.27.2: + version "0.27.2" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.27.2.tgz#207658cc8621606e586c85db4b41a750e756d972" + integrity sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ== dependencies: - follow-redirects "^1.15.0" + follow-redirects "^1.14.9" form-data "^4.0.0" - proxy-from-env "^1.1.0" axios@^1.4.0: version "1.6.0" @@ -2949,6 +2943,11 @@ flatted@^3.2.9: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.9.tgz#7eb4c67ca1ba34232ca9d2d93e9886e611ad7daf" integrity sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ== +follow-redirects@^1.14.9: + version "1.15.9" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.9.tgz#a604fa10e443bf98ca94228d9eebcc2e8a2c8ee1" + integrity sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ== + follow-redirects@^1.15.0: version "1.15.6" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" @@ -3477,7 +3476,7 @@ merge2@^1.3.0, merge2@^1.4.1: resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== -micromatch@^4.0.4, micromatch@^4.0.8: +micromatch@^4.0.4: version "4.0.8" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202" integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA== @@ -4182,8 +4181,16 @@ std-env@^3.7.0: resolved "https://registry.yarnpkg.com/std-env/-/std-env-3.7.0.tgz#c9f7386ced6ecf13360b6c6c55b8aaa4ef7481d2" integrity sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg== -"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0: - name string-width-cjs +"string-width-cjs@npm:string-width@^4.2.0": + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +string-width@^4.1.0: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -4208,8 +4215,14 @@ string_decoder@^1.1.1: dependencies: safe-buffer "~5.2.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: - name strip-ansi-cjs +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -4437,7 +4450,7 @@ undici-types@~5.26.4: resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== -undici@5.28.4, undici@^5.24.0: +undici@^5.24.0: version "5.28.4" resolved "https://registry.yarnpkg.com/undici/-/undici-5.28.4.tgz#6b280408edb6a1a604a9b20340f45b422e373068" integrity sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g== From b1bdd7bc9d536d100f5a0fa7e6a4649b25336d70 Mon Sep 17 00:00:00 2001 From: atif1019 Date: Tue, 22 Oct 2024 19:38:43 +0500 Subject: [PATCH 2/3] changes are made to pkgs --- ui/package.json | 10 +++++++--- ui/yarn.lock | 20 ++++++++------------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/ui/package.json b/ui/package.json index 2a64fc154ddb..49b50031fb94 100644 --- a/ui/package.json +++ b/ui/package.json @@ -50,7 +50,7 @@ "@fortawesome/vue-fontawesome": "^3.0.6", "@vueuse/core": "^9.13.0", "ace-builds": "^1.32.6", - "axios": "^0.27.2", + "axios": "^0.28.0", "chart.js": "^3.9.1", "chartjs-plugin-zoom": "^2.0.1", "cronstrue": "^2.11.0", @@ -110,6 +110,10 @@ "yarn": ">=1.22.18" }, "resolutions": { - "@antfu/utils": "^0.7.3" + "@antfu/utils": "^0.7.3", + "undici": "5.28.4", + "micromatch": "^4.0.8" } - } \ No newline at end of file + } + + \ No newline at end of file diff --git a/ui/yarn.lock b/ui/yarn.lock index fa583c9009ae..dc7252bb31a8 100644 --- a/ui/yarn.lock +++ b/ui/yarn.lock @@ -1944,13 +1944,14 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== -axios@^0.27.2: - version "0.27.2" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.27.2.tgz#207658cc8621606e586c85db4b41a750e756d972" - integrity sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ== +axios@^0.28.0: + version "0.28.1" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.28.1.tgz#2a7bcd34a3837b71ee1a5ca3762214b86b703e70" + integrity sha512-iUcGA5a7p0mVb4Gm/sy+FSECNkPFT4y7wt6OM/CDpO/OnNCvSs3PoMG8ibrC9jRoGYU0gUK5pXVC4NPXq6lHRQ== dependencies: - follow-redirects "^1.14.9" + follow-redirects "^1.15.0" form-data "^4.0.0" + proxy-from-env "^1.1.0" axios@^1.4.0: version "1.6.0" @@ -2943,11 +2944,6 @@ flatted@^3.2.9: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.9.tgz#7eb4c67ca1ba34232ca9d2d93e9886e611ad7daf" integrity sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ== -follow-redirects@^1.14.9: - version "1.15.9" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.9.tgz#a604fa10e443bf98ca94228d9eebcc2e8a2c8ee1" - integrity sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ== - follow-redirects@^1.15.0: version "1.15.6" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" @@ -3476,7 +3472,7 @@ merge2@^1.3.0, merge2@^1.4.1: resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== -micromatch@^4.0.4: +micromatch@^4.0.4, micromatch@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202" integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA== @@ -4450,7 +4446,7 @@ undici-types@~5.26.4: resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== -undici@^5.24.0: +undici@5.28.4, undici@^5.24.0: version "5.28.4" resolved "https://registry.yarnpkg.com/undici/-/undici-5.28.4.tgz#6b280408edb6a1a604a9b20340f45b422e373068" integrity sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g== From 9bfa6db496bed826757faea93645a2ec58c0ec9b Mon Sep 17 00:00:00 2001 From: atif1019 Date: Tue, 29 Oct 2024 20:20:03 +0500 Subject: [PATCH 3/3] AA/Jira/NMS-165554_updated changes are made --- ui/package.json | 208 ++++++++++++++++++++++++------------------------ ui/src/main.ts | 145 ++++++++++++++++----------------- 2 files changed, 176 insertions(+), 177 deletions(-) diff --git a/ui/package.json b/ui/package.json index 49b50031fb94..537e06ed5196 100644 --- a/ui/package.json +++ b/ui/package.json @@ -3,117 +3,115 @@ "version": "0.0.0", "license": "AGPL v3", "scripts": { - "dev": "vite", - "build": "vue-tsc --noEmit && vite build --base=/opennms/ui/", - "build:dev": "vue-tsc --noEmit && vite build --base=/opennms/ui/ --minify false", - "watch": "vue-tsc --noEmit && vite build --base=/opennms/ui/ --watch", - "watch:dev": "vue-tsc --noEmit && vite build --base=/opennms/ui/ --minify false --watch", - "serve": "vite preview", - "test": "vitest run", - "lint": "eslint --ignore-path ../.gitignore --ext .ts,.vue .", - "lint:fix": "eslint --ignore-path ../.gitignore --ext .ts,.vue . --fix", - "format": "prettier --ignore-path ../.gitignore --write \"**/*.+(ts)\"" + "dev": "vite", + "build": "vue-tsc --noEmit && vite build --base=/opennms/ui/", + "build:dev": "vue-tsc --noEmit && vite build --base=/opennms/ui/ --minify false", + "watch": "vue-tsc --noEmit && vite build --base=/opennms/ui/ --watch", + "watch:dev": "vue-tsc --noEmit && vite build --base=/opennms/ui/ --minify false --watch", + "serve": "vite preview", + "test": "vitest run", + "lint": "eslint --ignore-path ../.gitignore --ext .ts,.vue .", + "lint:fix": "eslint --ignore-path ../.gitignore --ext .ts,.vue . --fix", + "format": "prettier --ignore-path ../.gitignore --write \"**/*.+(ts)\"" }, "dependencies": { - "@featherds/app-bar": "0.12.30", - "@featherds/app-layout": "0.12.30", - "@featherds/autocomplete": "0.12.30", - "@featherds/button": "0.12.30", - "@featherds/checkbox": "0.12.30", - "@featherds/chips": "0.12.30", - "@featherds/date-input": "0.12.30", - "@featherds/dialog": "0.12.30", - "@featherds/drawer": "0.12.30", - "@featherds/dropdown": "0.12.30", - "@featherds/expansion": "0.12.30", - "@featherds/icon": "0.12.30", - "@featherds/input": "0.12.30", - "@featherds/list": "0.12.30", - "@featherds/megamenu": "0.12.30", - "@featherds/menu": "0.12.30", - "@featherds/navigation-rail": "0.12.30", - "@featherds/pagination": "0.12.30", - "@featherds/progress": "0.12.30", - "@featherds/protected-input": "0.12.30", - "@featherds/radio": "0.12.30", - "@featherds/select": "0.12.30", - "@featherds/snackbar": "0.12.30", - "@featherds/styles": "0.12.30", - "@featherds/table": "0.12.30", - "@featherds/tabs": "0.12.30", - "@featherds/textarea": "0.12.30", - "@featherds/tooltip": "0.12.30", - "@featherds/utils": "0.12.30", - "@fortawesome/fontawesome-svg-core": "^6.6.0", - "@fortawesome/free-regular-svg-icons": "^6.6.0", - "@fortawesome/free-solid-svg-icons": "6.6.0", - "@fortawesome/vue-fontawesome": "^3.0.6", - "@vueuse/core": "^9.13.0", - "ace-builds": "^1.32.6", - "axios": "^0.28.0", - "chart.js": "^3.9.1", - "chartjs-plugin-zoom": "^2.0.1", - "cronstrue": "^2.11.0", - "d3": "^7.8.5", - "date-fns": "^2.30.0", - "date-fns-tz": "^2.0.1", - "ip-regex": "^5.0.0", - "is-ip": "^5.0.1", - "is-valid-domain": "^0.1.6", - "leaflet": "^1.8.0", - "leaflet.markercluster": "^1.5.3", - "lodash": "^4.17.21", - "marked": "^12.0.2", - "pinia": "^2.1.6", - "rapidoc": "^9.3.4", - "sass": "^1.75.0", - "sass-loader": "^14.1.1", - "splitpanes": "^3.1.5", - "vite-svg-loader": "^4.0.0", - "vue": "^3.3.4", - "vue-diff": "^1.2.4", - "vue-router": "^4.2.4", - "vue3-ace-editor": "^2.2.4" + "@featherds/app-bar": "0.12.30", + "@featherds/app-layout": "0.12.30", + "@featherds/autocomplete": "0.12.30", + "@featherds/button": "0.12.30", + "@featherds/checkbox": "0.12.30", + "@featherds/chips": "0.12.30", + "@featherds/date-input": "0.12.30", + "@featherds/dialog": "0.12.30", + "@featherds/drawer": "0.12.30", + "@featherds/dropdown": "0.12.30", + "@featherds/expansion": "0.12.30", + "@featherds/icon": "0.12.30", + "@featherds/input": "0.12.30", + "@featherds/list": "0.12.30", + "@featherds/megamenu": "0.12.30", + "@featherds/menu": "0.12.30", + "@featherds/navigation-rail": "0.12.30", + "@featherds/pagination": "0.12.30", + "@featherds/progress": "0.12.30", + "@featherds/protected-input": "0.12.30", + "@featherds/radio": "0.12.30", + "@featherds/select": "0.12.30", + "@featherds/snackbar": "0.12.30", + "@featherds/styles": "0.12.30", + "@featherds/table": "0.12.30", + "@featherds/tabs": "0.12.30", + "@featherds/textarea": "0.12.30", + "@featherds/tooltip": "0.12.30", + "@featherds/utils": "0.12.30", + "@fortawesome/fontawesome-svg-core": "^6.6.0", + "@fortawesome/free-regular-svg-icons": "^6.6.0", + "@fortawesome/free-solid-svg-icons": "6.6.0", + "@fortawesome/vue-fontawesome": "^3.0.6", + "@vueuse/core": "^9.13.0", + "ace-builds": "^1.32.6", + "axios": "^0.28.0", + "chart.js": "^3.9.1", + "chartjs-plugin-zoom": "^2.0.1", + "cronstrue": "^2.11.0", + "d3": "^7.8.5", + "date-fns": "^2.30.0", + "date-fns-tz": "^2.0.1", + "ip-regex": "^5.0.0", + "is-ip": "^5.0.1", + "is-valid-domain": "^0.1.6", + "leaflet": "^1.8.0", + "leaflet.markercluster": "^1.5.3", + "lodash": "^4.17.21", + "marked": "^12.0.2", + "pinia": "^2.1.6", + "rapidoc": "^9.3.4", + "sass": "^1.75.0", + "sass-loader": "^14.1.1", + "splitpanes": "^3.1.5", + "vite-svg-loader": "^4.0.0", + "vue": "^3.3.4", + "vue-diff": "^1.2.4", + "vue-router": "^4.2.4", + "vue3-ace-editor": "^2.2.4" }, "devDependencies": { - "@pinia/testing": "^0.1.3", - "@types/d3": "^7.4.0", - "@types/diff": "^5.0.3", - "@types/leaflet": "^1.9.11", - "@types/leaflet.markercluster": "^1.5.1", - "@types/lodash": "^4.14.196", - "@types/marked": "^4.0.3", - "@types/node": ">=20", - "@types/splitpanes": "^2.2.1", - "@typescript-eslint/eslint-plugin": "^6.21.0", - "@typescript-eslint/parser": "^6.21.0", - "@vitejs/plugin-vue": "^4.0.0", - "@vue-leaflet/vue-leaflet": "^0.7.0", - "@vue/test-utils": "^2.4.5", - "diff": "^5.1.0", - "eslint": "^8.46.0", - "eslint-config-prettier": "^8.10.0", - "eslint-plugin-vue": "^9.22.0", - "happy-dom": "^9.20.3", - "prettier": "^3.2.5", - "typescript": "^5.4.5", - "unplugin-auto-import": "^0.17.5", - "unplugin-vue-components": "^0.26.0", - "vite": "^4.3.9", - "vitest": "^2.0.0", - "vitest-mock-extended": "^1.3.1", - "vue-eslint-parser": "^9.3.1", - "vue-tsc": "^1.6.5" + "@pinia/testing": "^0.1.3", + "@types/d3": "^7.4.0", + "@types/diff": "^5.0.3", + "@types/leaflet": "^1.9.11", + "@types/leaflet.markercluster": "^1.5.1", + "@types/lodash": "^4.14.196", + "@types/marked": "^4.0.3", + "@types/node": ">=20", + "@types/splitpanes": "^2.2.1", + "@typescript-eslint/eslint-plugin": "^6.21.0", + "@typescript-eslint/parser": "^6.21.0", + "@vitejs/plugin-vue": "^4.0.0", + "@vue-leaflet/vue-leaflet": "^0.7.0", + "@vue/test-utils": "^2.4.5", + "diff": "^5.1.0", + "eslint": "^8.46.0", + "eslint-config-prettier": "^8.10.0", + "eslint-plugin-vue": "^9.22.0", + "happy-dom": "^9.20.3", + "prettier": "^3.2.5", + "typescript": "^5.4.5", + "unplugin-auto-import": "^0.17.5", + "unplugin-vue-components": "^0.26.0", + "vite": "^4.3.9", + "vitest": "^2.0.0", + "vitest-mock-extended": "^1.3.1", + "vue-eslint-parser": "^9.3.1", + "vue-tsc": "^1.6.5" }, "engines": { - "node": ">=18", - "yarn": ">=1.22.18" + "node": ">=18", + "yarn": ">=1.22.18" }, "resolutions": { - "@antfu/utils": "^0.7.3", - "undici": "5.28.4", - "micromatch": "^4.0.8" + "@antfu/utils": "^0.7.3", + "undici": "5.28.4", + "micromatch": "^4.0.8" } - } - - \ No newline at end of file +} diff --git a/ui/src/main.ts b/ui/src/main.ts index 58fbbb4afe76..fe6ec1a73ee0 100644 --- a/ui/src/main.ts +++ b/ui/src/main.ts @@ -1,21 +1,21 @@ /// /// Licensed to The OpenNMS Group, Inc (TOG) under one or more -/// contributor license agreements. See the LICENSE.md file +/// contributor license agreements. See the LICENSE.md file /// distributed with this work for additional information /// regarding copyright ownership. /// /// TOG licenses this file to You under the GNU Affero General /// Public License Version 3 (the "License") or (at your option) -/// any later version. You may not use this file except in -/// compliance with the License. You may obtain a copy of the +/// any later version. You may not use this file except in +/// compliance with the License. You may obtain a copy of the /// License at: /// -/// https://www.gnu.org/licenses/agpl-3.0.txt +/// https://www.gnu.org/licenses/agpl-3.0.txt /// /// Unless required by applicable law or agreed to in writing, /// software distributed under the License is distributed on an /// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -/// either express or implied. See the License for the specific +/// either express or implied. See the License for the specific /// language governing permissions and limitations under the /// License. /// @@ -50,47 +50,48 @@ import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome' // TODO: Move to separate fil // See: https://fontawesome.com/docs/web/use-with/vue/ and following import { -faArrowLeftLong, -faArrowRightLong, -faBell, -faBellSlash, -faCalendar, -faCircle, -faCogs, -faInfoCircle, -faSearch, -faKey, -faLifeRing, -faMinusCircle, -faPlus, -faPlusCircle, -faQuestionCircle, -faSignOut, -faUser, -faUsers + faArrowLeftLong, + faArrowRightLong, + faBell, + faBellSlash, + faCalendar, + faCircle, + faCogs, + faInfoCircle, + faSearch, + faKey, + faLifeRing, + faMinusCircle, + faPlus, + faPlusCircle, + faQuestionCircle, + faSignOut, + faUser, + faUsers } from '@fortawesome/free-solid-svg-icons' const icons = [ -faArrowLeftLong, -faArrowRightLong, -faBell, -faBellSlash, -faCalendar, -faCircle, -faCogs, -faPlusCircle, -faPlus, -faInfoCircle, -faKey, -faLifeRing, -faMinusCircle, -faQuestionCircle, -faSearch, -faSignOut, -faUser, -faUsers + faArrowLeftLong, + faArrowRightLong, + faBell, + faBellSlash, + faCalendar, + faCircle, + faCogs, + faPlusCircle, + faPlus, + faInfoCircle, + faKey, + faLifeRing, + faMinusCircle, + faQuestionCircle, + faSearch, + faSignOut, + faUser, + faUsers ] as IconDefinition[] library.add(...icons); + // let plugins use state mngmnt / router (window as any).Vue = Vue; (window as any).Pinia = Pinia; @@ -102,40 +103,40 @@ const baseUrl = import.meta.env.VITE_BASE_REST_URL const plugins = await API.getPlugins() for (const plugin of plugins) { -if (!isLegacyPlugin(plugin)) { -// add this plugin to routes -// - route 'name' is 'Plugin-extensionId'. Plugins should add their routes as children of this named route -// - route 'path' has the Plugin extensionId as part of the segment rather than as a parameter, -// so it will only match the uniquely-named plugin -// Legacy plugins will add their routes to the 'Plugin' route, but only one legacy plugin -// will work at a time -const routeRecord : RouteRecordRaw = -{ -path: `/plugins/${plugin.extensionId}/:resourceRootPath/:moduleFileName`, -name: `Plugin-${plugin.extensionId}`, -props: route => ({ -extensionId: plugin.extensionId, -resourceRootPath: route.params.resourceRootPath, -moduleFileName: route.params.moduleFileName -}), -component: () => import('@/containers/Plugin.vue') -} + if (!isLegacyPlugin(plugin)) { + // add this plugin to routes + // - route 'name' is 'Plugin-extensionId'. Plugins should add their routes as children of this named route + // - route 'path' has the Plugin extensionId as part of the segment rather than as a parameter, + // so it will only match the uniquely-named plugin + // Legacy plugins will add their routes to the 'Plugin' route, but only one legacy plugin + // will work at a time + const routeRecord : RouteRecordRaw = + { + path: `/plugins/${plugin.extensionId}/:resourceRootPath/:moduleFileName`, + name: `Plugin-${plugin.extensionId}`, + props: route => ({ + extensionId: plugin.extensionId, + resourceRootPath: route.params.resourceRootPath, + moduleFileName: route.params.moduleFileName + }), + component: () => import('@/containers/Plugin.vue') + } -router.addRoute(routeRecord) -} else { -console.warn(`Warning: plugin '${plugin.menuEntry}' is a legacy plugin. Plugin will not work if any other legacy UI plugins are installed.`) -} + router.addRoute(routeRecord) + } else { + console.warn(`Warning: plugin '${plugin.menuEntry}' is a legacy plugin. Plugin will not work if any other legacy UI plugins are installed.`) + } -const js = getJSPath(baseUrl, plugin.extensionId, plugin.resourceRootPath, plugin.moduleFileName) -await externalComponent(js) + const js = getJSPath(baseUrl, plugin.extensionId, plugin.resourceRootPath, plugin.moduleFileName) + await externalComponent(js) } createApp({ -render: () => h(App) + render: () => h(App) }) -.use(VueDiff) -.use(router) -.use(createPinia()) -.component('font-awesome-icon', FontAwesomeIcon) -.directive('date', dateFormatDirective) -.mount('#app') + .use(VueDiff) + .use(router) + .use(createPinia()) + .component('font-awesome-icon', FontAwesomeIcon) + .directive('date', dateFormatDirective) + .mount('#app')