remove offline servers from dropdown
This commit is contained in:
parent
fab7cc3d38
commit
fc53c8e5f3
2 changed files with 3 additions and 3 deletions
|
@ -421,7 +421,7 @@ if (datalist) {
|
||||||
instancein.value = json[0].name;
|
instancein.value = json[0].name;
|
||||||
}
|
}
|
||||||
for (const instance of json) {
|
for (const instance of json) {
|
||||||
if (instance.display === false) {
|
if (instance.display === false || !instance.online) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const option = document.createElement("option");
|
const option = document.createElement("option");
|
||||||
|
|
|
@ -405,13 +405,13 @@ export {mobile, getBulkUsers,getBulkInfo,setTheme,Specialuser,getapiurls,adduser
|
||||||
const datalist=document.getElementById("instances");
|
const datalist=document.getElementById("instances");
|
||||||
console.warn(datalist);
|
console.warn(datalist);
|
||||||
if(datalist){
|
if(datalist){
|
||||||
fetch("/instances.json").then(_=>_.json()).then((json:{name:string,description?:string,src?:string,url?:string,display?:boolean,urls:{wellknown:string,api:string,cdn:string,gateway:string,login?:string}}[])=>{
|
fetch("/instances.json").then(_=>_.json()).then((json:{name:string,online:boolean,description?:string,src?:string,url?:string,display?:boolean,urls:{wellknown:string,api:string,cdn:string,gateway:string,login?:string}}[])=>{
|
||||||
console.warn(json);
|
console.warn(json);
|
||||||
if(instancein&&instancein.value===""){
|
if(instancein&&instancein.value===""){
|
||||||
instancein.value=json[0].name;
|
instancein.value=json[0].name;
|
||||||
}
|
}
|
||||||
for(const instance of json){
|
for(const instance of json){
|
||||||
if(instance.display===false){
|
if(instance.display===false||!instance.online){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const option=document.createElement("option");
|
const option=document.createElement("option");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue