mirror of
https://github.com/lordfriky/web-cfw-loader.git
synced 2024-12-27 23:51:55 +00:00
I think this should be better
This commit is contained in:
parent
9fb2ccedce
commit
d2584ae653
26
main.js
26
main.js
@ -20,21 +20,23 @@ async function getPayloadList(){
|
|||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const payloadSelect = document.getElementById("payloadSelect");
|
const payloadSelect = document.getElementById("payloadSelect");
|
||||||
|
let payloadList;
|
||||||
try {
|
try {
|
||||||
const payloadList = await getPayloadList();
|
payloadList = await getPayloadList();
|
||||||
|
|
||||||
payloadList.forEach((payload) => {
|
|
||||||
const payloadOption = document.createElement("option");
|
|
||||||
|
|
||||||
payloadOption.value = payload.path;
|
|
||||||
payloadOption.innerHTML = payload.name + " " + payload.version;
|
|
||||||
|
|
||||||
payloadSelect.appendChild(payloadOption);
|
|
||||||
});
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logOutput("There was a problem retreiving the payload list. HTTP error code: " + error)
|
logOutput("There was a problem retreiving the payload list. Error: " + error);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
payloadList.forEach((payload) => {
|
||||||
|
const payloadOption = document.createElement("option");
|
||||||
|
|
||||||
|
payloadOption.value = payload.path;
|
||||||
|
payloadOption.innerHTML = payload.name + " " + payload.version;
|
||||||
|
|
||||||
|
payloadSelect.appendChild(payloadOption);
|
||||||
|
});
|
||||||
|
|
||||||
})()
|
})()
|
||||||
|
|
||||||
async function getPayload(payloadSrc){
|
async function getPayload(payloadSrc){
|
||||||
@ -191,7 +193,7 @@ document.getElementById("goButton").addEventListener("click", async () => {
|
|||||||
try {
|
try {
|
||||||
payload = new Uint8Array(await getPayload(payloadPath));
|
payload = new Uint8Array(await getPayload(payloadPath));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logOutput("There was a problem retreiving the payload. HTTP error code: " + error)
|
logOutput("There was a problem retreiving the payload. Error: " + error)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user