Added ability to set config from settings

theme slide toggle is now in top right menu
This commit is contained in:
Isaac Grynsztein
2020-03-05 22:38:23 -05:00
parent e57839e8de
commit ae605d5f70
10 changed files with 273 additions and 8 deletions

View File

@@ -510,6 +510,20 @@ app.get('/api/config', function(req, res) {
});
});
app.post('/api/setConfig', function(req, res) {
let new_config_file = req.body.new_config_file;
if (new_config_file && new_config_file['YoutubeDLMaterial']) {
let success = config_api.setConfigFile(new_config_file);
res.send({
success: success
});
} else {
console.log('ERROR: Tried to save invalid config file!')
res.sendStatus(400);
}
});
app.get('/api/using-encryption', function(req, res) {
res.send(usingEncryption);
});

View File

@@ -109,5 +109,6 @@ module.exports = {
setConfigItem: setConfigItem,
setConfigItems: setConfigItems,
getConfigFile: getConfigFile,
setConfigFile: setConfigFile,
CONFIG_ITEMS: CONFIG_ITEMS
}