diff --git a/frontend/.gitignore b/frontend/.gitignore
index 91f7558..338a350 100644
--- a/frontend/.gitignore
+++ b/frontend/.gitignore
@@ -27,5 +27,4 @@ coverage
*.sln
*.sw?
*.json
-*.ts
*.tsbuildinfo
diff --git a/frontend/src/App.vue b/frontend/src/App.vue
index 0e5f7a5..12e910c 100644
--- a/frontend/src/App.vue
+++ b/frontend/src/App.vue
@@ -7,7 +7,7 @@ import {
Connection,
List,
Setting,
- Zap,
+ SwitchButton,
ArrowLeft,
ArrowRight
} from '@element-plus/icons-vue'
@@ -93,7 +93,7 @@ onMounted(() => {
服务管理
-
+
电源控制
diff --git a/frontend/src/main.ts b/frontend/src/main.ts
new file mode 100644
index 0000000..71591a0
--- /dev/null
+++ b/frontend/src/main.ts
@@ -0,0 +1,19 @@
+import './assets/main.css'
+
+import { createApp } from 'vue'
+import ElementPlus from 'element-plus'
+import 'element-plus/dist/index.css'
+import App from './App.vue'
+import router from './router/index.ts'
+import axios from 'axios'
+
+// 配置 axios 默认值
+// axios.defaults.baseURL = window.location.origin + ':8000/api'
+// axios.defaults.baseURL = '/api'
+axios.defaults.baseURL = `${window.location.protocol}//${window.location.hostname}/api`;
+const app = createApp(App)
+
+app.use(ElementPlus)
+app.use(router)
+
+app.mount('#app')
\ No newline at end of file
diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts
new file mode 100644
index 0000000..25108ce
--- /dev/null
+++ b/frontend/src/router/index.ts
@@ -0,0 +1,45 @@
+import { createRouter, createWebHistory } from 'vue-router'
+import Home from '../views/Home.vue'
+import DeviceManagement from '../views/DeviceManagement.vue'
+import DeviceTypeManagement from '../views/DeviceTypeManagement.vue'
+import ServiceManagement from '../views/ServiceManagement.vue'
+import InterfaceManagement from '../views/InterfaceManagement.vue'
+import PowerControl from '../views/PowerControl.vue'
+
+const router = createRouter({
+ history: createWebHistory(import.meta.env.BASE_URL),
+ routes: [
+ {
+ path: '/',
+ name: 'home',
+ component: Home
+ },
+ {
+ path: '/devices',
+ name: 'devices',
+ component: DeviceManagement
+ },
+ {
+ path: '/device-types',
+ name: 'device-types',
+ component: DeviceTypeManagement
+ },
+ {
+ path: '/services',
+ name: 'services',
+ component: ServiceManagement
+ },
+ {
+ path: '/interfaces',
+ name: 'interfaces',
+ component: InterfaceManagement
+ },
+ {
+ path: '/power-control',
+ name: 'power-control',
+ component: PowerControl
+ }
+ ]
+})
+
+export default router
\ No newline at end of file
diff --git a/hvs_service/main.py b/hvs_service/main.py
index f3846e9..2d141d3 100644
--- a/hvs_service/main.py
+++ b/hvs_service/main.py
@@ -1,11 +1,17 @@
import time
+import os
from config import *
from tcp_io_module import TcpIoModule
from hvs import HvService
from mqtt_client import mqtt_client
+# pinctrl set 26 op pn dl
+
def main():
+ #通过pinctrl打开电源
+ os.system("pinctrl set 26 op pn dl")
+
io_module = TcpIoModule(host='192.168.8.211', port=502)
io_module.start()