refac: frontend

This commit is contained in:
Timothy Jaeryang Baek
2024-11-15 02:05:43 -08:00
parent 2ab5b2fd71
commit d9dc04f1a1
20 changed files with 1340 additions and 1407 deletions
+4 -2
View File
@@ -211,10 +211,12 @@ export const getOllamaVersion = async (token: string, urlIdx?: number) => {
return res?.version ?? false;
};
export const getOllamaModels = async (token: string = '') => {
export const getOllamaModels = async (token: string = '', urlIdx: null|number = null) => {
let error = null;
const res = await fetch(`${OLLAMA_API_BASE_URL}/api/tags`, {
const res = await fetch(`${OLLAMA_API_BASE_URL}/api/tags${
urlIdx !== null ? `/${urlIdx}` : ''
}`, {
method: 'GET',
headers: {
Accept: 'application/json',