mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
added --remote not allowing navigation outside of the model folder for custom models.
added a delete custom models option (will not delete models outside of the models directory, nor will it delete non-model directories)
This commit is contained in:
@@ -1017,6 +1017,14 @@ function buildLoadModelList(ar, menu, breadcrumbs) {
|
||||
$("#loadmodellistbreadcrumbs").append("<hr size='1'>")
|
||||
}
|
||||
for(i=0; i<ar.length; i++) {
|
||||
if (Array.isArray(ar[i][0])) {
|
||||
full_path = ar[i][0][0];
|
||||
folder = ar[i][0][1];
|
||||
} else {
|
||||
full_path = "";
|
||||
folder = ar[i][0];
|
||||
}
|
||||
|
||||
var html
|
||||
html = "<div class=\"flex\">\
|
||||
<div class=\"loadlistpadding\"></div>"
|
||||
@@ -1027,13 +1035,14 @@ function buildLoadModelList(ar, menu, breadcrumbs) {
|
||||
//this is a model
|
||||
html = html + "<div class=\"loadlistpadding\"></div>"
|
||||
}
|
||||
if (Array.isArray(ar[i][0])) {
|
||||
full_path = ar[i][0][0];
|
||||
folder = ar[i][0][1];
|
||||
|
||||
//now let's do the delete icon if applicable
|
||||
if (['NeoCustom', 'GPT2Custom'].includes(menu) && !ar[i][3]) {
|
||||
html = html + "<span class=\"loadlisticon loadmodellisticon-folder oi oi-x allowed\" aria-hidden=\"true\" onclick='if(confirm(\"This will delete the selected folder with all contents. Are you sure?\")) { socket.send({\"cmd\": \"delete_model\", \"data\": \""+full_path.replaceAll("\\", "\\\\")+"\", \"menu\": \""+menu+"\"});}'></span>"
|
||||
} else {
|
||||
full_path = "";
|
||||
folder = ar[i][0];
|
||||
html = html + "<div class=\"loadlistpadding\"></div>"
|
||||
}
|
||||
|
||||
html = html + "<div class=\"loadlistpadding\"></div>\
|
||||
<div class=\"loadlistitem\" id=\"loadmodel"+i+"\" name=\""+ar[i][1]+"\" pretty_name=\""+full_path+"\">\
|
||||
<div>"+folder+"</div>\
|
||||
|
Reference in New Issue
Block a user