diff --git a/README.md b/README.md index ccf8397..25be4c3 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# OpenWrt Firmware Selector Wizard [![codecov](https://codecov.io/gh/sudhanshu16/openwrt-firmware-selector/branch/master/graph/badge.svg?token=F26634D0PG)](https://codecov.io/gh/sudhanshu16/openwrt-firmware-selector) +# OpenWrt Firmware Selector [![codecov](https://codecov.io/gh/sudhanshu16/openwrt-firmware-selector/branch/master/graph/badge.svg?token=F26634D0PG)](https://codecov.io/gh/sudhanshu16/openwrt-firmware-selector) A simple OpenWrt firmware selector using autocompletion. @@ -16,6 +16,19 @@ You can set it up easily: 2. Use [yarn](https://yarnpkg.com/en/) to install package dependencies `yarn install` 3. Run `scripts/collect.py` to generate required JSON files. + + Format: + + ```sh + ./scripts/collect.py --image-url + ``` + + Example: + + ```sh + ./scripts/collect.py --image-url 'https://downloads.openwrt.org/{base}/{target}' https://downloads.openwrt.org ./src ./public/ + ``` + 4. Use the following command to start a dev server: `yarn start` diff --git a/public/index.html b/public/index.html index f9fc5e8..926e49e 100644 --- a/public/index.html +++ b/public/index.html @@ -21,7 +21,7 @@ work correctly both with client-side routing and a non-root public URL. Learn how to configure a non-root public URL by running `npm run build`. --> - OpenWrt Firmware Selector Wizard + OpenWrt Firmware Selector diff --git a/scripts/collect.py b/scripts/collect.py index 4282993..da62f88 100755 --- a/scripts/collect.py +++ b/scripts/collect.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 """ Tool to create overview.json files and update the config.ts. +source: https://github.com/mwarning/openwrt-firmware-selector """ from pathlib import Path @@ -153,7 +154,7 @@ def write_data(releases, args): """ Scrape profiles.json using wget (slower but more generic). Merge into overview.json files. -Update config.json. +Update config.ts. """ @@ -194,7 +195,7 @@ def scrape(args): """ Scan a local directory for releases with profiles.json. Merge into overview.json files. -Update config.json. +Update config.ts. """ diff --git a/src/App.scss b/src/App.scss index cfd0d6c..3c46d66 100644 --- a/src/App.scss +++ b/src/App.scss @@ -52,6 +52,12 @@ background-color: #f3f3f3; } + code { + max-height: 300px; + overflow: auto; + width: 100%; + } + .std-textarea { width: 100%; border-radius: 5px; diff --git a/src/config.ts b/src/config.ts index d91b15a..1942f85 100644 --- a/src/config.ts +++ b/src/config.ts @@ -5,7 +5,11 @@ const config = { show_help: true, // Path to overview.json file or URL to the ASU API - versions: { '19.07.7': 'data/19.07.7', SNAPSHOT: 'data/SNAPSHOT' }, + versions: { + '19.07.7': 'data/19.07.7', + '21.02.0-rc1': 'data/21.02.0-rc1', + SNAPSHOT: 'data/SNAPSHOT', + }, // Pre-selected version (optional) default_version: '19.07.7', diff --git a/src/containers/home/components/ProfileDetails.tsx b/src/containers/home/components/ProfileDetails.tsx index 41abfb9..df1c3a9 100644 --- a/src/containers/home/components/ProfileDetails.tsx +++ b/src/containers/home/components/ProfileDetails.tsx @@ -98,7 +98,7 @@ const ProfileDetails: FunctionComponent = ({ selectedVersion, selectedPro if (!profileData) { const response = await axios.get( `${process.env.PUBLIC_URL}/data/${selectedVersion}` + - `/${selectedProfile.target}/${selectedProfile.id}.json` + `/${selectedProfile.target}/${selectedProfile.id}.json?t=${new Date().getTime()}` ); profileData = response.data; profilesData[selectedProfile.id] = profileData; @@ -460,6 +460,19 @@ const ProfileDetails: FunctionComponent = ({ selectedVersion, selectedPro

+ + }>Manifest + + + {Object.keys(buildResponse.manifest).map((e) => ( + <> + {e}: {buildResponse.manifest[e]} +
+ + ))} +
+
+
}>Stderr diff --git a/src/containers/home/components/ProfileSearch.tsx b/src/containers/home/components/ProfileSearch.tsx index b4777b4..ce0f3e4 100644 --- a/src/containers/home/components/ProfileSearch.tsx +++ b/src/containers/home/components/ProfileSearch.tsx @@ -30,7 +30,9 @@ const ProfileSearch: FunctionComponent = ({ selectedVersion, onProfileCha toggleWorking(true); if (!overview) { - const overviewPath = `${process.env.PUBLIC_URL}/data/${selectedVersion}/overview.json`; + const overviewPath = `${ + process.env.PUBLIC_URL + }/data/${selectedVersion}/overview.json?t=${new Date().getTime()}`; const response = await Axios.get(overviewPath); overview = response.data; overviewData[selectedVersion] = overview;