2021-09-12 13:23:51 -04:00
|
|
|
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 List from "./pages/List.vue";
|
2021-09-29 12:16:15 -04:00
|
|
|
const Settings = () => import("./pages/Settings.vue");
|
2021-09-12 13:23:51 -04:00
|
|
|
import Setup from "./pages/Setup.vue";
|
2021-09-29 12:16:15 -04:00
|
|
|
const StatusPage = () => import("./pages/StatusPage.vue");
|
2021-09-23 01:57:24 -04:00
|
|
|
import Entry from "./pages/Entry.vue";
|
2021-09-12 13:23:51 -04:00
|
|
|
|
2021-11-03 05:03:40 -04:00
|
|
|
import Appearance from "./components/settings/Appearance.vue";
|
|
|
|
import General from "./components/settings/General.vue";
|
|
|
|
import Notifications from "./components/settings/Notifications.vue";
|
2022-03-29 13:49:45 -04:00
|
|
|
import ReverseProxy from "./components/settings/ReverseProxy.vue";
|
2021-11-03 05:03:40 -04:00
|
|
|
import MonitorHistory from "./components/settings/MonitorHistory.vue";
|
|
|
|
import Security from "./components/settings/Security.vue";
|
2021-10-30 13:37:15 -04:00
|
|
|
import Proxies from "./components/settings/Proxies.vue";
|
2021-11-03 05:03:40 -04:00
|
|
|
import Backup from "./components/settings/Backup.vue";
|
|
|
|
import About from "./components/settings/About.vue";
|
2022-03-10 08:34:30 -05:00
|
|
|
import ManageStatusPage from "./pages/ManageStatusPage.vue";
|
2022-03-15 00:00:29 -04:00
|
|
|
import AddStatusPage from "./pages/AddStatusPage.vue";
|
2022-03-25 14:09:12 -04:00
|
|
|
import NotFound from "./pages/NotFound.vue";
|
2021-11-03 05:03:40 -04:00
|
|
|
|
2021-09-12 13:23:51 -04:00
|
|
|
const routes = [
|
|
|
|
{
|
|
|
|
path: "/",
|
2021-09-23 01:57:24 -04:00
|
|
|
component: Entry,
|
|
|
|
},
|
|
|
|
{
|
2021-09-24 03:00:52 -04: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",
|
2021-09-12 13:23:51 -04:00
|
|
|
component: Layout,
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: "",
|
|
|
|
component: Dashboard,
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
name: "DashboardHome",
|
2021-09-24 03:00:52 -04:00
|
|
|
path: "/dashboard",
|
2021-09-12 13:23:51 -04:00
|
|
|
component: DashboardHome,
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: "/dashboard/:id",
|
|
|
|
component: EmptyLayout,
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: "",
|
|
|
|
component: Details,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/edit/:id",
|
|
|
|
component: EditMonitor,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/add",
|
|
|
|
component: EditMonitor,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/list",
|
|
|
|
component: List,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/settings",
|
|
|
|
component: Settings,
|
2021-11-03 05:03:40 -04:00
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: "general",
|
|
|
|
component: General,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "appearance",
|
|
|
|
component: Appearance,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "notifications",
|
|
|
|
component: Notifications,
|
|
|
|
},
|
2022-03-29 13:49:45 -04:00
|
|
|
{
|
|
|
|
path: "reverse-proxy",
|
|
|
|
component: ReverseProxy,
|
|
|
|
},
|
2021-11-03 05:03:40 -04:00
|
|
|
{
|
|
|
|
path: "monitor-history",
|
|
|
|
component: MonitorHistory,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "security",
|
|
|
|
component: Security,
|
|
|
|
},
|
2021-10-30 13:37:15 -04:00
|
|
|
{
|
|
|
|
path: "proxies",
|
|
|
|
component: Proxies,
|
|
|
|
},
|
2021-11-03 05:03:40 -04:00
|
|
|
{
|
|
|
|
path: "backup",
|
|
|
|
component: Backup,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "about",
|
|
|
|
component: About,
|
|
|
|
},
|
|
|
|
]
|
2021-09-12 13:23:51 -04:00
|
|
|
},
|
2022-03-10 08:34:30 -05:00
|
|
|
{
|
|
|
|
path: "/manage-status-page",
|
|
|
|
component: ManageStatusPage,
|
|
|
|
},
|
2022-03-15 00:00:29 -04:00
|
|
|
{
|
|
|
|
path: "/add-status-page",
|
|
|
|
component: AddStatusPage,
|
|
|
|
},
|
2021-09-12 13:23:51 -04:00
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/setup",
|
|
|
|
component: Setup,
|
|
|
|
},
|
2021-09-14 02:19:23 -04:00
|
|
|
{
|
|
|
|
path: "/status-page",
|
|
|
|
component: StatusPage,
|
|
|
|
},
|
2021-09-25 10:44:29 -04:00
|
|
|
{
|
|
|
|
path: "/status",
|
|
|
|
component: StatusPage,
|
|
|
|
},
|
2022-03-10 08:34:30 -05:00
|
|
|
{
|
|
|
|
path: "/status/:slug",
|
|
|
|
component: StatusPage,
|
|
|
|
},
|
2022-03-25 14:09:12 -04:00
|
|
|
{
|
|
|
|
path: "/:pathMatch(.*)*",
|
|
|
|
component: NotFound,
|
|
|
|
},
|
2021-09-14 02:19:23 -04:00
|
|
|
];
|
2021-09-12 13:23:51 -04:00
|
|
|
|
|
|
|
export const router = createRouter({
|
|
|
|
linkActiveClass: "active",
|
|
|
|
history: createWebHistory(),
|
|
|
|
routes,
|
|
|
|
});
|