feat: DB-Explorer, Scanner-KeyTypes-Setting, Stripe-Checker, Anthropic-Auth-Fix, Progress-Tracking
Backend:
- Neuer Database Explorer Endpoint (GET /api/admin/db/tables, GET /api/admin/db/tables/{name})
- DatabaseService: public GetConnection() Methode
- StripeKeyChecker: 2-Schritt-Check (/v1/balance + /v1/account), erkennt Live/Test, Balance, Account-Details
- AnthropicKeyChecker: Auth-Header fix (x-api-key für API-Keys, Bearer für OAuth), 400-Handler für credit balance
- KeyPatterns: Stripe einkommentiert, Krea AI Pattern, AllTypes-Array, MinLength 4
- ServerSettingsService: string_array Typ (Get/SetStringArray), ScannerKeyTypes Setting mit Checkbox-Optionen
- ServerSettingsEndpoint: string_array Speichern (Array/CSV)
- KeyScannerService: GetActiveSearchPatterns() filtert nach ScannerKeyTypes, Progress-Tracking
- GitHubEventScannerService: CheckNewKeys nur für aktuelle Poll-Keys (statt alle unchecked), klarere Log-Meldung
Frontend:
- Database Explorer Page: Tabellenliste mit Klick -> Tabelleninhalt, Pagination, sticky Header
- Server Settings: Checkbox-Gruppe für string_array (Alle/Keine Buttons)
- API Keys: adoptedApiKeyId Fix (leerer String == null)
- Dashboard: DB-Explorer Link für Admins
- Scan-Progress: Live-Fortschritt mit Phase/Detail/Counter
This commit is contained in:
1 parent
3cd35ebbfa
commit
e61f3ef082
15 files changed
+642
-33
No files matched your search
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Nodes;
|
||||
using Microsoft.Data.Sqlite;
|
||||
@@ -34,6 +35,7 @@ public class ServerSettingsService
|
||||
new SettingDefinition( "SerperApiKey", "string", "", "Serper.dev API-Key für Google-Suche (Key-Scanner + Tool)", "password" ),
|
||||
new SettingDefinition( "ScanIntervalHours", "int", "0", "Key-Scanner Intervall in Stunden (0 = nur manuell)", "number" ),
|
||||
new SettingDefinition( "GitHubEventScanner", "bool", "false", "GitHub Event Scanner (Echtzeit-Monitoring öffentlicher Pushes)", "toggle" ),
|
||||
new SettingDefinition( "ScannerKeyTypes", "string_array", "anthropic_oauth,krea_ai", "Key-Scanner: Aktive Key-Typen", "checkboxes" ),
|
||||
};
|
||||
|
||||
public ServerSettingsService(string dbPath)
|
||||
@@ -181,6 +183,23 @@ public class ServerSettingsService
|
||||
public void SetInt(string key, int value) => Set(key, value.ToString());
|
||||
public void SetBool(string key, bool value) => Set(key, value ? "true" : "false");
|
||||
|
||||
public string[] GetStringArray(string key, string defaultCsv = "")
|
||||
{
|
||||
var raw = Get(key, null);
|
||||
if (raw == null)
|
||||
{
|
||||
var def = Definitions.Find(d => d.Key == key);
|
||||
raw = def?.DefaultValue ?? defaultCsv;
|
||||
}
|
||||
if (string.IsNullOrWhiteSpace(raw)) return Array.Empty<string>();
|
||||
return raw.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
|
||||
}
|
||||
|
||||
public void SetStringArray(string key, string[] values)
|
||||
{
|
||||
Set(key, string.Join(",", values ?? Array.Empty<string>()));
|
||||
}
|
||||
|
||||
// ─── Bulk-Operationen (für Endpoint) ───────────────────────
|
||||
|
||||
public List<object> GetAll()
|
||||
@@ -197,11 +216,21 @@ public class ServerSettingsService
|
||||
case "bool":
|
||||
value = GetBool(def.Key, def.DefaultValue.Equals("true", StringComparison.OrdinalIgnoreCase));
|
||||
break;
|
||||
case "string_array":
|
||||
value = GetStringArray(def.Key, def.DefaultValue);
|
||||
break;
|
||||
default:
|
||||
value = Get(def.Key, def.DefaultValue);
|
||||
break;
|
||||
}
|
||||
|
||||
// Zusatz-Metadaten für bestimmte Settings
|
||||
object options = null;
|
||||
if (def.Key == "ScannerKeyTypes")
|
||||
{
|
||||
options = KeyPatterns.AllTypes.Select(t => new { id = t, name = KeyPatterns.DisplayName(t) }).ToArray();
|
||||
}
|
||||
|
||||
result.Add(new
|
||||
{
|
||||
key = def.Key,
|
||||
@@ -209,6 +238,7 @@ public class ServerSettingsService
|
||||
value = value,
|
||||
label = def.Label,
|
||||
inputType = def.InputType,
|
||||
options = options,
|
||||
});
|
||||
}
|
||||
return result;
|
||||
|
||||
Reference in new issue
Block a user