[BridgeCard] Display configuration options (if enabled) when bridge has no parameters (#1968)

Updates displayBridgeCard() in BridgeCard to allow configuration options noproxy and cache_timeout to be displayed, if enabled, when a bridge has no parameters in its PARAMETERS array
This commit is contained in:
Joseph 2021-02-05 05:17:30 +00:00 committed by GitHub
parent eab575dc9d
commit 6224fbb6a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -347,11 +347,13 @@ This bridge is not fetching its content through a secure connection</div>';
CARD; CARD;
// If we don't have any parameter for the bridge, we print a generic form to load it. // If we don't have any parameter for the bridge, we print a generic form to load it.
if(count($parameters) === 0 if (count($parameters) === 0) {
|| count($parameters) === 1 && array_key_exists('global', $parameters)) {
$card .= self::getForm($bridgeName, $formats, $isActive, $isHttps); $card .= self::getForm($bridgeName, $formats, $isActive, $isHttps);
// Display form with cache timeout and/or noproxy options (if enabled) when bridge has no parameters
} else if (count($parameters) === 1 && array_key_exists('global', $parameters)) {
$card .= self::getForm($bridgeName, $formats, $isActive, $isHttps, '', $parameters['global']);
} else { } else {
foreach($parameters as $parameterName => $parameter) { foreach($parameters as $parameterName => $parameter) {