diff options
author | kaotisk <kaotisk@arching-kaos.org> | 2024-12-03 15:21:23 +0200 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.org> | 2024-12-03 15:21:23 +0200 |
commit | 8dd45fe02ef44fae11bee385d6d226c471b99d26 (patch) | |
tree | 85d67f2e318dd0f8244565f11fc8969b2d1867c6 /src/js | |
parent | a9a97d9495b67258c2eeab196ce860a010cff466 (diff) | |
download | arching-kaos-web-ui-8dd45fe02ef44fae11bee385d6d226c471b99d26.tar.gz arching-kaos-web-ui-8dd45fe02ef44fae11bee385d6d226c471b99d26.tar.bz2 arching-kaos-web-ui-8dd45fe02ef44fae11bee385d6d226c471b99d26.zip |
Load radio api address from settings
Diffstat (limited to 'src/js')
-rw-r--r-- | src/js/arching-kaos-web-ui-settings.js | 9 | ||||
-rw-r--r-- | src/js/radio-emulator.js | 10 |
2 files changed, 15 insertions, 4 deletions
diff --git a/src/js/arching-kaos-web-ui-settings.js b/src/js/arching-kaos-web-ui-settings.js index ddee8f8..1277eea 100644 --- a/src/js/arching-kaos-web-ui-settings.js +++ b/src/js/arching-kaos-web-ui-settings.js @@ -80,6 +80,14 @@ var default_settings = { ], active: 1 }, + radio: { + list: [ + 'http://127.0.0.1:8010', + 'http://api.radio.z.kaotisk-hund.com', + 'https://api.radio.arching-kaos.com' + ], + active: 2 + }, scan: false } }; @@ -111,6 +119,7 @@ if (( location.origin === "http://z.kaotisk-hund.com") || ( location.origin === "http://[fc59:6076:6299:6776:c13d:fbb2:1226:ead0]")) { settings.ipfs.gateway.active = 1; settings.stellar.horizon.active = 1; + settings.ak.radio.active = 1; } else if ( location.origin === "http://localhost:3000" ) { settings.ipfs.gateway.active = 2; } else { diff --git a/src/js/radio-emulator.js b/src/js/radio-emulator.js index 0926d2a..9c9d27e 100644 --- a/src/js/radio-emulator.js +++ b/src/js/radio-emulator.js @@ -30,14 +30,16 @@ // - show_info // import { makeElement } from "./arching-kaos-generator.js"; +import { getSettings } from "./arching-kaos-web-ui-settings.js"; import { generateImage } from "./image-generator.js"; var debugMode = false; -const apiURL = "http://z.kaotisk-hund.com:8010/"; +const settings = getSettings(); +const apiURL = settings.ak.radio.list[settings.ak.radio.active]; const version = "v0"; -const listRequest = `${apiURL}${version}/list` -const jsonRequest = `${apiURL}${version}/application/json/` -const audioRequest = `${apiURL}${version}/audio/ogg/` +const listRequest = `${apiURL}/${version}/list` +const jsonRequest = `${apiURL}/${version}/application/json/` +const audioRequest = `${apiURL}/${version}/audio/ogg/` const documentTitle = "Radio Station Emulator"; const separator = " :: "; |