diff --git a/cmd/relay/service.go b/cmd/relay/service.go index 025e6bf7..ab17a3d4 100644 --- a/cmd/relay/service.go +++ b/cmd/relay/service.go @@ -87,6 +87,7 @@ func (svc *Service) StartAPI(bind string) error { func (svc *Service) startWithListener(listen net.Listener) error { e := echo.New() e.HideBanner = true + e.HidePort = true e.Use(middleware.CORSWithConfig(middleware.CORSConfig{ AllowOrigins: []string{"*"}, @@ -189,6 +190,7 @@ func (svc *Service) startWithListener(listen net.Listener) error { // Echo instance it's already got a port, and then use its StartServer // method to re-use that listener. e.Listener = listen + svc.logger.Info("starting web server", "listen", e.Listener.Addr().String()) srv := &http.Server{} // TODO: attach echo to Service, for shutdown? return e.StartServer(srv) -- 2.51.2 From 6cc9f4c2870cb349609a5706aa1e21ed571eb98a Mon Sep 17 00:00:00 2001 From: bryan newbold Date: Tue, 21 Apr 2026 20:36:17 -0700 Subject: [PATCH 2/2] relay: simplify admin dash editable fields In this new version of the relay, only the account limit is actually editable. This clarifies this by making the other event limits static (not editable) --- .../src/components/Dash/Dash.tsx | 180 +----------------- 1 file changed, 6 insertions(+), 174 deletions(-) diff --git a/cmd/relay/relay-admin-ui/src/components/Dash/Dash.tsx b/cmd/relay/relay-admin-ui/src/components/Dash/Dash.tsx index 11faf7c1..dc787b6c 100644 --- a/cmd/relay/relay-admin-ui/src/components/Dash/Dash.tsx +++ b/cmd/relay/relay-admin-ui/src/components/Dash/Dash.tsx @@ -63,12 +63,6 @@ const Dash: FC<{}> = () => { const [modalConfirm, setModalConfirm] = useState<() => void>(() => { }); const [modalCancel, setModalCancel] = useState<() => void>(() => { }); - const [editingPerSecondRateLimit, setEditingPerSecondRateLimimt] = - useState(null); - const [editingPerHourRateLimit, setEditingPerHourRateLimit] = - useState(null); - const [editingPerDayRateLimit, setEditingPerDayRateLimit] = - useState(null); const [editingRepoLimit, setEditingRepoLimit] = useState(null); @@ -1000,178 +994,16 @@ const Dash: FC<{}> = () => { {pds.Cursor?.toLocaleString()} - - {pds.PerSecondEventRate.Max?.toLocaleString()} - /sec - - - setEditingPerSecondRateLimimt(pds)} - className={editingPerSecondRateLimit ? "hidden" : ""} - > - - { - const newRateLimit = document.getElementById( - `per-second-rate-limit-${pds.ID}` - ) as HTMLInputElement; - if (newRateLimit) { - pds.PerSecondEventRate.Max = +newRateLimit.value; - updateRateLimits(pds); - } - setEditingPerSecondRateLimimt(null); - }} - className={ - "rounded-md p-2 ml-1 hover:text-green-600 hover:bg-green-100 focus:outline-none focus:ring-2 focus:ring-green-600 focus:ring-offset-2 focus:ring-offset-green-50" + - (editingPerSecondRateLimit?.ID === pds.ID - ? "" - : " hidden") - } - > - + {pds.PerSecondEventRate.Max?.toLocaleString()} + /sec - - {pds.PerHourEventRate.Max?.toLocaleString()} - /hour - - - setEditingPerHourRateLimit(pds)} - className={editingPerHourRateLimit ? "hidden" : ""} - > - - { - const newRateLimit = document.getElementById( - `per-hour-rate-limit-${pds.ID}` - ) as HTMLInputElement; - if (newRateLimit) { - pds.PerHourEventRate.Max = +newRateLimit.value; - updateRateLimits(pds); - } - setEditingPerHourRateLimit(null); - }} - className={ - "rounded-md p-2 ml-1 hover:text-green-600 hover:bg-green-100 focus:outline-none focus:ring-2 focus:ring-green-600 focus:ring-offset-2 focus:ring-offset-green-50" + - (editingPerHourRateLimit?.ID === pds.ID - ? "" - : " hidden") - } - > - + {pds.PerHourEventRate.Max?.toLocaleString()} + /sec - - {pds.PerDayEventRate.Max?.toLocaleString()} - /day - - - setEditingPerDayRateLimit(pds)} - className={editingPerDayRateLimit ? "hidden" : ""} - > - - { - const newRateLimit = document.getElementById( - `per-day-rate-limit-${pds.ID}` - ) as HTMLInputElement; - if (newRateLimit) { - pds.PerDayEventRate.Max = +newRateLimit.value; - updateRateLimits(pds); - } - setEditingPerDayRateLimit(null); - }} - className={ - "rounded-md p-2 ml-1 hover:text-green-600 hover:bg-green-100 focus:outline-none focus:ring-2 focus:ring-green-600 focus:ring-offset-2 focus:ring-offset-green-50" + - (editingPerDayRateLimit?.ID === pds.ID - ? "" - : " hidden") - } - > - + {pds.PerDayEventRate.Max?.toLocaleString()} + /sec