feat(wavelog): link to the Wavelog instance next to the API key field
Show an "Open Wavelog" link beside the Wavelog API Key heading in the OpenWebRX panel. The URL comes from the runtime WAVELOG_BASE_URL (exposed via GET /v1/me and the OpenWebRX session response), so the private hostname is never hardcoded in this public repo. The link is hidden when no base URL is configured. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -360,7 +360,7 @@ async function routeRequest(req, res) {
|
||||
if (method === "GET" && url.pathname === "/v1/me") {
|
||||
const auth = requireAuth(req, res);
|
||||
if (!auth) return;
|
||||
return sendJson(res, 200, { user: sanitizeUser(auth.user), wavelogApiKey: auth.user.wavelogApiKey || "", capabilities: userCapabilities(auth.user) });
|
||||
return sendJson(res, 200, { user: sanitizeUser(auth.user), wavelogApiKey: auth.user.wavelogApiKey || "", wavelogBaseUrl: wavelogBaseUrlPublic(), capabilities: userCapabilities(auth.user) });
|
||||
}
|
||||
|
||||
if (method === "GET" && url.pathname === "/v1/auth/session/diag") {
|
||||
@@ -3641,7 +3641,8 @@ async function handleOpenWebRxSessionIssue(res, user) {
|
||||
return sendJson(res, 200, {
|
||||
ok: true,
|
||||
session: result,
|
||||
wavelogApiKey: user.wavelogApiKey || ""
|
||||
wavelogApiKey: user.wavelogApiKey || "",
|
||||
wavelogBaseUrl: wavelogBaseUrlPublic()
|
||||
});
|
||||
}
|
||||
|
||||
@@ -3719,6 +3720,12 @@ async function handleOpenWebRxBandSelect(res, user, body) {
|
||||
}
|
||||
}
|
||||
|
||||
// Public Wavelog base URL (for the UI link). Comes from runtime env only, so the
|
||||
// private hostname is never baked into this (public) repo.
|
||||
function wavelogBaseUrlPublic() {
|
||||
return String(process.env.WAVELOG_BASE_URL || "").trim().replace(/\/+$/, "");
|
||||
}
|
||||
|
||||
// Push a frequency/mode to the active operator's Wavelog logbook (CAT API).
|
||||
// Best-effort: never throws into the caller's flow.
|
||||
async function sendWavelogCat(user, frequencyHz, mode) {
|
||||
|
||||
Reference in New Issue
Block a user