260 lines
8.3 KiB
JavaScript
Raw Normal View History

Squashed commit of the following from initial Omada widget: commit ad3e664b56ad2a9024684f2141f8f21ead59177e Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 19:54:54 2022 +0100 Add .idea to .gitignore commit 7e51a093845c6bcda4fac78a2c174adbcc7701b6 Merge: 93d8035 7dd0b0e Author: Benoit SERRA <oupsman@oupsman.fr> Date: Tue Dec 13 18:38:51 2022 +0100 Merge branch 'benphelps:main' into main commit 93d80350b1d4519ac217b880568ccabbef43f03f Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 18:15:20 2022 +0100 Omada widget : One widget, shows only the number alerts, the number of connected AP, the number of connected devices to Wifi, the number of connected switches and gatewawys. commit a1babd860ce8a2dd6981b7fef6e055e249cbccb2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 09:33:50 2022 +0100 Omada widget : spliting widget between WLAN and LAN/WAN fields to have no more than 5 fields per widget. commit e12cc65c7703f2f1930fc7646c1f4386b49e73fb Merge: 331f31f 146326f Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sun Dec 11 14:39:27 2022 +0100 Merge branch 'benphelps:main' into main commit 331f31fc2be80e0738869fd050b3034638979350 Merge: 37154e3 ccc1229 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sat Dec 10 17:56:44 2022 +0100 Merge branch 'benphelps:main' into main commit 37154e327af7d3fe66e7638ba79851ef789d3649 Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 17:11:30 2022 +0100 Omada widget : Improved error handling Omada widget: handling power as common.power in translation commit 1f484914067e514f22c1f250b62f589fedefe1fd Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 10:24:55 2022 +0100 Omada widget : adding stats for isolated aps, connected gateways, connected switches, available ports, power consumption commit f375f0b815bf6697f7044995203084427b14ea69 Merge: 467b678 775b511 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:38 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 467b67802a7b8dface01703b6035951dcaa1e069 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:09 2022 +0100 Omada widget : v3 v4 and v5 versions don't use the same fields for the same stats, I've corrected the code to make it more reliable commit 775b5111e13072a18edb33f30a4d4f0589bc2af0 Merge: 8d66756 88c4375 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Thu Dec 8 15:38:20 2022 +0100 Merge branch 'benphelps:main' into main commit 8d66756a7d8f9e0b43c8abde2f2e6f2fd86a1098 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:45:44 2022 +0100 Omada Widget : code cleanup commit 282a6d0592c53a39184d63bba517f482a84f5b36 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:42:41 2022 +0100 Omada Widget : code cleanup commit c3e9b8f87075e834ea1a520fd8c93708afb15ac0 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:37:10 2022 +0100 Omada Widget : No more legacy variable, the code detects the controller version and adapts the requests. Logic is not duplicated anymore commit eafcc205975cc1bd04f063f1627d380f2a2b7f04 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 15:46:00 2022 +0100 V2 API is working commit bcc2864ee2e1f0f1d2f4c009df1ba8a1a7244f80 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 10:01:26 2022 +0100 Code fore v2 API is not working but V1 code is. commit ea8e297e849c2ef5659bfec94d76d2fff8677c4c Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 14:28:05 2022 +0100 Errors handling commit ab6d51a88c8737654dd31bec46106d7c49ed39d2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 09:50:14 2022 +0100 Adding alerts commit 047db2cce867c0207be7fe0827b24107fdd84923 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:53:43 2022 +0100 Fixed translation system commit 42c5a3e6658f22662b1c58f54cba31dc90bfbc61 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:34:34 2022 +0100 Translation system is still * up commit c80eac9d5bd5491ec4a61da38cdaf82f0ea1cc2f Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:33:50 2022 +0100 Translation system is still * up commit f8ba6b02454d66eb96e7e6ebd8022492ff79e690 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:32:22 2022 +0100 Translation system is still * up commit dec7eec6de26298eb7c90fd01e1c0fd23b6469a4 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:16:13 2022 +0100 Translation system is * up commit cc840cf7ccb40509f1da3f521a4a1b3e26498ac0 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 21:33:00 2022 +0100 First working version commit 54b65e619e41c9963a614a177df3a4af68ebe77d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 18:59:09 2022 +0100 Using getGlobalStat method commit 7ebc8500da9d52bd2911a620179fb6585f044c47 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 14:33:37 2022 +0100 Working on Omada Widget : NOT WORKING FOR NOW commit 04eaf28cae1be0935cb190e50ae5b75c19254403 Merge: 61065ac 826fe15 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:32:30 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 61065ace2887c3c1d6486001d34ce6f58d58958d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:24:57 2022 +0100 Working on Omada Widget remove idea Co-Authored-By: Benoit SERRA <11260343+oupsman@users.noreply.github.com>
2022-12-21 12:08:34 -08:00
import { httpProxy } from "utils/proxy/http";
import getServiceWidget from "utils/config/service-helpers";
import createLogger from "utils/logger";
import widgets from "widgets/widgets";
const proxyName = "omadaProxyHandler";
const logger = createLogger(proxyName);
2022-12-21 12:20:17 -08:00
async function login(loginUrl, username, password, controllerVersionMajor) {
const params = {
username: username,
password: password
Squashed commit of the following from initial Omada widget: commit ad3e664b56ad2a9024684f2141f8f21ead59177e Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 19:54:54 2022 +0100 Add .idea to .gitignore commit 7e51a093845c6bcda4fac78a2c174adbcc7701b6 Merge: 93d8035 7dd0b0e Author: Benoit SERRA <oupsman@oupsman.fr> Date: Tue Dec 13 18:38:51 2022 +0100 Merge branch 'benphelps:main' into main commit 93d80350b1d4519ac217b880568ccabbef43f03f Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 18:15:20 2022 +0100 Omada widget : One widget, shows only the number alerts, the number of connected AP, the number of connected devices to Wifi, the number of connected switches and gatewawys. commit a1babd860ce8a2dd6981b7fef6e055e249cbccb2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 09:33:50 2022 +0100 Omada widget : spliting widget between WLAN and LAN/WAN fields to have no more than 5 fields per widget. commit e12cc65c7703f2f1930fc7646c1f4386b49e73fb Merge: 331f31f 146326f Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sun Dec 11 14:39:27 2022 +0100 Merge branch 'benphelps:main' into main commit 331f31fc2be80e0738869fd050b3034638979350 Merge: 37154e3 ccc1229 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sat Dec 10 17:56:44 2022 +0100 Merge branch 'benphelps:main' into main commit 37154e327af7d3fe66e7638ba79851ef789d3649 Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 17:11:30 2022 +0100 Omada widget : Improved error handling Omada widget: handling power as common.power in translation commit 1f484914067e514f22c1f250b62f589fedefe1fd Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 10:24:55 2022 +0100 Omada widget : adding stats for isolated aps, connected gateways, connected switches, available ports, power consumption commit f375f0b815bf6697f7044995203084427b14ea69 Merge: 467b678 775b511 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:38 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 467b67802a7b8dface01703b6035951dcaa1e069 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:09 2022 +0100 Omada widget : v3 v4 and v5 versions don't use the same fields for the same stats, I've corrected the code to make it more reliable commit 775b5111e13072a18edb33f30a4d4f0589bc2af0 Merge: 8d66756 88c4375 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Thu Dec 8 15:38:20 2022 +0100 Merge branch 'benphelps:main' into main commit 8d66756a7d8f9e0b43c8abde2f2e6f2fd86a1098 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:45:44 2022 +0100 Omada Widget : code cleanup commit 282a6d0592c53a39184d63bba517f482a84f5b36 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:42:41 2022 +0100 Omada Widget : code cleanup commit c3e9b8f87075e834ea1a520fd8c93708afb15ac0 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:37:10 2022 +0100 Omada Widget : No more legacy variable, the code detects the controller version and adapts the requests. Logic is not duplicated anymore commit eafcc205975cc1bd04f063f1627d380f2a2b7f04 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 15:46:00 2022 +0100 V2 API is working commit bcc2864ee2e1f0f1d2f4c009df1ba8a1a7244f80 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 10:01:26 2022 +0100 Code fore v2 API is not working but V1 code is. commit ea8e297e849c2ef5659bfec94d76d2fff8677c4c Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 14:28:05 2022 +0100 Errors handling commit ab6d51a88c8737654dd31bec46106d7c49ed39d2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 09:50:14 2022 +0100 Adding alerts commit 047db2cce867c0207be7fe0827b24107fdd84923 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:53:43 2022 +0100 Fixed translation system commit 42c5a3e6658f22662b1c58f54cba31dc90bfbc61 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:34:34 2022 +0100 Translation system is still * up commit c80eac9d5bd5491ec4a61da38cdaf82f0ea1cc2f Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:33:50 2022 +0100 Translation system is still * up commit f8ba6b02454d66eb96e7e6ebd8022492ff79e690 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:32:22 2022 +0100 Translation system is still * up commit dec7eec6de26298eb7c90fd01e1c0fd23b6469a4 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:16:13 2022 +0100 Translation system is * up commit cc840cf7ccb40509f1da3f521a4a1b3e26498ac0 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 21:33:00 2022 +0100 First working version commit 54b65e619e41c9963a614a177df3a4af68ebe77d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 18:59:09 2022 +0100 Using getGlobalStat method commit 7ebc8500da9d52bd2911a620179fb6585f044c47 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 14:33:37 2022 +0100 Working on Omada Widget : NOT WORKING FOR NOW commit 04eaf28cae1be0935cb190e50ae5b75c19254403 Merge: 61065ac 826fe15 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:32:30 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 61065ace2887c3c1d6486001d34ce6f58d58958d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:24:57 2022 +0100 Working on Omada Widget remove idea Co-Authored-By: Benoit SERRA <11260343+oupsman@users.noreply.github.com>
2022-12-21 12:08:34 -08:00
}
2022-12-21 12:20:17 -08:00
if (controllerVersionMajor < 4) {
params.method = "login";
params.name = username;
Squashed commit of the following from initial Omada widget: commit ad3e664b56ad2a9024684f2141f8f21ead59177e Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 19:54:54 2022 +0100 Add .idea to .gitignore commit 7e51a093845c6bcda4fac78a2c174adbcc7701b6 Merge: 93d8035 7dd0b0e Author: Benoit SERRA <oupsman@oupsman.fr> Date: Tue Dec 13 18:38:51 2022 +0100 Merge branch 'benphelps:main' into main commit 93d80350b1d4519ac217b880568ccabbef43f03f Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 18:15:20 2022 +0100 Omada widget : One widget, shows only the number alerts, the number of connected AP, the number of connected devices to Wifi, the number of connected switches and gatewawys. commit a1babd860ce8a2dd6981b7fef6e055e249cbccb2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 09:33:50 2022 +0100 Omada widget : spliting widget between WLAN and LAN/WAN fields to have no more than 5 fields per widget. commit e12cc65c7703f2f1930fc7646c1f4386b49e73fb Merge: 331f31f 146326f Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sun Dec 11 14:39:27 2022 +0100 Merge branch 'benphelps:main' into main commit 331f31fc2be80e0738869fd050b3034638979350 Merge: 37154e3 ccc1229 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sat Dec 10 17:56:44 2022 +0100 Merge branch 'benphelps:main' into main commit 37154e327af7d3fe66e7638ba79851ef789d3649 Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 17:11:30 2022 +0100 Omada widget : Improved error handling Omada widget: handling power as common.power in translation commit 1f484914067e514f22c1f250b62f589fedefe1fd Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 10:24:55 2022 +0100 Omada widget : adding stats for isolated aps, connected gateways, connected switches, available ports, power consumption commit f375f0b815bf6697f7044995203084427b14ea69 Merge: 467b678 775b511 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:38 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 467b67802a7b8dface01703b6035951dcaa1e069 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:09 2022 +0100 Omada widget : v3 v4 and v5 versions don't use the same fields for the same stats, I've corrected the code to make it more reliable commit 775b5111e13072a18edb33f30a4d4f0589bc2af0 Merge: 8d66756 88c4375 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Thu Dec 8 15:38:20 2022 +0100 Merge branch 'benphelps:main' into main commit 8d66756a7d8f9e0b43c8abde2f2e6f2fd86a1098 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:45:44 2022 +0100 Omada Widget : code cleanup commit 282a6d0592c53a39184d63bba517f482a84f5b36 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:42:41 2022 +0100 Omada Widget : code cleanup commit c3e9b8f87075e834ea1a520fd8c93708afb15ac0 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:37:10 2022 +0100 Omada Widget : No more legacy variable, the code detects the controller version and adapts the requests. Logic is not duplicated anymore commit eafcc205975cc1bd04f063f1627d380f2a2b7f04 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 15:46:00 2022 +0100 V2 API is working commit bcc2864ee2e1f0f1d2f4c009df1ba8a1a7244f80 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 10:01:26 2022 +0100 Code fore v2 API is not working but V1 code is. commit ea8e297e849c2ef5659bfec94d76d2fff8677c4c Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 14:28:05 2022 +0100 Errors handling commit ab6d51a88c8737654dd31bec46106d7c49ed39d2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 09:50:14 2022 +0100 Adding alerts commit 047db2cce867c0207be7fe0827b24107fdd84923 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:53:43 2022 +0100 Fixed translation system commit 42c5a3e6658f22662b1c58f54cba31dc90bfbc61 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:34:34 2022 +0100 Translation system is still * up commit c80eac9d5bd5491ec4a61da38cdaf82f0ea1cc2f Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:33:50 2022 +0100 Translation system is still * up commit f8ba6b02454d66eb96e7e6ebd8022492ff79e690 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:32:22 2022 +0100 Translation system is still * up commit dec7eec6de26298eb7c90fd01e1c0fd23b6469a4 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:16:13 2022 +0100 Translation system is * up commit cc840cf7ccb40509f1da3f521a4a1b3e26498ac0 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 21:33:00 2022 +0100 First working version commit 54b65e619e41c9963a614a177df3a4af68ebe77d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 18:59:09 2022 +0100 Using getGlobalStat method commit 7ebc8500da9d52bd2911a620179fb6585f044c47 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 14:33:37 2022 +0100 Working on Omada Widget : NOT WORKING FOR NOW commit 04eaf28cae1be0935cb190e50ae5b75c19254403 Merge: 61065ac 826fe15 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:32:30 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 61065ace2887c3c1d6486001d34ce6f58d58958d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:24:57 2022 +0100 Working on Omada Widget remove idea Co-Authored-By: Benoit SERRA <11260343+oupsman@users.noreply.github.com>
2022-12-21 12:08:34 -08:00
}
2022-12-21 12:20:17 -08:00
const [status, contentType, data] = await httpProxy(loginUrl, {
method: "POST",
body: JSON.stringify(params),
headers: {
"Content-Type": "application/json",
},
});
return [status, JSON.parse(data.toString())];
Squashed commit of the following from initial Omada widget: commit ad3e664b56ad2a9024684f2141f8f21ead59177e Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 19:54:54 2022 +0100 Add .idea to .gitignore commit 7e51a093845c6bcda4fac78a2c174adbcc7701b6 Merge: 93d8035 7dd0b0e Author: Benoit SERRA <oupsman@oupsman.fr> Date: Tue Dec 13 18:38:51 2022 +0100 Merge branch 'benphelps:main' into main commit 93d80350b1d4519ac217b880568ccabbef43f03f Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 18:15:20 2022 +0100 Omada widget : One widget, shows only the number alerts, the number of connected AP, the number of connected devices to Wifi, the number of connected switches and gatewawys. commit a1babd860ce8a2dd6981b7fef6e055e249cbccb2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 09:33:50 2022 +0100 Omada widget : spliting widget between WLAN and LAN/WAN fields to have no more than 5 fields per widget. commit e12cc65c7703f2f1930fc7646c1f4386b49e73fb Merge: 331f31f 146326f Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sun Dec 11 14:39:27 2022 +0100 Merge branch 'benphelps:main' into main commit 331f31fc2be80e0738869fd050b3034638979350 Merge: 37154e3 ccc1229 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sat Dec 10 17:56:44 2022 +0100 Merge branch 'benphelps:main' into main commit 37154e327af7d3fe66e7638ba79851ef789d3649 Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 17:11:30 2022 +0100 Omada widget : Improved error handling Omada widget: handling power as common.power in translation commit 1f484914067e514f22c1f250b62f589fedefe1fd Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 10:24:55 2022 +0100 Omada widget : adding stats for isolated aps, connected gateways, connected switches, available ports, power consumption commit f375f0b815bf6697f7044995203084427b14ea69 Merge: 467b678 775b511 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:38 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 467b67802a7b8dface01703b6035951dcaa1e069 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:09 2022 +0100 Omada widget : v3 v4 and v5 versions don't use the same fields for the same stats, I've corrected the code to make it more reliable commit 775b5111e13072a18edb33f30a4d4f0589bc2af0 Merge: 8d66756 88c4375 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Thu Dec 8 15:38:20 2022 +0100 Merge branch 'benphelps:main' into main commit 8d66756a7d8f9e0b43c8abde2f2e6f2fd86a1098 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:45:44 2022 +0100 Omada Widget : code cleanup commit 282a6d0592c53a39184d63bba517f482a84f5b36 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:42:41 2022 +0100 Omada Widget : code cleanup commit c3e9b8f87075e834ea1a520fd8c93708afb15ac0 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:37:10 2022 +0100 Omada Widget : No more legacy variable, the code detects the controller version and adapts the requests. Logic is not duplicated anymore commit eafcc205975cc1bd04f063f1627d380f2a2b7f04 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 15:46:00 2022 +0100 V2 API is working commit bcc2864ee2e1f0f1d2f4c009df1ba8a1a7244f80 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 10:01:26 2022 +0100 Code fore v2 API is not working but V1 code is. commit ea8e297e849c2ef5659bfec94d76d2fff8677c4c Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 14:28:05 2022 +0100 Errors handling commit ab6d51a88c8737654dd31bec46106d7c49ed39d2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 09:50:14 2022 +0100 Adding alerts commit 047db2cce867c0207be7fe0827b24107fdd84923 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:53:43 2022 +0100 Fixed translation system commit 42c5a3e6658f22662b1c58f54cba31dc90bfbc61 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:34:34 2022 +0100 Translation system is still * up commit c80eac9d5bd5491ec4a61da38cdaf82f0ea1cc2f Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:33:50 2022 +0100 Translation system is still * up commit f8ba6b02454d66eb96e7e6ebd8022492ff79e690 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:32:22 2022 +0100 Translation system is still * up commit dec7eec6de26298eb7c90fd01e1c0fd23b6469a4 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:16:13 2022 +0100 Translation system is * up commit cc840cf7ccb40509f1da3f521a4a1b3e26498ac0 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 21:33:00 2022 +0100 First working version commit 54b65e619e41c9963a614a177df3a4af68ebe77d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 18:59:09 2022 +0100 Using getGlobalStat method commit 7ebc8500da9d52bd2911a620179fb6585f044c47 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 14:33:37 2022 +0100 Working on Omada Widget : NOT WORKING FOR NOW commit 04eaf28cae1be0935cb190e50ae5b75c19254403 Merge: 61065ac 826fe15 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:32:30 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 61065ace2887c3c1d6486001d34ce6f58d58958d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:24:57 2022 +0100 Working on Omada Widget remove idea Co-Authored-By: Benoit SERRA <11260343+oupsman@users.noreply.github.com>
2022-12-21 12:08:34 -08:00
}
export default async function omadaProxyHandler(req, res) {
const { group, service } = req.query;
if (group && service) {
const widget = await getServiceWidget(group, service);
if (!widgets?.[widget.type]?.api) {
return res.status(403).json({ error: "Service does not support API calls" });
}
if (widget) {
const {url} = widget;
2022-12-21 12:20:17 -08:00
const controllerInfoURL = `${widget.url}/api/info`;
Squashed commit of the following from initial Omada widget: commit ad3e664b56ad2a9024684f2141f8f21ead59177e Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 19:54:54 2022 +0100 Add .idea to .gitignore commit 7e51a093845c6bcda4fac78a2c174adbcc7701b6 Merge: 93d8035 7dd0b0e Author: Benoit SERRA <oupsman@oupsman.fr> Date: Tue Dec 13 18:38:51 2022 +0100 Merge branch 'benphelps:main' into main commit 93d80350b1d4519ac217b880568ccabbef43f03f Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 18:15:20 2022 +0100 Omada widget : One widget, shows only the number alerts, the number of connected AP, the number of connected devices to Wifi, the number of connected switches and gatewawys. commit a1babd860ce8a2dd6981b7fef6e055e249cbccb2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 09:33:50 2022 +0100 Omada widget : spliting widget between WLAN and LAN/WAN fields to have no more than 5 fields per widget. commit e12cc65c7703f2f1930fc7646c1f4386b49e73fb Merge: 331f31f 146326f Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sun Dec 11 14:39:27 2022 +0100 Merge branch 'benphelps:main' into main commit 331f31fc2be80e0738869fd050b3034638979350 Merge: 37154e3 ccc1229 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sat Dec 10 17:56:44 2022 +0100 Merge branch 'benphelps:main' into main commit 37154e327af7d3fe66e7638ba79851ef789d3649 Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 17:11:30 2022 +0100 Omada widget : Improved error handling Omada widget: handling power as common.power in translation commit 1f484914067e514f22c1f250b62f589fedefe1fd Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 10:24:55 2022 +0100 Omada widget : adding stats for isolated aps, connected gateways, connected switches, available ports, power consumption commit f375f0b815bf6697f7044995203084427b14ea69 Merge: 467b678 775b511 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:38 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 467b67802a7b8dface01703b6035951dcaa1e069 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:09 2022 +0100 Omada widget : v3 v4 and v5 versions don't use the same fields for the same stats, I've corrected the code to make it more reliable commit 775b5111e13072a18edb33f30a4d4f0589bc2af0 Merge: 8d66756 88c4375 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Thu Dec 8 15:38:20 2022 +0100 Merge branch 'benphelps:main' into main commit 8d66756a7d8f9e0b43c8abde2f2e6f2fd86a1098 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:45:44 2022 +0100 Omada Widget : code cleanup commit 282a6d0592c53a39184d63bba517f482a84f5b36 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:42:41 2022 +0100 Omada Widget : code cleanup commit c3e9b8f87075e834ea1a520fd8c93708afb15ac0 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:37:10 2022 +0100 Omada Widget : No more legacy variable, the code detects the controller version and adapts the requests. Logic is not duplicated anymore commit eafcc205975cc1bd04f063f1627d380f2a2b7f04 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 15:46:00 2022 +0100 V2 API is working commit bcc2864ee2e1f0f1d2f4c009df1ba8a1a7244f80 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 10:01:26 2022 +0100 Code fore v2 API is not working but V1 code is. commit ea8e297e849c2ef5659bfec94d76d2fff8677c4c Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 14:28:05 2022 +0100 Errors handling commit ab6d51a88c8737654dd31bec46106d7c49ed39d2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 09:50:14 2022 +0100 Adding alerts commit 047db2cce867c0207be7fe0827b24107fdd84923 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:53:43 2022 +0100 Fixed translation system commit 42c5a3e6658f22662b1c58f54cba31dc90bfbc61 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:34:34 2022 +0100 Translation system is still * up commit c80eac9d5bd5491ec4a61da38cdaf82f0ea1cc2f Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:33:50 2022 +0100 Translation system is still * up commit f8ba6b02454d66eb96e7e6ebd8022492ff79e690 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:32:22 2022 +0100 Translation system is still * up commit dec7eec6de26298eb7c90fd01e1c0fd23b6469a4 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:16:13 2022 +0100 Translation system is * up commit cc840cf7ccb40509f1da3f521a4a1b3e26498ac0 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 21:33:00 2022 +0100 First working version commit 54b65e619e41c9963a614a177df3a4af68ebe77d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 18:59:09 2022 +0100 Using getGlobalStat method commit 7ebc8500da9d52bd2911a620179fb6585f044c47 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 14:33:37 2022 +0100 Working on Omada Widget : NOT WORKING FOR NOW commit 04eaf28cae1be0935cb190e50ae5b75c19254403 Merge: 61065ac 826fe15 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:32:30 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 61065ace2887c3c1d6486001d34ce6f58d58958d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:24:57 2022 +0100 Working on Omada Widget remove idea Co-Authored-By: Benoit SERRA <11260343+oupsman@users.noreply.github.com>
2022-12-21 12:08:34 -08:00
2022-12-21 12:20:17 -08:00
let [status, contentType, data] = await httpProxy(controllerInfoURL, {
Squashed commit of the following from initial Omada widget: commit ad3e664b56ad2a9024684f2141f8f21ead59177e Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 19:54:54 2022 +0100 Add .idea to .gitignore commit 7e51a093845c6bcda4fac78a2c174adbcc7701b6 Merge: 93d8035 7dd0b0e Author: Benoit SERRA <oupsman@oupsman.fr> Date: Tue Dec 13 18:38:51 2022 +0100 Merge branch 'benphelps:main' into main commit 93d80350b1d4519ac217b880568ccabbef43f03f Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 18:15:20 2022 +0100 Omada widget : One widget, shows only the number alerts, the number of connected AP, the number of connected devices to Wifi, the number of connected switches and gatewawys. commit a1babd860ce8a2dd6981b7fef6e055e249cbccb2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 09:33:50 2022 +0100 Omada widget : spliting widget between WLAN and LAN/WAN fields to have no more than 5 fields per widget. commit e12cc65c7703f2f1930fc7646c1f4386b49e73fb Merge: 331f31f 146326f Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sun Dec 11 14:39:27 2022 +0100 Merge branch 'benphelps:main' into main commit 331f31fc2be80e0738869fd050b3034638979350 Merge: 37154e3 ccc1229 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sat Dec 10 17:56:44 2022 +0100 Merge branch 'benphelps:main' into main commit 37154e327af7d3fe66e7638ba79851ef789d3649 Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 17:11:30 2022 +0100 Omada widget : Improved error handling Omada widget: handling power as common.power in translation commit 1f484914067e514f22c1f250b62f589fedefe1fd Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 10:24:55 2022 +0100 Omada widget : adding stats for isolated aps, connected gateways, connected switches, available ports, power consumption commit f375f0b815bf6697f7044995203084427b14ea69 Merge: 467b678 775b511 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:38 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 467b67802a7b8dface01703b6035951dcaa1e069 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:09 2022 +0100 Omada widget : v3 v4 and v5 versions don't use the same fields for the same stats, I've corrected the code to make it more reliable commit 775b5111e13072a18edb33f30a4d4f0589bc2af0 Merge: 8d66756 88c4375 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Thu Dec 8 15:38:20 2022 +0100 Merge branch 'benphelps:main' into main commit 8d66756a7d8f9e0b43c8abde2f2e6f2fd86a1098 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:45:44 2022 +0100 Omada Widget : code cleanup commit 282a6d0592c53a39184d63bba517f482a84f5b36 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:42:41 2022 +0100 Omada Widget : code cleanup commit c3e9b8f87075e834ea1a520fd8c93708afb15ac0 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:37:10 2022 +0100 Omada Widget : No more legacy variable, the code detects the controller version and adapts the requests. Logic is not duplicated anymore commit eafcc205975cc1bd04f063f1627d380f2a2b7f04 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 15:46:00 2022 +0100 V2 API is working commit bcc2864ee2e1f0f1d2f4c009df1ba8a1a7244f80 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 10:01:26 2022 +0100 Code fore v2 API is not working but V1 code is. commit ea8e297e849c2ef5659bfec94d76d2fff8677c4c Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 14:28:05 2022 +0100 Errors handling commit ab6d51a88c8737654dd31bec46106d7c49ed39d2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 09:50:14 2022 +0100 Adding alerts commit 047db2cce867c0207be7fe0827b24107fdd84923 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:53:43 2022 +0100 Fixed translation system commit 42c5a3e6658f22662b1c58f54cba31dc90bfbc61 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:34:34 2022 +0100 Translation system is still * up commit c80eac9d5bd5491ec4a61da38cdaf82f0ea1cc2f Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:33:50 2022 +0100 Translation system is still * up commit f8ba6b02454d66eb96e7e6ebd8022492ff79e690 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:32:22 2022 +0100 Translation system is still * up commit dec7eec6de26298eb7c90fd01e1c0fd23b6469a4 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:16:13 2022 +0100 Translation system is * up commit cc840cf7ccb40509f1da3f521a4a1b3e26498ac0 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 21:33:00 2022 +0100 First working version commit 54b65e619e41c9963a614a177df3a4af68ebe77d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 18:59:09 2022 +0100 Using getGlobalStat method commit 7ebc8500da9d52bd2911a620179fb6585f044c47 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 14:33:37 2022 +0100 Working on Omada Widget : NOT WORKING FOR NOW commit 04eaf28cae1be0935cb190e50ae5b75c19254403 Merge: 61065ac 826fe15 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:32:30 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 61065ace2887c3c1d6486001d34ce6f58d58958d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:24:57 2022 +0100 Working on Omada Widget remove idea Co-Authored-By: Benoit SERRA <11260343+oupsman@users.noreply.github.com>
2022-12-21 12:08:34 -08:00
headers: {
"Content-Type": "application/json",
},
});
2022-12-21 12:20:17 -08:00
if (status !== 200) {
logger.error("Unable to retrieve Omada controller info");
return res.status(status).json({error: {message: `HTTP Error ${status}`, url: controllerInfoURL, data: data}});
Squashed commit of the following from initial Omada widget: commit ad3e664b56ad2a9024684f2141f8f21ead59177e Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 19:54:54 2022 +0100 Add .idea to .gitignore commit 7e51a093845c6bcda4fac78a2c174adbcc7701b6 Merge: 93d8035 7dd0b0e Author: Benoit SERRA <oupsman@oupsman.fr> Date: Tue Dec 13 18:38:51 2022 +0100 Merge branch 'benphelps:main' into main commit 93d80350b1d4519ac217b880568ccabbef43f03f Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 18:15:20 2022 +0100 Omada widget : One widget, shows only the number alerts, the number of connected AP, the number of connected devices to Wifi, the number of connected switches and gatewawys. commit a1babd860ce8a2dd6981b7fef6e055e249cbccb2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 09:33:50 2022 +0100 Omada widget : spliting widget between WLAN and LAN/WAN fields to have no more than 5 fields per widget. commit e12cc65c7703f2f1930fc7646c1f4386b49e73fb Merge: 331f31f 146326f Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sun Dec 11 14:39:27 2022 +0100 Merge branch 'benphelps:main' into main commit 331f31fc2be80e0738869fd050b3034638979350 Merge: 37154e3 ccc1229 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sat Dec 10 17:56:44 2022 +0100 Merge branch 'benphelps:main' into main commit 37154e327af7d3fe66e7638ba79851ef789d3649 Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 17:11:30 2022 +0100 Omada widget : Improved error handling Omada widget: handling power as common.power in translation commit 1f484914067e514f22c1f250b62f589fedefe1fd Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 10:24:55 2022 +0100 Omada widget : adding stats for isolated aps, connected gateways, connected switches, available ports, power consumption commit f375f0b815bf6697f7044995203084427b14ea69 Merge: 467b678 775b511 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:38 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 467b67802a7b8dface01703b6035951dcaa1e069 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:09 2022 +0100 Omada widget : v3 v4 and v5 versions don't use the same fields for the same stats, I've corrected the code to make it more reliable commit 775b5111e13072a18edb33f30a4d4f0589bc2af0 Merge: 8d66756 88c4375 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Thu Dec 8 15:38:20 2022 +0100 Merge branch 'benphelps:main' into main commit 8d66756a7d8f9e0b43c8abde2f2e6f2fd86a1098 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:45:44 2022 +0100 Omada Widget : code cleanup commit 282a6d0592c53a39184d63bba517f482a84f5b36 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:42:41 2022 +0100 Omada Widget : code cleanup commit c3e9b8f87075e834ea1a520fd8c93708afb15ac0 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:37:10 2022 +0100 Omada Widget : No more legacy variable, the code detects the controller version and adapts the requests. Logic is not duplicated anymore commit eafcc205975cc1bd04f063f1627d380f2a2b7f04 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 15:46:00 2022 +0100 V2 API is working commit bcc2864ee2e1f0f1d2f4c009df1ba8a1a7244f80 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 10:01:26 2022 +0100 Code fore v2 API is not working but V1 code is. commit ea8e297e849c2ef5659bfec94d76d2fff8677c4c Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 14:28:05 2022 +0100 Errors handling commit ab6d51a88c8737654dd31bec46106d7c49ed39d2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 09:50:14 2022 +0100 Adding alerts commit 047db2cce867c0207be7fe0827b24107fdd84923 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:53:43 2022 +0100 Fixed translation system commit 42c5a3e6658f22662b1c58f54cba31dc90bfbc61 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:34:34 2022 +0100 Translation system is still * up commit c80eac9d5bd5491ec4a61da38cdaf82f0ea1cc2f Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:33:50 2022 +0100 Translation system is still * up commit f8ba6b02454d66eb96e7e6ebd8022492ff79e690 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:32:22 2022 +0100 Translation system is still * up commit dec7eec6de26298eb7c90fd01e1c0fd23b6469a4 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:16:13 2022 +0100 Translation system is * up commit cc840cf7ccb40509f1da3f521a4a1b3e26498ac0 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 21:33:00 2022 +0100 First working version commit 54b65e619e41c9963a614a177df3a4af68ebe77d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 18:59:09 2022 +0100 Using getGlobalStat method commit 7ebc8500da9d52bd2911a620179fb6585f044c47 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 14:33:37 2022 +0100 Working on Omada Widget : NOT WORKING FOR NOW commit 04eaf28cae1be0935cb190e50ae5b75c19254403 Merge: 61065ac 826fe15 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:32:30 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 61065ace2887c3c1d6486001d34ce6f58d58958d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:24:57 2022 +0100 Working on Omada Widget remove idea Co-Authored-By: Benoit SERRA <11260343+oupsman@users.noreply.github.com>
2022-12-21 12:08:34 -08:00
}
2022-12-21 12:20:17 -08:00
const cId = JSON.parse(data).result.omadacId;
let controllerVersion;
Squashed commit of the following from initial Omada widget: commit ad3e664b56ad2a9024684f2141f8f21ead59177e Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 19:54:54 2022 +0100 Add .idea to .gitignore commit 7e51a093845c6bcda4fac78a2c174adbcc7701b6 Merge: 93d8035 7dd0b0e Author: Benoit SERRA <oupsman@oupsman.fr> Date: Tue Dec 13 18:38:51 2022 +0100 Merge branch 'benphelps:main' into main commit 93d80350b1d4519ac217b880568ccabbef43f03f Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 18:15:20 2022 +0100 Omada widget : One widget, shows only the number alerts, the number of connected AP, the number of connected devices to Wifi, the number of connected switches and gatewawys. commit a1babd860ce8a2dd6981b7fef6e055e249cbccb2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 09:33:50 2022 +0100 Omada widget : spliting widget between WLAN and LAN/WAN fields to have no more than 5 fields per widget. commit e12cc65c7703f2f1930fc7646c1f4386b49e73fb Merge: 331f31f 146326f Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sun Dec 11 14:39:27 2022 +0100 Merge branch 'benphelps:main' into main commit 331f31fc2be80e0738869fd050b3034638979350 Merge: 37154e3 ccc1229 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sat Dec 10 17:56:44 2022 +0100 Merge branch 'benphelps:main' into main commit 37154e327af7d3fe66e7638ba79851ef789d3649 Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 17:11:30 2022 +0100 Omada widget : Improved error handling Omada widget: handling power as common.power in translation commit 1f484914067e514f22c1f250b62f589fedefe1fd Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 10:24:55 2022 +0100 Omada widget : adding stats for isolated aps, connected gateways, connected switches, available ports, power consumption commit f375f0b815bf6697f7044995203084427b14ea69 Merge: 467b678 775b511 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:38 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 467b67802a7b8dface01703b6035951dcaa1e069 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:09 2022 +0100 Omada widget : v3 v4 and v5 versions don't use the same fields for the same stats, I've corrected the code to make it more reliable commit 775b5111e13072a18edb33f30a4d4f0589bc2af0 Merge: 8d66756 88c4375 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Thu Dec 8 15:38:20 2022 +0100 Merge branch 'benphelps:main' into main commit 8d66756a7d8f9e0b43c8abde2f2e6f2fd86a1098 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:45:44 2022 +0100 Omada Widget : code cleanup commit 282a6d0592c53a39184d63bba517f482a84f5b36 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:42:41 2022 +0100 Omada Widget : code cleanup commit c3e9b8f87075e834ea1a520fd8c93708afb15ac0 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:37:10 2022 +0100 Omada Widget : No more legacy variable, the code detects the controller version and adapts the requests. Logic is not duplicated anymore commit eafcc205975cc1bd04f063f1627d380f2a2b7f04 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 15:46:00 2022 +0100 V2 API is working commit bcc2864ee2e1f0f1d2f4c009df1ba8a1a7244f80 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 10:01:26 2022 +0100 Code fore v2 API is not working but V1 code is. commit ea8e297e849c2ef5659bfec94d76d2fff8677c4c Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 14:28:05 2022 +0100 Errors handling commit ab6d51a88c8737654dd31bec46106d7c49ed39d2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 09:50:14 2022 +0100 Adding alerts commit 047db2cce867c0207be7fe0827b24107fdd84923 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:53:43 2022 +0100 Fixed translation system commit 42c5a3e6658f22662b1c58f54cba31dc90bfbc61 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:34:34 2022 +0100 Translation system is still * up commit c80eac9d5bd5491ec4a61da38cdaf82f0ea1cc2f Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:33:50 2022 +0100 Translation system is still * up commit f8ba6b02454d66eb96e7e6ebd8022492ff79e690 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:32:22 2022 +0100 Translation system is still * up commit dec7eec6de26298eb7c90fd01e1c0fd23b6469a4 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:16:13 2022 +0100 Translation system is * up commit cc840cf7ccb40509f1da3f521a4a1b3e26498ac0 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 21:33:00 2022 +0100 First working version commit 54b65e619e41c9963a614a177df3a4af68ebe77d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 18:59:09 2022 +0100 Using getGlobalStat method commit 7ebc8500da9d52bd2911a620179fb6585f044c47 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 14:33:37 2022 +0100 Working on Omada Widget : NOT WORKING FOR NOW commit 04eaf28cae1be0935cb190e50ae5b75c19254403 Merge: 61065ac 826fe15 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:32:30 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 61065ace2887c3c1d6486001d34ce6f58d58958d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:24:57 2022 +0100 Working on Omada Widget remove idea Co-Authored-By: Benoit SERRA <11260343+oupsman@users.noreply.github.com>
2022-12-21 12:08:34 -08:00
try {
2022-12-21 12:20:17 -08:00
controllerVersion = JSON.parse(data).result.controllerVer;
Squashed commit of the following from initial Omada widget: commit ad3e664b56ad2a9024684f2141f8f21ead59177e Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 19:54:54 2022 +0100 Add .idea to .gitignore commit 7e51a093845c6bcda4fac78a2c174adbcc7701b6 Merge: 93d8035 7dd0b0e Author: Benoit SERRA <oupsman@oupsman.fr> Date: Tue Dec 13 18:38:51 2022 +0100 Merge branch 'benphelps:main' into main commit 93d80350b1d4519ac217b880568ccabbef43f03f Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 18:15:20 2022 +0100 Omada widget : One widget, shows only the number alerts, the number of connected AP, the number of connected devices to Wifi, the number of connected switches and gatewawys. commit a1babd860ce8a2dd6981b7fef6e055e249cbccb2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 09:33:50 2022 +0100 Omada widget : spliting widget between WLAN and LAN/WAN fields to have no more than 5 fields per widget. commit e12cc65c7703f2f1930fc7646c1f4386b49e73fb Merge: 331f31f 146326f Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sun Dec 11 14:39:27 2022 +0100 Merge branch 'benphelps:main' into main commit 331f31fc2be80e0738869fd050b3034638979350 Merge: 37154e3 ccc1229 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sat Dec 10 17:56:44 2022 +0100 Merge branch 'benphelps:main' into main commit 37154e327af7d3fe66e7638ba79851ef789d3649 Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 17:11:30 2022 +0100 Omada widget : Improved error handling Omada widget: handling power as common.power in translation commit 1f484914067e514f22c1f250b62f589fedefe1fd Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 10:24:55 2022 +0100 Omada widget : adding stats for isolated aps, connected gateways, connected switches, available ports, power consumption commit f375f0b815bf6697f7044995203084427b14ea69 Merge: 467b678 775b511 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:38 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 467b67802a7b8dface01703b6035951dcaa1e069 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:09 2022 +0100 Omada widget : v3 v4 and v5 versions don't use the same fields for the same stats, I've corrected the code to make it more reliable commit 775b5111e13072a18edb33f30a4d4f0589bc2af0 Merge: 8d66756 88c4375 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Thu Dec 8 15:38:20 2022 +0100 Merge branch 'benphelps:main' into main commit 8d66756a7d8f9e0b43c8abde2f2e6f2fd86a1098 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:45:44 2022 +0100 Omada Widget : code cleanup commit 282a6d0592c53a39184d63bba517f482a84f5b36 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:42:41 2022 +0100 Omada Widget : code cleanup commit c3e9b8f87075e834ea1a520fd8c93708afb15ac0 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:37:10 2022 +0100 Omada Widget : No more legacy variable, the code detects the controller version and adapts the requests. Logic is not duplicated anymore commit eafcc205975cc1bd04f063f1627d380f2a2b7f04 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 15:46:00 2022 +0100 V2 API is working commit bcc2864ee2e1f0f1d2f4c009df1ba8a1a7244f80 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 10:01:26 2022 +0100 Code fore v2 API is not working but V1 code is. commit ea8e297e849c2ef5659bfec94d76d2fff8677c4c Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 14:28:05 2022 +0100 Errors handling commit ab6d51a88c8737654dd31bec46106d7c49ed39d2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 09:50:14 2022 +0100 Adding alerts commit 047db2cce867c0207be7fe0827b24107fdd84923 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:53:43 2022 +0100 Fixed translation system commit 42c5a3e6658f22662b1c58f54cba31dc90bfbc61 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:34:34 2022 +0100 Translation system is still * up commit c80eac9d5bd5491ec4a61da38cdaf82f0ea1cc2f Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:33:50 2022 +0100 Translation system is still * up commit f8ba6b02454d66eb96e7e6ebd8022492ff79e690 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:32:22 2022 +0100 Translation system is still * up commit dec7eec6de26298eb7c90fd01e1c0fd23b6469a4 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:16:13 2022 +0100 Translation system is * up commit cc840cf7ccb40509f1da3f521a4a1b3e26498ac0 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 21:33:00 2022 +0100 First working version commit 54b65e619e41c9963a614a177df3a4af68ebe77d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 18:59:09 2022 +0100 Using getGlobalStat method commit 7ebc8500da9d52bd2911a620179fb6585f044c47 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 14:33:37 2022 +0100 Working on Omada Widget : NOT WORKING FOR NOW commit 04eaf28cae1be0935cb190e50ae5b75c19254403 Merge: 61065ac 826fe15 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:32:30 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 61065ace2887c3c1d6486001d34ce6f58d58958d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:24:57 2022 +0100 Working on Omada Widget remove idea Co-Authored-By: Benoit SERRA <11260343+oupsman@users.noreply.github.com>
2022-12-21 12:08:34 -08:00
} catch (e) {
2022-12-21 12:20:17 -08:00
// fallback to this random version?
controllerVersion = "3.2.17"
Squashed commit of the following from initial Omada widget: commit ad3e664b56ad2a9024684f2141f8f21ead59177e Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 19:54:54 2022 +0100 Add .idea to .gitignore commit 7e51a093845c6bcda4fac78a2c174adbcc7701b6 Merge: 93d8035 7dd0b0e Author: Benoit SERRA <oupsman@oupsman.fr> Date: Tue Dec 13 18:38:51 2022 +0100 Merge branch 'benphelps:main' into main commit 93d80350b1d4519ac217b880568ccabbef43f03f Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 18:15:20 2022 +0100 Omada widget : One widget, shows only the number alerts, the number of connected AP, the number of connected devices to Wifi, the number of connected switches and gatewawys. commit a1babd860ce8a2dd6981b7fef6e055e249cbccb2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 09:33:50 2022 +0100 Omada widget : spliting widget between WLAN and LAN/WAN fields to have no more than 5 fields per widget. commit e12cc65c7703f2f1930fc7646c1f4386b49e73fb Merge: 331f31f 146326f Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sun Dec 11 14:39:27 2022 +0100 Merge branch 'benphelps:main' into main commit 331f31fc2be80e0738869fd050b3034638979350 Merge: 37154e3 ccc1229 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sat Dec 10 17:56:44 2022 +0100 Merge branch 'benphelps:main' into main commit 37154e327af7d3fe66e7638ba79851ef789d3649 Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 17:11:30 2022 +0100 Omada widget : Improved error handling Omada widget: handling power as common.power in translation commit 1f484914067e514f22c1f250b62f589fedefe1fd Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 10:24:55 2022 +0100 Omada widget : adding stats for isolated aps, connected gateways, connected switches, available ports, power consumption commit f375f0b815bf6697f7044995203084427b14ea69 Merge: 467b678 775b511 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:38 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 467b67802a7b8dface01703b6035951dcaa1e069 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:09 2022 +0100 Omada widget : v3 v4 and v5 versions don't use the same fields for the same stats, I've corrected the code to make it more reliable commit 775b5111e13072a18edb33f30a4d4f0589bc2af0 Merge: 8d66756 88c4375 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Thu Dec 8 15:38:20 2022 +0100 Merge branch 'benphelps:main' into main commit 8d66756a7d8f9e0b43c8abde2f2e6f2fd86a1098 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:45:44 2022 +0100 Omada Widget : code cleanup commit 282a6d0592c53a39184d63bba517f482a84f5b36 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:42:41 2022 +0100 Omada Widget : code cleanup commit c3e9b8f87075e834ea1a520fd8c93708afb15ac0 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:37:10 2022 +0100 Omada Widget : No more legacy variable, the code detects the controller version and adapts the requests. Logic is not duplicated anymore commit eafcc205975cc1bd04f063f1627d380f2a2b7f04 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 15:46:00 2022 +0100 V2 API is working commit bcc2864ee2e1f0f1d2f4c009df1ba8a1a7244f80 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 10:01:26 2022 +0100 Code fore v2 API is not working but V1 code is. commit ea8e297e849c2ef5659bfec94d76d2fff8677c4c Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 14:28:05 2022 +0100 Errors handling commit ab6d51a88c8737654dd31bec46106d7c49ed39d2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 09:50:14 2022 +0100 Adding alerts commit 047db2cce867c0207be7fe0827b24107fdd84923 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:53:43 2022 +0100 Fixed translation system commit 42c5a3e6658f22662b1c58f54cba31dc90bfbc61 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:34:34 2022 +0100 Translation system is still * up commit c80eac9d5bd5491ec4a61da38cdaf82f0ea1cc2f Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:33:50 2022 +0100 Translation system is still * up commit f8ba6b02454d66eb96e7e6ebd8022492ff79e690 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:32:22 2022 +0100 Translation system is still * up commit dec7eec6de26298eb7c90fd01e1c0fd23b6469a4 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:16:13 2022 +0100 Translation system is * up commit cc840cf7ccb40509f1da3f521a4a1b3e26498ac0 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 21:33:00 2022 +0100 First working version commit 54b65e619e41c9963a614a177df3a4af68ebe77d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 18:59:09 2022 +0100 Using getGlobalStat method commit 7ebc8500da9d52bd2911a620179fb6585f044c47 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 14:33:37 2022 +0100 Working on Omada Widget : NOT WORKING FOR NOW commit 04eaf28cae1be0935cb190e50ae5b75c19254403 Merge: 61065ac 826fe15 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:32:30 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 61065ace2887c3c1d6486001d34ce6f58d58958d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:24:57 2022 +0100 Working on Omada Widget remove idea Co-Authored-By: Benoit SERRA <11260343+oupsman@users.noreply.github.com>
2022-12-21 12:08:34 -08:00
}
2022-12-21 12:20:17 -08:00
const controllerVersionMajor = parseInt(controllerVersion.split('.')[0], 10)
if (![3,4,5].includes(controllerVersionMajor)) {
return res.status(500).json({error: {message: "Error determining controller version", data}});
}
let loginUrl;
switch (controllerVersionMajor) {
case 3:
loginUrl = `${widget.url}/api/user/login?ajax`;
break;
case 4:
loginUrl = `${widget.url}/api/v2/login`;
break;
case 5:
loginUrl = `${widget.url}/${cId}/api/v2/login`;
break;
default:
break;
Squashed commit of the following from initial Omada widget: commit ad3e664b56ad2a9024684f2141f8f21ead59177e Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 19:54:54 2022 +0100 Add .idea to .gitignore commit 7e51a093845c6bcda4fac78a2c174adbcc7701b6 Merge: 93d8035 7dd0b0e Author: Benoit SERRA <oupsman@oupsman.fr> Date: Tue Dec 13 18:38:51 2022 +0100 Merge branch 'benphelps:main' into main commit 93d80350b1d4519ac217b880568ccabbef43f03f Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 18:15:20 2022 +0100 Omada widget : One widget, shows only the number alerts, the number of connected AP, the number of connected devices to Wifi, the number of connected switches and gatewawys. commit a1babd860ce8a2dd6981b7fef6e055e249cbccb2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 09:33:50 2022 +0100 Omada widget : spliting widget between WLAN and LAN/WAN fields to have no more than 5 fields per widget. commit e12cc65c7703f2f1930fc7646c1f4386b49e73fb Merge: 331f31f 146326f Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sun Dec 11 14:39:27 2022 +0100 Merge branch 'benphelps:main' into main commit 331f31fc2be80e0738869fd050b3034638979350 Merge: 37154e3 ccc1229 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sat Dec 10 17:56:44 2022 +0100 Merge branch 'benphelps:main' into main commit 37154e327af7d3fe66e7638ba79851ef789d3649 Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 17:11:30 2022 +0100 Omada widget : Improved error handling Omada widget: handling power as common.power in translation commit 1f484914067e514f22c1f250b62f589fedefe1fd Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 10:24:55 2022 +0100 Omada widget : adding stats for isolated aps, connected gateways, connected switches, available ports, power consumption commit f375f0b815bf6697f7044995203084427b14ea69 Merge: 467b678 775b511 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:38 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 467b67802a7b8dface01703b6035951dcaa1e069 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:09 2022 +0100 Omada widget : v3 v4 and v5 versions don't use the same fields for the same stats, I've corrected the code to make it more reliable commit 775b5111e13072a18edb33f30a4d4f0589bc2af0 Merge: 8d66756 88c4375 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Thu Dec 8 15:38:20 2022 +0100 Merge branch 'benphelps:main' into main commit 8d66756a7d8f9e0b43c8abde2f2e6f2fd86a1098 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:45:44 2022 +0100 Omada Widget : code cleanup commit 282a6d0592c53a39184d63bba517f482a84f5b36 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:42:41 2022 +0100 Omada Widget : code cleanup commit c3e9b8f87075e834ea1a520fd8c93708afb15ac0 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:37:10 2022 +0100 Omada Widget : No more legacy variable, the code detects the controller version and adapts the requests. Logic is not duplicated anymore commit eafcc205975cc1bd04f063f1627d380f2a2b7f04 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 15:46:00 2022 +0100 V2 API is working commit bcc2864ee2e1f0f1d2f4c009df1ba8a1a7244f80 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 10:01:26 2022 +0100 Code fore v2 API is not working but V1 code is. commit ea8e297e849c2ef5659bfec94d76d2fff8677c4c Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 14:28:05 2022 +0100 Errors handling commit ab6d51a88c8737654dd31bec46106d7c49ed39d2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 09:50:14 2022 +0100 Adding alerts commit 047db2cce867c0207be7fe0827b24107fdd84923 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:53:43 2022 +0100 Fixed translation system commit 42c5a3e6658f22662b1c58f54cba31dc90bfbc61 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:34:34 2022 +0100 Translation system is still * up commit c80eac9d5bd5491ec4a61da38cdaf82f0ea1cc2f Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:33:50 2022 +0100 Translation system is still * up commit f8ba6b02454d66eb96e7e6ebd8022492ff79e690 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:32:22 2022 +0100 Translation system is still * up commit dec7eec6de26298eb7c90fd01e1c0fd23b6469a4 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:16:13 2022 +0100 Translation system is * up commit cc840cf7ccb40509f1da3f521a4a1b3e26498ac0 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 21:33:00 2022 +0100 First working version commit 54b65e619e41c9963a614a177df3a4af68ebe77d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 18:59:09 2022 +0100 Using getGlobalStat method commit 7ebc8500da9d52bd2911a620179fb6585f044c47 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 14:33:37 2022 +0100 Working on Omada Widget : NOT WORKING FOR NOW commit 04eaf28cae1be0935cb190e50ae5b75c19254403 Merge: 61065ac 826fe15 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:32:30 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 61065ace2887c3c1d6486001d34ce6f58d58958d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:24:57 2022 +0100 Working on Omada Widget remove idea Co-Authored-By: Benoit SERRA <11260343+oupsman@users.noreply.github.com>
2022-12-21 12:08:34 -08:00
}
2022-12-21 12:20:17 -08:00
const [loginStatus, loginResponseData] = await login(loginUrl, widget.username, widget.password, controllerVersionMajor);
Squashed commit of the following from initial Omada widget: commit ad3e664b56ad2a9024684f2141f8f21ead59177e Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 19:54:54 2022 +0100 Add .idea to .gitignore commit 7e51a093845c6bcda4fac78a2c174adbcc7701b6 Merge: 93d8035 7dd0b0e Author: Benoit SERRA <oupsman@oupsman.fr> Date: Tue Dec 13 18:38:51 2022 +0100 Merge branch 'benphelps:main' into main commit 93d80350b1d4519ac217b880568ccabbef43f03f Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 18:15:20 2022 +0100 Omada widget : One widget, shows only the number alerts, the number of connected AP, the number of connected devices to Wifi, the number of connected switches and gatewawys. commit a1babd860ce8a2dd6981b7fef6e055e249cbccb2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 09:33:50 2022 +0100 Omada widget : spliting widget between WLAN and LAN/WAN fields to have no more than 5 fields per widget. commit e12cc65c7703f2f1930fc7646c1f4386b49e73fb Merge: 331f31f 146326f Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sun Dec 11 14:39:27 2022 +0100 Merge branch 'benphelps:main' into main commit 331f31fc2be80e0738869fd050b3034638979350 Merge: 37154e3 ccc1229 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sat Dec 10 17:56:44 2022 +0100 Merge branch 'benphelps:main' into main commit 37154e327af7d3fe66e7638ba79851ef789d3649 Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 17:11:30 2022 +0100 Omada widget : Improved error handling Omada widget: handling power as common.power in translation commit 1f484914067e514f22c1f250b62f589fedefe1fd Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 10:24:55 2022 +0100 Omada widget : adding stats for isolated aps, connected gateways, connected switches, available ports, power consumption commit f375f0b815bf6697f7044995203084427b14ea69 Merge: 467b678 775b511 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:38 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 467b67802a7b8dface01703b6035951dcaa1e069 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:09 2022 +0100 Omada widget : v3 v4 and v5 versions don't use the same fields for the same stats, I've corrected the code to make it more reliable commit 775b5111e13072a18edb33f30a4d4f0589bc2af0 Merge: 8d66756 88c4375 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Thu Dec 8 15:38:20 2022 +0100 Merge branch 'benphelps:main' into main commit 8d66756a7d8f9e0b43c8abde2f2e6f2fd86a1098 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:45:44 2022 +0100 Omada Widget : code cleanup commit 282a6d0592c53a39184d63bba517f482a84f5b36 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:42:41 2022 +0100 Omada Widget : code cleanup commit c3e9b8f87075e834ea1a520fd8c93708afb15ac0 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:37:10 2022 +0100 Omada Widget : No more legacy variable, the code detects the controller version and adapts the requests. Logic is not duplicated anymore commit eafcc205975cc1bd04f063f1627d380f2a2b7f04 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 15:46:00 2022 +0100 V2 API is working commit bcc2864ee2e1f0f1d2f4c009df1ba8a1a7244f80 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 10:01:26 2022 +0100 Code fore v2 API is not working but V1 code is. commit ea8e297e849c2ef5659bfec94d76d2fff8677c4c Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 14:28:05 2022 +0100 Errors handling commit ab6d51a88c8737654dd31bec46106d7c49ed39d2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 09:50:14 2022 +0100 Adding alerts commit 047db2cce867c0207be7fe0827b24107fdd84923 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:53:43 2022 +0100 Fixed translation system commit 42c5a3e6658f22662b1c58f54cba31dc90bfbc61 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:34:34 2022 +0100 Translation system is still * up commit c80eac9d5bd5491ec4a61da38cdaf82f0ea1cc2f Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:33:50 2022 +0100 Translation system is still * up commit f8ba6b02454d66eb96e7e6ebd8022492ff79e690 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:32:22 2022 +0100 Translation system is still * up commit dec7eec6de26298eb7c90fd01e1c0fd23b6469a4 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:16:13 2022 +0100 Translation system is * up commit cc840cf7ccb40509f1da3f521a4a1b3e26498ac0 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 21:33:00 2022 +0100 First working version commit 54b65e619e41c9963a614a177df3a4af68ebe77d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 18:59:09 2022 +0100 Using getGlobalStat method commit 7ebc8500da9d52bd2911a620179fb6585f044c47 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 14:33:37 2022 +0100 Working on Omada Widget : NOT WORKING FOR NOW commit 04eaf28cae1be0935cb190e50ae5b75c19254403 Merge: 61065ac 826fe15 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:32:30 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 61065ace2887c3c1d6486001d34ce6f58d58958d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:24:57 2022 +0100 Working on Omada Widget remove idea Co-Authored-By: Benoit SERRA <11260343+oupsman@users.noreply.github.com>
2022-12-21 12:08:34 -08:00
2022-12-21 12:20:17 -08:00
if (loginStatus !== 200 || loginResponseData.errorCode > 0) {
return res.status(requestresponse[0]).json({error: {message: "Error logging in to Oamda controller", url: loginUrl, data: loginResponseData}});
Squashed commit of the following from initial Omada widget: commit ad3e664b56ad2a9024684f2141f8f21ead59177e Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 19:54:54 2022 +0100 Add .idea to .gitignore commit 7e51a093845c6bcda4fac78a2c174adbcc7701b6 Merge: 93d8035 7dd0b0e Author: Benoit SERRA <oupsman@oupsman.fr> Date: Tue Dec 13 18:38:51 2022 +0100 Merge branch 'benphelps:main' into main commit 93d80350b1d4519ac217b880568ccabbef43f03f Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 18:15:20 2022 +0100 Omada widget : One widget, shows only the number alerts, the number of connected AP, the number of connected devices to Wifi, the number of connected switches and gatewawys. commit a1babd860ce8a2dd6981b7fef6e055e249cbccb2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 09:33:50 2022 +0100 Omada widget : spliting widget between WLAN and LAN/WAN fields to have no more than 5 fields per widget. commit e12cc65c7703f2f1930fc7646c1f4386b49e73fb Merge: 331f31f 146326f Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sun Dec 11 14:39:27 2022 +0100 Merge branch 'benphelps:main' into main commit 331f31fc2be80e0738869fd050b3034638979350 Merge: 37154e3 ccc1229 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sat Dec 10 17:56:44 2022 +0100 Merge branch 'benphelps:main' into main commit 37154e327af7d3fe66e7638ba79851ef789d3649 Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 17:11:30 2022 +0100 Omada widget : Improved error handling Omada widget: handling power as common.power in translation commit 1f484914067e514f22c1f250b62f589fedefe1fd Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 10:24:55 2022 +0100 Omada widget : adding stats for isolated aps, connected gateways, connected switches, available ports, power consumption commit f375f0b815bf6697f7044995203084427b14ea69 Merge: 467b678 775b511 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:38 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 467b67802a7b8dface01703b6035951dcaa1e069 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:09 2022 +0100 Omada widget : v3 v4 and v5 versions don't use the same fields for the same stats, I've corrected the code to make it more reliable commit 775b5111e13072a18edb33f30a4d4f0589bc2af0 Merge: 8d66756 88c4375 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Thu Dec 8 15:38:20 2022 +0100 Merge branch 'benphelps:main' into main commit 8d66756a7d8f9e0b43c8abde2f2e6f2fd86a1098 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:45:44 2022 +0100 Omada Widget : code cleanup commit 282a6d0592c53a39184d63bba517f482a84f5b36 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:42:41 2022 +0100 Omada Widget : code cleanup commit c3e9b8f87075e834ea1a520fd8c93708afb15ac0 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:37:10 2022 +0100 Omada Widget : No more legacy variable, the code detects the controller version and adapts the requests. Logic is not duplicated anymore commit eafcc205975cc1bd04f063f1627d380f2a2b7f04 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 15:46:00 2022 +0100 V2 API is working commit bcc2864ee2e1f0f1d2f4c009df1ba8a1a7244f80 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 10:01:26 2022 +0100 Code fore v2 API is not working but V1 code is. commit ea8e297e849c2ef5659bfec94d76d2fff8677c4c Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 14:28:05 2022 +0100 Errors handling commit ab6d51a88c8737654dd31bec46106d7c49ed39d2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 09:50:14 2022 +0100 Adding alerts commit 047db2cce867c0207be7fe0827b24107fdd84923 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:53:43 2022 +0100 Fixed translation system commit 42c5a3e6658f22662b1c58f54cba31dc90bfbc61 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:34:34 2022 +0100 Translation system is still * up commit c80eac9d5bd5491ec4a61da38cdaf82f0ea1cc2f Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:33:50 2022 +0100 Translation system is still * up commit f8ba6b02454d66eb96e7e6ebd8022492ff79e690 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:32:22 2022 +0100 Translation system is still * up commit dec7eec6de26298eb7c90fd01e1c0fd23b6469a4 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:16:13 2022 +0100 Translation system is * up commit cc840cf7ccb40509f1da3f521a4a1b3e26498ac0 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 21:33:00 2022 +0100 First working version commit 54b65e619e41c9963a614a177df3a4af68ebe77d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 18:59:09 2022 +0100 Using getGlobalStat method commit 7ebc8500da9d52bd2911a620179fb6585f044c47 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 14:33:37 2022 +0100 Working on Omada Widget : NOT WORKING FOR NOW commit 04eaf28cae1be0935cb190e50ae5b75c19254403 Merge: 61065ac 826fe15 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:32:30 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 61065ace2887c3c1d6486001d34ce6f58d58958d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:24:57 2022 +0100 Working on Omada Widget remove idea Co-Authored-By: Benoit SERRA <11260343+oupsman@users.noreply.github.com>
2022-12-21 12:08:34 -08:00
}
2022-12-21 12:20:17 -08:00
const token = loginResponseData.result.token;
// List sites
Squashed commit of the following from initial Omada widget: commit ad3e664b56ad2a9024684f2141f8f21ead59177e Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 19:54:54 2022 +0100 Add .idea to .gitignore commit 7e51a093845c6bcda4fac78a2c174adbcc7701b6 Merge: 93d8035 7dd0b0e Author: Benoit SERRA <oupsman@oupsman.fr> Date: Tue Dec 13 18:38:51 2022 +0100 Merge branch 'benphelps:main' into main commit 93d80350b1d4519ac217b880568ccabbef43f03f Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 18:15:20 2022 +0100 Omada widget : One widget, shows only the number alerts, the number of connected AP, the number of connected devices to Wifi, the number of connected switches and gatewawys. commit a1babd860ce8a2dd6981b7fef6e055e249cbccb2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 09:33:50 2022 +0100 Omada widget : spliting widget between WLAN and LAN/WAN fields to have no more than 5 fields per widget. commit e12cc65c7703f2f1930fc7646c1f4386b49e73fb Merge: 331f31f 146326f Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sun Dec 11 14:39:27 2022 +0100 Merge branch 'benphelps:main' into main commit 331f31fc2be80e0738869fd050b3034638979350 Merge: 37154e3 ccc1229 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sat Dec 10 17:56:44 2022 +0100 Merge branch 'benphelps:main' into main commit 37154e327af7d3fe66e7638ba79851ef789d3649 Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 17:11:30 2022 +0100 Omada widget : Improved error handling Omada widget: handling power as common.power in translation commit 1f484914067e514f22c1f250b62f589fedefe1fd Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 10:24:55 2022 +0100 Omada widget : adding stats for isolated aps, connected gateways, connected switches, available ports, power consumption commit f375f0b815bf6697f7044995203084427b14ea69 Merge: 467b678 775b511 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:38 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 467b67802a7b8dface01703b6035951dcaa1e069 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:09 2022 +0100 Omada widget : v3 v4 and v5 versions don't use the same fields for the same stats, I've corrected the code to make it more reliable commit 775b5111e13072a18edb33f30a4d4f0589bc2af0 Merge: 8d66756 88c4375 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Thu Dec 8 15:38:20 2022 +0100 Merge branch 'benphelps:main' into main commit 8d66756a7d8f9e0b43c8abde2f2e6f2fd86a1098 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:45:44 2022 +0100 Omada Widget : code cleanup commit 282a6d0592c53a39184d63bba517f482a84f5b36 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:42:41 2022 +0100 Omada Widget : code cleanup commit c3e9b8f87075e834ea1a520fd8c93708afb15ac0 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:37:10 2022 +0100 Omada Widget : No more legacy variable, the code detects the controller version and adapts the requests. Logic is not duplicated anymore commit eafcc205975cc1bd04f063f1627d380f2a2b7f04 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 15:46:00 2022 +0100 V2 API is working commit bcc2864ee2e1f0f1d2f4c009df1ba8a1a7244f80 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 10:01:26 2022 +0100 Code fore v2 API is not working but V1 code is. commit ea8e297e849c2ef5659bfec94d76d2fff8677c4c Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 14:28:05 2022 +0100 Errors handling commit ab6d51a88c8737654dd31bec46106d7c49ed39d2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 09:50:14 2022 +0100 Adding alerts commit 047db2cce867c0207be7fe0827b24107fdd84923 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:53:43 2022 +0100 Fixed translation system commit 42c5a3e6658f22662b1c58f54cba31dc90bfbc61 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:34:34 2022 +0100 Translation system is still * up commit c80eac9d5bd5491ec4a61da38cdaf82f0ea1cc2f Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:33:50 2022 +0100 Translation system is still * up commit f8ba6b02454d66eb96e7e6ebd8022492ff79e690 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:32:22 2022 +0100 Translation system is still * up commit dec7eec6de26298eb7c90fd01e1c0fd23b6469a4 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:16:13 2022 +0100 Translation system is * up commit cc840cf7ccb40509f1da3f521a4a1b3e26498ac0 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 21:33:00 2022 +0100 First working version commit 54b65e619e41c9963a614a177df3a4af68ebe77d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 18:59:09 2022 +0100 Using getGlobalStat method commit 7ebc8500da9d52bd2911a620179fb6585f044c47 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 14:33:37 2022 +0100 Working on Omada Widget : NOT WORKING FOR NOW commit 04eaf28cae1be0935cb190e50ae5b75c19254403 Merge: 61065ac 826fe15 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:32:30 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 61065ace2887c3c1d6486001d34ce6f58d58958d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:24:57 2022 +0100 Working on Omada Widget remove idea Co-Authored-By: Benoit SERRA <11260343+oupsman@users.noreply.github.com>
2022-12-21 12:08:34 -08:00
let sitesUrl;
2022-12-21 12:20:17 -08:00
let body = {};
let params = { token };
let headers = { "Csrf-Token": token };
let method = "GET";
switch (controllerVersionMajor) {
case 3:
sitesUrl = `${widget.url}/web/v1/controller?ajax=&token=${token}`;
body = {
"method": "getUserSites",
"params": {
"userName": widget.username
}
};
method = "POST";
break;
case 4:
sitesUrl = `${widget.url}/api/v2/sites?token=${token}&currentPage=1&currentPageSize=1000`;
break;
case 5:
sitesUrl = `${widget.url}/${cId}/api/v2/sites?token=${token}&currentPage=1&currentPageSize=1000`;
break;
Squashed commit of the following from initial Omada widget: commit ad3e664b56ad2a9024684f2141f8f21ead59177e Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 19:54:54 2022 +0100 Add .idea to .gitignore commit 7e51a093845c6bcda4fac78a2c174adbcc7701b6 Merge: 93d8035 7dd0b0e Author: Benoit SERRA <oupsman@oupsman.fr> Date: Tue Dec 13 18:38:51 2022 +0100 Merge branch 'benphelps:main' into main commit 93d80350b1d4519ac217b880568ccabbef43f03f Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 18:15:20 2022 +0100 Omada widget : One widget, shows only the number alerts, the number of connected AP, the number of connected devices to Wifi, the number of connected switches and gatewawys. commit a1babd860ce8a2dd6981b7fef6e055e249cbccb2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 09:33:50 2022 +0100 Omada widget : spliting widget between WLAN and LAN/WAN fields to have no more than 5 fields per widget. commit e12cc65c7703f2f1930fc7646c1f4386b49e73fb Merge: 331f31f 146326f Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sun Dec 11 14:39:27 2022 +0100 Merge branch 'benphelps:main' into main commit 331f31fc2be80e0738869fd050b3034638979350 Merge: 37154e3 ccc1229 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sat Dec 10 17:56:44 2022 +0100 Merge branch 'benphelps:main' into main commit 37154e327af7d3fe66e7638ba79851ef789d3649 Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 17:11:30 2022 +0100 Omada widget : Improved error handling Omada widget: handling power as common.power in translation commit 1f484914067e514f22c1f250b62f589fedefe1fd Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 10:24:55 2022 +0100 Omada widget : adding stats for isolated aps, connected gateways, connected switches, available ports, power consumption commit f375f0b815bf6697f7044995203084427b14ea69 Merge: 467b678 775b511 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:38 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 467b67802a7b8dface01703b6035951dcaa1e069 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:09 2022 +0100 Omada widget : v3 v4 and v5 versions don't use the same fields for the same stats, I've corrected the code to make it more reliable commit 775b5111e13072a18edb33f30a4d4f0589bc2af0 Merge: 8d66756 88c4375 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Thu Dec 8 15:38:20 2022 +0100 Merge branch 'benphelps:main' into main commit 8d66756a7d8f9e0b43c8abde2f2e6f2fd86a1098 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:45:44 2022 +0100 Omada Widget : code cleanup commit 282a6d0592c53a39184d63bba517f482a84f5b36 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:42:41 2022 +0100 Omada Widget : code cleanup commit c3e9b8f87075e834ea1a520fd8c93708afb15ac0 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:37:10 2022 +0100 Omada Widget : No more legacy variable, the code detects the controller version and adapts the requests. Logic is not duplicated anymore commit eafcc205975cc1bd04f063f1627d380f2a2b7f04 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 15:46:00 2022 +0100 V2 API is working commit bcc2864ee2e1f0f1d2f4c009df1ba8a1a7244f80 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 10:01:26 2022 +0100 Code fore v2 API is not working but V1 code is. commit ea8e297e849c2ef5659bfec94d76d2fff8677c4c Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 14:28:05 2022 +0100 Errors handling commit ab6d51a88c8737654dd31bec46106d7c49ed39d2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 09:50:14 2022 +0100 Adding alerts commit 047db2cce867c0207be7fe0827b24107fdd84923 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:53:43 2022 +0100 Fixed translation system commit 42c5a3e6658f22662b1c58f54cba31dc90bfbc61 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:34:34 2022 +0100 Translation system is still * up commit c80eac9d5bd5491ec4a61da38cdaf82f0ea1cc2f Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:33:50 2022 +0100 Translation system is still * up commit f8ba6b02454d66eb96e7e6ebd8022492ff79e690 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:32:22 2022 +0100 Translation system is still * up commit dec7eec6de26298eb7c90fd01e1c0fd23b6469a4 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:16:13 2022 +0100 Translation system is * up commit cc840cf7ccb40509f1da3f521a4a1b3e26498ac0 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 21:33:00 2022 +0100 First working version commit 54b65e619e41c9963a614a177df3a4af68ebe77d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 18:59:09 2022 +0100 Using getGlobalStat method commit 7ebc8500da9d52bd2911a620179fb6585f044c47 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 14:33:37 2022 +0100 Working on Omada Widget : NOT WORKING FOR NOW commit 04eaf28cae1be0935cb190e50ae5b75c19254403 Merge: 61065ac 826fe15 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:32:30 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 61065ace2887c3c1d6486001d34ce6f58d58958d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:24:57 2022 +0100 Working on Omada Widget remove idea Co-Authored-By: Benoit SERRA <11260343+oupsman@users.noreply.github.com>
2022-12-21 12:08:34 -08:00
}
2022-12-21 12:20:17 -08:00
[status, contentType, data] = await httpProxy(sitesUrl, {
Squashed commit of the following from initial Omada widget: commit ad3e664b56ad2a9024684f2141f8f21ead59177e Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 19:54:54 2022 +0100 Add .idea to .gitignore commit 7e51a093845c6bcda4fac78a2c174adbcc7701b6 Merge: 93d8035 7dd0b0e Author: Benoit SERRA <oupsman@oupsman.fr> Date: Tue Dec 13 18:38:51 2022 +0100 Merge branch 'benphelps:main' into main commit 93d80350b1d4519ac217b880568ccabbef43f03f Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 18:15:20 2022 +0100 Omada widget : One widget, shows only the number alerts, the number of connected AP, the number of connected devices to Wifi, the number of connected switches and gatewawys. commit a1babd860ce8a2dd6981b7fef6e055e249cbccb2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 09:33:50 2022 +0100 Omada widget : spliting widget between WLAN and LAN/WAN fields to have no more than 5 fields per widget. commit e12cc65c7703f2f1930fc7646c1f4386b49e73fb Merge: 331f31f 146326f Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sun Dec 11 14:39:27 2022 +0100 Merge branch 'benphelps:main' into main commit 331f31fc2be80e0738869fd050b3034638979350 Merge: 37154e3 ccc1229 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sat Dec 10 17:56:44 2022 +0100 Merge branch 'benphelps:main' into main commit 37154e327af7d3fe66e7638ba79851ef789d3649 Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 17:11:30 2022 +0100 Omada widget : Improved error handling Omada widget: handling power as common.power in translation commit 1f484914067e514f22c1f250b62f589fedefe1fd Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 10:24:55 2022 +0100 Omada widget : adding stats for isolated aps, connected gateways, connected switches, available ports, power consumption commit f375f0b815bf6697f7044995203084427b14ea69 Merge: 467b678 775b511 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:38 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 467b67802a7b8dface01703b6035951dcaa1e069 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:09 2022 +0100 Omada widget : v3 v4 and v5 versions don't use the same fields for the same stats, I've corrected the code to make it more reliable commit 775b5111e13072a18edb33f30a4d4f0589bc2af0 Merge: 8d66756 88c4375 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Thu Dec 8 15:38:20 2022 +0100 Merge branch 'benphelps:main' into main commit 8d66756a7d8f9e0b43c8abde2f2e6f2fd86a1098 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:45:44 2022 +0100 Omada Widget : code cleanup commit 282a6d0592c53a39184d63bba517f482a84f5b36 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:42:41 2022 +0100 Omada Widget : code cleanup commit c3e9b8f87075e834ea1a520fd8c93708afb15ac0 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:37:10 2022 +0100 Omada Widget : No more legacy variable, the code detects the controller version and adapts the requests. Logic is not duplicated anymore commit eafcc205975cc1bd04f063f1627d380f2a2b7f04 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 15:46:00 2022 +0100 V2 API is working commit bcc2864ee2e1f0f1d2f4c009df1ba8a1a7244f80 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 10:01:26 2022 +0100 Code fore v2 API is not working but V1 code is. commit ea8e297e849c2ef5659bfec94d76d2fff8677c4c Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 14:28:05 2022 +0100 Errors handling commit ab6d51a88c8737654dd31bec46106d7c49ed39d2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 09:50:14 2022 +0100 Adding alerts commit 047db2cce867c0207be7fe0827b24107fdd84923 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:53:43 2022 +0100 Fixed translation system commit 42c5a3e6658f22662b1c58f54cba31dc90bfbc61 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:34:34 2022 +0100 Translation system is still * up commit c80eac9d5bd5491ec4a61da38cdaf82f0ea1cc2f Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:33:50 2022 +0100 Translation system is still * up commit f8ba6b02454d66eb96e7e6ebd8022492ff79e690 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:32:22 2022 +0100 Translation system is still * up commit dec7eec6de26298eb7c90fd01e1c0fd23b6469a4 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:16:13 2022 +0100 Translation system is * up commit cc840cf7ccb40509f1da3f521a4a1b3e26498ac0 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 21:33:00 2022 +0100 First working version commit 54b65e619e41c9963a614a177df3a4af68ebe77d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 18:59:09 2022 +0100 Using getGlobalStat method commit 7ebc8500da9d52bd2911a620179fb6585f044c47 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 14:33:37 2022 +0100 Working on Omada Widget : NOT WORKING FOR NOW commit 04eaf28cae1be0935cb190e50ae5b75c19254403 Merge: 61065ac 826fe15 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:32:30 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 61065ace2887c3c1d6486001d34ce6f58d58958d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:24:57 2022 +0100 Working on Omada Widget remove idea Co-Authored-By: Benoit SERRA <11260343+oupsman@users.noreply.github.com>
2022-12-21 12:08:34 -08:00
method,
params,
2022-12-21 12:20:17 -08:00
body: JSON.stringify(body),
Squashed commit of the following from initial Omada widget: commit ad3e664b56ad2a9024684f2141f8f21ead59177e Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 19:54:54 2022 +0100 Add .idea to .gitignore commit 7e51a093845c6bcda4fac78a2c174adbcc7701b6 Merge: 93d8035 7dd0b0e Author: Benoit SERRA <oupsman@oupsman.fr> Date: Tue Dec 13 18:38:51 2022 +0100 Merge branch 'benphelps:main' into main commit 93d80350b1d4519ac217b880568ccabbef43f03f Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 18:15:20 2022 +0100 Omada widget : One widget, shows only the number alerts, the number of connected AP, the number of connected devices to Wifi, the number of connected switches and gatewawys. commit a1babd860ce8a2dd6981b7fef6e055e249cbccb2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 09:33:50 2022 +0100 Omada widget : spliting widget between WLAN and LAN/WAN fields to have no more than 5 fields per widget. commit e12cc65c7703f2f1930fc7646c1f4386b49e73fb Merge: 331f31f 146326f Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sun Dec 11 14:39:27 2022 +0100 Merge branch 'benphelps:main' into main commit 331f31fc2be80e0738869fd050b3034638979350 Merge: 37154e3 ccc1229 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sat Dec 10 17:56:44 2022 +0100 Merge branch 'benphelps:main' into main commit 37154e327af7d3fe66e7638ba79851ef789d3649 Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 17:11:30 2022 +0100 Omada widget : Improved error handling Omada widget: handling power as common.power in translation commit 1f484914067e514f22c1f250b62f589fedefe1fd Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 10:24:55 2022 +0100 Omada widget : adding stats for isolated aps, connected gateways, connected switches, available ports, power consumption commit f375f0b815bf6697f7044995203084427b14ea69 Merge: 467b678 775b511 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:38 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 467b67802a7b8dface01703b6035951dcaa1e069 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:09 2022 +0100 Omada widget : v3 v4 and v5 versions don't use the same fields for the same stats, I've corrected the code to make it more reliable commit 775b5111e13072a18edb33f30a4d4f0589bc2af0 Merge: 8d66756 88c4375 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Thu Dec 8 15:38:20 2022 +0100 Merge branch 'benphelps:main' into main commit 8d66756a7d8f9e0b43c8abde2f2e6f2fd86a1098 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:45:44 2022 +0100 Omada Widget : code cleanup commit 282a6d0592c53a39184d63bba517f482a84f5b36 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:42:41 2022 +0100 Omada Widget : code cleanup commit c3e9b8f87075e834ea1a520fd8c93708afb15ac0 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:37:10 2022 +0100 Omada Widget : No more legacy variable, the code detects the controller version and adapts the requests. Logic is not duplicated anymore commit eafcc205975cc1bd04f063f1627d380f2a2b7f04 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 15:46:00 2022 +0100 V2 API is working commit bcc2864ee2e1f0f1d2f4c009df1ba8a1a7244f80 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 10:01:26 2022 +0100 Code fore v2 API is not working but V1 code is. commit ea8e297e849c2ef5659bfec94d76d2fff8677c4c Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 14:28:05 2022 +0100 Errors handling commit ab6d51a88c8737654dd31bec46106d7c49ed39d2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 09:50:14 2022 +0100 Adding alerts commit 047db2cce867c0207be7fe0827b24107fdd84923 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:53:43 2022 +0100 Fixed translation system commit 42c5a3e6658f22662b1c58f54cba31dc90bfbc61 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:34:34 2022 +0100 Translation system is still * up commit c80eac9d5bd5491ec4a61da38cdaf82f0ea1cc2f Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:33:50 2022 +0100 Translation system is still * up commit f8ba6b02454d66eb96e7e6ebd8022492ff79e690 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:32:22 2022 +0100 Translation system is still * up commit dec7eec6de26298eb7c90fd01e1c0fd23b6469a4 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:16:13 2022 +0100 Translation system is * up commit cc840cf7ccb40509f1da3f521a4a1b3e26498ac0 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 21:33:00 2022 +0100 First working version commit 54b65e619e41c9963a614a177df3a4af68ebe77d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 18:59:09 2022 +0100 Using getGlobalStat method commit 7ebc8500da9d52bd2911a620179fb6585f044c47 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 14:33:37 2022 +0100 Working on Omada Widget : NOT WORKING FOR NOW commit 04eaf28cae1be0935cb190e50ae5b75c19254403 Merge: 61065ac 826fe15 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:32:30 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 61065ace2887c3c1d6486001d34ce6f58d58958d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:24:57 2022 +0100 Working on Omada Widget remove idea Co-Authored-By: Benoit SERRA <11260343+oupsman@users.noreply.github.com>
2022-12-21 12:08:34 -08:00
headers,
});
2022-12-21 12:20:17 -08:00
const sitesResponseData = JSON.parse(data);
let site;
let connectedAp;
let activeUser;
let connectedSwitches;
let connectedGateways;
let alerts;
if (sitesResponseData.errorCode > 0) {
logger.debug(`HTTTP ${status} getting sites list: ${requestresponse[2].msg}`);
return res.status(status).json({error: {message: "Error getting sites list", url, data: requestresponse[2]}});
Squashed commit of the following from initial Omada widget: commit ad3e664b56ad2a9024684f2141f8f21ead59177e Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 19:54:54 2022 +0100 Add .idea to .gitignore commit 7e51a093845c6bcda4fac78a2c174adbcc7701b6 Merge: 93d8035 7dd0b0e Author: Benoit SERRA <oupsman@oupsman.fr> Date: Tue Dec 13 18:38:51 2022 +0100 Merge branch 'benphelps:main' into main commit 93d80350b1d4519ac217b880568ccabbef43f03f Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 18:15:20 2022 +0100 Omada widget : One widget, shows only the number alerts, the number of connected AP, the number of connected devices to Wifi, the number of connected switches and gatewawys. commit a1babd860ce8a2dd6981b7fef6e055e249cbccb2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 09:33:50 2022 +0100 Omada widget : spliting widget between WLAN and LAN/WAN fields to have no more than 5 fields per widget. commit e12cc65c7703f2f1930fc7646c1f4386b49e73fb Merge: 331f31f 146326f Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sun Dec 11 14:39:27 2022 +0100 Merge branch 'benphelps:main' into main commit 331f31fc2be80e0738869fd050b3034638979350 Merge: 37154e3 ccc1229 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sat Dec 10 17:56:44 2022 +0100 Merge branch 'benphelps:main' into main commit 37154e327af7d3fe66e7638ba79851ef789d3649 Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 17:11:30 2022 +0100 Omada widget : Improved error handling Omada widget: handling power as common.power in translation commit 1f484914067e514f22c1f250b62f589fedefe1fd Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 10:24:55 2022 +0100 Omada widget : adding stats for isolated aps, connected gateways, connected switches, available ports, power consumption commit f375f0b815bf6697f7044995203084427b14ea69 Merge: 467b678 775b511 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:38 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 467b67802a7b8dface01703b6035951dcaa1e069 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:09 2022 +0100 Omada widget : v3 v4 and v5 versions don't use the same fields for the same stats, I've corrected the code to make it more reliable commit 775b5111e13072a18edb33f30a4d4f0589bc2af0 Merge: 8d66756 88c4375 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Thu Dec 8 15:38:20 2022 +0100 Merge branch 'benphelps:main' into main commit 8d66756a7d8f9e0b43c8abde2f2e6f2fd86a1098 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:45:44 2022 +0100 Omada Widget : code cleanup commit 282a6d0592c53a39184d63bba517f482a84f5b36 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:42:41 2022 +0100 Omada Widget : code cleanup commit c3e9b8f87075e834ea1a520fd8c93708afb15ac0 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:37:10 2022 +0100 Omada Widget : No more legacy variable, the code detects the controller version and adapts the requests. Logic is not duplicated anymore commit eafcc205975cc1bd04f063f1627d380f2a2b7f04 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 15:46:00 2022 +0100 V2 API is working commit bcc2864ee2e1f0f1d2f4c009df1ba8a1a7244f80 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 10:01:26 2022 +0100 Code fore v2 API is not working but V1 code is. commit ea8e297e849c2ef5659bfec94d76d2fff8677c4c Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 14:28:05 2022 +0100 Errors handling commit ab6d51a88c8737654dd31bec46106d7c49ed39d2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 09:50:14 2022 +0100 Adding alerts commit 047db2cce867c0207be7fe0827b24107fdd84923 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:53:43 2022 +0100 Fixed translation system commit 42c5a3e6658f22662b1c58f54cba31dc90bfbc61 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:34:34 2022 +0100 Translation system is still * up commit c80eac9d5bd5491ec4a61da38cdaf82f0ea1cc2f Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:33:50 2022 +0100 Translation system is still * up commit f8ba6b02454d66eb96e7e6ebd8022492ff79e690 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:32:22 2022 +0100 Translation system is still * up commit dec7eec6de26298eb7c90fd01e1c0fd23b6469a4 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:16:13 2022 +0100 Translation system is * up commit cc840cf7ccb40509f1da3f521a4a1b3e26498ac0 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 21:33:00 2022 +0100 First working version commit 54b65e619e41c9963a614a177df3a4af68ebe77d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 18:59:09 2022 +0100 Using getGlobalStat method commit 7ebc8500da9d52bd2911a620179fb6585f044c47 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 14:33:37 2022 +0100 Working on Omada Widget : NOT WORKING FOR NOW commit 04eaf28cae1be0935cb190e50ae5b75c19254403 Merge: 61065ac 826fe15 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:32:30 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 61065ace2887c3c1d6486001d34ce6f58d58958d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:24:57 2022 +0100 Working on Omada Widget remove idea Co-Authored-By: Benoit SERRA <11260343+oupsman@users.noreply.github.com>
2022-12-21 12:08:34 -08:00
}
2022-12-21 12:20:17 -08:00
// on modern controller, we need to call two different endpoints
// on older controller, we can call one endpoint
Squashed commit of the following from initial Omada widget: commit ad3e664b56ad2a9024684f2141f8f21ead59177e Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 19:54:54 2022 +0100 Add .idea to .gitignore commit 7e51a093845c6bcda4fac78a2c174adbcc7701b6 Merge: 93d8035 7dd0b0e Author: Benoit SERRA <oupsman@oupsman.fr> Date: Tue Dec 13 18:38:51 2022 +0100 Merge branch 'benphelps:main' into main commit 93d80350b1d4519ac217b880568ccabbef43f03f Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 18:15:20 2022 +0100 Omada widget : One widget, shows only the number alerts, the number of connected AP, the number of connected devices to Wifi, the number of connected switches and gatewawys. commit a1babd860ce8a2dd6981b7fef6e055e249cbccb2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 09:33:50 2022 +0100 Omada widget : spliting widget between WLAN and LAN/WAN fields to have no more than 5 fields per widget. commit e12cc65c7703f2f1930fc7646c1f4386b49e73fb Merge: 331f31f 146326f Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sun Dec 11 14:39:27 2022 +0100 Merge branch 'benphelps:main' into main commit 331f31fc2be80e0738869fd050b3034638979350 Merge: 37154e3 ccc1229 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sat Dec 10 17:56:44 2022 +0100 Merge branch 'benphelps:main' into main commit 37154e327af7d3fe66e7638ba79851ef789d3649 Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 17:11:30 2022 +0100 Omada widget : Improved error handling Omada widget: handling power as common.power in translation commit 1f484914067e514f22c1f250b62f589fedefe1fd Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 10:24:55 2022 +0100 Omada widget : adding stats for isolated aps, connected gateways, connected switches, available ports, power consumption commit f375f0b815bf6697f7044995203084427b14ea69 Merge: 467b678 775b511 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:38 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 467b67802a7b8dface01703b6035951dcaa1e069 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:09 2022 +0100 Omada widget : v3 v4 and v5 versions don't use the same fields for the same stats, I've corrected the code to make it more reliable commit 775b5111e13072a18edb33f30a4d4f0589bc2af0 Merge: 8d66756 88c4375 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Thu Dec 8 15:38:20 2022 +0100 Merge branch 'benphelps:main' into main commit 8d66756a7d8f9e0b43c8abde2f2e6f2fd86a1098 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:45:44 2022 +0100 Omada Widget : code cleanup commit 282a6d0592c53a39184d63bba517f482a84f5b36 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:42:41 2022 +0100 Omada Widget : code cleanup commit c3e9b8f87075e834ea1a520fd8c93708afb15ac0 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:37:10 2022 +0100 Omada Widget : No more legacy variable, the code detects the controller version and adapts the requests. Logic is not duplicated anymore commit eafcc205975cc1bd04f063f1627d380f2a2b7f04 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 15:46:00 2022 +0100 V2 API is working commit bcc2864ee2e1f0f1d2f4c009df1ba8a1a7244f80 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 10:01:26 2022 +0100 Code fore v2 API is not working but V1 code is. commit ea8e297e849c2ef5659bfec94d76d2fff8677c4c Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 14:28:05 2022 +0100 Errors handling commit ab6d51a88c8737654dd31bec46106d7c49ed39d2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 09:50:14 2022 +0100 Adding alerts commit 047db2cce867c0207be7fe0827b24107fdd84923 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:53:43 2022 +0100 Fixed translation system commit 42c5a3e6658f22662b1c58f54cba31dc90bfbc61 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:34:34 2022 +0100 Translation system is still * up commit c80eac9d5bd5491ec4a61da38cdaf82f0ea1cc2f Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:33:50 2022 +0100 Translation system is still * up commit f8ba6b02454d66eb96e7e6ebd8022492ff79e690 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:32:22 2022 +0100 Translation system is still * up commit dec7eec6de26298eb7c90fd01e1c0fd23b6469a4 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:16:13 2022 +0100 Translation system is * up commit cc840cf7ccb40509f1da3f521a4a1b3e26498ac0 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 21:33:00 2022 +0100 First working version commit 54b65e619e41c9963a614a177df3a4af68ebe77d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 18:59:09 2022 +0100 Using getGlobalStat method commit 7ebc8500da9d52bd2911a620179fb6585f044c47 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 14:33:37 2022 +0100 Working on Omada Widget : NOT WORKING FOR NOW commit 04eaf28cae1be0935cb190e50ae5b75c19254403 Merge: 61065ac 826fe15 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:32:30 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 61065ace2887c3c1d6486001d34ce6f58d58958d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:24:57 2022 +0100 Working on Omada Widget remove idea Co-Authored-By: Benoit SERRA <11260343+oupsman@users.noreply.github.com>
2022-12-21 12:08:34 -08:00
2022-12-21 12:20:17 -08:00
if (controllerVersionMajor === 3) {
Squashed commit of the following from initial Omada widget: commit ad3e664b56ad2a9024684f2141f8f21ead59177e Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 19:54:54 2022 +0100 Add .idea to .gitignore commit 7e51a093845c6bcda4fac78a2c174adbcc7701b6 Merge: 93d8035 7dd0b0e Author: Benoit SERRA <oupsman@oupsman.fr> Date: Tue Dec 13 18:38:51 2022 +0100 Merge branch 'benphelps:main' into main commit 93d80350b1d4519ac217b880568ccabbef43f03f Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 18:15:20 2022 +0100 Omada widget : One widget, shows only the number alerts, the number of connected AP, the number of connected devices to Wifi, the number of connected switches and gatewawys. commit a1babd860ce8a2dd6981b7fef6e055e249cbccb2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 09:33:50 2022 +0100 Omada widget : spliting widget between WLAN and LAN/WAN fields to have no more than 5 fields per widget. commit e12cc65c7703f2f1930fc7646c1f4386b49e73fb Merge: 331f31f 146326f Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sun Dec 11 14:39:27 2022 +0100 Merge branch 'benphelps:main' into main commit 331f31fc2be80e0738869fd050b3034638979350 Merge: 37154e3 ccc1229 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sat Dec 10 17:56:44 2022 +0100 Merge branch 'benphelps:main' into main commit 37154e327af7d3fe66e7638ba79851ef789d3649 Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 17:11:30 2022 +0100 Omada widget : Improved error handling Omada widget: handling power as common.power in translation commit 1f484914067e514f22c1f250b62f589fedefe1fd Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 10:24:55 2022 +0100 Omada widget : adding stats for isolated aps, connected gateways, connected switches, available ports, power consumption commit f375f0b815bf6697f7044995203084427b14ea69 Merge: 467b678 775b511 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:38 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 467b67802a7b8dface01703b6035951dcaa1e069 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:09 2022 +0100 Omada widget : v3 v4 and v5 versions don't use the same fields for the same stats, I've corrected the code to make it more reliable commit 775b5111e13072a18edb33f30a4d4f0589bc2af0 Merge: 8d66756 88c4375 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Thu Dec 8 15:38:20 2022 +0100 Merge branch 'benphelps:main' into main commit 8d66756a7d8f9e0b43c8abde2f2e6f2fd86a1098 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:45:44 2022 +0100 Omada Widget : code cleanup commit 282a6d0592c53a39184d63bba517f482a84f5b36 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:42:41 2022 +0100 Omada Widget : code cleanup commit c3e9b8f87075e834ea1a520fd8c93708afb15ac0 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:37:10 2022 +0100 Omada Widget : No more legacy variable, the code detects the controller version and adapts the requests. Logic is not duplicated anymore commit eafcc205975cc1bd04f063f1627d380f2a2b7f04 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 15:46:00 2022 +0100 V2 API is working commit bcc2864ee2e1f0f1d2f4c009df1ba8a1a7244f80 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 10:01:26 2022 +0100 Code fore v2 API is not working but V1 code is. commit ea8e297e849c2ef5659bfec94d76d2fff8677c4c Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 14:28:05 2022 +0100 Errors handling commit ab6d51a88c8737654dd31bec46106d7c49ed39d2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 09:50:14 2022 +0100 Adding alerts commit 047db2cce867c0207be7fe0827b24107fdd84923 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:53:43 2022 +0100 Fixed translation system commit 42c5a3e6658f22662b1c58f54cba31dc90bfbc61 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:34:34 2022 +0100 Translation system is still * up commit c80eac9d5bd5491ec4a61da38cdaf82f0ea1cc2f Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:33:50 2022 +0100 Translation system is still * up commit f8ba6b02454d66eb96e7e6ebd8022492ff79e690 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:32:22 2022 +0100 Translation system is still * up commit dec7eec6de26298eb7c90fd01e1c0fd23b6469a4 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:16:13 2022 +0100 Translation system is * up commit cc840cf7ccb40509f1da3f521a4a1b3e26498ac0 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 21:33:00 2022 +0100 First working version commit 54b65e619e41c9963a614a177df3a4af68ebe77d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 18:59:09 2022 +0100 Using getGlobalStat method commit 7ebc8500da9d52bd2911a620179fb6585f044c47 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 14:33:37 2022 +0100 Working on Omada Widget : NOT WORKING FOR NOW commit 04eaf28cae1be0935cb190e50ae5b75c19254403 Merge: 61065ac 826fe15 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:32:30 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 61065ace2887c3c1d6486001d34ce6f58d58958d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:24:57 2022 +0100 Working on Omada Widget remove idea Co-Authored-By: Benoit SERRA <11260343+oupsman@users.noreply.github.com>
2022-12-21 12:08:34 -08:00
2022-12-21 12:20:17 -08:00
// Switching site is really needed only for Omada 3.x.x controllers
let switchUrl;
site = listresult.result.siteList.filter(site => site.name === widget.site);
siteName = site[0].siteName;
Squashed commit of the following from initial Omada widget: commit ad3e664b56ad2a9024684f2141f8f21ead59177e Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 19:54:54 2022 +0100 Add .idea to .gitignore commit 7e51a093845c6bcda4fac78a2c174adbcc7701b6 Merge: 93d8035 7dd0b0e Author: Benoit SERRA <oupsman@oupsman.fr> Date: Tue Dec 13 18:38:51 2022 +0100 Merge branch 'benphelps:main' into main commit 93d80350b1d4519ac217b880568ccabbef43f03f Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 18:15:20 2022 +0100 Omada widget : One widget, shows only the number alerts, the number of connected AP, the number of connected devices to Wifi, the number of connected switches and gatewawys. commit a1babd860ce8a2dd6981b7fef6e055e249cbccb2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 09:33:50 2022 +0100 Omada widget : spliting widget between WLAN and LAN/WAN fields to have no more than 5 fields per widget. commit e12cc65c7703f2f1930fc7646c1f4386b49e73fb Merge: 331f31f 146326f Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sun Dec 11 14:39:27 2022 +0100 Merge branch 'benphelps:main' into main commit 331f31fc2be80e0738869fd050b3034638979350 Merge: 37154e3 ccc1229 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sat Dec 10 17:56:44 2022 +0100 Merge branch 'benphelps:main' into main commit 37154e327af7d3fe66e7638ba79851ef789d3649 Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 17:11:30 2022 +0100 Omada widget : Improved error handling Omada widget: handling power as common.power in translation commit 1f484914067e514f22c1f250b62f589fedefe1fd Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 10:24:55 2022 +0100 Omada widget : adding stats for isolated aps, connected gateways, connected switches, available ports, power consumption commit f375f0b815bf6697f7044995203084427b14ea69 Merge: 467b678 775b511 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:38 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 467b67802a7b8dface01703b6035951dcaa1e069 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:09 2022 +0100 Omada widget : v3 v4 and v5 versions don't use the same fields for the same stats, I've corrected the code to make it more reliable commit 775b5111e13072a18edb33f30a4d4f0589bc2af0 Merge: 8d66756 88c4375 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Thu Dec 8 15:38:20 2022 +0100 Merge branch 'benphelps:main' into main commit 8d66756a7d8f9e0b43c8abde2f2e6f2fd86a1098 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:45:44 2022 +0100 Omada Widget : code cleanup commit 282a6d0592c53a39184d63bba517f482a84f5b36 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:42:41 2022 +0100 Omada Widget : code cleanup commit c3e9b8f87075e834ea1a520fd8c93708afb15ac0 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:37:10 2022 +0100 Omada Widget : No more legacy variable, the code detects the controller version and adapts the requests. Logic is not duplicated anymore commit eafcc205975cc1bd04f063f1627d380f2a2b7f04 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 15:46:00 2022 +0100 V2 API is working commit bcc2864ee2e1f0f1d2f4c009df1ba8a1a7244f80 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 10:01:26 2022 +0100 Code fore v2 API is not working but V1 code is. commit ea8e297e849c2ef5659bfec94d76d2fff8677c4c Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 14:28:05 2022 +0100 Errors handling commit ab6d51a88c8737654dd31bec46106d7c49ed39d2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 09:50:14 2022 +0100 Adding alerts commit 047db2cce867c0207be7fe0827b24107fdd84923 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:53:43 2022 +0100 Fixed translation system commit 42c5a3e6658f22662b1c58f54cba31dc90bfbc61 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:34:34 2022 +0100 Translation system is still * up commit c80eac9d5bd5491ec4a61da38cdaf82f0ea1cc2f Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:33:50 2022 +0100 Translation system is still * up commit f8ba6b02454d66eb96e7e6ebd8022492ff79e690 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:32:22 2022 +0100 Translation system is still * up commit dec7eec6de26298eb7c90fd01e1c0fd23b6469a4 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:16:13 2022 +0100 Translation system is * up commit cc840cf7ccb40509f1da3f521a4a1b3e26498ac0 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 21:33:00 2022 +0100 First working version commit 54b65e619e41c9963a614a177df3a4af68ebe77d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 18:59:09 2022 +0100 Using getGlobalStat method commit 7ebc8500da9d52bd2911a620179fb6585f044c47 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 14:33:37 2022 +0100 Working on Omada Widget : NOT WORKING FOR NOW commit 04eaf28cae1be0935cb190e50ae5b75c19254403 Merge: 61065ac 826fe15 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:32:30 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 61065ace2887c3c1d6486001d34ce6f58d58958d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:24:57 2022 +0100 Working on Omada Widget remove idea Co-Authored-By: Benoit SERRA <11260343+oupsman@users.noreply.github.com>
2022-12-21 12:08:34 -08:00
switchUrl = `${widget.url}/web/v1/controller?ajax=&token=${token}`;
method = "POST";
body = JSON.stringify({
"method": "switchSite",
"params": {
"siteName": siteName,
"userName": widget.username
}
});
headers = { "Content-Type": "application/json" };
params = { "token": token };
requestresponse = await httpProxy(switchUrl, {
method,
params,
body: body.toString(),
headers,
});
const switchresult = JSON.parse(requestresponse[2]);
if (switchresult.errorCode !== 0) {
logger.debug(`HTTTP ${requestresponse[0]} getting sites list: ${requestresponse[2]}`);
return res.status(requestresponse[0]).json({error: {message: "Error switching site", url, data: requestresponse[2]}});
}
2022-12-21 12:20:17 -08:00
Squashed commit of the following from initial Omada widget: commit ad3e664b56ad2a9024684f2141f8f21ead59177e Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 19:54:54 2022 +0100 Add .idea to .gitignore commit 7e51a093845c6bcda4fac78a2c174adbcc7701b6 Merge: 93d8035 7dd0b0e Author: Benoit SERRA <oupsman@oupsman.fr> Date: Tue Dec 13 18:38:51 2022 +0100 Merge branch 'benphelps:main' into main commit 93d80350b1d4519ac217b880568ccabbef43f03f Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 18:15:20 2022 +0100 Omada widget : One widget, shows only the number alerts, the number of connected AP, the number of connected devices to Wifi, the number of connected switches and gatewawys. commit a1babd860ce8a2dd6981b7fef6e055e249cbccb2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 09:33:50 2022 +0100 Omada widget : spliting widget between WLAN and LAN/WAN fields to have no more than 5 fields per widget. commit e12cc65c7703f2f1930fc7646c1f4386b49e73fb Merge: 331f31f 146326f Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sun Dec 11 14:39:27 2022 +0100 Merge branch 'benphelps:main' into main commit 331f31fc2be80e0738869fd050b3034638979350 Merge: 37154e3 ccc1229 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sat Dec 10 17:56:44 2022 +0100 Merge branch 'benphelps:main' into main commit 37154e327af7d3fe66e7638ba79851ef789d3649 Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 17:11:30 2022 +0100 Omada widget : Improved error handling Omada widget: handling power as common.power in translation commit 1f484914067e514f22c1f250b62f589fedefe1fd Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 10:24:55 2022 +0100 Omada widget : adding stats for isolated aps, connected gateways, connected switches, available ports, power consumption commit f375f0b815bf6697f7044995203084427b14ea69 Merge: 467b678 775b511 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:38 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 467b67802a7b8dface01703b6035951dcaa1e069 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:09 2022 +0100 Omada widget : v3 v4 and v5 versions don't use the same fields for the same stats, I've corrected the code to make it more reliable commit 775b5111e13072a18edb33f30a4d4f0589bc2af0 Merge: 8d66756 88c4375 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Thu Dec 8 15:38:20 2022 +0100 Merge branch 'benphelps:main' into main commit 8d66756a7d8f9e0b43c8abde2f2e6f2fd86a1098 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:45:44 2022 +0100 Omada Widget : code cleanup commit 282a6d0592c53a39184d63bba517f482a84f5b36 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:42:41 2022 +0100 Omada Widget : code cleanup commit c3e9b8f87075e834ea1a520fd8c93708afb15ac0 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:37:10 2022 +0100 Omada Widget : No more legacy variable, the code detects the controller version and adapts the requests. Logic is not duplicated anymore commit eafcc205975cc1bd04f063f1627d380f2a2b7f04 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 15:46:00 2022 +0100 V2 API is working commit bcc2864ee2e1f0f1d2f4c009df1ba8a1a7244f80 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 10:01:26 2022 +0100 Code fore v2 API is not working but V1 code is. commit ea8e297e849c2ef5659bfec94d76d2fff8677c4c Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 14:28:05 2022 +0100 Errors handling commit ab6d51a88c8737654dd31bec46106d7c49ed39d2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 09:50:14 2022 +0100 Adding alerts commit 047db2cce867c0207be7fe0827b24107fdd84923 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:53:43 2022 +0100 Fixed translation system commit 42c5a3e6658f22662b1c58f54cba31dc90bfbc61 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:34:34 2022 +0100 Translation system is still * up commit c80eac9d5bd5491ec4a61da38cdaf82f0ea1cc2f Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:33:50 2022 +0100 Translation system is still * up commit f8ba6b02454d66eb96e7e6ebd8022492ff79e690 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:32:22 2022 +0100 Translation system is still * up commit dec7eec6de26298eb7c90fd01e1c0fd23b6469a4 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:16:13 2022 +0100 Translation system is * up commit cc840cf7ccb40509f1da3f521a4a1b3e26498ac0 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 21:33:00 2022 +0100 First working version commit 54b65e619e41c9963a614a177df3a4af68ebe77d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 18:59:09 2022 +0100 Using getGlobalStat method commit 7ebc8500da9d52bd2911a620179fb6585f044c47 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 14:33:37 2022 +0100 Working on Omada Widget : NOT WORKING FOR NOW commit 04eaf28cae1be0935cb190e50ae5b75c19254403 Merge: 61065ac 826fe15 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:32:30 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 61065ace2887c3c1d6486001d34ce6f58d58958d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:24:57 2022 +0100 Working on Omada Widget remove idea Co-Authored-By: Benoit SERRA <11260343+oupsman@users.noreply.github.com>
2022-12-21 12:08:34 -08:00
const statsUrl = `${widget.url}/web/v1/controller?getGlobalStat=&token=${token}`;
const statResponse = await httpProxy(statsUrl, {
method: "POST",
params: { "token": token },
body: JSON.stringify({
"method": "getGlobalStat",
}),
headers: {
"Content-Type": "application/json",
},
});
const data = JSON.parse(statResponse[2]);
if (data.errorCode !== 0) {
return res.status(statResponse[0]).json({error: {message: "Error getting stats", url, data: statResponse[2]}});
}
connectedAp = data.result.connectedAp;
2022-12-21 12:20:17 -08:00
activeUser = data.result.activeUser;
Squashed commit of the following from initial Omada widget: commit ad3e664b56ad2a9024684f2141f8f21ead59177e Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 19:54:54 2022 +0100 Add .idea to .gitignore commit 7e51a093845c6bcda4fac78a2c174adbcc7701b6 Merge: 93d8035 7dd0b0e Author: Benoit SERRA <oupsman@oupsman.fr> Date: Tue Dec 13 18:38:51 2022 +0100 Merge branch 'benphelps:main' into main commit 93d80350b1d4519ac217b880568ccabbef43f03f Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 18:15:20 2022 +0100 Omada widget : One widget, shows only the number alerts, the number of connected AP, the number of connected devices to Wifi, the number of connected switches and gatewawys. commit a1babd860ce8a2dd6981b7fef6e055e249cbccb2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 09:33:50 2022 +0100 Omada widget : spliting widget between WLAN and LAN/WAN fields to have no more than 5 fields per widget. commit e12cc65c7703f2f1930fc7646c1f4386b49e73fb Merge: 331f31f 146326f Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sun Dec 11 14:39:27 2022 +0100 Merge branch 'benphelps:main' into main commit 331f31fc2be80e0738869fd050b3034638979350 Merge: 37154e3 ccc1229 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sat Dec 10 17:56:44 2022 +0100 Merge branch 'benphelps:main' into main commit 37154e327af7d3fe66e7638ba79851ef789d3649 Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 17:11:30 2022 +0100 Omada widget : Improved error handling Omada widget: handling power as common.power in translation commit 1f484914067e514f22c1f250b62f589fedefe1fd Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 10:24:55 2022 +0100 Omada widget : adding stats for isolated aps, connected gateways, connected switches, available ports, power consumption commit f375f0b815bf6697f7044995203084427b14ea69 Merge: 467b678 775b511 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:38 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 467b67802a7b8dface01703b6035951dcaa1e069 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:09 2022 +0100 Omada widget : v3 v4 and v5 versions don't use the same fields for the same stats, I've corrected the code to make it more reliable commit 775b5111e13072a18edb33f30a4d4f0589bc2af0 Merge: 8d66756 88c4375 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Thu Dec 8 15:38:20 2022 +0100 Merge branch 'benphelps:main' into main commit 8d66756a7d8f9e0b43c8abde2f2e6f2fd86a1098 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:45:44 2022 +0100 Omada Widget : code cleanup commit 282a6d0592c53a39184d63bba517f482a84f5b36 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:42:41 2022 +0100 Omada Widget : code cleanup commit c3e9b8f87075e834ea1a520fd8c93708afb15ac0 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:37:10 2022 +0100 Omada Widget : No more legacy variable, the code detects the controller version and adapts the requests. Logic is not duplicated anymore commit eafcc205975cc1bd04f063f1627d380f2a2b7f04 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 15:46:00 2022 +0100 V2 API is working commit bcc2864ee2e1f0f1d2f4c009df1ba8a1a7244f80 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 10:01:26 2022 +0100 Code fore v2 API is not working but V1 code is. commit ea8e297e849c2ef5659bfec94d76d2fff8677c4c Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 14:28:05 2022 +0100 Errors handling commit ab6d51a88c8737654dd31bec46106d7c49ed39d2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 09:50:14 2022 +0100 Adding alerts commit 047db2cce867c0207be7fe0827b24107fdd84923 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:53:43 2022 +0100 Fixed translation system commit 42c5a3e6658f22662b1c58f54cba31dc90bfbc61 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:34:34 2022 +0100 Translation system is still * up commit c80eac9d5bd5491ec4a61da38cdaf82f0ea1cc2f Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:33:50 2022 +0100 Translation system is still * up commit f8ba6b02454d66eb96e7e6ebd8022492ff79e690 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:32:22 2022 +0100 Translation system is still * up commit dec7eec6de26298eb7c90fd01e1c0fd23b6469a4 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:16:13 2022 +0100 Translation system is * up commit cc840cf7ccb40509f1da3f521a4a1b3e26498ac0 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 21:33:00 2022 +0100 First working version commit 54b65e619e41c9963a614a177df3a4af68ebe77d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 18:59:09 2022 +0100 Using getGlobalStat method commit 7ebc8500da9d52bd2911a620179fb6585f044c47 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 14:33:37 2022 +0100 Working on Omada Widget : NOT WORKING FOR NOW commit 04eaf28cae1be0935cb190e50ae5b75c19254403 Merge: 61065ac 826fe15 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:32:30 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 61065ace2887c3c1d6486001d34ce6f58d58958d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:24:57 2022 +0100 Working on Omada Widget remove idea Co-Authored-By: Benoit SERRA <11260343+oupsman@users.noreply.github.com>
2022-12-21 12:08:34 -08:00
alerts = data.result.alerts;
2022-12-21 12:20:17 -08:00
} else if (controllerVersionMajor === 4 || controllerVersionMajor === 5) {
site = sitesResponseData.result.data.find(site => site.name === widget.site);
Squashed commit of the following from initial Omada widget: commit ad3e664b56ad2a9024684f2141f8f21ead59177e Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 19:54:54 2022 +0100 Add .idea to .gitignore commit 7e51a093845c6bcda4fac78a2c174adbcc7701b6 Merge: 93d8035 7dd0b0e Author: Benoit SERRA <oupsman@oupsman.fr> Date: Tue Dec 13 18:38:51 2022 +0100 Merge branch 'benphelps:main' into main commit 93d80350b1d4519ac217b880568ccabbef43f03f Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 18:15:20 2022 +0100 Omada widget : One widget, shows only the number alerts, the number of connected AP, the number of connected devices to Wifi, the number of connected switches and gatewawys. commit a1babd860ce8a2dd6981b7fef6e055e249cbccb2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 09:33:50 2022 +0100 Omada widget : spliting widget between WLAN and LAN/WAN fields to have no more than 5 fields per widget. commit e12cc65c7703f2f1930fc7646c1f4386b49e73fb Merge: 331f31f 146326f Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sun Dec 11 14:39:27 2022 +0100 Merge branch 'benphelps:main' into main commit 331f31fc2be80e0738869fd050b3034638979350 Merge: 37154e3 ccc1229 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sat Dec 10 17:56:44 2022 +0100 Merge branch 'benphelps:main' into main commit 37154e327af7d3fe66e7638ba79851ef789d3649 Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 17:11:30 2022 +0100 Omada widget : Improved error handling Omada widget: handling power as common.power in translation commit 1f484914067e514f22c1f250b62f589fedefe1fd Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 10:24:55 2022 +0100 Omada widget : adding stats for isolated aps, connected gateways, connected switches, available ports, power consumption commit f375f0b815bf6697f7044995203084427b14ea69 Merge: 467b678 775b511 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:38 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 467b67802a7b8dface01703b6035951dcaa1e069 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:09 2022 +0100 Omada widget : v3 v4 and v5 versions don't use the same fields for the same stats, I've corrected the code to make it more reliable commit 775b5111e13072a18edb33f30a4d4f0589bc2af0 Merge: 8d66756 88c4375 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Thu Dec 8 15:38:20 2022 +0100 Merge branch 'benphelps:main' into main commit 8d66756a7d8f9e0b43c8abde2f2e6f2fd86a1098 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:45:44 2022 +0100 Omada Widget : code cleanup commit 282a6d0592c53a39184d63bba517f482a84f5b36 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:42:41 2022 +0100 Omada Widget : code cleanup commit c3e9b8f87075e834ea1a520fd8c93708afb15ac0 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:37:10 2022 +0100 Omada Widget : No more legacy variable, the code detects the controller version and adapts the requests. Logic is not duplicated anymore commit eafcc205975cc1bd04f063f1627d380f2a2b7f04 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 15:46:00 2022 +0100 V2 API is working commit bcc2864ee2e1f0f1d2f4c009df1ba8a1a7244f80 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 10:01:26 2022 +0100 Code fore v2 API is not working but V1 code is. commit ea8e297e849c2ef5659bfec94d76d2fff8677c4c Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 14:28:05 2022 +0100 Errors handling commit ab6d51a88c8737654dd31bec46106d7c49ed39d2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 09:50:14 2022 +0100 Adding alerts commit 047db2cce867c0207be7fe0827b24107fdd84923 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:53:43 2022 +0100 Fixed translation system commit 42c5a3e6658f22662b1c58f54cba31dc90bfbc61 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:34:34 2022 +0100 Translation system is still * up commit c80eac9d5bd5491ec4a61da38cdaf82f0ea1cc2f Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:33:50 2022 +0100 Translation system is still * up commit f8ba6b02454d66eb96e7e6ebd8022492ff79e690 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:32:22 2022 +0100 Translation system is still * up commit dec7eec6de26298eb7c90fd01e1c0fd23b6469a4 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:16:13 2022 +0100 Translation system is * up commit cc840cf7ccb40509f1da3f521a4a1b3e26498ac0 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 21:33:00 2022 +0100 First working version commit 54b65e619e41c9963a614a177df3a4af68ebe77d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 18:59:09 2022 +0100 Using getGlobalStat method commit 7ebc8500da9d52bd2911a620179fb6585f044c47 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 14:33:37 2022 +0100 Working on Omada Widget : NOT WORKING FOR NOW commit 04eaf28cae1be0935cb190e50ae5b75c19254403 Merge: 61065ac 826fe15 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:32:30 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 61065ace2887c3c1d6486001d34ce6f58d58958d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:24:57 2022 +0100 Working on Omada Widget remove idea Co-Authored-By: Benoit SERRA <11260343+oupsman@users.noreply.github.com>
2022-12-21 12:08:34 -08:00
2022-12-21 12:20:17 -08:00
if (site.length === 0) {
return res.status(requestresponse[0]).json({error: {message: `Site ${widget.site} is not found`, url, data}});
Squashed commit of the following from initial Omada widget: commit ad3e664b56ad2a9024684f2141f8f21ead59177e Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 19:54:54 2022 +0100 Add .idea to .gitignore commit 7e51a093845c6bcda4fac78a2c174adbcc7701b6 Merge: 93d8035 7dd0b0e Author: Benoit SERRA <oupsman@oupsman.fr> Date: Tue Dec 13 18:38:51 2022 +0100 Merge branch 'benphelps:main' into main commit 93d80350b1d4519ac217b880568ccabbef43f03f Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 18:15:20 2022 +0100 Omada widget : One widget, shows only the number alerts, the number of connected AP, the number of connected devices to Wifi, the number of connected switches and gatewawys. commit a1babd860ce8a2dd6981b7fef6e055e249cbccb2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 09:33:50 2022 +0100 Omada widget : spliting widget between WLAN and LAN/WAN fields to have no more than 5 fields per widget. commit e12cc65c7703f2f1930fc7646c1f4386b49e73fb Merge: 331f31f 146326f Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sun Dec 11 14:39:27 2022 +0100 Merge branch 'benphelps:main' into main commit 331f31fc2be80e0738869fd050b3034638979350 Merge: 37154e3 ccc1229 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sat Dec 10 17:56:44 2022 +0100 Merge branch 'benphelps:main' into main commit 37154e327af7d3fe66e7638ba79851ef789d3649 Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 17:11:30 2022 +0100 Omada widget : Improved error handling Omada widget: handling power as common.power in translation commit 1f484914067e514f22c1f250b62f589fedefe1fd Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 10:24:55 2022 +0100 Omada widget : adding stats for isolated aps, connected gateways, connected switches, available ports, power consumption commit f375f0b815bf6697f7044995203084427b14ea69 Merge: 467b678 775b511 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:38 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 467b67802a7b8dface01703b6035951dcaa1e069 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:09 2022 +0100 Omada widget : v3 v4 and v5 versions don't use the same fields for the same stats, I've corrected the code to make it more reliable commit 775b5111e13072a18edb33f30a4d4f0589bc2af0 Merge: 8d66756 88c4375 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Thu Dec 8 15:38:20 2022 +0100 Merge branch 'benphelps:main' into main commit 8d66756a7d8f9e0b43c8abde2f2e6f2fd86a1098 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:45:44 2022 +0100 Omada Widget : code cleanup commit 282a6d0592c53a39184d63bba517f482a84f5b36 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:42:41 2022 +0100 Omada Widget : code cleanup commit c3e9b8f87075e834ea1a520fd8c93708afb15ac0 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:37:10 2022 +0100 Omada Widget : No more legacy variable, the code detects the controller version and adapts the requests. Logic is not duplicated anymore commit eafcc205975cc1bd04f063f1627d380f2a2b7f04 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 15:46:00 2022 +0100 V2 API is working commit bcc2864ee2e1f0f1d2f4c009df1ba8a1a7244f80 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 10:01:26 2022 +0100 Code fore v2 API is not working but V1 code is. commit ea8e297e849c2ef5659bfec94d76d2fff8677c4c Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 14:28:05 2022 +0100 Errors handling commit ab6d51a88c8737654dd31bec46106d7c49ed39d2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 09:50:14 2022 +0100 Adding alerts commit 047db2cce867c0207be7fe0827b24107fdd84923 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:53:43 2022 +0100 Fixed translation system commit 42c5a3e6658f22662b1c58f54cba31dc90bfbc61 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:34:34 2022 +0100 Translation system is still * up commit c80eac9d5bd5491ec4a61da38cdaf82f0ea1cc2f Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:33:50 2022 +0100 Translation system is still * up commit f8ba6b02454d66eb96e7e6ebd8022492ff79e690 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:32:22 2022 +0100 Translation system is still * up commit dec7eec6de26298eb7c90fd01e1c0fd23b6469a4 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:16:13 2022 +0100 Translation system is * up commit cc840cf7ccb40509f1da3f521a4a1b3e26498ac0 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 21:33:00 2022 +0100 First working version commit 54b65e619e41c9963a614a177df3a4af68ebe77d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 18:59:09 2022 +0100 Using getGlobalStat method commit 7ebc8500da9d52bd2911a620179fb6585f044c47 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 14:33:37 2022 +0100 Working on Omada Widget : NOT WORKING FOR NOW commit 04eaf28cae1be0935cb190e50ae5b75c19254403 Merge: 61065ac 826fe15 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:32:30 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 61065ace2887c3c1d6486001d34ce6f58d58958d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:24:57 2022 +0100 Working on Omada Widget remove idea Co-Authored-By: Benoit SERRA <11260343+oupsman@users.noreply.github.com>
2022-12-21 12:08:34 -08:00
}
2022-12-21 12:20:17 -08:00
const siteName = (controllerVersionMajor === 5) ? site.id : site.key;
const siteStatsUrl = (controllerVersionMajor === 4) ?
`${url}/api/v2/sites/${siteName}/dashboard/overviewDiagram?token=${token}&currentPage=1&currentPageSize=1000` :
`${url}/${cId}/api/v2/sites/${siteName}/dashboard/overviewDiagram?token=${token}&currentPage=1&currentPageSize=1000`;
[status, contentType, data] = await httpProxy(siteStatsUrl, {
Squashed commit of the following from initial Omada widget: commit ad3e664b56ad2a9024684f2141f8f21ead59177e Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 19:54:54 2022 +0100 Add .idea to .gitignore commit 7e51a093845c6bcda4fac78a2c174adbcc7701b6 Merge: 93d8035 7dd0b0e Author: Benoit SERRA <oupsman@oupsman.fr> Date: Tue Dec 13 18:38:51 2022 +0100 Merge branch 'benphelps:main' into main commit 93d80350b1d4519ac217b880568ccabbef43f03f Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 18:15:20 2022 +0100 Omada widget : One widget, shows only the number alerts, the number of connected AP, the number of connected devices to Wifi, the number of connected switches and gatewawys. commit a1babd860ce8a2dd6981b7fef6e055e249cbccb2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 09:33:50 2022 +0100 Omada widget : spliting widget between WLAN and LAN/WAN fields to have no more than 5 fields per widget. commit e12cc65c7703f2f1930fc7646c1f4386b49e73fb Merge: 331f31f 146326f Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sun Dec 11 14:39:27 2022 +0100 Merge branch 'benphelps:main' into main commit 331f31fc2be80e0738869fd050b3034638979350 Merge: 37154e3 ccc1229 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sat Dec 10 17:56:44 2022 +0100 Merge branch 'benphelps:main' into main commit 37154e327af7d3fe66e7638ba79851ef789d3649 Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 17:11:30 2022 +0100 Omada widget : Improved error handling Omada widget: handling power as common.power in translation commit 1f484914067e514f22c1f250b62f589fedefe1fd Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 10:24:55 2022 +0100 Omada widget : adding stats for isolated aps, connected gateways, connected switches, available ports, power consumption commit f375f0b815bf6697f7044995203084427b14ea69 Merge: 467b678 775b511 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:38 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 467b67802a7b8dface01703b6035951dcaa1e069 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:09 2022 +0100 Omada widget : v3 v4 and v5 versions don't use the same fields for the same stats, I've corrected the code to make it more reliable commit 775b5111e13072a18edb33f30a4d4f0589bc2af0 Merge: 8d66756 88c4375 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Thu Dec 8 15:38:20 2022 +0100 Merge branch 'benphelps:main' into main commit 8d66756a7d8f9e0b43c8abde2f2e6f2fd86a1098 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:45:44 2022 +0100 Omada Widget : code cleanup commit 282a6d0592c53a39184d63bba517f482a84f5b36 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:42:41 2022 +0100 Omada Widget : code cleanup commit c3e9b8f87075e834ea1a520fd8c93708afb15ac0 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:37:10 2022 +0100 Omada Widget : No more legacy variable, the code detects the controller version and adapts the requests. Logic is not duplicated anymore commit eafcc205975cc1bd04f063f1627d380f2a2b7f04 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 15:46:00 2022 +0100 V2 API is working commit bcc2864ee2e1f0f1d2f4c009df1ba8a1a7244f80 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 10:01:26 2022 +0100 Code fore v2 API is not working but V1 code is. commit ea8e297e849c2ef5659bfec94d76d2fff8677c4c Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 14:28:05 2022 +0100 Errors handling commit ab6d51a88c8737654dd31bec46106d7c49ed39d2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 09:50:14 2022 +0100 Adding alerts commit 047db2cce867c0207be7fe0827b24107fdd84923 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:53:43 2022 +0100 Fixed translation system commit 42c5a3e6658f22662b1c58f54cba31dc90bfbc61 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:34:34 2022 +0100 Translation system is still * up commit c80eac9d5bd5491ec4a61da38cdaf82f0ea1cc2f Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:33:50 2022 +0100 Translation system is still * up commit f8ba6b02454d66eb96e7e6ebd8022492ff79e690 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:32:22 2022 +0100 Translation system is still * up commit dec7eec6de26298eb7c90fd01e1c0fd23b6469a4 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:16:13 2022 +0100 Translation system is * up commit cc840cf7ccb40509f1da3f521a4a1b3e26498ac0 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 21:33:00 2022 +0100 First working version commit 54b65e619e41c9963a614a177df3a4af68ebe77d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 18:59:09 2022 +0100 Using getGlobalStat method commit 7ebc8500da9d52bd2911a620179fb6585f044c47 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 14:33:37 2022 +0100 Working on Omada Widget : NOT WORKING FOR NOW commit 04eaf28cae1be0935cb190e50ae5b75c19254403 Merge: 61065ac 826fe15 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:32:30 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 61065ace2887c3c1d6486001d34ce6f58d58958d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:24:57 2022 +0100 Working on Omada Widget remove idea Co-Authored-By: Benoit SERRA <11260343+oupsman@users.noreply.github.com>
2022-12-21 12:08:34 -08:00
headers: {
"Csrf-Token": token,
},
});
2022-12-21 12:20:17 -08:00
const siteResponseData = JSON.parse(data);
if (status !== 200 || siteResponseData.errorCode > 0) {
logger.debug(`HTTP ${status} getting stats for site ${widget.site} with message ${listresult.msg}`);
return res.status(500).send(data);
Squashed commit of the following from initial Omada widget: commit ad3e664b56ad2a9024684f2141f8f21ead59177e Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 19:54:54 2022 +0100 Add .idea to .gitignore commit 7e51a093845c6bcda4fac78a2c174adbcc7701b6 Merge: 93d8035 7dd0b0e Author: Benoit SERRA <oupsman@oupsman.fr> Date: Tue Dec 13 18:38:51 2022 +0100 Merge branch 'benphelps:main' into main commit 93d80350b1d4519ac217b880568ccabbef43f03f Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 18:15:20 2022 +0100 Omada widget : One widget, shows only the number alerts, the number of connected AP, the number of connected devices to Wifi, the number of connected switches and gatewawys. commit a1babd860ce8a2dd6981b7fef6e055e249cbccb2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 09:33:50 2022 +0100 Omada widget : spliting widget between WLAN and LAN/WAN fields to have no more than 5 fields per widget. commit e12cc65c7703f2f1930fc7646c1f4386b49e73fb Merge: 331f31f 146326f Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sun Dec 11 14:39:27 2022 +0100 Merge branch 'benphelps:main' into main commit 331f31fc2be80e0738869fd050b3034638979350 Merge: 37154e3 ccc1229 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sat Dec 10 17:56:44 2022 +0100 Merge branch 'benphelps:main' into main commit 37154e327af7d3fe66e7638ba79851ef789d3649 Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 17:11:30 2022 +0100 Omada widget : Improved error handling Omada widget: handling power as common.power in translation commit 1f484914067e514f22c1f250b62f589fedefe1fd Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 10:24:55 2022 +0100 Omada widget : adding stats for isolated aps, connected gateways, connected switches, available ports, power consumption commit f375f0b815bf6697f7044995203084427b14ea69 Merge: 467b678 775b511 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:38 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 467b67802a7b8dface01703b6035951dcaa1e069 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:09 2022 +0100 Omada widget : v3 v4 and v5 versions don't use the same fields for the same stats, I've corrected the code to make it more reliable commit 775b5111e13072a18edb33f30a4d4f0589bc2af0 Merge: 8d66756 88c4375 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Thu Dec 8 15:38:20 2022 +0100 Merge branch 'benphelps:main' into main commit 8d66756a7d8f9e0b43c8abde2f2e6f2fd86a1098 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:45:44 2022 +0100 Omada Widget : code cleanup commit 282a6d0592c53a39184d63bba517f482a84f5b36 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:42:41 2022 +0100 Omada Widget : code cleanup commit c3e9b8f87075e834ea1a520fd8c93708afb15ac0 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:37:10 2022 +0100 Omada Widget : No more legacy variable, the code detects the controller version and adapts the requests. Logic is not duplicated anymore commit eafcc205975cc1bd04f063f1627d380f2a2b7f04 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 15:46:00 2022 +0100 V2 API is working commit bcc2864ee2e1f0f1d2f4c009df1ba8a1a7244f80 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 10:01:26 2022 +0100 Code fore v2 API is not working but V1 code is. commit ea8e297e849c2ef5659bfec94d76d2fff8677c4c Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 14:28:05 2022 +0100 Errors handling commit ab6d51a88c8737654dd31bec46106d7c49ed39d2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 09:50:14 2022 +0100 Adding alerts commit 047db2cce867c0207be7fe0827b24107fdd84923 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:53:43 2022 +0100 Fixed translation system commit 42c5a3e6658f22662b1c58f54cba31dc90bfbc61 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:34:34 2022 +0100 Translation system is still * up commit c80eac9d5bd5491ec4a61da38cdaf82f0ea1cc2f Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:33:50 2022 +0100 Translation system is still * up commit f8ba6b02454d66eb96e7e6ebd8022492ff79e690 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:32:22 2022 +0100 Translation system is still * up commit dec7eec6de26298eb7c90fd01e1c0fd23b6469a4 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:16:13 2022 +0100 Translation system is * up commit cc840cf7ccb40509f1da3f521a4a1b3e26498ac0 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 21:33:00 2022 +0100 First working version commit 54b65e619e41c9963a614a177df3a4af68ebe77d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 18:59:09 2022 +0100 Using getGlobalStat method commit 7ebc8500da9d52bd2911a620179fb6585f044c47 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 14:33:37 2022 +0100 Working on Omada Widget : NOT WORKING FOR NOW commit 04eaf28cae1be0935cb190e50ae5b75c19254403 Merge: 61065ac 826fe15 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:32:30 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 61065ace2887c3c1d6486001d34ce6f58d58958d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:24:57 2022 +0100 Working on Omada Widget remove idea Co-Authored-By: Benoit SERRA <11260343+oupsman@users.noreply.github.com>
2022-12-21 12:08:34 -08:00
}
2022-12-21 12:20:17 -08:00
activeUser = siteResponseData.result.totalClientNum;
connectedAp = siteResponseData.result.connectedApNum;
connectedGateways = siteResponseData.result.connectedGatewayNum;
connectedSwitches = siteResponseData.result.connectedSwitchNum;
Squashed commit of the following from initial Omada widget: commit ad3e664b56ad2a9024684f2141f8f21ead59177e Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 19:54:54 2022 +0100 Add .idea to .gitignore commit 7e51a093845c6bcda4fac78a2c174adbcc7701b6 Merge: 93d8035 7dd0b0e Author: Benoit SERRA <oupsman@oupsman.fr> Date: Tue Dec 13 18:38:51 2022 +0100 Merge branch 'benphelps:main' into main commit 93d80350b1d4519ac217b880568ccabbef43f03f Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 18:15:20 2022 +0100 Omada widget : One widget, shows only the number alerts, the number of connected AP, the number of connected devices to Wifi, the number of connected switches and gatewawys. commit a1babd860ce8a2dd6981b7fef6e055e249cbccb2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 09:33:50 2022 +0100 Omada widget : spliting widget between WLAN and LAN/WAN fields to have no more than 5 fields per widget. commit e12cc65c7703f2f1930fc7646c1f4386b49e73fb Merge: 331f31f 146326f Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sun Dec 11 14:39:27 2022 +0100 Merge branch 'benphelps:main' into main commit 331f31fc2be80e0738869fd050b3034638979350 Merge: 37154e3 ccc1229 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sat Dec 10 17:56:44 2022 +0100 Merge branch 'benphelps:main' into main commit 37154e327af7d3fe66e7638ba79851ef789d3649 Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 17:11:30 2022 +0100 Omada widget : Improved error handling Omada widget: handling power as common.power in translation commit 1f484914067e514f22c1f250b62f589fedefe1fd Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 10:24:55 2022 +0100 Omada widget : adding stats for isolated aps, connected gateways, connected switches, available ports, power consumption commit f375f0b815bf6697f7044995203084427b14ea69 Merge: 467b678 775b511 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:38 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 467b67802a7b8dface01703b6035951dcaa1e069 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:09 2022 +0100 Omada widget : v3 v4 and v5 versions don't use the same fields for the same stats, I've corrected the code to make it more reliable commit 775b5111e13072a18edb33f30a4d4f0589bc2af0 Merge: 8d66756 88c4375 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Thu Dec 8 15:38:20 2022 +0100 Merge branch 'benphelps:main' into main commit 8d66756a7d8f9e0b43c8abde2f2e6f2fd86a1098 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:45:44 2022 +0100 Omada Widget : code cleanup commit 282a6d0592c53a39184d63bba517f482a84f5b36 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:42:41 2022 +0100 Omada Widget : code cleanup commit c3e9b8f87075e834ea1a520fd8c93708afb15ac0 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:37:10 2022 +0100 Omada Widget : No more legacy variable, the code detects the controller version and adapts the requests. Logic is not duplicated anymore commit eafcc205975cc1bd04f063f1627d380f2a2b7f04 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 15:46:00 2022 +0100 V2 API is working commit bcc2864ee2e1f0f1d2f4c009df1ba8a1a7244f80 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 10:01:26 2022 +0100 Code fore v2 API is not working but V1 code is. commit ea8e297e849c2ef5659bfec94d76d2fff8677c4c Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 14:28:05 2022 +0100 Errors handling commit ab6d51a88c8737654dd31bec46106d7c49ed39d2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 09:50:14 2022 +0100 Adding alerts commit 047db2cce867c0207be7fe0827b24107fdd84923 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:53:43 2022 +0100 Fixed translation system commit 42c5a3e6658f22662b1c58f54cba31dc90bfbc61 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:34:34 2022 +0100 Translation system is still * up commit c80eac9d5bd5491ec4a61da38cdaf82f0ea1cc2f Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:33:50 2022 +0100 Translation system is still * up commit f8ba6b02454d66eb96e7e6ebd8022492ff79e690 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:32:22 2022 +0100 Translation system is still * up commit dec7eec6de26298eb7c90fd01e1c0fd23b6469a4 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:16:13 2022 +0100 Translation system is * up commit cc840cf7ccb40509f1da3f521a4a1b3e26498ac0 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 21:33:00 2022 +0100 First working version commit 54b65e619e41c9963a614a177df3a4af68ebe77d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 18:59:09 2022 +0100 Using getGlobalStat method commit 7ebc8500da9d52bd2911a620179fb6585f044c47 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 14:33:37 2022 +0100 Working on Omada Widget : NOT WORKING FOR NOW commit 04eaf28cae1be0935cb190e50ae5b75c19254403 Merge: 61065ac 826fe15 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:32:30 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 61065ace2887c3c1d6486001d34ce6f58d58958d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:24:57 2022 +0100 Working on Omada Widget remove idea Co-Authored-By: Benoit SERRA <11260343+oupsman@users.noreply.github.com>
2022-12-21 12:08:34 -08:00
2022-12-21 12:20:17 -08:00
const alertUrl = (controllerVersionMajor === 4) ?
`${url}/api/v2/sites/${siteName}/alerts/num?token=${token}&currentPage=1&currentPageSize=1000` :
`${url}/${cId}/api/v2/sites/${siteName}/alerts/num?token=${token}&currentPage=1&currentPageSize=1000`;
Squashed commit of the following from initial Omada widget: commit ad3e664b56ad2a9024684f2141f8f21ead59177e Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 19:54:54 2022 +0100 Add .idea to .gitignore commit 7e51a093845c6bcda4fac78a2c174adbcc7701b6 Merge: 93d8035 7dd0b0e Author: Benoit SERRA <oupsman@oupsman.fr> Date: Tue Dec 13 18:38:51 2022 +0100 Merge branch 'benphelps:main' into main commit 93d80350b1d4519ac217b880568ccabbef43f03f Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 18:15:20 2022 +0100 Omada widget : One widget, shows only the number alerts, the number of connected AP, the number of connected devices to Wifi, the number of connected switches and gatewawys. commit a1babd860ce8a2dd6981b7fef6e055e249cbccb2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 09:33:50 2022 +0100 Omada widget : spliting widget between WLAN and LAN/WAN fields to have no more than 5 fields per widget. commit e12cc65c7703f2f1930fc7646c1f4386b49e73fb Merge: 331f31f 146326f Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sun Dec 11 14:39:27 2022 +0100 Merge branch 'benphelps:main' into main commit 331f31fc2be80e0738869fd050b3034638979350 Merge: 37154e3 ccc1229 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sat Dec 10 17:56:44 2022 +0100 Merge branch 'benphelps:main' into main commit 37154e327af7d3fe66e7638ba79851ef789d3649 Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 17:11:30 2022 +0100 Omada widget : Improved error handling Omada widget: handling power as common.power in translation commit 1f484914067e514f22c1f250b62f589fedefe1fd Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 10:24:55 2022 +0100 Omada widget : adding stats for isolated aps, connected gateways, connected switches, available ports, power consumption commit f375f0b815bf6697f7044995203084427b14ea69 Merge: 467b678 775b511 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:38 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 467b67802a7b8dface01703b6035951dcaa1e069 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:09 2022 +0100 Omada widget : v3 v4 and v5 versions don't use the same fields for the same stats, I've corrected the code to make it more reliable commit 775b5111e13072a18edb33f30a4d4f0589bc2af0 Merge: 8d66756 88c4375 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Thu Dec 8 15:38:20 2022 +0100 Merge branch 'benphelps:main' into main commit 8d66756a7d8f9e0b43c8abde2f2e6f2fd86a1098 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:45:44 2022 +0100 Omada Widget : code cleanup commit 282a6d0592c53a39184d63bba517f482a84f5b36 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:42:41 2022 +0100 Omada Widget : code cleanup commit c3e9b8f87075e834ea1a520fd8c93708afb15ac0 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:37:10 2022 +0100 Omada Widget : No more legacy variable, the code detects the controller version and adapts the requests. Logic is not duplicated anymore commit eafcc205975cc1bd04f063f1627d380f2a2b7f04 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 15:46:00 2022 +0100 V2 API is working commit bcc2864ee2e1f0f1d2f4c009df1ba8a1a7244f80 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 10:01:26 2022 +0100 Code fore v2 API is not working but V1 code is. commit ea8e297e849c2ef5659bfec94d76d2fff8677c4c Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 14:28:05 2022 +0100 Errors handling commit ab6d51a88c8737654dd31bec46106d7c49ed39d2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 09:50:14 2022 +0100 Adding alerts commit 047db2cce867c0207be7fe0827b24107fdd84923 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:53:43 2022 +0100 Fixed translation system commit 42c5a3e6658f22662b1c58f54cba31dc90bfbc61 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:34:34 2022 +0100 Translation system is still * up commit c80eac9d5bd5491ec4a61da38cdaf82f0ea1cc2f Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:33:50 2022 +0100 Translation system is still * up commit f8ba6b02454d66eb96e7e6ebd8022492ff79e690 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:32:22 2022 +0100 Translation system is still * up commit dec7eec6de26298eb7c90fd01e1c0fd23b6469a4 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:16:13 2022 +0100 Translation system is * up commit cc840cf7ccb40509f1da3f521a4a1b3e26498ac0 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 21:33:00 2022 +0100 First working version commit 54b65e619e41c9963a614a177df3a4af68ebe77d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 18:59:09 2022 +0100 Using getGlobalStat method commit 7ebc8500da9d52bd2911a620179fb6585f044c47 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 14:33:37 2022 +0100 Working on Omada Widget : NOT WORKING FOR NOW commit 04eaf28cae1be0935cb190e50ae5b75c19254403 Merge: 61065ac 826fe15 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:32:30 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 61065ace2887c3c1d6486001d34ce6f58d58958d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:24:57 2022 +0100 Working on Omada Widget remove idea Co-Authored-By: Benoit SERRA <11260343+oupsman@users.noreply.github.com>
2022-12-21 12:08:34 -08:00
2022-12-21 12:20:17 -08:00
[status, contentType, data] = await httpProxy(alertUrl, {
Squashed commit of the following from initial Omada widget: commit ad3e664b56ad2a9024684f2141f8f21ead59177e Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 19:54:54 2022 +0100 Add .idea to .gitignore commit 7e51a093845c6bcda4fac78a2c174adbcc7701b6 Merge: 93d8035 7dd0b0e Author: Benoit SERRA <oupsman@oupsman.fr> Date: Tue Dec 13 18:38:51 2022 +0100 Merge branch 'benphelps:main' into main commit 93d80350b1d4519ac217b880568ccabbef43f03f Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 18:15:20 2022 +0100 Omada widget : One widget, shows only the number alerts, the number of connected AP, the number of connected devices to Wifi, the number of connected switches and gatewawys. commit a1babd860ce8a2dd6981b7fef6e055e249cbccb2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 09:33:50 2022 +0100 Omada widget : spliting widget between WLAN and LAN/WAN fields to have no more than 5 fields per widget. commit e12cc65c7703f2f1930fc7646c1f4386b49e73fb Merge: 331f31f 146326f Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sun Dec 11 14:39:27 2022 +0100 Merge branch 'benphelps:main' into main commit 331f31fc2be80e0738869fd050b3034638979350 Merge: 37154e3 ccc1229 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sat Dec 10 17:56:44 2022 +0100 Merge branch 'benphelps:main' into main commit 37154e327af7d3fe66e7638ba79851ef789d3649 Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 17:11:30 2022 +0100 Omada widget : Improved error handling Omada widget: handling power as common.power in translation commit 1f484914067e514f22c1f250b62f589fedefe1fd Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 10:24:55 2022 +0100 Omada widget : adding stats for isolated aps, connected gateways, connected switches, available ports, power consumption commit f375f0b815bf6697f7044995203084427b14ea69 Merge: 467b678 775b511 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:38 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 467b67802a7b8dface01703b6035951dcaa1e069 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:09 2022 +0100 Omada widget : v3 v4 and v5 versions don't use the same fields for the same stats, I've corrected the code to make it more reliable commit 775b5111e13072a18edb33f30a4d4f0589bc2af0 Merge: 8d66756 88c4375 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Thu Dec 8 15:38:20 2022 +0100 Merge branch 'benphelps:main' into main commit 8d66756a7d8f9e0b43c8abde2f2e6f2fd86a1098 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:45:44 2022 +0100 Omada Widget : code cleanup commit 282a6d0592c53a39184d63bba517f482a84f5b36 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:42:41 2022 +0100 Omada Widget : code cleanup commit c3e9b8f87075e834ea1a520fd8c93708afb15ac0 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:37:10 2022 +0100 Omada Widget : No more legacy variable, the code detects the controller version and adapts the requests. Logic is not duplicated anymore commit eafcc205975cc1bd04f063f1627d380f2a2b7f04 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 15:46:00 2022 +0100 V2 API is working commit bcc2864ee2e1f0f1d2f4c009df1ba8a1a7244f80 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 10:01:26 2022 +0100 Code fore v2 API is not working but V1 code is. commit ea8e297e849c2ef5659bfec94d76d2fff8677c4c Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 14:28:05 2022 +0100 Errors handling commit ab6d51a88c8737654dd31bec46106d7c49ed39d2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 09:50:14 2022 +0100 Adding alerts commit 047db2cce867c0207be7fe0827b24107fdd84923 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:53:43 2022 +0100 Fixed translation system commit 42c5a3e6658f22662b1c58f54cba31dc90bfbc61 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:34:34 2022 +0100 Translation system is still * up commit c80eac9d5bd5491ec4a61da38cdaf82f0ea1cc2f Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:33:50 2022 +0100 Translation system is still * up commit f8ba6b02454d66eb96e7e6ebd8022492ff79e690 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:32:22 2022 +0100 Translation system is still * up commit dec7eec6de26298eb7c90fd01e1c0fd23b6469a4 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:16:13 2022 +0100 Translation system is * up commit cc840cf7ccb40509f1da3f521a4a1b3e26498ac0 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 21:33:00 2022 +0100 First working version commit 54b65e619e41c9963a614a177df3a4af68ebe77d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 18:59:09 2022 +0100 Using getGlobalStat method commit 7ebc8500da9d52bd2911a620179fb6585f044c47 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 14:33:37 2022 +0100 Working on Omada Widget : NOT WORKING FOR NOW commit 04eaf28cae1be0935cb190e50ae5b75c19254403 Merge: 61065ac 826fe15 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:32:30 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 61065ace2887c3c1d6486001d34ce6f58d58958d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:24:57 2022 +0100 Working on Omada Widget remove idea Co-Authored-By: Benoit SERRA <11260343+oupsman@users.noreply.github.com>
2022-12-21 12:08:34 -08:00
headers: {
"Csrf-Token": token,
},
});
2022-12-21 12:20:17 -08:00
const alertResponseData = JSON.parse(data);
alerts = alertResponseData.result.alertNum;
Squashed commit of the following from initial Omada widget: commit ad3e664b56ad2a9024684f2141f8f21ead59177e Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 19:54:54 2022 +0100 Add .idea to .gitignore commit 7e51a093845c6bcda4fac78a2c174adbcc7701b6 Merge: 93d8035 7dd0b0e Author: Benoit SERRA <oupsman@oupsman.fr> Date: Tue Dec 13 18:38:51 2022 +0100 Merge branch 'benphelps:main' into main commit 93d80350b1d4519ac217b880568ccabbef43f03f Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 18:15:20 2022 +0100 Omada widget : One widget, shows only the number alerts, the number of connected AP, the number of connected devices to Wifi, the number of connected switches and gatewawys. commit a1babd860ce8a2dd6981b7fef6e055e249cbccb2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 09:33:50 2022 +0100 Omada widget : spliting widget between WLAN and LAN/WAN fields to have no more than 5 fields per widget. commit e12cc65c7703f2f1930fc7646c1f4386b49e73fb Merge: 331f31f 146326f Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sun Dec 11 14:39:27 2022 +0100 Merge branch 'benphelps:main' into main commit 331f31fc2be80e0738869fd050b3034638979350 Merge: 37154e3 ccc1229 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sat Dec 10 17:56:44 2022 +0100 Merge branch 'benphelps:main' into main commit 37154e327af7d3fe66e7638ba79851ef789d3649 Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 17:11:30 2022 +0100 Omada widget : Improved error handling Omada widget: handling power as common.power in translation commit 1f484914067e514f22c1f250b62f589fedefe1fd Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 10:24:55 2022 +0100 Omada widget : adding stats for isolated aps, connected gateways, connected switches, available ports, power consumption commit f375f0b815bf6697f7044995203084427b14ea69 Merge: 467b678 775b511 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:38 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 467b67802a7b8dface01703b6035951dcaa1e069 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:09 2022 +0100 Omada widget : v3 v4 and v5 versions don't use the same fields for the same stats, I've corrected the code to make it more reliable commit 775b5111e13072a18edb33f30a4d4f0589bc2af0 Merge: 8d66756 88c4375 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Thu Dec 8 15:38:20 2022 +0100 Merge branch 'benphelps:main' into main commit 8d66756a7d8f9e0b43c8abde2f2e6f2fd86a1098 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:45:44 2022 +0100 Omada Widget : code cleanup commit 282a6d0592c53a39184d63bba517f482a84f5b36 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:42:41 2022 +0100 Omada Widget : code cleanup commit c3e9b8f87075e834ea1a520fd8c93708afb15ac0 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:37:10 2022 +0100 Omada Widget : No more legacy variable, the code detects the controller version and adapts the requests. Logic is not duplicated anymore commit eafcc205975cc1bd04f063f1627d380f2a2b7f04 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 15:46:00 2022 +0100 V2 API is working commit bcc2864ee2e1f0f1d2f4c009df1ba8a1a7244f80 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 10:01:26 2022 +0100 Code fore v2 API is not working but V1 code is. commit ea8e297e849c2ef5659bfec94d76d2fff8677c4c Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 14:28:05 2022 +0100 Errors handling commit ab6d51a88c8737654dd31bec46106d7c49ed39d2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 09:50:14 2022 +0100 Adding alerts commit 047db2cce867c0207be7fe0827b24107fdd84923 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:53:43 2022 +0100 Fixed translation system commit 42c5a3e6658f22662b1c58f54cba31dc90bfbc61 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:34:34 2022 +0100 Translation system is still * up commit c80eac9d5bd5491ec4a61da38cdaf82f0ea1cc2f Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:33:50 2022 +0100 Translation system is still * up commit f8ba6b02454d66eb96e7e6ebd8022492ff79e690 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:32:22 2022 +0100 Translation system is still * up commit dec7eec6de26298eb7c90fd01e1c0fd23b6469a4 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:16:13 2022 +0100 Translation system is * up commit cc840cf7ccb40509f1da3f521a4a1b3e26498ac0 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 21:33:00 2022 +0100 First working version commit 54b65e619e41c9963a614a177df3a4af68ebe77d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 18:59:09 2022 +0100 Using getGlobalStat method commit 7ebc8500da9d52bd2911a620179fb6585f044c47 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 14:33:37 2022 +0100 Working on Omada Widget : NOT WORKING FOR NOW commit 04eaf28cae1be0935cb190e50ae5b75c19254403 Merge: 61065ac 826fe15 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:32:30 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 61065ace2887c3c1d6486001d34ce6f58d58958d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:24:57 2022 +0100 Working on Omada Widget remove idea Co-Authored-By: Benoit SERRA <11260343+oupsman@users.noreply.github.com>
2022-12-21 12:08:34 -08:00
}
return res.send(JSON.stringify({
2022-12-21 12:20:17 -08:00
connectedAp,
activeUser,
alerts,
connectedGateways,
connectedSwitches,
Squashed commit of the following from initial Omada widget: commit ad3e664b56ad2a9024684f2141f8f21ead59177e Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 19:54:54 2022 +0100 Add .idea to .gitignore commit 7e51a093845c6bcda4fac78a2c174adbcc7701b6 Merge: 93d8035 7dd0b0e Author: Benoit SERRA <oupsman@oupsman.fr> Date: Tue Dec 13 18:38:51 2022 +0100 Merge branch 'benphelps:main' into main commit 93d80350b1d4519ac217b880568ccabbef43f03f Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 18:15:20 2022 +0100 Omada widget : One widget, shows only the number alerts, the number of connected AP, the number of connected devices to Wifi, the number of connected switches and gatewawys. commit a1babd860ce8a2dd6981b7fef6e055e249cbccb2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 09:33:50 2022 +0100 Omada widget : spliting widget between WLAN and LAN/WAN fields to have no more than 5 fields per widget. commit e12cc65c7703f2f1930fc7646c1f4386b49e73fb Merge: 331f31f 146326f Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sun Dec 11 14:39:27 2022 +0100 Merge branch 'benphelps:main' into main commit 331f31fc2be80e0738869fd050b3034638979350 Merge: 37154e3 ccc1229 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sat Dec 10 17:56:44 2022 +0100 Merge branch 'benphelps:main' into main commit 37154e327af7d3fe66e7638ba79851ef789d3649 Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 17:11:30 2022 +0100 Omada widget : Improved error handling Omada widget: handling power as common.power in translation commit 1f484914067e514f22c1f250b62f589fedefe1fd Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 10:24:55 2022 +0100 Omada widget : adding stats for isolated aps, connected gateways, connected switches, available ports, power consumption commit f375f0b815bf6697f7044995203084427b14ea69 Merge: 467b678 775b511 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:38 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 467b67802a7b8dface01703b6035951dcaa1e069 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:09 2022 +0100 Omada widget : v3 v4 and v5 versions don't use the same fields for the same stats, I've corrected the code to make it more reliable commit 775b5111e13072a18edb33f30a4d4f0589bc2af0 Merge: 8d66756 88c4375 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Thu Dec 8 15:38:20 2022 +0100 Merge branch 'benphelps:main' into main commit 8d66756a7d8f9e0b43c8abde2f2e6f2fd86a1098 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:45:44 2022 +0100 Omada Widget : code cleanup commit 282a6d0592c53a39184d63bba517f482a84f5b36 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:42:41 2022 +0100 Omada Widget : code cleanup commit c3e9b8f87075e834ea1a520fd8c93708afb15ac0 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:37:10 2022 +0100 Omada Widget : No more legacy variable, the code detects the controller version and adapts the requests. Logic is not duplicated anymore commit eafcc205975cc1bd04f063f1627d380f2a2b7f04 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 15:46:00 2022 +0100 V2 API is working commit bcc2864ee2e1f0f1d2f4c009df1ba8a1a7244f80 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 10:01:26 2022 +0100 Code fore v2 API is not working but V1 code is. commit ea8e297e849c2ef5659bfec94d76d2fff8677c4c Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 14:28:05 2022 +0100 Errors handling commit ab6d51a88c8737654dd31bec46106d7c49ed39d2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 09:50:14 2022 +0100 Adding alerts commit 047db2cce867c0207be7fe0827b24107fdd84923 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:53:43 2022 +0100 Fixed translation system commit 42c5a3e6658f22662b1c58f54cba31dc90bfbc61 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:34:34 2022 +0100 Translation system is still * up commit c80eac9d5bd5491ec4a61da38cdaf82f0ea1cc2f Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:33:50 2022 +0100 Translation system is still * up commit f8ba6b02454d66eb96e7e6ebd8022492ff79e690 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:32:22 2022 +0100 Translation system is still * up commit dec7eec6de26298eb7c90fd01e1c0fd23b6469a4 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:16:13 2022 +0100 Translation system is * up commit cc840cf7ccb40509f1da3f521a4a1b3e26498ac0 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 21:33:00 2022 +0100 First working version commit 54b65e619e41c9963a614a177df3a4af68ebe77d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 18:59:09 2022 +0100 Using getGlobalStat method commit 7ebc8500da9d52bd2911a620179fb6585f044c47 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 14:33:37 2022 +0100 Working on Omada Widget : NOT WORKING FOR NOW commit 04eaf28cae1be0935cb190e50ae5b75c19254403 Merge: 61065ac 826fe15 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:32:30 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 61065ace2887c3c1d6486001d34ce6f58d58958d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:24:57 2022 +0100 Working on Omada Widget remove idea Co-Authored-By: Benoit SERRA <11260343+oupsman@users.noreply.github.com>
2022-12-21 12:08:34 -08:00
}));
}
}
2022-12-21 12:20:17 -08:00
Squashed commit of the following from initial Omada widget: commit ad3e664b56ad2a9024684f2141f8f21ead59177e Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 19:54:54 2022 +0100 Add .idea to .gitignore commit 7e51a093845c6bcda4fac78a2c174adbcc7701b6 Merge: 93d8035 7dd0b0e Author: Benoit SERRA <oupsman@oupsman.fr> Date: Tue Dec 13 18:38:51 2022 +0100 Merge branch 'benphelps:main' into main commit 93d80350b1d4519ac217b880568ccabbef43f03f Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 18:15:20 2022 +0100 Omada widget : One widget, shows only the number alerts, the number of connected AP, the number of connected devices to Wifi, the number of connected switches and gatewawys. commit a1babd860ce8a2dd6981b7fef6e055e249cbccb2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 13 09:33:50 2022 +0100 Omada widget : spliting widget between WLAN and LAN/WAN fields to have no more than 5 fields per widget. commit e12cc65c7703f2f1930fc7646c1f4386b49e73fb Merge: 331f31f 146326f Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sun Dec 11 14:39:27 2022 +0100 Merge branch 'benphelps:main' into main commit 331f31fc2be80e0738869fd050b3034638979350 Merge: 37154e3 ccc1229 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Sat Dec 10 17:56:44 2022 +0100 Merge branch 'benphelps:main' into main commit 37154e327af7d3fe66e7638ba79851ef789d3649 Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 17:11:30 2022 +0100 Omada widget : Improved error handling Omada widget: handling power as common.power in translation commit 1f484914067e514f22c1f250b62f589fedefe1fd Author: Benoit <oupsman@oupsman.fr> Date: Sat Dec 10 10:24:55 2022 +0100 Omada widget : adding stats for isolated aps, connected gateways, connected switches, available ports, power consumption commit f375f0b815bf6697f7044995203084427b14ea69 Merge: 467b678 775b511 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:38 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 467b67802a7b8dface01703b6035951dcaa1e069 Author: Benoit <oupsman@oupsman.fr> Date: Fri Dec 9 21:06:09 2022 +0100 Omada widget : v3 v4 and v5 versions don't use the same fields for the same stats, I've corrected the code to make it more reliable commit 775b5111e13072a18edb33f30a4d4f0589bc2af0 Merge: 8d66756 88c4375 Author: Benoit SERRA <oupsman@oupsman.fr> Date: Thu Dec 8 15:38:20 2022 +0100 Merge branch 'benphelps:main' into main commit 8d66756a7d8f9e0b43c8abde2f2e6f2fd86a1098 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:45:44 2022 +0100 Omada Widget : code cleanup commit 282a6d0592c53a39184d63bba517f482a84f5b36 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:42:41 2022 +0100 Omada Widget : code cleanup commit c3e9b8f87075e834ea1a520fd8c93708afb15ac0 Author: Benoit <oupsman@oupsman.fr> Date: Thu Dec 8 12:37:10 2022 +0100 Omada Widget : No more legacy variable, the code detects the controller version and adapts the requests. Logic is not duplicated anymore commit eafcc205975cc1bd04f063f1627d380f2a2b7f04 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 15:46:00 2022 +0100 V2 API is working commit bcc2864ee2e1f0f1d2f4c009df1ba8a1a7244f80 Author: Benoit <oupsman@oupsman.fr> Date: Wed Dec 7 10:01:26 2022 +0100 Code fore v2 API is not working but V1 code is. commit ea8e297e849c2ef5659bfec94d76d2fff8677c4c Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 14:28:05 2022 +0100 Errors handling commit ab6d51a88c8737654dd31bec46106d7c49ed39d2 Author: Benoit <oupsman@oupsman.fr> Date: Tue Dec 6 09:50:14 2022 +0100 Adding alerts commit 047db2cce867c0207be7fe0827b24107fdd84923 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:53:43 2022 +0100 Fixed translation system commit 42c5a3e6658f22662b1c58f54cba31dc90bfbc61 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:34:34 2022 +0100 Translation system is still * up commit c80eac9d5bd5491ec4a61da38cdaf82f0ea1cc2f Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:33:50 2022 +0100 Translation system is still * up commit f8ba6b02454d66eb96e7e6ebd8022492ff79e690 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:32:22 2022 +0100 Translation system is still * up commit dec7eec6de26298eb7c90fd01e1c0fd23b6469a4 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 22:16:13 2022 +0100 Translation system is * up commit cc840cf7ccb40509f1da3f521a4a1b3e26498ac0 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 21:33:00 2022 +0100 First working version commit 54b65e619e41c9963a614a177df3a4af68ebe77d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 18:59:09 2022 +0100 Using getGlobalStat method commit 7ebc8500da9d52bd2911a620179fb6585f044c47 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 14:33:37 2022 +0100 Working on Omada Widget : NOT WORKING FOR NOW commit 04eaf28cae1be0935cb190e50ae5b75c19254403 Merge: 61065ac 826fe15 Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:32:30 2022 +0100 Merge branch 'main' of https://github.com/Oupsman/homepage into main commit 61065ace2887c3c1d6486001d34ce6f58d58958d Author: Benoit <oupsman@oupsman.fr> Date: Mon Dec 5 10:24:57 2022 +0100 Working on Omada Widget remove idea Co-Authored-By: Benoit SERRA <11260343+oupsman@users.noreply.github.com>
2022-12-21 12:08:34 -08:00
return res.status(400).json({ error: "Invalid proxy service type" });
}