You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat(ui): show loaded models in the index
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
* chore(ui): re-organize navbar
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
---------
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
if(!confirm(`Are you sure you want to stop "${modelName}"?`)){
378
+
return;
379
+
}
380
+
381
+
try{
382
+
constresponse=awaitfetch('/backend/shutdown',{
383
+
method: 'POST',
384
+
headers: {
385
+
'Content-Type': 'application/json',
386
+
},
387
+
body: JSON.stringify({model: modelName})
388
+
});
389
+
390
+
if(response.ok){
391
+
// Reload page after short delay to reflect changes
392
+
setTimeout(()=>{
393
+
window.location.reload();
394
+
},500);
395
+
}else{
396
+
alert('Failed to stop model');
397
+
}
398
+
}catch(error){
399
+
console.error('Error stopping model:',error);
400
+
alert('Failed to stop model');
401
+
}
402
+
}
403
+
404
+
// Stop all loaded models
405
+
asyncfunctionstopAllModels(component){
406
+
constloadedModelNamesStr='{{ $loadedModels := .LoadedModels }}{{ range .ModelsConfig }}{{ if index $loadedModels .Name }}{{.Name}},{{ end }}{{ end }}';
0 commit comments