2021-12-29 22:33:07 +00:00
|
|
|
import { _get, _post, _delete } from "../../ts/modules/common.js";
|
|
|
|
import { unstableSect } from "./main.js";
|
|
|
|
|
|
|
|
const urlBase = "https://builds.hrfee.pw/repo/hrfee/jfa-go/latest/file/";
|
|
|
|
const categories = {
|
|
|
|
"Windows (Tray)": {
|
|
|
|
"x64": "Windows"
|
|
|
|
},
|
|
|
|
"Linux (Tray)": {
|
|
|
|
"x64": "TrayIcon_Linux_x86_64.zip"
|
|
|
|
},
|
|
|
|
"Linux": {
|
|
|
|
"x64": "Linux_x86_64.zip",
|
|
|
|
"ARM (32-bit)": "Linux_arm.zip",
|
|
|
|
"ARM (64-bit)": "Linux_arm64.zip"
|
|
|
|
},
|
|
|
|
"macOS": {
|
|
|
|
"x64": "macOS_x86_64",
|
|
|
|
"ARM": "macOS_arm64"
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
export const loadBuilds = () => {
|
|
|
|
for (let buildName in categories) {
|
|
|
|
if (Object.keys(categories[buildName]).length == 1) {
|
|
|
|
const button = document.createElement("a") as HTMLAnchorElement;
|
2022-01-04 21:13:09 +00:00
|
|
|
button.classList.add("button", "~info", "mr-2", "mb-2", "lang-link");
|
2021-12-29 22:33:07 +00:00
|
|
|
button.target = "_blank";
|
|
|
|
button.textContent = buildName.toLowerCase();
|
|
|
|
button.href = urlBase + categories[buildName][Object.keys(categories[buildName])[0]];
|
|
|
|
unstableSect.querySelector(".row.col.flex.center").appendChild(button);
|
|
|
|
} else {
|
|
|
|
const dropdown = document.createElement("span") as HTMLSpanElement;
|
|
|
|
dropdown.tabIndex = 0;
|
|
|
|
dropdown.classList.add("dropdown");
|
|
|
|
let innerHTML = `
|
2022-01-04 21:13:09 +00:00
|
|
|
<span class="button ~info mr-2 mb-2 lang-link">
|
2021-12-29 22:33:07 +00:00
|
|
|
${buildName.toLowerCase()}
|
2022-01-04 21:13:09 +00:00
|
|
|
<span class="ml-2 chev"></span>
|
2021-12-29 22:33:07 +00:00
|
|
|
</span>
|
|
|
|
<div class="dropdown-display above">
|
2022-01-04 21:13:09 +00:00
|
|
|
<div class="card @low">
|
2021-12-29 22:33:07 +00:00
|
|
|
`;
|
|
|
|
for (let arch in categories[buildName]) {
|
|
|
|
innerHTML += `
|
2022-01-04 21:13:09 +00:00
|
|
|
<a href="${urlBase + categories[buildName][arch]}" target="_blank" class="button input ~neutral field mb-2 lang-link">${arch}</a>
|
2021-12-29 22:33:07 +00:00
|
|
|
`;
|
|
|
|
}
|
|
|
|
innerHTML += `
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
`;
|
|
|
|
dropdown.innerHTML = innerHTML;
|
|
|
|
unstableSect.querySelector(".row.col.flex.center").appendChild(dropdown);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|