From 4f77a181424c569b152dbd4155a3309589f705d5 Mon Sep 17 00:00:00 2001 From: Moritz Warning Date: Fri, 12 Jun 2020 22:04:05 +0200 Subject: [PATCH] rename profiles.json to overview.json (#45) For the basic use case, the URLs in config.js are explicit file paths. For ASU, this is expected to be the base URL of the ASU API. --- README.md | 2 +- config.js | 8 ++++---- index.js | 6 +++++- misc/18.06.7/{profiles.json => overview.json} | 0 misc/19.07.1/{profiles.json => overview.json} | 0 misc/snapshot/{profiles.json => overview.json} | 0 6 files changed, 10 insertions(+), 6 deletions(-) rename misc/18.06.7/{profiles.json => overview.json} (100%) rename misc/19.07.1/{profiles.json => overview.json} (100%) rename misc/snapshot/{profiles.json => overview.json} (100%) diff --git a/README.md b/README.md index 268306b..48224a9 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ image`. A [Python script](misc/collect.py) is included to merge the JSON files: `./collect.py bin/ --url 'https://downloads.openwrt.org/releases/{version}/targets/{target}' > -profiles.json`. +overview.json`. For the OpenWrt 18.06 and 19.07 releases, you need to patch OpenWrt to output JSON files for collect.py (commit [openwrt/openwrt@881ed09](https://github.com/openwrt/openwrt/commit/881ed09ee6e23f6c224184bb7493253c4624fb9f)). diff --git a/config.js b/config.js index 475b625..6048dd6 100644 --- a/config.js +++ b/config.js @@ -3,11 +3,11 @@ var config = { language: 'en', // Show help text for images showHelp: true, - // Files to get data from + // Image overview file or path to the ASU API versions: { - 'SNAPSHOT': 'misc/snapshot', - '19.07.1': 'misc/19.07.1', - '18.06.7': 'misc/18.06.7' + 'SNAPSHOT': 'misc/snapshot/overview.json', + '19.07.1': 'misc/19.07.1/overview.json', + '18.06.7': 'misc/18.06.7/overview.json' }, // Build custom images // See https://github.com/aparcar/asu diff --git a/index.js b/index.js index 90a26c0..2f305be 100644 --- a/index.js +++ b/index.js @@ -392,7 +392,11 @@ function updateImages(version, code, date, model, url, mobj, is_custom) { function init() { var build_date = "unknown" setupSelectList($('versions'), Object.keys(config.versions), version => { - fetch(config.versions[version] + '/profiles.json') + var url = config.versions[version]; + if (config.asu_url) { + url += "/profiles.json"; + } + fetch(url) .then(obj => { build_date = obj.headers.get('last-modified'); return obj.json(); diff --git a/misc/18.06.7/profiles.json b/misc/18.06.7/overview.json similarity index 100% rename from misc/18.06.7/profiles.json rename to misc/18.06.7/overview.json diff --git a/misc/19.07.1/profiles.json b/misc/19.07.1/overview.json similarity index 100% rename from misc/19.07.1/profiles.json rename to misc/19.07.1/overview.json diff --git a/misc/snapshot/profiles.json b/misc/snapshot/overview.json similarity index 100% rename from misc/snapshot/profiles.json rename to misc/snapshot/overview.json -- 2.30.2