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

Function loadHuginnConfig

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

Source from the content-addressed store, hash-verified

18077 const button = event.currentTarget;
18078 if (!button || button.dataset.busy === 'true') {
18079 return;
18080 }
18081 const interfaceName = button.dataset.interface;
18082 const currentlyEnabled = button.dataset.scanState === 'enabled';
18083 updateInterfaceScanState(interfaceName, !currentlyEnabled, button);
18084}
18085
18086async function updateInterfaceScanState(interfaceName, enable, button) {
18087 if (!interfaceName) {
18088 return;
18089 }
18090 const endpoint = enable ? '/api/wifi/scan-control/start' : '/api/wifi/scan-control/stop';
18091 if (button) {
18092 button.dataset.busy = 'true';
18093 button.disabled = true;
18094 button.classList.add('opacity-60', 'cursor-not-allowed');
18095 button.textContent = enable ? 'Resuming…' : 'Pausing…';
18096 }
18097
18098 let updated = false;
18099 try {
18100 const response = await postAPI(endpoint, { interface: interfaceName });

Callers 1

loadWardrivingDataFunction · 0.70

Calls 2

errorMethod · 0.80
_updateHuginnConfigBadgeFunction · 0.70

Tested by

no test coverage detected