1
0
mirror of https://github.com/louislam/uptime-kuma.git synced 2024-12-14 10:23:16 +02:00
uptime-kuma/src/main.js

102 lines
2.7 KiB
JavaScript
Raw Normal View History

2021-07-27 19:47:13 +02:00
import "bootstrap";
import { createApp, h } from "vue";
import { createRouter, createWebHistory } from "vue-router";
import Toast from "vue-toastification";
import "vue-toastification/dist/index.css";
import App from "./App.vue";
import "./assets/app.scss";
import { FontAwesomeIcon } from "./icon.js";
import EmptyLayout from "./layouts/EmptyLayout.vue";
import Layout from "./layouts/Layout.vue";
import socket from "./mixins/socket";
import theme from "./mixins/theme";
2021-06-25 15:55:49 +02:00
import Dashboard from "./pages/Dashboard.vue";
import DashboardHome from "./pages/DashboardHome.vue";
import Details from "./pages/Details.vue";
import EditMonitor from "./pages/EditMonitor.vue";
2021-07-27 19:47:13 +02:00
import Settings from "./pages/Settings.vue";
2021-07-11 07:47:57 +02:00
import Setup from "./pages/Setup.vue";
import { appName } from "./util.ts";
2021-06-25 15:55:49 +02:00
const routes = [
{
2021-07-27 19:47:13 +02:00
path: "/",
2021-06-25 15:55:49 +02:00
component: Layout,
children: [
{
name: "root",
2021-07-27 19:47:13 +02:00
path: "",
2021-06-25 15:55:49 +02:00
component: Dashboard,
children: [
{
name: "DashboardHome",
2021-07-27 19:47:13 +02:00
path: "/dashboard",
2021-06-25 15:55:49 +02:00
component: DashboardHome,
children: [
{
2021-07-27 19:47:13 +02:00
path: "/dashboard/:id",
2021-06-27 10:10:55 +02:00
component: EmptyLayout,
children: [
{
2021-07-27 19:47:13 +02:00
path: "",
2021-06-27 10:10:55 +02:00
component: Details,
},
{
2021-07-27 19:47:13 +02:00
path: "/edit/:id",
2021-06-27 10:10:55 +02:00
component: EditMonitor,
},
2021-07-27 19:47:13 +02:00
],
2021-06-25 15:55:49 +02:00
},
{
2021-07-27 19:47:13 +02:00
path: "/add",
2021-06-25 15:55:49 +02:00
component: EditMonitor,
},
2021-07-27 19:47:13 +02:00
],
2021-06-25 15:55:49 +02:00
},
{
2021-07-27 19:47:13 +02:00
path: "/settings",
2021-06-25 15:55:49 +02:00
component: Settings,
},
],
},
2021-07-11 07:47:57 +02:00
2021-06-25 15:55:49 +02:00
],
2021-07-11 07:47:57 +02:00
},
{
2021-07-27 19:47:13 +02:00
path: "/setup",
2021-07-11 07:47:57 +02:00
component: Setup,
},
2021-06-25 15:55:49 +02:00
]
const router = createRouter({
2021-07-27 19:47:13 +02:00
linkActiveClass: "active",
2021-06-25 15:55:49 +02:00
history: createWebHistory(),
routes,
})
const app = createApp({
mixins: [
socket,
theme
2021-06-25 15:55:49 +02:00
],
data() {
return {
appName: appName
}
},
2021-07-27 19:47:13 +02:00
render: () => h(App),
2021-06-25 15:55:49 +02:00
})
app.use(router)
const options = {
2021-07-27 19:47:13 +02:00
position: "bottom-right",
2021-06-25 15:55:49 +02:00
};
app.use(Toast, options);
2021-07-27 19:47:13 +02:00
app.component("FontAwesomeIcon", FontAwesomeIcon)
2021-07-27 10:52:44 +02:00
2021-07-27 19:47:13 +02:00
app.mount("#app")