From 522a8a00b47f9d89cd3889f7ffee55f3fa32be98 Mon Sep 17 00:00:00 2001 From: rovast Date: Mon, 18 Sep 2023 10:29:00 +0800 Subject: [PATCH] Add device form update Signed-off-by: rovast --- locales/en.yaml | 1 + locales/zh-CN.yaml | 1 + src/components/Modal/new-device.vue | 17 +++++++++-------- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/locales/en.yaml b/locales/en.yaml index f6b884c..b101323 100644 --- a/locales/en.yaml +++ b/locales/en.yaml @@ -225,6 +225,7 @@ user: iot: "new device": New Device name: Name + mid: ID protocol: Protocol address: Address driver_sku: Driver SKU diff --git a/locales/zh-CN.yaml b/locales/zh-CN.yaml index 1697403..bf7e978 100644 --- a/locales/zh-CN.yaml +++ b/locales/zh-CN.yaml @@ -225,6 +225,7 @@ user: iot: "new device": 接入新设备 name: 设备名称 + mid: 设备ID protocol: 通讯协议 address: 链接地址 driver_sku: 设备驱动SKU diff --git a/src/components/Modal/new-device.vue b/src/components/Modal/new-device.vue index 770759a..5d331ce 100644 --- a/src/components/Modal/new-device.vue +++ b/src/components/Modal/new-device.vue @@ -9,12 +9,13 @@ import emitter from "@/utils/event-bus"; const loading = ref(false); const form = reactive({ name: "", - protocol: "HTTP", - address: "", - driver_sku: "", - driver_image: "", - instructions: "", - telemetries: "" + mid: "" + // protocol: "HTTP", + // address: "", + // driver_sku: "", + // driver_image: "", + // instructions: "", + // telemetries: "" // name: "test-thermometer", // protocol: "HTTP", @@ -39,8 +40,8 @@ const res = ref({ }); const handleSubmit = () => { const formData = clone(form); - formData.instructions = window.btoa(formData.instructions); - formData.telemetries = window.btoa(formData.telemetries); + // formData.instructions = window.btoa(formData.instructions); + // formData.telemetries = window.btoa(formData.telemetries); loading.value = true; loadData(res, "iot.device.add", formData, loading, () => {