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.

106 lines
2.8 KiB

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