diff --git a/.gitignore b/.gitignore index c716661..ea70b69 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ node_modules .env *.log .DS_Store -Thumbs.db \ No newline at end of file +Thumbs.db +.vscode \ No newline at end of file diff --git a/wwwroot/main.js b/wwwroot/main.js index e6e15dc..23e6e36 100644 --- a/wwwroot/main.js +++ b/wwwroot/main.js @@ -17,17 +17,10 @@ function changeTitle(newTitle) { async function getModelsUrn() { try { - // const resp = await fetch("/api/theurn"); - // if (!resp.ok) { - // throw new Error(await resp.text()); - // } - // const data = await resp.json(); - // const urn = data.urn; - const resp1 = await fetch("/api/models"); + const resp1 = await fetch("/api/models"); // api call to get all available models const allmodels = await resp1.json(); - const resp2 = await fetch("/api/selectedmodel") + const resp2 = await fetch("/api/selectedmodel") // api call to get configured model name const selectModelName = await resp2.json(); - // const data2 = await resp2.json(); for (let i = 0; i < allmodels.length; i++){ if (allmodels[i].name == selectModelName.name){ console.log(allmodels[i].urn); @@ -35,12 +28,6 @@ async function getModelsUrn() { return allmodels[i].urn; } } - // const urns = models.map((model) => model.urn); - // const titles = models.map((model) => model.name); - // const randomIndex = Math.floor(Math.random() * urns.length); - // console.log(urns) - // changeTitle(titles[urnModelID]); - // return urn; } catch (err) { alert("Could not list models. See the console for more details."); console.error(err);