mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-09-21 06:12:17 +03:00
feat(proxylogs): show registry proxy name in proxy log columns (#12814)
* feat(proxylogs): show registry proxy name in proxy log columns Registry resolution already attaches name to the runtime proxy object; the name was dropped at the persistence boundary (ProxyInfo had no name field) and never rendered. Add proxy_name column (base schema + ALTER heal for existing DBs), persist/hydrate it, render it in the ProxyLogger table and ProxyLogDetail pane with host:port fallback, and search by name. Local-only (PMO City): not submitted upstream. Re-apply after upgrades via patch file (see pmo-city-builds omniroute/Operator/runbooks/upgrade.md). * test(proxylogs): flush batched writes before asserting persisted row The v3.8.50 rebase kept upstream's batched proxy-log persistence (enqueueProxyLogs/flushProxyLogsSync); logProxyEvent no longer writes synchronously, so the persist+hydrate test closed the DB before the row was flushed. Flush explicitly first. * test(proxylogs): drain batched queue in resetStorage to avoid cross-test row bleed * docs(changelog): add changelog fragment for proxy registry name in proxy logs Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> --------- Co-authored-by: Tiangao (hermes) <montigaud@aikumi.pro> Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
This commit is contained in:
@@ -14,6 +14,17 @@ import { formatDuration as formatLatency } from "@/shared/utils/formatting";
|
||||
* Proxy log detail modal — shows full proxy event metadata, error info, and config.
|
||||
* Extracted from ProxyLogger.js for maintainability.
|
||||
*/
|
||||
/**
|
||||
* Proxy label for the detail pane: the registry name when the log carries one
|
||||
* (`murphy-eu-fr (http://host:port)`), else `type://host:port`, else the direct label.
|
||||
* Module-scope so the component's cyclomatic complexity stays inside the ratchet.
|
||||
*/
|
||||
function formatProxyLabel(proxy, directLabel) {
|
||||
if (!proxy) return directLabel;
|
||||
const endpoint = `${proxy.type}://${proxy.host}:${proxy.port}`;
|
||||
return proxy.name ? `${proxy.name} (${endpoint})` : endpoint;
|
||||
}
|
||||
|
||||
export default function ProxyLogDetail({ log, onClose }) {
|
||||
const t = useTranslations("proxyLog");
|
||||
useEffect(() => {
|
||||
@@ -109,9 +120,7 @@ export default function ProxyLogDetail({ log, onClose }) {
|
||||
{t("proxy")}
|
||||
</div>
|
||||
<div className="text-sm font-medium font-mono text-primary">
|
||||
{log.proxy
|
||||
? `${log.proxy.type}://${log.proxy.host}:${log.proxy.port}`
|
||||
: t("direct")}
|
||||
{formatProxyLabel(log.proxy, t("direct"))}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
|
||||
@@ -476,7 +476,9 @@ export default function ProxyLogger() {
|
||||
)}
|
||||
{visibleColumns.proxy && (
|
||||
<td className="px-3 py-2 font-mono text-[11px] text-primary">
|
||||
{log.proxy ? `${log.proxy.host}:${log.proxy.port}` : "—"}
|
||||
{log.proxy
|
||||
? log.proxy.name || `${log.proxy.host}:${log.proxy.port}`
|
||||
: "—"}
|
||||
</td>
|
||||
)}
|
||||
{visibleColumns.tls && (
|
||||
|
||||
Reference in New Issue
Block a user