diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-06-29 03:14:12 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-06-29 03:14:12 +0900 |
| commit | ae9ca7d56840d48a42119e67f8e91e7476f30ae3 (patch) | |
| tree | 4876625fd1a231719fcb639c01737e995202c1dd /static/js/releases.js | |
| parent | ae2ce608935993583304a0e1e6a301bf69ccc75b (diff) | |
static: replace install
Also get rid of many unused pages and assets.
Diffstat (limited to 'static/js/releases.js')
| -rw-r--r-- | static/js/releases.js | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/static/js/releases.js b/static/js/releases.js deleted file mode 100644 index 026cab33..00000000 --- a/static/js/releases.js +++ /dev/null @@ -1,49 +0,0 @@ -// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT - -const baseUrl = "https://releases.grapheneos.org/"; -const devices = ["comet", "komodo", "caiman", "tokay", "akita", "husky", "shiba", "felix", "tangorpro", "lynx", "cheetah", "panther", "bluejay", "raven", "oriole", "barbet", "redfin", "bramble", "sunfish", "coral", "flame"]; -const legacyFactoryDevices = new Set(["sunfish", "coral", "flame"]); -const channels = ["stable", "beta", "alpha"]; -const delayMs = 1000 * 60 * 5; - -async function updateReleases() { - const requests = []; - - for (const channel of channels) { - for (const device of devices) { - requests.push(fetch(`${baseUrl}${device}-${channel}`).then(response => { - if (!response.ok) { - return Promise.reject(); - } - return response.text(); - }).then(text => { - const metadata = text.trim().split(" "); - - const factoryFormat = legacyFactoryDevices.has(device) ? "factory" : "install"; - const factoryFilename = `${device}-${factoryFormat}-${metadata[0]}.zip`; - const factoryUrl = baseUrl + factoryFilename; - - const updateFilename = `${device}-ota_update-${metadata[0]}.zip`; - const updateUrl = baseUrl + updateFilename; - - const release = document.getElementById(`${device}-${channel}`); - const links = release.querySelectorAll("a, span"); - - links[0].textContent = metadata[0]; - if (links[0].nodeName == "A") { - links[0].setAttribute("href", "#" + metadata[0]); - } - links[1].setAttribute("href", factoryUrl); - links[2].setAttribute("href", factoryUrl + ".sig"); - links[3].setAttribute("href", updateUrl); - })); - } - } - - await Promise.allSettled(requests); - setTimeout(updateReleases, delayMs); -} - -setTimeout(updateReleases, delayMs); - -// @license-end |
