2023-08-25 11:54:14 +02:00
|
|
|
function addline(ligne){
|
|
|
|
var lplus = parseInt(ligne) + 1;
|
|
|
|
document.getElementById("table").insertRow(lplus).insertCell(0).innerHTML = '<input type="file" id="file' + lplus + '" name="file' + lplus + '" onchange="addline(' + lplus + ')">'
|
2023-08-25 12:06:52 +02:00
|
|
|
}
|
|
|
|
|
2023-08-26 13:17:57 +02:00
|
|
|
function change_discord(value, data, len) {
|
|
|
|
if (value == len){
|
2023-08-25 12:06:52 +02:00
|
|
|
document.getElementById("name").value = "";
|
|
|
|
document.getElementById("submit").value = "Create !";
|
|
|
|
document.getElementById("successT").checked = false;
|
|
|
|
document.getElementById("errorsT").checked = false;
|
|
|
|
document.getElementById("successL").value = "";
|
|
|
|
document.getElementById("errorsL").value = "";
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
console.log(data[parseInt(value)]["successL"]);
|
|
|
|
document.getElementById("submit").value = "Update";
|
|
|
|
document.getElementById("successT").checked = data[parseInt(value)]["successT"] == "True";
|
|
|
|
document.getElementById("errorsT").checked = data[parseInt(value)]["errorsT"] == "True";
|
|
|
|
document.getElementById("successL").value = data[parseInt(value)]["successL"];
|
|
|
|
document.getElementById("errorsL").value = data[parseInt(value)]["errorsL"];
|
|
|
|
document.getElementById("name").value = data[parseInt(value)]["name"];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-09-27 19:59:48 +02:00
|
|
|
function delay(ms) {
|
|
|
|
return new Promise(resolve => setTimeout(resolve, ms));
|
|
|
|
}
|
|
|
|
|
2023-08-26 13:17:57 +02:00
|
|
|
function change_config(value, data, len) {
|
2023-09-10 11:02:15 +02:00
|
|
|
console.log(data[2]);
|
2023-08-25 12:06:52 +02:00
|
|
|
document.getElementById("delete").style.visibility = "hidden";
|
2023-08-26 13:17:57 +02:00
|
|
|
if (value == len){
|
2023-08-25 12:06:52 +02:00
|
|
|
document.getElementById("submit").value = "Create !";
|
|
|
|
document.getElementById("discord").value = "-1";
|
|
|
|
document.getElementById("proxy").value = "-1";
|
|
|
|
document.getElementById("name").value = "";
|
|
|
|
for (let i = 1; i < 6; i++) {
|
|
|
|
document.getElementById("mail"+ i).value = "";
|
|
|
|
document.getElementById("pwd"+ i).value = "" ;
|
|
|
|
document.getElementById("2fa"+ i).value = "" ;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
document.getElementById("delete").style.visibility = "visible";
|
|
|
|
document.getElementById("submit").value = "Update !";
|
|
|
|
document.getElementById("discord").value = data[parseInt(value)]["discord"];
|
|
|
|
document.getElementById("proxy").value = data[parseInt(value)]["proxy"];
|
|
|
|
document.getElementById("name").value = data[parseInt(value)]["name"];
|
|
|
|
for (let i = 1; i < 6; i++) {
|
|
|
|
document.getElementById("mail"+ i).value = data[parseInt(value)]['accounts'][i]["mail"] ;
|
|
|
|
document.getElementById("pwd"+ i).value = data[parseInt(value)]['accounts'][i]["pwd"] ;
|
|
|
|
document.getElementById("2fa"+ i).value = data[parseInt(value)]['accounts'][i]["2fa"] ;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-26 13:17:57 +02:00
|
|
|
function change_proxy(value, data, len) {
|
|
|
|
if (value == len){
|
2023-08-25 12:06:52 +02:00
|
|
|
document.getElementById("submit").value = "Create";
|
|
|
|
document.getElementById("address").value = "";
|
|
|
|
document.getElementById("port").value = "";
|
|
|
|
document.getElementById("name").value = "";
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
document.getElementById("submit").value = "Update";
|
|
|
|
document.getElementById("address").value = data[parseInt(value)]["address"];
|
|
|
|
document.getElementById("port").value = data[parseInt(value)]["port"];
|
|
|
|
document.getElementById("name").value = data[parseInt(value)]["name"];
|
|
|
|
}
|
2023-08-25 15:23:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function change_logs(value) {
|
2023-09-27 11:30:50 +02:00
|
|
|
var myIframe = document.getElementById('embed');
|
2023-09-27 12:15:08 +02:00
|
|
|
myIframe.addEventListener("load", function() {
|
2023-09-27 11:30:50 +02:00
|
|
|
let doc = myIframe.contentDocument;
|
|
|
|
doc.body.innerHTML = doc.body.innerHTML + '<style>html{color:white;}</style>';
|
2023-09-27 11:34:47 +02:00
|
|
|
myIframe.contentWindow.scrollTo(0, myIframe.contentDocument.body.scrollHeight);
|
2023-09-27 11:30:50 +02:00
|
|
|
});
|
|
|
|
myIframe.src = "/static/logs/" + value + ".txt";
|
|
|
|
|
|
|
|
|
2023-08-25 15:23:33 +02:00
|
|
|
}
|