From 1879a6cd0bb53dc4c87a49cc1bed07d601c9dc12 Mon Sep 17 00:00:00 2001 From: leandrofars Date: Tue, 11 Jun 2024 22:20:46 -0300 Subject: [PATCH] feat(frontend): cwmp remote messages | closes #266 --- .../src/sections/devices/cwmp/devices-rpc.js | 121 ++++++++++-------- 1 file changed, 66 insertions(+), 55 deletions(-) diff --git a/frontend/src/sections/devices/cwmp/devices-rpc.js b/frontend/src/sections/devices/cwmp/devices-rpc.js index 6da1c33..2fdcad1 100644 --- a/frontend/src/sections/devices/cwmp/devices-rpc.js +++ b/frontend/src/sections/devices/cwmp/devices-rpc.js @@ -38,15 +38,18 @@ const [answer, setAnswer] = useState(false) const [content, setContent] = useState('') const [age, setAge] = useState(2); -const [value, setValue] = useState(`{ - "param_paths": [ - "Device.WiFi.SSID.[Name==wlan0].", - "Device.IP.Interface.*.Alias", - "Device.DeviceInfo.FirmwareImage.*.Alias", - "Device.IP.Interface.1.IPv4Address.1.IPAddress" - ], - "max_depth": 2 -}`) +const [value, setValue] = useState(` + + + + + + InternetGatewayDevice.LANDevice.1.WLANConfiguration.1. + InternetGatewayDevice.LANDevice.1.WLANConfiguration.2. + + + +`) const handleClose = () => { setOpen(false); @@ -103,58 +106,66 @@ const handleOpen = () => { setAge(event.target.value); switch(event.target.value) { case 1: - setValue(`{ - "allow_partial": true, - "create_objs": [ - { - "obj_path": "Device.IP.Interface.", - "param_settings": [ - { - "param": "Alias", - "value": "test", - "required": true - } - ] - } - ] - }`) + setValue(` + + + + + InternetGatewayDevice.LANDevice. + + + + `) break; case 2: - setValue(`{ - "param_paths": [ - "Device.WiFi.SSID.[Name==wlan0].", - "Device.IP.Interface.*.Alias", - "Device.DeviceInfo.FirmwareImage.*.Alias", - "Device.IP.Interface.1.IPv4Address.1.IPAddress" - ], - "max_depth": 2 - }`) + setValue(` + + + + + + InternetGatewayDevice.LANDevice.1.WLANConfiguration.1. + InternetGatewayDevice.LANDevice.1.WLANConfiguration.2. + InternetGatewayDevice.LANDevice.2.WLANConfiguration.2. + InternetGatewayDevice.LANDevice.2.WLANConfiguration.1. + + + + `) break; case 3: setValue(` - { - "allow_partial":true, - "update_objs":[ - { - "obj_path":"Device.IP.Interface.[Alias==pamonha].", - "param_settings":[ - { - "param":"Alias", - "value":"goiaba", - "required":true - } - ] - } - ] - }`) + + + + + + + + InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.Enable + 0 + + + InternetGatewayDevice.LANDevice.1.WLANConfiguration.2.SSID + HUAWEI_TEST-2 + + + LC1309123 + + + `) break; case 4: - setValue(`{ - "allow_partial": true, - "obj_paths": [ - "Device.IP.Interface.3." - ] - }`) + setValue(` + + + + + InternetGatewayDevice.LANDevice.3. + + + + `) break; default: // code block @@ -207,7 +218,7 @@ const handleOpen = () => { onChange={handleChange} value={value} fullWidth - rows="9" + rows="15" />