reuse existing template for releases
This commit is contained in:
parent
01b879af95
commit
2427ea0db6
@ -283,6 +283,6 @@
|
|||||||
<a href="https://github.com/GrapheneOS">GitHub</a>
|
<a href="https://github.com/GrapheneOS">GitHub</a>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
<script src="/releases.js?4"></script>
|
<script src="/releases.js?5"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -13,28 +13,6 @@ function createLink(href, text) {
|
|||||||
return link;
|
return link;
|
||||||
}
|
}
|
||||||
|
|
||||||
function deviceModel(device) {
|
|
||||||
if (device === "crosshatch") {
|
|
||||||
return "Pixel 3 XL";
|
|
||||||
}
|
|
||||||
if (device === "blueline") {
|
|
||||||
return "Pixel 3";
|
|
||||||
}
|
|
||||||
if (device === "taimen") {
|
|
||||||
return "Pixel 2 XL";
|
|
||||||
}
|
|
||||||
if (device === "walleye") {
|
|
||||||
return "Pixel 2";
|
|
||||||
}
|
|
||||||
if (device === "marlin") {
|
|
||||||
return "Pixel XL (legacy)";
|
|
||||||
}
|
|
||||||
if (device === "sailfish") {
|
|
||||||
return "Pixel (legacy)";
|
|
||||||
}
|
|
||||||
return device;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const channel of channels) {
|
for (const channel of channels) {
|
||||||
for (const device of devices) {
|
for (const device of devices) {
|
||||||
fetch(baseUrl + device + "-" + channel).then(response => {
|
fetch(baseUrl + device + "-" + channel).then(response => {
|
||||||
@ -51,13 +29,7 @@ for (const channel of channels) {
|
|||||||
const updateFilename = device + "-ota_update-" + metadata[0] + ".zip";
|
const updateFilename = device + "-ota_update-" + metadata[0] + ".zip";
|
||||||
const updateUrl = baseUrl + updateFilename;
|
const updateUrl = baseUrl + updateFilename;
|
||||||
|
|
||||||
const model = deviceModel(device);
|
const release = document.getElementById(device + "-" + channel);
|
||||||
|
|
||||||
const release = document.createElement("div");
|
|
||||||
|
|
||||||
const header = document.createElement("h3");
|
|
||||||
header.appendChild(document.createTextNode(model));
|
|
||||||
release.appendChild(header);
|
|
||||||
|
|
||||||
const tag = metadata[2] + "." + metadata[0];
|
const tag = metadata[2] + "." + metadata[0];
|
||||||
const version = document.createElement("p");
|
const version = document.createElement("p");
|
||||||
@ -67,16 +39,13 @@ for (const channel of channels) {
|
|||||||
version.appendChild(document.createTextNode("Version: "));
|
version.appendChild(document.createTextNode("Version: "));
|
||||||
version.appendChild(createLink(versionBaseUrl + tag, tag));
|
version.appendChild(createLink(versionBaseUrl + tag, tag));
|
||||||
}
|
}
|
||||||
release.appendChild(version);
|
release.replaceChild(version, release.getElementsByTagName("p")[0]);
|
||||||
|
|
||||||
release.appendChild(createLink(factoryUrl, factoryFilename));
|
const links = release.getElementsByTagName("a");
|
||||||
release.appendChild(document.createElement("br"));
|
|
||||||
release.appendChild(createLink(factoryUrl + ".sig", factoryFilename + ".sig"));
|
|
||||||
release.appendChild(document.createElement("br"));
|
|
||||||
release.appendChild(createLink(updateUrl, updateFilename));
|
|
||||||
|
|
||||||
const div = document.getElementById(device + "-" + channel);
|
release.replaceChild(createLink(factoryUrl, factoryFilename), links[1]);
|
||||||
div.parentNode.replaceChild(release, div);
|
release.replaceChild(createLink(factoryUrl + ".sig", factoryFilename + ".sig"), links[2]);
|
||||||
|
release.replaceChild(createLink(updateUrl, updateFilename), links[3]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user