mirror of
https://github.com/louislam/dockge.git
synced 2024-11-27 13:14:03 +00:00
refactor: ♻️ add pattern to invalid route with redirect & message error
This commit is contained in:
parent
74c8baef93
commit
af78257418
1 changed files with 11 additions and 0 deletions
|
@ -7,6 +7,8 @@ import DashboardHome from "./pages/DashboardHome.vue";
|
|||
import Console from "./pages/Console.vue";
|
||||
import Compose from "./pages/Compose.vue";
|
||||
import ContainerTerminal from "./pages/ContainerTerminal.vue";
|
||||
import { useToast } from "vue-toastification";
|
||||
const toast = useToast();
|
||||
|
||||
const Settings = () => import("./pages/Settings.vue");
|
||||
|
||||
|
@ -92,6 +94,15 @@ const routes = [
|
|||
path: "/setup",
|
||||
component: Setup,
|
||||
},
|
||||
{
|
||||
path: "/:pathMatch(.*)*",
|
||||
redirect: (to) => {
|
||||
setTimeout(() => {
|
||||
toast.error("Page not found");
|
||||
}, 100);
|
||||
return "/";
|
||||
},
|
||||
}
|
||||
];
|
||||
|
||||
export const router = createRouter({
|
||||
|
|
Loading…
Reference in a new issue