uptime-kuma/src/router.js

198 lines
7.1 KiB
JavaScript
Raw Normal View History

import { createRouter, createWebHistory } from "vue-router";
import EmptyLayout from "./layouts/EmptyLayout.vue";
import Layout from "./layouts/Layout.vue";
import Dashboard from "./pages/Dashboard.vue";
import DashboardHome from "./pages/DashboardHome.vue";
import Details from "./pages/Details.vue";
import EditMonitor from "./pages/EditMonitor.vue";
import EditMaintenance from "./pages/EditMaintenance.vue";
import List from "./pages/List.vue";
const Settings = () => import("./pages/Settings.vue");
import Setup from "./pages/Setup.vue";
import StatusPage from "./pages/StatusPage.vue";
2021-09-23 05:57:24 +00:00
import Entry from "./pages/Entry.vue";
import ManageStatusPage from "./pages/ManageStatusPage.vue";
import AddStatusPage from "./pages/AddStatusPage.vue";
import NotFound from "./pages/NotFound.vue";
2022-09-17 14:00:11 +00:00
import DockerHosts from "./components/settings/Docker.vue";
import MaintenanceDetails from "./pages/MaintenanceDetails.vue";
import ManageMaintenance from "./pages/ManageMaintenance.vue";
import APIKeys from "./components/settings/APIKeys.vue";
import SetupDatabase from "./pages/SetupDatabase.vue";
// Settings - Sub Pages
import Appearance from "./components/settings/Appearance.vue";
import General from "./components/settings/General.vue";
const Notifications = () => import("./components/settings/Notifications.vue");
import ReverseProxy from "./components/settings/ReverseProxy.vue";
import Tags from "./components/settings/Tags.vue";
import MonitorHistory from "./components/settings/MonitorHistory.vue";
const Security = () => import("./components/settings/Security.vue");
import Proxies from "./components/settings/Proxies.vue";
import About from "./components/settings/About.vue";
import RemoteBrowsers from "./components/settings/RemoteBrowsers.vue";
const routes = [
{
path: "/",
2021-09-23 05:57:24 +00:00
component: Entry,
},
{
2021-09-24 07:00:52 +00:00
// If it is "/dashboard", the active link is not working
// If it is "", it overrides the "/" unexpectedly
// Give a random name to solve the problem.
path: "/empty",
component: Layout,
children: [
{
path: "",
component: Dashboard,
children: [
{
name: "DashboardHome",
2021-09-24 07:00:52 +00:00
path: "/dashboard",
component: DashboardHome,
children: [
{
path: "/dashboard/:id",
component: EmptyLayout,
children: [
{
path: "",
component: Details,
},
{
path: "/edit/:id",
component: EditMonitor,
},
],
},
{
path: "/clone/:id",
component: EditMonitor,
},
{
path: "/add",
component: EditMonitor,
},
],
},
2022-06-14 14:43:44 +00:00
{
path: "/list",
component: List,
},
{
path: "/settings",
component: Settings,
children: [
{
path: "general",
component: General,
},
{
path: "appearance",
component: Appearance,
},
{
path: "notifications",
component: Notifications,
},
{
path: "reverse-proxy",
component: ReverseProxy,
},
{
path: "tags",
component: Tags,
},
{
path: "monitor-history",
component: MonitorHistory,
},
2022-07-24 12:34:43 +00:00
{
path: "docker-hosts",
component: DockerHosts,
},
{
path: "remote-browsers",
component: RemoteBrowsers,
},
{
path: "security",
component: Security,
},
{
path: "api-keys",
component: APIKeys,
},
{
path: "proxies",
component: Proxies,
},
{
path: "about",
component: About,
},
]
},
2022-03-10 13:34:30 +00:00
{
path: "/manage-status-page",
component: ManageStatusPage,
},
2022-03-15 04:00:29 +00:00
{
path: "/add-status-page",
component: AddStatusPage,
},
2022-09-17 14:00:11 +00:00
{
path: "/maintenance",
component: ManageMaintenance,
},
{
path: "/maintenance/:id",
component: MaintenanceDetails,
},
{
path: "/add-maintenance",
component: EditMaintenance,
},
{
path: "/maintenance/edit/:id",
component: EditMaintenance,
},
],
},
],
},
{
path: "/setup",
component: Setup,
},
{
path: "/setup-database",
component: SetupDatabase,
},
2021-09-14 06:19:23 +00:00
{
path: "/status-page",
component: StatusPage,
},
{
path: "/status",
component: StatusPage,
},
2022-03-10 13:34:30 +00:00
{
path: "/status/:slug",
component: StatusPage,
},
2022-03-25 18:09:12 +00:00
{
path: "/:pathMatch(.*)*",
component: NotFound,
},
2021-09-14 06:19:23 +00:00
];
export const router = createRouter({
linkActiveClass: "active",
history: createWebHistory(),
routes,
});