mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-17 20:52:15 +03:00
Adds a "Reorder" action to the provider detail Connections toolbar that sorts a provider's connections so available ones float to the top and unavailable ones sink to the bottom, then persists the new order via the existing per-connection priority PUT endpoint (same pattern already used by handleSwapPriority). Availability is computed with OmniRoute's own resilience model rather than upstream's `modelLock_*` convention: a connection counts as available when its effective status (testStatus, adjusted for the lazy connection-cooldown window via rateLimitedUntil) is active/success — mirroring the exact logic ConnectionRow already uses for its status badge, so the button and the row badges never disagree. The sort is a stable Array.prototype.sort, so connections keep their relative order within each availability group. New pure helpers (sortConnectionsByAvailability, isConnectionAvailable, getConnectionEffectiveStatus) live in connectionRowHelpers.ts and are covered by a dedicated unit test, including the cooldown-lazy-recovery edge case. i18n keys added to all 43 locales. Co-authored-by: Fazril Syaveral Hillaby <fazriloke18@gmail.com> Inspired-by: https://github.com/decolua/9router/pull/2558