You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
uptime-kuma/src/main.js

104 lines
2.8 KiB

3 years ago
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";
import mobile from "./mixins/mobile";
3 years ago
import Dashboard from "./pages/Dashboard.vue";
import DashboardHome from "./pages/DashboardHome.vue";
import Details from "./pages/Details.vue";
import EditMonitor from "./pages/EditMonitor.vue";
3 years ago
import Settings from "./pages/Settings.vue";
3 years ago
import Setup from "./pages/Setup.vue";
import { appName } from "./util.ts";
3 years ago
const routes = [
{
3 years ago
path: "/",
3 years ago
component: Layout,
children: [
{
name: "root",
3 years ago
path: "",
3 years ago
component: Dashboard,
children: [
{
name: "DashboardHome",
3 years ago
path: "/dashboard",
3 years ago
component: DashboardHome,
children: [
{
3 years ago
path: "/dashboard/:id",
3 years ago
component: EmptyLayout,
children: [
{
3 years ago
path: "",
3 years ago
component: Details,
},
{
3 years ago
path: "/edit/:id",
3 years ago
component: EditMonitor,
},
3 years ago
],
3 years ago
},
{
3 years ago
path: "/add",
3 years ago
component: EditMonitor,
},
3 years ago
],
3 years ago
},
{
3 years ago
path: "/settings",
3 years ago
component: Settings,
},
],
},
3 years ago
3 years ago
],
3 years ago
},
{
3 years ago
path: "/setup",
3 years ago
component: Setup,
},
3 years ago
]
const router = createRouter({
3 years ago
linkActiveClass: "active",
3 years ago
history: createWebHistory(),
routes,
})
const app = createApp({
mixins: [
socket,
theme,
mobile
3 years ago
],
data() {
return {
appName: appName
}
},
3 years ago
render: () => h(App),
3 years ago
})
app.use(router)
const options = {
3 years ago
position: "bottom-right",
3 years ago
};
app.use(Toast, options);
3 years ago
app.component("FontAwesomeIcon", FontAwesomeIcon)
3 years ago
app.mount("#app")