diff options
author | Moritz Warning <moritzwarning@web.de> | 2021-08-17 00:36:25 +0300 |
---|---|---|
committer | Paul Spooren <mail@aparcar.org> | 2021-08-23 01:08:43 +0300 |
commit | 6abd5536f00600be8af68b3b9377703d63d93594 (patch) | |
tree | f01dffaebd7758251193039feddaab9a2b0ce6d4 | |
parent | 8847f5e45b44ea8cae63e4d41440f17e3a7972bf (diff) |
asu: remove attended sysupgradev3.5.0
Remove as this feature is not supported anymore.
Signed-off-by: Moritz Warning <moritzwarning@web.de>
-rw-r--r-- | www/config.js | 6 | ||||
-rw-r--r-- | www/index.css | 44 | ||||
-rw-r--r-- | www/index.html | 19 | ||||
-rw-r--r-- | www/index.js | 131 | ||||
-rw-r--r-- | www/spinner.gif | bin | 1786 -> 0 bytes |
5 files changed, 2 insertions, 198 deletions
diff --git a/www/config.js b/www/config.js index e32c56b..688af4c 100644 --- a/www/config.js +++ b/www/config.js @@ -4,7 +4,7 @@ var config = { // Show help text for images show_help: true, - // Path to overview.json file or URL to the ASU API + // Path to were overview.json can be found versions: { "18.06.9": "../misc/18.06.9/", "19.07.5": "../misc/19.07.5", @@ -19,8 +19,4 @@ var config = { // Info link URL (optional) info_url: "https://openwrt.org/start?do=search&id=toh&q={title} @toh", - - // Build custom images (optional) - // See https://github.com/aparcar/asu - //asu_url: 'https://chef.libremesh.org' }; diff --git a/www/index.css b/www/index.css index 79e2cd9..82f0dd3 100644 --- a/www/index.css +++ b/www/index.css @@ -230,50 +230,6 @@ header > div { display: none; } -#custom textarea { - width: 100%; - height: 10em; - font-size: 1.5em; - display: block; -} - -/* Customize - */ -#custom h3::after { - content: "\002B"; - font-weight: bold; - margin-left: 0.2em; -} - -/* Customize + */ -#custom h3.active::after { - content: "\2212"; - font-weight: bold; - margin-left: 0.2em; -} - -#custom a :first-child { - margin-right: 0.625em; - margin-top: 0em; - font-size: 1.6em; -} - -#custom a { - text-decoration: none; - border-radius: 0.25em; - padding: 0.6em; - margin: 0.3em; - font-size: inherit; - cursor: pointer; - letter-spacing: 0.05em; - display: inline-flex; - align-items: center; - box-shadow: 0em 0.06em 0.3em 0em rgba(0, 0, 0, 0.2), - 0em 0.125em 0.125em 0em rgba(0, 0, 0, 0.14), - 0em 0.19em 0.06em -0.125em rgba(0, 0, 0, 0.12); - color: #fff; - background-color: #00a3e1; -} - .download-help { margin-top: 0.5em; } diff --git a/www/index.html b/www/index.html index 78293f3..54be6f1 100644 --- a/www/index.html +++ b/www/index.html @@ -66,25 +66,6 @@ </div> <div id="images" class="hide"> - <div id="custom" class="hide"> - <h3 class="tr-customize" onclick="javascript:toggleCustomize();"> - Customize - </h3> - <div class="hide"> - <div class="autocomplete"> - <textarea - id="packages" - spellcheck="false" - autocapitalize="off" - ></textarea> - </div> - <a href="javascript:buildAsuRequest()" class="custom-link"> - <span>⚙</span - ><span class="tr-request-build">Request Build</span> - </a> - </div> - </div> - <!-- static information about the selected build --> <div> <h3 id="build-title" class="tr-version-build">About this build</h3> diff --git a/www/index.js b/www/index.js index 908516b..356ae59 100644 --- a/www/index.js +++ b/www/index.js @@ -1,6 +1,5 @@ /* global translations, config */ -/* exported buildAsuRequest, init */ - +/* exported init */ let current_device = {}; let current_language = "en"; let url_params = undefined; @@ -42,83 +41,6 @@ function getModelTitles(titles) { }); } -function buildAsuRequest() { - if (!current_device || !current_device.id) { - alert("bad profile"); - return; - } - - function showStatus(message, url) { - show("#buildstatus"); - const tr = message.startsWith("tr-") ? message : ""; - if (url) { - $("#buildstatus").innerHTML = - '<a href="' + url + '" class="' + tr + '">' + message + "</a>"; - } else { - $("#buildstatus").innerHTML = '<span class="' + tr + '"></span>'; - } - translate(); - } - - // hide image view - updateImages(); - - hide("#notfound"); - show("#buildspinner"); - showStatus("tr-request-image"); - - const request_data = { - target: current_device.target, - profile: current_device.id, - packages: split($("#packages").value), - version: $("#versions").value, - }; - - fetch(config.asu_url + "/api/build", { - method: "POST", - cache: "no-cache", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify(request_data), - }) - .then((response) => { - switch (response.status) { - case 200: - hide("#buildspinner"); - showStatus("tr-build-successful"); - - response.json().then((mobj) => { - const image_url = config.asu_url + "/store/" + mobj.bin_dir; - showStatus("tr-build-successful", image_url + "/buildlog.txt"); - mobj["id"] = current_device.id; - updateImages(mobj, { image_url: image_url }, true); - }); - break; - case 202: - showStatus("tr-check-again"); - setTimeout(() => { - buildAsuRequest(); - }, 5000); - break; - case 400: // bad request - case 422: // bad package - case 500: // build failed - hide("#buildspinner"); - response.json().then((mobj) => { - const message = mobj["message"] || "tr-build-failed"; - const url = mobj.buildlog - ? config.asu_url + "/store/" + mobj.bin_dir + "/buildlog.txt" - : undefined; - showStatus(message, url); - }); - break; - } - }) - .catch((err) => { - hide("#buildspinner"); - showStatus(err); - }); -} - function setupSelectList(select, items, onselection) { for (const item of items.sort().reverse()) { const option = document.createElement("OPTION"); @@ -310,45 +232,6 @@ function setupAutocompleteList(input, items, as_list, onbegin, onend) { } } -// for attended sysupgrade -function updatePackageList(mobj) { - // set available packages - fetch( - config.asu_url + - "/" + - config.versions[mobj.version_number] + - "/" + - mobj.target + - "/index.json", - { cache: "no-cache" } - ) - .then((response) => response.json()) - .then((packages) => { - const all_packages = packages.concat( - mobj.default_packages.map((e) => "-" + e), - mobj.device_packages.map((e) => "-" + e) - ); - - setupAutocompleteList( - $("#packages"), - all_packages, - true, - () => {}, - (textarea) => { - textarea.value = split(textarea.value) - // make list unique, ignore minus prefix - .filter((value, index, self) => { - const i = self.indexOf(value.replace(/^[-]/, "")); - return i === index || i < 0; - }) - // limit to available packages - .filter((value) => all_packages.indexOf(value) !== -1) - .join(" "); - } - ); - }); -} - function setValue(query, value) { const e = $(query); if (value !== undefined && value.length > 0) { @@ -522,10 +405,6 @@ function updateImages(mobj, overview, is_custom) { $("#download-links").appendChild(a); } - if (config.asu_url) { - updatePackageList(mobj); - } - // set current selection in URL history.pushState( null, @@ -595,10 +474,6 @@ function init() { setupSelectList($("#versions"), Object.keys(config.versions), (version) => { // A new version was selected let base_url = config.versions[version]; - if (config.asu_url) { - base_url = config.asu_url + "/" + base_url; - } - fetch(base_url + "/overview.json", { cache: "no-cache" }) .then((obj) => { return obj.json(); @@ -669,10 +544,6 @@ function init() { }); }); - if (config.asu_url) { - show("#custom"); - } - // hide fields updateImages(); diff --git a/www/spinner.gif b/www/spinner.gif Binary files differdeleted file mode 100644 index 7154314..0000000 --- a/www/spinner.gif +++ /dev/null |