const cacheBuster = Math.floor(new Date().getTime() / (1000 * 60 * 5)); fetch("./data.json?cacheBuster=" + cacheBuster) .then((response) => response.json()) .then((data) => { const osList = ["linux", "darwin", "windows", "docker"]; const releases = data.releases; const osData = osList.map((os) => { const data = releases.map((release) => { const binaries = release.binaries.filter((binary) => { return binary.os === os; }); return { version: release.version, os: os, binaries, }; }); if (os === "darwin") { os = "macOS"; } return { os: os, stable: data.filter((release) => !release.version.includes("rc")), rc: data.filter((release) => release.version.includes("rc")), }; }); const stableTabContainer = document.getElementById("tab-container"); const rcTabContainer = document.getElementById("rc-tab-container"); const stableContainer = document.getElementById("stable-data"); const stableNoData = document.getElementById("stable-no-data"); const rcContainer = document.getElementById("rc-data"); const rcNoData = document.getElementById("rc-no-data"); if (osData) { let stableLength = 0; let rcLength = 0; osData.map((os) => { stableLength += os.stable.length; rcLength += os.rc.length; }); if (stableLength === 0) { stableContainer.style.display = "none"; stableNoData.style.display = "block"; } if (rcLength === 0) { rcContainer.style.display = "none"; rcNoData.style.display = "block"; } } osData.map((os, idx) => { const tabContent = document.createElement("div"); tabContent.setAttribute("id", os.os); tabContent.classList.add("tabcontent"); tabContent.setAttribute("data-type", "stable"); if (idx === 0) { tabContent.classList.add("active"); } let eventIdsToAdd = []; const html = os.stable.map((release, index) => { eventIdsToAdd.push(`${release.version}-${os.os}`); let cls = "panel"; if (index === 0) { cls += " panel-active"; } let als = "accordion"; if (index === 0) { als += " accordion-active"; } return `
Binary | Arch | File | Checksum | Tag |
---|---|---|---|---|
No binaries available | ||||
${binary.name} | ${binary.arch} | ${binary.file_name} | ${binary.checksum} | ${binary.tag} |