mirror of
https://github.com/navidrome/navidrome.git
synced 2025-08-10 00:52:20 +00:00
* Flatten config endpoint and improve About dialog * add config resource Signed-off-by: Deluan <deluan@navidrome.org> * fix(ui): replace `==` with `===` Signed-off-by: Deluan <deluan@navidrome.org> * feat(ui): add environment variables Signed-off-by: Deluan <deluan@navidrome.org> * feat(ui): add sensitive value redaction Signed-off-by: Deluan <deluan@navidrome.org> * feat(ui): more translations Signed-off-by: Deluan <deluan@navidrome.org> * address PR comments Signed-off-by: Deluan <deluan@navidrome.org> * feat(ui): add configuration export feature in About dialog Signed-off-by: Deluan <deluan@navidrome.org> * feat(ui): translate development flags section header Signed-off-by: Deluan <deluan@navidrome.org> * refactor Signed-off-by: Deluan <deluan@navidrome.org> * feat(api): refactor routes for keepalive and insights endpoints Signed-off-by: Deluan <deluan@navidrome.org> * lint Signed-off-by: Deluan <deluan@navidrome.org> * fix(ui): enhance string escaping in formatTomlValue function Updated the formatTomlValue function to properly escape backslashes in addition to quotes. Added new test cases to ensure correct handling of strings containing both backslashes and quotes. Signed-off-by: Deluan <deluan@navidrome.org> * feat(ui): adjust dialog size Signed-off-by: Deluan <deluan@navidrome.org> --------- Signed-off-by: Deluan <deluan@navidrome.org>
62 lines
1.5 KiB
JavaScript
62 lines
1.5 KiB
JavaScript
// These defaults are only used in development mode. When bundled in the app,
|
|
// the __APP_CONFIG__ object is dynamically filled by the ServeIndex function,
|
|
// in the /server/app/serve_index.go
|
|
const defaultConfig = {
|
|
version: 'dev',
|
|
firstTime: false,
|
|
baseURL: '',
|
|
variousArtistsId: '63sqASlAfjbGMuLP4JhnZU', // See consts.VariousArtistsID in consts.go
|
|
// Login backgrounds from https://unsplash.com/collections/1065384/music-wallpapers
|
|
loginBackgroundURL: 'https://source.unsplash.com/collection/1065384/1600x900',
|
|
maxSidebarPlaylists: 100,
|
|
enableTranscodingConfig: true,
|
|
enableDownloads: true,
|
|
enableFavourites: true,
|
|
losslessFormats: 'FLAC,WAV,ALAC,DSF',
|
|
welcomeMessage: '',
|
|
gaTrackingId: '',
|
|
devActivityPanel: true,
|
|
enableStarRating: true,
|
|
defaultTheme: 'Dark',
|
|
defaultLanguage: '',
|
|
defaultUIVolume: 100,
|
|
enableUserEditing: true,
|
|
enableSharing: true,
|
|
shareURL: '',
|
|
defaultDownloadableShare: true,
|
|
devSidebarPlaylists: true,
|
|
lastFMEnabled: true,
|
|
listenBrainzEnabled: true,
|
|
enableExternalServices: true,
|
|
enableCoverAnimation: true,
|
|
devShowArtistPage: true,
|
|
devUIShowConfig: true,
|
|
enableReplayGain: true,
|
|
defaultDownsamplingFormat: 'opus',
|
|
publicBaseUrl: '/share',
|
|
separator: '/',
|
|
enableInspect: true,
|
|
}
|
|
|
|
let config
|
|
|
|
try {
|
|
const appConfig = JSON.parse(window.__APP_CONFIG__)
|
|
config = {
|
|
...defaultConfig,
|
|
...appConfig,
|
|
}
|
|
} catch (e) {
|
|
config = defaultConfig
|
|
}
|
|
|
|
export let shareInfo
|
|
|
|
try {
|
|
shareInfo = JSON.parse(window.__SHARE_INFO__)
|
|
} catch (e) {
|
|
shareInfo = null
|
|
}
|
|
|
|
export default config
|