mirror of
https://git.netzspielplatz.de/docker-multiarch/openwrt-firmware-selector.git
synced 2025-11-09 01:49:35 +00:00
Add prettier support
Add prettier and bind it with eslint. Also add pre-commit hook to prettify before commit Signed-off-by: Sudhanshu Gautam <me@sudhanshug.com>
This commit is contained in:
parent
3f46d13ccf
commit
ce4d2e1436
13 changed files with 776 additions and 468 deletions
|
|
@ -1,32 +1,44 @@
|
|||
import axios from 'axios';
|
||||
|
||||
const base_downloads = 'https://cors-anywhere.herokuapp.com/https://aparcar.stephen304.com/download/json-demo/openwrt/';
|
||||
const base_api = 'https://cors-anywhere.herokuapp.com/https://aparcar.stephen304.com/api/';
|
||||
const base_downloads =
|
||||
'https://cors-anywhere.herokuapp.com/https://aparcar.stephen304.com/download/json-demo/openwrt/';
|
||||
const base_api =
|
||||
'https://cors-anywhere.herokuapp.com/https://aparcar.stephen304.com/api/';
|
||||
|
||||
class DataService {
|
||||
|
||||
getVersions = () => axios.get(base_downloads + 'versions.json');
|
||||
|
||||
getOverview = (path) => axios.get(base_downloads + path + '/overview.json');
|
||||
|
||||
getDeviceData = (device_path) => axios.get(base_downloads + device_path);
|
||||
getOverview = path => axios.get(base_downloads + path + '/overview.json');
|
||||
|
||||
getDevicePackages = (version, target, profile) => axios.get(base_api + 'packages_image?distro=openwrt&version=' + version.toLowerCase() + '&target=' + target + '&profile=' + profile.toLowerCase());
|
||||
getDeviceData = device_path => axios.get(base_downloads + device_path);
|
||||
|
||||
buildImage = (board, packages, target, version) => axios.post(base_api + 'build-request', {
|
||||
profile: board,
|
||||
board,
|
||||
defaults: '',
|
||||
distro: 'openwrt',
|
||||
packages,
|
||||
target,
|
||||
version,
|
||||
});
|
||||
getDevicePackages = (version, target, profile) =>
|
||||
axios.get(
|
||||
base_api +
|
||||
'packages_image?distro=openwrt&version=' +
|
||||
version.toLowerCase() +
|
||||
'&target=' +
|
||||
target +
|
||||
'&profile=' +
|
||||
profile.toLowerCase()
|
||||
);
|
||||
|
||||
buildStatusCheck = (request_hash) => axios.get(base_api + 'build-request/' + request_hash);
|
||||
buildImage = (board, packages, target, version) =>
|
||||
axios.post(base_api + 'build-request', {
|
||||
profile: board,
|
||||
board,
|
||||
defaults: '',
|
||||
distro: 'openwrt',
|
||||
packages,
|
||||
target,
|
||||
version,
|
||||
});
|
||||
|
||||
getFiles = (files_url) => axios.get('https://chef.libremesh.org' + files_url).then(res => res.data);
|
||||
buildStatusCheck = request_hash =>
|
||||
axios.get(base_api + 'build-request/' + request_hash);
|
||||
|
||||
getFiles = files_url =>
|
||||
axios.get('https://chef.libremesh.org' + files_url).then(res => res.data);
|
||||
}
|
||||
|
||||
export default DataService;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue