48 lines
1.2 KiB
Vue
48 lines
1.2 KiB
Vue
<template>
|
|
<div class="fit">
|
|
<q-ajax-bar position="top" color="accent" size="5px" skip-hijack />
|
|
<router-view />
|
|
</div>
|
|
</template>
|
|
<script lang="ts">
|
|
import { defineComponent } from "vue";
|
|
import { useI18n } from "vue-i18n";
|
|
import EventBus, { EventNamesDefine } from "src/common/EventBus";
|
|
import GlobalData from "./common/GlobalData";
|
|
import { useStore } from "src/store";
|
|
|
|
export default defineComponent({
|
|
name: "App",
|
|
|
|
setup() {
|
|
const $t = useI18n();
|
|
const $q = useStore();
|
|
document.title = $t.t("title");
|
|
|
|
window.onresize = (evt: any) =>
|
|
EventBus.getInstance().emit(EventNamesDefine.WindowResize, evt);
|
|
|
|
window.document.body.onclick = (evt: any) =>
|
|
EventBus.getInstance().emit(EventNamesDefine.DocumentBodyClick, evt);
|
|
|
|
document.body.classList.add("overflow-hidden");
|
|
|
|
const refreshFanTemp = async () => {
|
|
try {
|
|
const info = await GlobalData.getInstance()
|
|
.getCurrentClient()
|
|
?.getUnimportantInfo();
|
|
console.log(info);
|
|
if (info) {
|
|
$q.commit("setFanTemp", info.fan_temp);
|
|
}
|
|
} catch {}
|
|
};
|
|
setInterval(refreshFanTemp, 1000 * 3);
|
|
refreshFanTemp();
|
|
|
|
return {};
|
|
},
|
|
});
|
|
</script>
|