arc/docs/custom.html
AuxXxilium 778fa948fd Revert "custom: disable build"
This reverts commit b86d54e19c.
2024-10-06 20:48:58 +02:00

354 lines
15 KiB
HTML

<!DOCTYPE html>
<html lang="en-US" data-color-mode="auto" data-light-theme="light" data-dark-theme="dark"
data-a11y-animated-images="system">
<head>
<meta charset="utf-8" />
<link rel="dns-prefetch" href="https://github.githubassets.com" />
<link rel="dns-prefetch" href="https://avatars.githubusercontent.com" />
<link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com" />
<link rel="dns-prefetch" href="https://user-images.githubusercontent.com/" />
<link rel="preconnect" href="https://github.githubassets.com" crossorigin />
<link rel="preconnect" href="https://avatars.githubusercontent.com" />
<link crossorigin="anonymous" media="all" rel="stylesheet"
href="https://github.githubassets.com/assets/light-0eace2597ca3.css" />
<link crossorigin="anonymous" media="all" rel="stylesheet"
href="https://github.githubassets.com/assets/dark-a167e256da9c.css" />
<link crossorigin="anonymous" media="all" rel="stylesheet"
href="https://github.githubassets.com/assets/primer-711f412bb361.css" />
<link crossorigin="anonymous" media="all" rel="stylesheet"
href="https://github.githubassets.com/assets/global-78704364aaba.css" />
<style>
select,
.input-style {
width: 100%;
}
.textarea-style {
width: 100%;
}
a {
color: #ff0000;
text-decoration: none;
}
.State--merged {
background-color: #ff0000;
}
.btn-primary {
background-color: #333333;
}
.btn-primary:disabled {
background-color: #111111;
}
.btn:disabled {
background-color: #111111;
}
</style>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="https://polyfill.io/v3/polyfill.min.js"></script>
<!-- <script src="https://fastly.jsdelivr.net/npm/marked/marked.min.js"></script> -->
<script type="application/javascript">
var repo = "AuxXxilium/arc"
var _models = {};
var _addons = {};
var _pats = {};
function httpGetAsync(theUrl, callback) {
let xmlHttpReq = new XMLHttpRequest();
xmlHttpReq.onreadystatechange = function () {
if (xmlHttpReq.readyState == 4 && xmlHttpReq.status == 200)
callback(xmlHttpReq.responseText);
};
xmlHttpReq.open("GET", theUrl, true); // true for asynchronous
xmlHttpReq.send(null);
}
window.onload = function () {
init();
}
function init() {
httpGetAsync("https://raw.githubusercontent.com/AuxXxilium/arc/page/docs/models.json", function (result) {
_models = JSON.parse(result);
httpGetAsync("https://raw.githubusercontent.com/AuxXxilium/arc/page/docs/pats.json", function (result) {
_pats = JSON.parse(result);
httpGetAsync("https://raw.githubusercontent.com/AuxXxilium/arc/page/docs/addons.json", function (result) {
_addons = JSON.parse(result);
$("#model").on("change", changeModel);
$("#version").on("change", changeVersion);
$("#kernel").on("change", changeKernel);
$('#addons').val("acpid,cpuinfo,powersched");
setModels();
});
});
});
}
function setModels() {
var models = [];
for (var P in _models) {
models = models.concat(_models[P]["models"]);
}
$("#model")[0].options.length = 0;
for (var i = 0; i < models.length; i++) {
var model = models[i];
$("#model").append(`<option value="${model}">${model}</option>`);
}
changeModel();
}
function changeModel() {
model = $("#model").val();
var versions = [];
if (model in _pats) {
versions = Object.keys(_pats[model]);
versions.sort((a, b) => b.localeCompare(a))
}
$("#version")[0].options.length = 0;
for (var i = 0; i < versions.length; i++) {
var version = versions[i];
$("#version").append(`<option value="${version}">${version}</option>`);
}
changeproductsimage();
changeVersion();
}
function changeproductsimage() {
//var model = $("#model").val().replace("#","").replace("+","plus");
//$('#products').html(`<img src="https://www.synology.cn/img/products/detail/${model}/heading.png" width="20%">`);
var model = $("#model").val().replace("#", "").replace("+", "%2B");
$('#products').html(`<img src="https://www.synology.com/api/products/getPhoto?product=${model}&type=img_s&sort=0" width="30%">`);
}
function changeVersion() {
createAddonsBtn();
changeKernel();
}
function createAddonsBtn() {
var extstr = $('#addons').val().split(",");
var idx = 1;
var html = `<div class="form-group-body" id="addons_btns">`;
var selectedModel = $("#model").val();
var platform = null;
// Parse models.json to get the platform for the selected model
$.getJSON('models.json', function(modelsData) {
for (var key in modelsData) {
if (modelsData[key].models.includes(selectedModel)) {
platform = key;
break;
}
}
// Parse addons.json to generate buttons
$.getJSON('addons.json', function(addonsData) {
for (var ext in addonsData) {
// Skip system addons
if (addonsData[ext]["system"] == true) {
continue;
}
var dispar = "";
if (!addonsData[ext][platform]) {
dispar = "disabled";
}
var par = "";
if (extstr.includes(ext)) {
par = "btn-danger";
}
html += `<button type="button" class="btn btn-primary btn-sm mt-2 ${par}" id="btn_${ext}" ${par} ${dispar} onclick="return onclickext('addons', '${ext}')" autofocus="" title="${addonsData[ext]["description"]}">${ext}</button>&nbsp;`;
}
html += `</div>`;
$('#addons_btns').html(html);
});
});
}
function changeKernel() {
var model = $("#model").val();
var version = $("#version").val().split(".").slice(0, 2).join(".");
var kernel = $("#kernel").val();
if (model == "SA6400" && version == "7.2") {
$("#kernel_item").show();
} else {
$("#kernel_item").hide();
}
}
function onclickext(type, ext) {
var btnobj = $("#btn_" + ext);
var extstr = $('#' + type).val().split(",");
if (btnobj.hasClass("btn-danger")) {
extstr.map((val, i) => {
if (val === ext) {
extstr.splice(i, 1);
}
});
btnobj.removeClass("btn-danger");
} else {
btnobj.addClass("btn-danger");
extstr.push(ext);
}
extstr.map((val, i) => {
if (val === "") {
extstr.splice(i, 1);
}
});
$('#' + type).val(extstr.join(","));
}
function createIssues() {
var form = document.getElementById("inputs");
let formData = new FormData(form);
var title = "custom";
var body = {};
var _parameters = ["title", "format", "model", "version", "kernel", "addons"];
for (var key in _parameters) {
var name = _parameters[key];
if ($("#" + name).is(":hidden")) { continue; }
if (name == "title") {
if ($("#" + name).val()) {
title += " " + $("#" + name).val();
} else {
title += " " + new Date().toISOString().substr(0, 10);
}
continue;
}
if ($("#" + name).val()) {
body[name] = $("#" + name).val();
}
}
body = JSON.stringify(body).replace(/\+/g, "%2b");
window.location.href = `https://github.com/${repo}/issues/new?assignees=&labels=custom&projects=&template=custom_build.md&title=${title}&body=${body}`;
}
</script>
<title>Arc Loader - Custom</title>
</head>
<body class="logged-in env-production page-responsive" style="word-wrap: break-word">
<div class="application-main left-0 text-left p-3 mx-auto container-xl px-3 px-md-4 px-lg-5 mt-4">
<pre id="logo">
<img src="https://raw.githubusercontent.com/AuxXxilium/arc/page/docs/arc_loader.png" width="60%" style="margin-left: 100px; margin-right: 100px;">
</pre>
<div class="image" id="products" style="height: 70px; margin-left: 35%;">
<img src="https://www.synology.com/img/products/detail/SA6400/heading.png" width="30%">
</div>
<div class="form-group mt-1 mb-2 ">
<div class="form-group-header">
<p>&nbsp;</p>
</div>
<div class="form-group-body">
<p>&nbsp;</p>
</div>
<div class="form-group-body">
<p>&nbsp;</p>
</div>
</div>
<div class="form-group mt-1 mb-2 ">
<div class="form-group-header">
<label class="color-fg-default text-mono f4">Build is based on <img alt="GitHub Release" src="https://img.shields.io/github/v/release/AuxXxilium/arc?display_name=release&style=flat-square"></label>
</div>
<div class="form-group-body">
<label class="color-fg-default text-mono f4">You should only use custom Builds, if you don't have physical access or online connection for destination device.<br />
Custom builds are not stable everytime and have limited features!<br />
To get full features and options, use <a href="https://github.com/AuxXxilium/arc">Arc Loader</a>. Please check the <a href="https://auxxxilium.tech/wiki" target="_blank">Wiki</a> before you start a build.</label>
</div>
<div class="form-group-body">
<p>&nbsp;</p>
</div>
</div>
<div class="form-group mt-1 mb-2" id="title_item">
<div class="form-group-header">
<label class="color-fg-default text-mono f5">Title:</label>
</div>
<div class="form-group-body">
<input class="form-control input-contrast input-sm" type="text" id="title" name="inputs[title]"
value="" />
</div>
</div>
<div class="form-group mt-1 mb-2" id="format_item">
<div class="form-group-header">
<label class="color-fg-default text-mono f5">Format:</label>
</div>
<div class="form-group-body">
<select class="form-select form-control select-sm input-contrast" id="format" name="inputs[format]"
value="">
<option selected="selected" value="img">img</option>
<option value="dyn">vmdk-dyn</option>
<option value="flat">vmdk-flat</option>
<option value="vhdx">vhdx</option>
</select>
</div>
</div>
<div class="form-group mt-1 mb-2" id="model_item">
<div class="form-group-header">
<label class="color-fg-default text-mono f5">Model: <a href="https://auxxxilium.tech/wiki/arc-loader-arc-loader/modell-plattform-auswaehlen/" target="_blank">More Information</a></label>
</div>
<div class="form-group-body">
<select class="form-select form-control select-sm input-contrast" id="model" name="inputs[model]"
value="">
<option selected="selected" value="SA6400">SA6400</option>
</select>
</div>
</div>
<div class="form-group mt-1 mb-2" id="version_item">
<div class="form-group-header">
<label class="color-fg-default text-mono f5">Version:</label>
</div>
<div class="form-group-body">
<select class="form-select form-control select-sm input-contrast" id="version" name="inputs[version]"
value="">
<option selected="selected" value="7.2">7.2</option>
</select>
</div>
</div>
<div class="form-group mt-1 mb-2" id="kernel_item">
<div class="form-group-header">
<label class="color-fg-default text-mono f5">Kernel: (only "custom" supports Hyper-V)</label>
</div>
<div class="form-group-body">
<select class="form-select form-control select-sm input-contrast" id="kernel" name="inputs[kernel]"
value="">
<option selected="selected" value="official">official</option>
<option value="custom">custom</option>
</select>
</div>
</div>
<div class="form-group mt-1 mb-2" id="addons_item">
<div class="form-group-header">
<label class="color-fg-default text-mono f5">Addons: <a href="https://auxxxilium.tech/wiki/arc-loader-arc-loader/addons/" target="_blank">More Information</a></label>
</div>
<div class="form-group-body">
<textarea class="textarea-style input-contrast input-sm" type="text" id="addons" name="inputs[addons]"
disabled></textarea>
<div class="form-group-body" id="addons_btns">
</div>
</div>
</div>
<div class="form-group-body">
<p>&nbsp;</p>
</div>
<div data-replace-remote-form-target="" class="workflow-dispatch">
<form id="inputs">
<button type="button" class="btn State--merged" onclick="return createIssues()" autofocus="">
Start Build
</button>
</form>
</div>
</div>
<footer class="footer width-full container-xl mt-3 text-center color-fg-muted">
<a aria-label="AuxXxilium" title="GitHub" class="footer-octicon mr-2" href="https://github.com/AuxXxilium">
<img class="avatar rounded-2 avatar-user" src="https://avatars.githubusercontent.com/u/67025065?v=4"
width="40" height="40" alt="AuxXxilium" />
</a>
<span>Copyright © 2024 by <a href="https://github.com/AuxXxilium">AuxXxilium</a><br>&nbsp;</span>
</footer>
</body>
</html>