From 8ac810bfb53196a40ddad06b5c6c679465b77bbc Mon Sep 17 00:00:00 2001 From: jackhoo_98 Date: Wed, 11 Jan 2023 18:12:41 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=AE=BE=E5=A4=87=E6=8E=A5=E5=85=A5?= =?UTF-8?q?=E7=BD=91=E5=85=B3=20=20=E6=8E=A5=E5=85=A5=E7=AC=AC=E4=B8=80?= =?UTF-8?q?=E6=AD=A5=E9=83=A8=E5=88=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/link/accessConfig.js | 33 + src/router/menu.ts | 4 + src/views/link/AccessConfig/Detail/data.ts | 45 +- src/views/link/AccessConfig/Detail/index.vue | 129 +-- .../components/AccessCard/index.vue | 86 ++ .../link/AccessConfig/components/Network.vue | 733 ++++++++++++++++++ .../components/Provider/index.vue | 145 ++++ src/views/link/AccessConfig/index.vue | 17 +- 8 files changed, 1120 insertions(+), 72 deletions(-) create mode 100644 src/api/link/accessConfig.js create mode 100644 src/views/link/AccessConfig/components/AccessCard/index.vue create mode 100644 src/views/link/AccessConfig/components/Network.vue create mode 100644 src/views/link/AccessConfig/components/Provider/index.vue diff --git a/src/api/link/accessConfig.js b/src/api/link/accessConfig.js new file mode 100644 index 00000000..0b972bb5 --- /dev/null +++ b/src/api/link/accessConfig.js @@ -0,0 +1,33 @@ +import server from '@/utils/request'; + +export const getProviders = () => server.get(`/gateway/device/providers`); + +export const detail = (id) => server.get(`/gateway/device/${id}`); + +export const getNetworkList = (networkType, data, params) => + server.get( + `/network/config/${networkType}/_alive?include=${params.include}`, + data, + ); + +export const getProtocolList = (transport, params) => + server.get(`/protocol/supports/${transport ? transport : ''}`, params); + +export const getConfigView = (id, transport) => + server.get(`/protocol/${id}/transport/${transport}`); + +export const getChildConfigView = (id) => + server.get(`/protocol/${id}/transports`); + +export const save = (data) => server.post(`/gateway/device`, data); + +export const update = (data) => server.patch(`/gateway/device`, data); + +export const list = (data) => + server.post(`/gateway/device/detail/_query`, data); + +export const undeploy = (id) => server.post(`/gateway/device/${id}/_shutdown`); + +export const deploy = (id) => server.post(`/gateway/device/${id}/_startup`); + +export const del = (id) => server.remove(`/gateway/device/${id}`); diff --git a/src/router/menu.ts b/src/router/menu.ts index 525ac2e8..fd37bff5 100644 --- a/src/router/menu.ts +++ b/src/router/menu.ts @@ -59,6 +59,10 @@ export default [ path: '/link/certificate/detail/add', component: () => import('@/views/link/Certificate/Detail/index.vue') }, + { + path: '/link/accessConfig', + component: () => import('@/views/link/AccessConfig/index.vue') + }, { path: '/link/accessConfig/detail/add', component: () => import('@/views/link/AccessConfig/Detail/index.vue') diff --git a/src/views/link/AccessConfig/Detail/data.ts b/src/views/link/AccessConfig/Detail/data.ts index 7dc2fe8a..6a29f551 100644 --- a/src/views/link/AccessConfig/Detail/data.ts +++ b/src/views/link/AccessConfig/Detail/data.ts @@ -1,21 +1,30 @@ -const MetworkTypeMapping = new Map(); -MetworkTypeMapping.set('websocket-server', 'WEB_SOCKET_SERVER'); -MetworkTypeMapping.set('http-server-gateway', 'HTTP_SERVER'); -MetworkTypeMapping.set('udp-device-gateway', 'UDP'); -MetworkTypeMapping.set('coap-server-gateway', 'COAP_SERVER'); -MetworkTypeMapping.set('mqtt-client-gateway', 'MQTT_CLIENT'); -MetworkTypeMapping.set('mqtt-server-gateway', 'MQTT_SERVER'); -MetworkTypeMapping.set('tcp-server-gateway', 'TCP_SERVER'); -const ProcotoleMapping = new Map(); -ProcotoleMapping.set('websocket-server', 'WebSocket'); -ProcotoleMapping.set('http-server-gateway', 'HTTP'); -ProcotoleMapping.set('udp-device-gateway', 'UDP'); -ProcotoleMapping.set('coap-server-gateway', 'CoAP'); -ProcotoleMapping.set('mqtt-client-gateway', 'MQTT'); -ProcotoleMapping.set('mqtt-server-gateway', 'MQTT'); -ProcotoleMapping.set('tcp-server-gateway', 'TCP'); -ProcotoleMapping.set('child-device', ''); +const ProtocolMapping = new Map(); +ProtocolMapping.set('websocket-server', 'WebSocket'); +ProtocolMapping.set('http-server-gateway', 'HTTP'); +ProtocolMapping.set('udp-device-gateway', 'UDP'); +ProtocolMapping.set('coap-server-gateway', 'CoAP'); +ProtocolMapping.set('mqtt-client-gateway', 'MQTT'); +ProtocolMapping.set('mqtt-server-gateway', 'MQTT'); +ProtocolMapping.set('tcp-server-gateway', 'TCP'); +ProtocolMapping.set('child-device', ''); +ProtocolMapping.set('OneNet', 'HTTP'); +ProtocolMapping.set('Ctwing', 'HTTP'); +ProtocolMapping.set('modbus-tcp', 'MODBUS_TCP'); +ProtocolMapping.set('opc-ua', 'OPC_UA'); +ProtocolMapping.set('edge-child-device', 'EdgeGateway'); +ProtocolMapping.set('official-edge-gateway', 'MQTT'); + +const NetworkTypeMapping = new Map(); +NetworkTypeMapping.set('websocket-server', 'WEB_SOCKET_SERVER'); +NetworkTypeMapping.set('http-server-gateway', 'HTTP_SERVER'); +NetworkTypeMapping.set('udp-device-gateway', 'UDP'); +NetworkTypeMapping.set('coap-server-gateway', 'COAP_SERVER'); +NetworkTypeMapping.set('mqtt-client-gateway', 'MQTT_CLIENT'); +NetworkTypeMapping.set('mqtt-server-gateway', 'MQTT_SERVER'); +NetworkTypeMapping.set('tcp-server-gateway', 'TCP_SERVER'); +NetworkTypeMapping.set('official-edge-gateway', 'MQTT_SERVER'); + const descriptionList = { 'udp-device-gateway': @@ -96,4 +105,4 @@ const columnsHTTP = [ }, ] -export { MetworkTypeMapping, ProcotoleMapping, descriptionList, columnsMQTT, columnsHTTP }; +export { NetworkTypeMapping, ProtocolMapping, descriptionList, columnsMQTT, columnsHTTP }; diff --git a/src/views/link/AccessConfig/Detail/index.vue b/src/views/link/AccessConfig/Detail/index.vue index 57a64f6b..97c13e2e 100644 --- a/src/views/link/AccessConfig/Detail/index.vue +++ b/src/views/link/AccessConfig/Detail/index.vue @@ -1,62 +1,93 @@ \ No newline at end of file diff --git a/src/views/link/AccessConfig/components/Network.vue b/src/views/link/AccessConfig/components/Network.vue new file mode 100644 index 00000000..8bb9b232 --- /dev/null +++ b/src/views/link/AccessConfig/components/Network.vue @@ -0,0 +1,733 @@ + + + + + diff --git a/src/views/link/AccessConfig/components/Provider/index.vue b/src/views/link/AccessConfig/components/Provider/index.vue new file mode 100644 index 00000000..d73dad78 --- /dev/null +++ b/src/views/link/AccessConfig/components/Provider/index.vue @@ -0,0 +1,145 @@ + + + + + diff --git a/src/views/link/AccessConfig/index.vue b/src/views/link/AccessConfig/index.vue index 5ce2ef66..e1509f3b 100644 --- a/src/views/link/AccessConfig/index.vue +++ b/src/views/link/AccessConfig/index.vue @@ -1,11 +1,18 @@