Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ All notable changes to this project are documented here. The format follows

## [Unreleased]

### Fixed

- Desktop app: changing "Model on this device" snapped back to the old value and never actually
saved. `fillMachineModels()` reset the `<select>` to the server's last-known model on every
call, including the one the model-change handler itself made before saving the new value —
so the new selection was always overwritten before it reached the server. The reset now only
happens when the option list itself is rebuilt, not on every refresh.

### Added

- `grid_device.py update <name> --model <tag>` and a matching coordinator endpoint
Expand Down
7 changes: 4 additions & 3 deletions projectzero/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,10 @@ <h2 id="account-h" data-i18n="account"></h2>
const o=L.ollama;$("ollama-note").textContent=s.backend==="mock"?t("mockNote"):(o.available?t("ollamaFound",{n:o.models.length}):t("ollamaMissing"));
fillMachineModels();
}
function fillMachineModels(){const allowed=(state.public&&state.public.allowed_models)||[];const sel=$("machine-model");const cur=(state.local.machine&&state.local.machine.model)||sel.value;
if(sel.options.length!==allowed.length){sel.replaceChildren(...allowed.map(m=>el("option",{value:m,text:m})))}
if(cur)sel.value=cur;const o=state.local.ollama;const need=$("backend").value==="ollama"&&o.available&&sel.value&&sel.value!=="demo-model"&&!o.models.includes(sel.value);
function fillMachineModels(){const allowed=(state.public&&state.public.allowed_models)||[];const sel=$("machine-model");
if(sel.options.length!==allowed.length){const cur=(state.local.machine&&state.local.machine.model)||sel.value;
sel.replaceChildren(...allowed.map(m=>el("option",{value:m,text:m})));if(cur)sel.value=cur}
const o=state.local.ollama;const need=$("backend").value==="ollama"&&o.available&&sel.value&&sel.value!=="demo-model"&&!o.models.includes(sel.value);
const pull=state.local.pulls[sel.value];$("pull").classList.toggle("hidden",!need);$("pull").disabled=pull==="running";$("pull").textContent=pull==="running"?t("downloading"):t("downloadModel")}
async function refreshMe(){if(!state.local||!state.local.signed_in)return;try{state.me=await call("/api/me");const m=state.me;$("credits").textContent=m.credits;$("provisional").textContent=m.provisional_credits;$("earned").textContent=m.earned_credits;$("cost").textContent=m.job_cost;$("server-dot").className="dot on"}catch(e){$("server-dot").className="dot off"}}
async function refreshPublic(){try{state.public=await call("/api/public/config");const sel=$("model");const cur=sel.value;sel.replaceChildren(...state.public.allowed_models.map(m=>el("option",{value:m,text:m})));if(cur)sel.value=cur;if(state.local)fillMachineModels();markModels()}catch(e){}}
Expand Down
Loading