Closed aparcar closed 4 years ago
Having multiple release files on demand also allows to keep things small while supporting more and more releases, the single file approach eventually bloats up the initial data loading.
Thanks for the proposal.
A few things:
var config = {
// Default language, see i18n.js
language: 'en',
// Show help text for images
showHelp: true,
// File to get data from
"versions": {
"SNAPSHOT": "names-SNAPSHOT.json",
"19.07.1": "names-19.07.1.json"
}
};
The buttons can should have additional descriptions however better based on type not filename, don't you think?
I'm okay with the rest, are you up to do the async magic?
@aparcar I do not think the type field of the OpenWrt json output has enough information for this image selector yet. I would like to keep the heuristic for now.
Please have a look at the current state of the code and let me know if that is something we can continue on.
In fine with the current heuristic, I'm just caring about the data structure right now
I'm okay with the rest, are you up to do the async magic?
Here is the gist of it. Or what do you mean?
mkdir tmp
rsync -avm --include='*.json' --include='*/' --exclude='*' 'rsync://downloads.openwrt.org/downloads/snapshots/targets/' tmp/
This PR simplifies the code by using a data structure similar to the OpenWrt upstream files. Ideally OpenWrt offers at some point files similar to names-.json.
The missing bit is that multiple files files containing images of a release should be loaded, however always just the selected one and on demand, so not all JSON files if only the latest version is selected. I tried to implement this, however ended up in the callback hell (as I learned today) - so please don't hesitate helping me here.
I accidentally used an autoformat tool called
js-beautify
which changed parts of the code indention without changing its functionality, however as this is more a RFC than an actual PR I did not fixed it afterwards.Using this structure would also work together with the new image on demand service I'm working on0.
Signed-off-by: Paul Spooren mail@aparcar.org