\ No newline at end of file
+
diff --git a/view/src/components/logger.vue b/view/src/components/logger.vue
index 0a33825..b9eff6f 100644
--- a/view/src/components/logger.vue
+++ b/view/src/components/logger.vue
@@ -1,29 +1,28 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
\ No newline at end of file
+
diff --git a/view/src/components/sidebar.vue b/view/src/components/sidebar.vue
index c9de66d..0d14a7b 100644
--- a/view/src/components/sidebar.vue
+++ b/view/src/components/sidebar.vue
@@ -12,17 +12,17 @@
\ No newline at end of file
+
diff --git a/view/src/components/view_files.vue b/view/src/components/view_files.vue
index 51ef011..1e51d50 100644
--- a/view/src/components/view_files.vue
+++ b/view/src/components/view_files.vue
@@ -36,9 +36,9 @@
@@ -47,15 +47,14 @@
\ No newline at end of file
+
diff --git a/view/src/main.ts b/view/src/main.ts
index 7c26c59..0729d5d 100644
--- a/view/src/main.ts
+++ b/view/src/main.ts
@@ -1,20 +1,18 @@
import { createApp } from "vue";
import App from "./App.vue";
-import {router} from "./router";
-import { store , key} from "./store";
+import { router } from "./router";
+import { store, key } from "./store";
import _ws from "./websocket";
-addEventListener("resize",()=>window.resizeTo(1200,600));window.resizeTo(1200,600)
+addEventListener("resize", () => window.resizeTo(1200, 600));
+window.resizeTo(1200, 600);
-const ws = window.ws = new _ws()
+const ws = (window.ws = new _ws());
-console.log("啟動GUI")
-const app = createApp(App)
+console.log("啟動GUI");
+const app = createApp(App);
-const app_prop = app.config.globalProperties
-app_prop.$ws = ws
+const app_prop = app.config.globalProperties;
+app_prop.$ws = ws;
-app
- .use(store,key)
- .use(router)
- .mount("#root")
\ No newline at end of file
+app.use(store, key).use(router).mount("#root");
diff --git a/view/src/router/index.ts b/view/src/router/index.ts
index 27e4ba7..ca9c56c 100644
--- a/view/src/router/index.ts
+++ b/view/src/router/index.ts
@@ -1,8 +1,9 @@
import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";
import Home from "../views/home.vue";
-
-function import_vue(name:string){return ()=>import(`../views/${name}.vue`)}
+function import_vue(name: string) {
+ return () => import(`../views/${name}.vue`);
+}
const routes: Array = [
{
path: "/",
@@ -22,12 +23,12 @@ const router = createRouter({
routes,
});
-const list = [] as {path:string,name:string,}[]
+const list = [] as { path: string; name: string }[];
for (const item of routes) {
list.push({
- path:item.path,
- name:(item.name as string),
- })
+ path: item.path,
+ name: item.name as string,
+ });
}
-export {router,list}
\ No newline at end of file
+export { router, list };
diff --git a/view/src/store/index.ts b/view/src/store/index.ts
index 9e91baa..be45a04 100644
--- a/view/src/store/index.ts
+++ b/view/src/store/index.ts
@@ -1,38 +1,50 @@
-import { InjectionKey } from 'vue'
-import { createStore, useStore as baseUseStore, Store, mapMutations as mapMutations, mapState, mapActions } from 'vuex'
+import { InjectionKey } from "vue";
+import {
+ createStore,
+ useStore as baseUseStore,
+ Store,
+ mapMutations as mapMutations,
+ mapActions,
+} from "vuex";
export interface State {
- console_opened: boolean
- loading: boolean
- logger:{title:string,content:string}[]
+ console_opened: boolean;
+ loading: boolean;
+ logger: { title: string; content: string }[];
}
-export const key: InjectionKey> = Symbol()
+export const key: InjectionKey> = Symbol();
const $store = {
state: {
console_opened: false,
- loading:false,
- logger:[],
- },
- actions: {
-
+ loading: false,
+ logger: [],
},
+ actions: {},
mutations: {
- log(state:State,payload:{title:string,content:string}) {state.logger.push(payload)},
- loading(state:State,payload:boolean){state.loading=payload},
- }
-}
+ log(state: State, payload: { title: string; content: string }) {
+ state.logger.push(payload);
+ },
+ loading(state: State, payload: boolean) {
+ state.loading = payload;
+ },
+ },
+};
-export const store = createStore($store)
+export const store = createStore($store);
export const mixin = {
methods: {
- ...mapActions(Object.keys($store.actions) as Array),
- ...mapMutations(Object.keys($store.mutations) as Array)
- }
-}
+ ...mapActions(
+ Object.keys($store.actions) as Array
+ ),
+ ...mapMutations(
+ Object.keys($store.mutations) as Array
+ ),
+ },
+};
-export function useStore () {
- return baseUseStore(key)
-}
\ No newline at end of file
+export function useStore(): Store {
+ return baseUseStore(key);
+}
diff --git a/view/src/store/vuex.d.ts b/view/src/store/vuex.d.ts
index 56b9ed7..4a04b82 100644
--- a/view/src/store/vuex.d.ts
+++ b/view/src/store/vuex.d.ts
@@ -1,11 +1,12 @@
-import { ComponentCustomProperties } from 'vue'
-import { State } from '.'
-import ws from '@/websocket'
+/* eslint-disable */
+import { ComponentCustomProperties } from "vue";
+import { State } from ".";
+import ws from "@/websocket";
-declare module '@vue/runtime-core' {
+declare module "@vue/runtime-core" {
interface ComponentCustomProperties {
- $router: Router,
- $store: State,
- $ws: ws
+ $router: Router;
+ $store: State;
+ $ws: ws;
}
-}
\ No newline at end of file
+}
diff --git a/view/src/types/global.d.ts b/view/src/types/global.d.ts
index d041a8d..1968b3e 100644
--- a/view/src/types/global.d.ts
+++ b/view/src/types/global.d.ts
@@ -1,7 +1,7 @@
-import ws from '@/websocket'
+import ws from "@/websocket";
declare global {
- interface Window {
- ws : ws
+ interface Window {
+ ws: ws;
}
-}
\ No newline at end of file
+}
diff --git a/view/src/views/home.vue b/view/src/views/home.vue
index 4a3ab05..d43cec9 100644
--- a/view/src/views/home.vue
+++ b/view/src/views/home.vue
@@ -54,12 +54,15 @@
,直接複製網址。
-
+