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

Function loadAIConfiguration

web/scripts/ragnar_modern.js:12824–12851  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

12822 }
12823 } catch (e) {
12824 console.error('Failed to load scan intensity:', e);
12825 }
12826}
12827
12828async function onScanIntensityChanged(selectEl) {
12829 const value = selectEl.value;
12830 const status = document.getElementById('scan-intensity-status');
12831 try {
12832 const res = await fetch('/api/config/scan-intensity', {
12833 method: 'POST',
12834 headers: { 'Content-Type': 'application/json' },
12835 body: JSON.stringify({ intensity: value })
12836 });
12837 const data = await res.json();
12838 if (!res.ok || data.error) throw new Error(data.error || `HTTP ${res.status}`);
12839 if (status) {
12840 status.textContent = `Saved: ${data.label}`;
12841 status.className = 'text-xs mt-2 text-green-400';
12842 status.classList.remove('hidden');
12843 setTimeout(() => status.classList.add('hidden'), 3000);
12844 }
12845 loadScanIntensity();
12846 } catch (e) {
12847 console.error('Failed to set scan intensity:', e);
12848 if (status) {
12849 status.textContent = `Error: ${e.message}`;
12850 status.className = 'text-xs mt-2 text-red-400';
12851 status.classList.remove('hidden');
12852 }
12853 }
12854}

Callers 2

loadConfigDataFunction · 0.70
saveAITokenFunction · 0.70

Calls 3

BooleanClass · 0.85
errorMethod · 0.80
fetchAPIFunction · 0.70

Tested by

no test coverage detected