Add pfSense API widget (#1491)

* Add support for pfSense API

* Fix linting issues

* remove a line

* rename cpu to load in default block

* Re-order container blocks to ensure defaults show

* simplify pfsense widget, rename, limit blocks

---------

Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
This commit is contained in:
Shaun Walker 2023-05-14 06:44:33 +10:00 committed by GitHub
parent 9617583ee8
commit 77f4c8bf54
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 91 additions and 3 deletions

View file

@ -267,7 +267,7 @@ export function cleanServiceGroups(groups) {
namespace, // kubernetes widget
app,
podSelector,
wan, // opnsense widget,
wan, // opnsense widget, pfsense widget
enableBlocks, // emby/jellyfin
enableNowPlaying,
volume, // diskstation widget
@ -299,10 +299,10 @@ export function cleanServiceGroups(groups) {
if (app) cleanedService.widget.app = app;
if (podSelector) cleanedService.widget.podSelector = podSelector;
}
if (type === "opnsense") {
if (["opnsense", "pfsense"].includes(type)) {
if (wan) cleanedService.widget.wan = wan;
}
if (type === "emby" || type === "jellyfin") {
if (["emby", "jellyfin"].includes(type)) {
if (enableBlocks !== undefined) cleanedService.widget.enableBlocks = JSON.parse(enableBlocks);
if (enableNowPlaying !== undefined) cleanedService.widget.enableNowPlaying = JSON.parse(enableNowPlaying);
}