From 0a5b86140c6d77373ccdaebb663099b398cb9c11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leandro=20Ant=C3=B4nio=20Farias=20Machado?= Date: Fri, 15 Sep 2023 11:01:20 -0300 Subject: [PATCH 1/3] chore: show table even with no devices --- frontend/src/pages/devices.js | 2 +- frontend/src/sections/overview/overview-latest-orders.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/devices.js b/frontend/src/pages/devices.js index f39129d..519b8ec 100644 --- a/frontend/src/pages/devices.js +++ b/frontend/src/pages/devices.js @@ -33,7 +33,7 @@ const Page = () => { .catch(error => console.error('Error:', error)); }, [auth.user]); - return (devices && + return ( <> diff --git a/frontend/src/sections/overview/overview-latest-orders.js b/frontend/src/sections/overview/overview-latest-orders.js index cb33731..996d99c 100644 --- a/frontend/src/sections/overview/overview-latest-orders.js +++ b/frontend/src/sections/overview/overview-latest-orders.js @@ -72,7 +72,7 @@ export const OverviewLatestOrders = (props) => { </TableRow> </TableHead> <TableBody> - {orders.map((order) => { + {orders && orders.map((order) => { return ( <TableRow From 7f961d91bb3216a30bfa4126db097e3434bfcbc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leandro=20Ant=C3=B4nio=20Farias=20Machado?= <leandrofars@gmail.com> Date: Sat, 16 Sep 2023 11:41:53 -0300 Subject: [PATCH 2/3] chore(readme): integration with obuspa close #111 --- README.md | 94 +++++-------------------------------------------------- 1 file changed, 8 insertions(+), 86 deletions(-) diff --git a/README.md b/README.md index c193a36..dc7ddc9 100644 --- a/README.md +++ b/README.md @@ -230,94 +230,16 @@ leandro@leandro-laptop:~$ cd oktopus/frontend && npm i && npm run dev</pre> OBS: Do not use those instructions in production. To implement the project in production you might use more resources that are already avaiable in Oktopus, but would take longer to explain in this README. Soon, there will be more help and explanations about those extra needed configs. </li> <li> -Device test agent config: +Device test agent (obuspa): </li> <ul> - <li> -<b>Device.LocalAgent.</b> -<pre> -"CertificateNumberOfEntries": "0", -"Controller.1.Alias": "", -"Controller.1.AssignedRole": "", -"Controller.1.BootParameterNumberOfEntries": "0", -"Controller.1.ControllerCode": "", -"Controller.1.Enable": "true", -"Controller.1.EndpointID": "oktopusController", -"Controller.1.InheritedRole": "Device.LocalAgent.ControllerTrust.Role.1", -"Controller.1.MTP.1.Alias": "", -"Controller.1.MTP.1.Enable": "true", -"Controller.1.MTP.1.MQTT.Reference": "Device.MQTT.Client.1", -"Controller.1.MTP.1.MQTT.Topic": "oktopus/v1/controller", -"Controller.1.MTP.1.Protocol": "MQTT", -"Controller.1.MTPNumberOfEntries": "1", -"Controller.1.PeriodicNotifInterval": "15", -"Controller.1.PeriodicNotifTime": "0001-01-01T00:00:00Z", -"Controller.1.ProvisioningCode": "", -"Controller.1.USPNotifRetryIntervalMultiplier": "2000", -"Controller.1.USPNotifRetryMinimumWaitInterval": "5", -"ControllerNumberOfEntries": "1", -"ControllerTrust.ChallengeNumberOfEntries": "0", -"ControllerTrust.CredentialNumberOfEntries": "0", -"ControllerTrust.Role.1.Alias": "cpe-1", -"ControllerTrust.Role.1.Enable": "true", -"ControllerTrust.Role.1.Name": "Full Access", -"ControllerTrust.Role.1.Permission.1.Alias": "cpe-1", -"ControllerTrust.Role.1.Permission.1.CommandEvent": "r-xn", -"ControllerTrust.Role.1.Permission.1.Enable": "true", -"ControllerTrust.Role.1.Permission.1.InstantiatedObj": "rw-n", -"ControllerTrust.Role.1.Permission.1.Obj": "rw-n", -"ControllerTrust.Role.1.Permission.1.Order": "0", -"ControllerTrust.Role.1.Permission.1.Param": "rw-n", -"ControllerTrust.Role.1.Permission.1.Targets": "Device.", -"ControllerTrust.Role.1.PermissionNumberOfEntries": "1", -"ControllerTrust.RoleNumberOfEntries": "2", -"EndpointID": "os::4851CF-000000000002", -"MTP.1.Alias": "", -"MTP.1.Enable": "false", -"MTP.1.MQTT.PublishQoS": "0", -"MTP.1.MQTT.Reference": "Device.MQTT.Client.1", -"MTP.1.MQTT.ResponseTopicConfigured": "oktopus/v1/controller", -"MTP.1.MQTT.ResponseTopicDiscovered": "oktopus/v1/agent/os::4851CF-000000000002", -"MTP.1.Protocol": "MQTT", -"MTP.1.Status": "Down", -"MTPNumberOfEntries": "1", -"RequestNumberOfEntries": "0", -"SoftwareVersion": "5.0.0", -"SubscriptionNumberOfEntries": "0", -"SupportedFingerprintAlgorithms": "SHA-1, SHA-224, SHA-256, SHA-384, SHA-512", -"SupportedProtocols": "STOMP, CoAP, MQTT, WebSocket", -"UpTime": "42" -</pre> - </li> - <li> -<b>Device.MQTT.Client.1</b> - </li> - <pre> -"Alias": "cpe-1", -"BrokerAddress": "10.100.250.4", -"BrokerPort": "1883", -"CleanSession": "false", -"CleanStart": "false", -"ClientID": "", -"ConnectRetryIntervalMultiplier": "2000", -"ConnectRetryMaxInterval": "30720", -"ConnectRetryTime": "5", -"Enable": "true", -"KeepAliveTime": "30", -"Name": "", -"Password": "", -"ProtocolVersion": "5.0", -"RequestProblemInfo": "false", -"RequestResponseInfo": "false", -"ResponseInformation": "oktopus/v1/agent/os::4851CF-000000000002", -"Status": "Connected", -"Subscription.1.Alias": "cpe-1", -"Subscription.1.Enable": "false", -"Subscription.1.QoS": "1", -"Subscription.1.Topic": "oktopus/v1/agent", -"SubscriptionNumberOfEntries": "1", -"TransportProtocol": "TCP/IP", -"Username": "test"</pre> + <p>You might follow the instructions to build <a href="https://github.com/BroadbandForum/obuspa">obuspa</a> at their repo QUICK_START_GUIDE.md and remember to define 'INCLUDE_PROGRAMMATIC_FACTORY_RESET' at <a href="https://github.com/BroadbandForum/obuspa/blob/master/src/vendor/vendor_defs.h">'vendor_defs.h'</a> inside src/vendor folder, also advice you to build it with make tool.</p> + + <p>You can customize <a href="https://github.com/OktopUSP/oktopus/tree/main/agent/oktopus-mqqt-obuspa.txt">'oktopus-mqqt-obuspa.txt'</a> accordingly to your needs, there you can change broker address, client password, and etc. '-i' option defines the interface your usp packets will go through, in this case it's localhost, also keep in mind that after you run obuspa if you made a change to 'oktopus-mqqt-obuspa.txt' and want it to take effect you must delete '/usr/local/var/obuspa/usp.db' file before running the agent again (docs provide you other methods to do it too).'-r' option defines the config file you want the agent to use:</p> + + <pre>leandro@leandro-laptop:~/oktopus$ obuspa -p -v 4 -r agent/oktopus-mqqt-obuspa.txt -i lo</pre> + + <p>Obuspa has a lot of info and docs at their repo, which shows you many options to set your environment and customize agent to your embedded project. This basic agent has the purpose to test oktopus connection and shows an idea of how it's like with true devices, although with those, you're able to explore much more parameters and execute lots of configurations.</p> </ul> </ul> From 4f3cf9881fcadda8842ca95c922f74c03058924e Mon Sep 17 00:00:00 2001 From: leandrofars <leandrofars@gmail.com> Date: Sat, 16 Sep 2023 13:41:29 -0300 Subject: [PATCH 3/3] fix(readme):identation --- README.md | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index dc7ddc9..e49859f 100644 --- a/README.md +++ b/README.md @@ -230,17 +230,12 @@ leandro@leandro-laptop:~$ cd oktopus/frontend && npm i && npm run dev</pre> OBS: Do not use those instructions in production. To implement the project in production you might use more resources that are already avaiable in Oktopus, but would take longer to explain in this README. Soon, there will be more help and explanations about those extra needed configs. </li> <li> -Device test agent (obuspa): - </li> -<ul> + <h4>Device test agent (obuspa):</h4> <p>You might follow the instructions to build <a href="https://github.com/BroadbandForum/obuspa">obuspa</a> at their repo QUICK_START_GUIDE.md and remember to define 'INCLUDE_PROGRAMMATIC_FACTORY_RESET' at <a href="https://github.com/BroadbandForum/obuspa/blob/master/src/vendor/vendor_defs.h">'vendor_defs.h'</a> inside src/vendor folder, also advice you to build it with make tool.</p> - <p>You can customize <a href="https://github.com/OktopUSP/oktopus/tree/main/agent/oktopus-mqqt-obuspa.txt">'oktopus-mqqt-obuspa.txt'</a> accordingly to your needs, there you can change broker address, client password, and etc. '-i' option defines the interface your usp packets will go through, in this case it's localhost, also keep in mind that after you run obuspa if you made a change to 'oktopus-mqqt-obuspa.txt' and want it to take effect you must delete '/usr/local/var/obuspa/usp.db' file before running the agent again (docs provide you other methods to do it too).'-r' option defines the config file you want the agent to use:</p> - <pre>leandro@leandro-laptop:~/oktopus$ obuspa -p -v 4 -r agent/oktopus-mqqt-obuspa.txt -i lo</pre> - <p>Obuspa has a lot of info and docs at their repo, which shows you many options to set your environment and customize agent to your embedded project. This basic agent has the purpose to test oktopus connection and shows an idea of how it's like with true devices, although with those, you're able to explore much more parameters and execute lots of configurations.</p> -</ul> + </li> </ul> --------------------------------------------------------------------------------------------------------------------------------------------------------