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

54 lines
1.3 KiB
JavaScript
Raw Normal View History

2021-07-27 19:47:13 +02:00
import "bootstrap";
import { createApp, h } from "vue";
import contenteditable from "vue-contenteditable";
2021-07-27 19:47:13 +02:00
import Toast from "vue-toastification";
import "vue-toastification/dist/index.css";
import App from "./App.vue";
import "./assets/app.scss";
import { i18n } from "./i18n";
2021-07-27 19:47:13 +02:00
import { FontAwesomeIcon } from "./icon.js";
import datetime from "./mixins/datetime";
import mobile from "./mixins/mobile";
import publicMixin from "./mixins/public";
2021-07-27 19:47:13 +02:00
import socket from "./mixins/socket";
import theme from "./mixins/theme";
2021-11-26 10:31:19 +02:00
import lang from "./mixins/lang";
import { router } from "./router";
import { appName } from "./util.ts";
2021-06-25 15:55:49 +02:00
const app = createApp({
mixins: [
socket,
2021-08-10 09:02:46 +02:00
theme,
2021-08-17 10:41:12 +02:00
mobile,
2021-09-13 13:21:39 +02:00
datetime,
publicMixin,
2021-11-26 10:31:19 +02:00
lang,
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
2021-08-24 10:44:58 +02:00
app.use(router);
app.use(i18n);
2021-06-25 15:55:49 +02:00
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-09-14 17:27:11 +02:00
app.component("Editable", contenteditable);
app.component("FontAwesomeIcon", FontAwesomeIcon);
2021-06-25 15:55:49 +02:00
2021-09-14 17:27:11 +02:00
app.mount("#app");
2021-10-08 07:35:04 +02:00
// Expose the vue instance for development
if (process.env.NODE_ENV === "development") {
console.log("Dev Only: window.app is the vue instance");
window.app = app._instance;
}