mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-07-31 13:50:23 +02:00
refactor: frontpage and proxy setting (#4214)
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
final class BridgeCard
|
||||
{
|
||||
public static function render(string $bridgeClassName, Request $request): string
|
||||
public static function render(string $bridgeClassName, ?string $token): string
|
||||
{
|
||||
$bridgeFactory = new BridgeFactory();
|
||||
|
||||
@@ -14,10 +14,15 @@ final class BridgeCard
|
||||
$description = $bridge->getDescription();
|
||||
$contexts = $bridge->getParameters();
|
||||
|
||||
if (Configuration::getConfig('proxy', 'url') && Configuration::getConfig('proxy', 'by_bridge')) {
|
||||
// Checkbox for disabling of proxy (if enabled)
|
||||
if (
|
||||
Configuration::getConfig('proxy', 'url')
|
||||
&& Configuration::getConfig('proxy', 'by_bridge')
|
||||
) {
|
||||
$proxyName = Configuration::getConfig('proxy', 'name') ?: Configuration::getConfig('proxy', 'url');
|
||||
$contexts['global']['_noproxy'] = [
|
||||
'name' => 'Disable proxy (' . (Configuration::getConfig('proxy', 'name') ?: Configuration::getConfig('proxy', 'url')) . ')',
|
||||
'type' => 'checkbox'
|
||||
'name' => sprintf('Disable proxy (%s)', $proxyName),
|
||||
'type' => 'checkbox',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -47,8 +52,6 @@ final class BridgeCard
|
||||
|
||||
CARD;
|
||||
|
||||
$token = $request->attribute('token');
|
||||
|
||||
if (count($contexts) === 0) {
|
||||
// The bridge has zero parameters
|
||||
$card .= self::renderForm($bridgeClassName, '', [], $token);
|
||||
|
Reference in New Issue
Block a user