From ec4281334fc252c3311f27141916b9a1fcd6630f Mon Sep 17 00:00:00 2001 From: LiLongLong <13717757313@163.com> Date: Sat, 1 Mar 2025 15:10:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E8=B0=83=E8=AF=95=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.ts | 12 ++- src/services/socket.ts | 5 + src/views/debug/index.vue | 219 +++++++++++++++++++++++++++++++++++++++++ src/views/debug/type.ts | 5 + src/views/spurtPrint/index.vue | 25 +++++ vite.config.ts | 8 ++ 6 files changed, 273 insertions(+), 1 deletion(-) create mode 100644 src/views/debug/index.vue create mode 100644 src/views/debug/type.ts create mode 100644 src/views/spurtPrint/index.vue diff --git a/src/router/index.ts b/src/router/index.ts index b90fe82..9c10548 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -5,6 +5,8 @@ import Index from "@/views/Index.vue"; import EnvironmentView from "../views/EnvironmentView.vue"; import SprayView from "../views/SprayView.vue"; import PrintView from "../views/PrintView.vue"; +import Debug from '../views/debug/index.vue' +import SpurtPrint from '../views/spurtPrint/index.vue' const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), @@ -33,7 +35,15 @@ const router = createRouter({ path: "/print", name: "print", component: PrintView, - }, + },{ + path: "/debug", + name: "debug", + component: Debug, + },{ + path: "/spurtPrint", + name: "spurtPrint", + component: SpurtPrint + } ], }, { diff --git a/src/services/socket.ts b/src/services/socket.ts index cfcd286..1826ffc 100644 --- a/src/services/socket.ts +++ b/src/services/socket.ts @@ -106,3 +106,8 @@ export const createWebSocket = (url: string): WebSocketClient => { return client; } }; + + +export const sharedWsUrl = `ws://${import.meta.env.VITE_API_HOST}:${import.meta.env.VITE_API_PORT}${ + import.meta.env.VITE_WS_PATH +}`; \ No newline at end of file diff --git a/src/views/debug/index.vue b/src/views/debug/index.vue new file mode 100644 index 0000000..d11bfb7 --- /dev/null +++ b/src/views/debug/index.vue @@ -0,0 +1,219 @@ + + + diff --git a/src/views/debug/type.ts b/src/views/debug/type.ts new file mode 100644 index 0000000..64eefa8 --- /dev/null +++ b/src/views/debug/type.ts @@ -0,0 +1,5 @@ +export type MachineryType = { + x: string | number + y: string | number + z: string | number +} \ No newline at end of file diff --git a/src/views/spurtPrint/index.vue b/src/views/spurtPrint/index.vue new file mode 100644 index 0000000..bd0ba9c --- /dev/null +++ b/src/views/spurtPrint/index.vue @@ -0,0 +1,25 @@ + + + \ No newline at end of file diff --git a/vite.config.ts b/vite.config.ts index f97ce0b..8331f24 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -16,5 +16,13 @@ export default defineConfig({ server: { host: "0.0.0.0", port: 5175, + proxy: { + "/api": { + target: "http://192.168.1.125:8080", + // target: "http://localhost:8080", + changeOrigin: true, + // rewrite: (path) => path.replace(/^\/api/, ''), + }, + }, }, });