Skip to content

Commit 3f6cf4f

Browse files
committed
Fix UI glitch from previous commit where everything turns green in the log viewer when enabling an endpoint
1 parent 83d86e7 commit 3f6cf4f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

root/app/www/public/functions/logger.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,12 @@ function getLog($logfile, $page = 1, $app = false)
201201
$isAllowed = $isAllowedEndpoint['allowed'];
202202

203203
foreach ($methods as $method => $usage) {
204-
$isAllowedEndpointMethod = $isAllowed ? $starr->isAllowedEndpointMethod($proxiedApp['access'], $starrEndpoint, $method) : false;
204+
$isAllowedEndpointMethod = $isAllowed ? $starr->isAllowedEndpointMethod($proxiedApp['access'], $starrEndpoint, $method) : false;
205+
$hash = md5(($starrEndpoint && $starrEndpoint != $endpoint ? $starrEndpoint : $endpoint).$method);
205206

206207
?>
207-
<i id="disallowed-endpoint-<?= md5($starrEndpoint.$method) ?>" class="far fa-times-circle text-danger" title="Disallowed endpoint, click to allow it" style="display: <?= !$isAllowedEndpointMethod ? 'inline-block' : 'none' ?>; cursor: pointer;" onclick="addEndpointAccess('<?= $app ?>', <?= $proxiedApp['proxiedAppDetails']['id'] ?>, '<?= $starrEndpoint ?: $endpoint ?>', '<?= $method ?>', '<?= md5($starrEndpoint.$method) ?>')"></i>
208-
<i id="allowed-endpoint-<?= md5($starrEndpoint.$method) ?>" class="far fa-check-circle text-success" title="Allowed endpoint, click to block it" style="display: <?= $isAllowedEndpointMethod ? 'inline-block' : 'none' ?>; cursor: pointer;" onclick="removeEndpointAccess('<?= $app ?>', <?= $proxiedApp['proxiedAppDetails']['id'] ?>, '<?= $starrEndpoint ?: $endpoint ?>', '<?= $method ?>', '<?= md5($starrEndpoint.$method) ?>')"></i>
208+
<i id="disallowed-endpoint-<?= $hash ?>" class="far fa-times-circle text-danger" title="Disallowed endpoint, click to allow it" style="display: <?= !$isAllowedEndpointMethod ? 'inline-block' : 'none' ?>; cursor: pointer;" onclick="addEndpointAccess('<?= $app ?>', <?= $proxiedApp['proxiedAppDetails']['id'] ?>, '<?= $starrEndpoint ?: $endpoint ?>', '<?= $method ?>', '<?= $hash ?>')"></i>
209+
<i id="allowed-endpoint-<?= $hash ?>" class="far fa-check-circle text-success" title="Allowed endpoint, click to block it" style="display: <?= $isAllowedEndpointMethod ? 'inline-block' : 'none' ?>; cursor: pointer;" onclick="removeEndpointAccess('<?= $app ?>', <?= $proxiedApp['proxiedAppDetails']['id'] ?>, '<?= $starrEndpoint ?: $endpoint ?>', '<?= $method ?>', '<?= $hash ?>')"></i>
209210
[<?= strtoupper($method) ?>] <?= ($starrEndpoint && $starrEndpoint != $endpoint ? $starrEndpoint . '' : '') . $endpoint . ': ' . number_format($usage) ?> hit<?= $usage == 1 ? '' : 's' ?><br>
210211
<?php
211212
}

0 commit comments

Comments
 (0)