mirror of
https://github.com/kilyabin/psysonic.git
synced 2026-07-22 14:35:41 +00:00
fix(navidrome-admin): resilient admin API calls + UI polish (#260)
* fix(navidrome-admin): force HTTP/1.1 + User-Agent + no idle pool for /auth and /api calls Replaces plain reqwest::Client::new() in all nd_* Tauri commands (navidrome_login, nd_list_users, nd_create_user, nd_update_user, nd_delete_user, nd_list_libraries, nd_set_user_libraries) with a shared nd_http_client() helper that: - sets a real User-Agent (Psysonic/<version> (Tauri)) - pins HTTP/1.1 (avoids HTTP/2 ALPN that some reverse proxies abort on) - disables the idle-connection pool so a second call doesn't reuse a TCP connection that the server or proxy has already half-closed (was producing intermittent "tls handshake eof" on external servers). Adds nd_err() to flatten the reqwest error source chain into the returned String, so the frontend surfaces the real cause (connection refused, tls handshake eof, etc.) instead of reqwest's opaque "error sending request for url (…)" wrapper. * fix(navidrome-admin): retry + graceful error + server row polish Rust (src-tauri/src/lib.rs): - nd_http_client: HTTP/1.1, TLS 1.2 only, no idle pool — browser-parity for /auth and /api so strict reverse proxies that abort reqwest's default HTTP/2+TLS-1.3 handshake mid-flight get through. - nd_retry: one retry after 500ms on connect/timeout errors only (ECONNRESET, TLS handshake EOF). Aggressive retries could push the nginx upstream probe into offline state; this is the minimal useful amount. - nd_err: flatten the reqwest error source chain so the UI surfaces the real cause instead of reqwest's opaque wrapper. User management UI: - Sequential load (users, then libraries) instead of parallel, to avoid racing two TLS connections on a single nginx upstream slot. - Friendlier failure state with a one-click Retry button that re-runs load(). Concrete Rust error is kept as muted sub-line. - User row layout: Magic-String button sits consistently next to last-seen + delete for every user, regardless of admin status or library-name length. No more mid-row jitter. Servers tab: - "Use" button no longer redirects to Home; stays on the Servers tab so the active-badge migration is visible. - Drag-and-drop reorder via grip handle (psyDnD), backed by a new setServers() action on authStore. - Active server row now has an accent-tinted background on top of the border — harder to miss. New i18n keys (userMgmtLoadFriendly, userMgmtRetry) added to all 8 locales. --------- Co-authored-by: Psychotoxical <dev@psysonic.app>
This commit is contained in:
committed by
GitHub
parent
2a496c600b
commit
21d00889aa
@@ -481,6 +481,8 @@ export const deTranslation = {
|
||||
userMgmtDesc: 'Benutzer auf diesem Server verwalten. Erfordert Admin-Rechte.',
|
||||
userMgmtNoAdmin: 'Du brauchst Admin-Rechte, um Benutzer auf diesem Server zu verwalten.',
|
||||
userMgmtLoadError: 'Benutzer konnten nicht geladen werden.',
|
||||
userMgmtLoadFriendly: 'Server hat nicht geantwortet — meistens ein Einzelfall.',
|
||||
userMgmtRetry: 'Erneut versuchen',
|
||||
userMgmtEmpty: 'Keine Benutzer gefunden.',
|
||||
userMgmtYouBadge: 'Du',
|
||||
userMgmtAdminBadge: 'Admin',
|
||||
|
||||
Reference in New Issue
Block a user