MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / onMapAiToggleClick

Function onMapAiToggleClick

web/scripts/ragnar_modern.js:20968–20978  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20966 }
20967}
20968
20969// Connect to a self-hosted endpoint and list the models it offers (#462).
20970// Proxied via the backend so we hit the server from the Pi's vantage.
20971async function connectAIEndpoint() {
20972 const btn = document.getElementById('ai-connect-btn');
20973 const statusDiv = document.getElementById('ai-config-status');
20974 const statusMessage = document.getElementById('ai-config-status-message');
20975 const modelsRow = document.getElementById('ai-models-row');
20976 const select = document.getElementById('ai-model-select');
20977 const baseUrl = (document.getElementById('ai-base-url')?.value || '').trim();
20978 // The token field shows a masked placeholder when already saved; only send
20979 // a value the operator actually typed, otherwise let the backend use the
20980 // stored token.
20981 const apiKey = (document.getElementById('openai-api-token')?.value || '').trim();

Callers

nothing calls this directly

Calls 1

refreshNetworkMapFunction · 0.70

Tested by

no test coverage detected