gitignore updated
This commit is contained in:
parent
13685c9976
commit
d84777c2bb
2 changed files with 4 additions and 16 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -3,3 +3,4 @@ node_modules
|
||||||
*.log
|
*.log
|
||||||
.DS_Store
|
.DS_Store
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
|
.vscode
|
|
@ -17,17 +17,10 @@ function changeTitle(newTitle) {
|
||||||
|
|
||||||
async function getModelsUrn() {
|
async function getModelsUrn() {
|
||||||
try {
|
try {
|
||||||
// const resp = await fetch("/api/theurn");
|
const resp1 = await fetch("/api/models"); // api call to get all available models
|
||||||
// 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 allmodels = await resp1.json();
|
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 selectModelName = await resp2.json();
|
||||||
// const data2 = await resp2.json();
|
|
||||||
for (let i = 0; i < allmodels.length; i++){
|
for (let i = 0; i < allmodels.length; i++){
|
||||||
if (allmodels[i].name == selectModelName.name){
|
if (allmodels[i].name == selectModelName.name){
|
||||||
console.log(allmodels[i].urn);
|
console.log(allmodels[i].urn);
|
||||||
|
@ -35,12 +28,6 @@ async function getModelsUrn() {
|
||||||
return allmodels[i].urn;
|
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) {
|
} catch (err) {
|
||||||
alert("Could not list models. See the console for more details.");
|
alert("Could not list models. See the console for more details.");
|
||||||
console.error(err);
|
console.error(err);
|
||||||
|
|
Loading…
Reference in a new issue