rueckbau
This commit is contained in:
@@ -398,44 +398,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
}
|
||||
|
||||
$moduleStatusPanel = null;
|
||||
if ($moduleName === 'boersenchecker') {
|
||||
$quotaApiKey = trim((string) ($current['bavest_api_key'] ?? ''));
|
||||
if ($quotaApiKey === '') {
|
||||
$moduleStatusPanel = [
|
||||
'title' => 'Bavest Quota',
|
||||
'type' => 'hint',
|
||||
'text' => 'Kein Bavest API Key hinterlegt. Nach dem Speichern wird hier die aktuelle Quota automatisch angezeigt.',
|
||||
'stats' => [],
|
||||
];
|
||||
} else {
|
||||
$quotaTimeout = (int) ($current['bavest_timeout_sec'] ?? 10);
|
||||
$quotaTimeout = $quotaTimeout > 0 ? $quotaTimeout : 10;
|
||||
$quotaResult = $fetchJsonWithApiKey('https://api.bavest.co/v2/account/quota', $quotaApiKey, $quotaTimeout);
|
||||
|
||||
if (!empty($quotaResult['ok'])) {
|
||||
$quotaData = is_array($quotaResult['data']['data'] ?? null) ? $quotaResult['data']['data'] : [];
|
||||
$moduleStatusPanel = [
|
||||
'title' => 'Bavest Quota',
|
||||
'type' => 'success',
|
||||
'text' => 'Quota erfolgreich geprueft.',
|
||||
'stats' => [
|
||||
['label' => 'Periode', 'value' => (string) ($quotaData['period'] ?? '-')],
|
||||
['label' => 'Verbrauch', 'value' => (string) ($quotaData['usage'] ?? '0')],
|
||||
['label' => 'Limit', 'value' => ($quotaData['limit'] ?? null) !== null ? (string) $quotaData['limit'] : 'unbegrenzt'],
|
||||
['label' => 'Verbleibend', 'value' => ($quotaData['remaining'] ?? null) !== null ? (string) $quotaData['remaining'] : 'unbegrenzt'],
|
||||
['label' => 'API-Key ID', 'value' => (string) ($quotaData['apiKey'] ?? '-')],
|
||||
],
|
||||
];
|
||||
} else {
|
||||
$moduleStatusPanel = [
|
||||
'title' => 'Bavest Quota',
|
||||
'type' => 'error',
|
||||
'text' => 'Quota konnte nicht geprueft werden: ' . (string) ($quotaResult['message'] ?? 'Unbekannter Fehler'),
|
||||
'stats' => [],
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$activeDbGroup = $testGroup !== null && array_key_exists($testGroup, $dbGroups)
|
||||
? $testGroup
|
||||
|
||||
Reference in New Issue
Block a user