-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert back to global defaults, clean up stores and rename config.json
- Loading branch information
Showing
11 changed files
with
51 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
/public/build/ | ||
/public/sw.js* | ||
/public/workbox-*.js* | ||
/public/config.json | ||
|
||
.DS_Store | ||
|
||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,39 @@ | ||
// DEFAULT configuration, can be (selectively) overwritten in /flood-for-transmission/public/config.json | ||
// Check /flood-for-transmission/public/config.json.defaults to get started | ||
const defaults = { | ||
DARK_MODE: 'auto', // String (enabled, disabled, auto) | ||
SWITCH_COLORS: false, // Boolean | ||
NOTATION_24H: true, // Boolean | ||
WRAP_HEADER: false, // Boolean | ||
COMMON_PATH: [], // Array of Strings | ||
COLUMNS: [ // Array of Strings in the order they should appear | ||
'Name', | ||
'Progress', | ||
'ETA', | ||
'Download Speed', | ||
'Upload Speed', | ||
'File Size', | ||
'Downloaded', | ||
'Uploaded', | ||
'Downloading from', | ||
'Seeding to' | ||
], | ||
SORT_COLUMN: 'Progress', // String | ||
SORT_DIRECTION: 'desc' // String (asc, desc) | ||
}; | ||
|
||
export default await fetch('./config.json') | ||
.then((res) => { | ||
return res.json(); | ||
if (res.ok) { | ||
return res.json(); | ||
} else { | ||
console.info('No config.json found, using default values:\nSee https://github.com/johman10/flood-for-transmission#beta-customization'); | ||
} | ||
}) | ||
.then((config) => { | ||
return config; | ||
return {...defaults, ...config}; | ||
}) | ||
.catch((e) => { | ||
console.error('Something went wrong while fetching config.json', e); | ||
return {}; | ||
return defaults; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters