mirror of https://github.com/rancher/dashboard.git
Resolving router-related warnings
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
This commit is contained in:
parent
b4d08bb704
commit
48869fa982
|
|
@ -1,22 +1,21 @@
|
||||||
import { createApp } from 'vue';
|
import { createRouter, createWebHistory } from 'vue-router';
|
||||||
import { createRouter } from 'vue-router';
|
|
||||||
import Routes from '@shell/config/router/routes';
|
import Routes from '@shell/config/router/routes';
|
||||||
import { installNavigationGuards } from '@shell/config/router/navigation-guards';
|
import { installNavigationGuards } from '@shell/config/router/navigation-guards';
|
||||||
const vueApp = createApp({});
|
|
||||||
|
|
||||||
vueApp.use(Router);
|
export const routerOptions = createRouter({
|
||||||
|
history: createWebHistory(process.env.routerBase || '/'),
|
||||||
export const routerOptions = {
|
|
||||||
mode: 'history',
|
|
||||||
// Note: router base comes from the ROUTER_BASE env var
|
// Note: router base comes from the ROUTER_BASE env var
|
||||||
base: process.env.routerBase || '/',
|
base: process.env.routerBase || '/',
|
||||||
routes: Routes,
|
routes: Routes,
|
||||||
fallback: false
|
fallback: false,
|
||||||
};
|
});
|
||||||
|
|
||||||
export function extendRouter(config, context) {
|
export function extendRouter(config, context) {
|
||||||
const base = (config._app && config._app.basePath) || routerOptions.base;
|
const base = (config._app && config._app.basePath) || routerOptions.base;
|
||||||
const router = new Router({ ...routerOptions, base });
|
const router = createRouter({
|
||||||
|
...routerOptions,
|
||||||
|
base,
|
||||||
|
});
|
||||||
|
|
||||||
installNavigationGuards(router, context);
|
installNavigationGuards(router, context);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { productsLoaded } from '@shell/store/type-map';
|
import { productsLoaded } from '@shell/store/type-map';
|
||||||
import { clearModelCache } from '@shell/plugins/dashboard-store/model-loader';
|
import { clearModelCache } from '@shell/plugins/dashboard-store/model-loader';
|
||||||
import { Plugin } from './plugin';
|
import { Plugin } from './plugin';
|
||||||
import { PluginRoutes } from './plugin-routes';
|
// import { PluginRoutes } from './plugin-routes';
|
||||||
import { UI_PLUGIN_BASE_URL } from '@shell/config/uiplugins';
|
import { UI_PLUGIN_BASE_URL } from '@shell/config/uiplugins';
|
||||||
import { ExtensionPoint } from './types';
|
import { ExtensionPoint } from './types';
|
||||||
|
|
||||||
|
|
@ -18,7 +18,7 @@ export default function(context, inject, vueApp) {
|
||||||
// Track which plugin loaded what, so we can unload stuff
|
// Track which plugin loaded what, so we can unload stuff
|
||||||
const plugins = {};
|
const plugins = {};
|
||||||
|
|
||||||
const pluginRoutes = new PluginRoutes(app.router);
|
// const pluginRoutes = new PluginRoutes(app.router);
|
||||||
|
|
||||||
const uiConfig = {};
|
const uiConfig = {};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import VTooltip from 'v-tooltip';
|
||||||
import vSelect from 'vue-select';
|
import vSelect from 'vue-select';
|
||||||
import 'vue-resize/dist/vue-resize.css';
|
import 'vue-resize/dist/vue-resize.css';
|
||||||
|
|
||||||
import '@shell/plugins/extend-router';
|
// import '@shell/plugins/extend-router';
|
||||||
import '@shell/plugins/formatters';
|
import '@shell/plugins/formatters';
|
||||||
import '@shell/plugins/vue-js-modal';
|
import '@shell/plugins/vue-js-modal';
|
||||||
import '@shell/plugins/js-yaml';
|
import '@shell/plugins/js-yaml';
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue