Fix wiring between overclock profiles, UI controls, and hardware fan actuation

This commit is contained in:
drjones
2026-08-23 09:05:20 -07:00
parent 02c85d778f
commit a0075d23a7
3 changed files with 26 additions and 5 deletions

View File

@@ -408,6 +408,8 @@ function pushOverclockSample(gpu, ram) {
ocChart.update('none');
}
let initialOcLoaded = false;
async function fetchOverclockStatus() {
try {
const resp = await fetch('/api/overclock');
@@ -415,6 +417,14 @@ async function fetchOverclockStatus() {
const data = await resp.json();
ocProfiles = data.profiles || {};
renderOverclockStatus(data);
if (!initialOcLoaded && data.active_profile) {
initialOcLoaded = true;
const editSel = document.getElementById('oc-edit-profile');
if (editSel) {
editSel.value = data.active_profile;
loadOverclockForProfile(data.active_profile);
}
}
} catch (err) {
console.warn('Overclock fetch error:', err);
}
@@ -588,6 +598,11 @@ async function applyOverclock(profile) {
if (!resp.ok) {
alert(`Apply failed: ${result.detail || 'error'}`);
}
const editSel = document.getElementById('oc-edit-profile');
if (editSel) {
editSel.value = profile;
loadOverclockForProfile(profile);
}
await fetchOverclockStatus();
} catch (err) {
alert(`Error: ${err}`);