Add raw config editor to settings for advanced tweaking
This commit is contained in:
16
app.py
16
app.py
@@ -102,6 +102,22 @@ def save_settings():
|
||||
|
||||
return redirect(url_for('settings'))
|
||||
|
||||
@app.route('/save_raw_config', methods=['POST'])
|
||||
def save_raw_config():
|
||||
try:
|
||||
raw_data = request.form.get('raw_config')
|
||||
config_data = json.loads(raw_data)
|
||||
if config_mgr.save_config(config_data):
|
||||
flash('Konfiguration gespeichert. Miner Neustart erforderlich.', 'success')
|
||||
else:
|
||||
flash('Fehler beim Speichern der Datei.', 'danger')
|
||||
except json.JSONDecodeError:
|
||||
flash('Ungültiges JSON Format.', 'danger')
|
||||
except Exception as e:
|
||||
flash(f'Fehler: {str(e)}', 'danger')
|
||||
|
||||
return redirect(url_for('settings'))
|
||||
|
||||
@app.route('/control/restart')
|
||||
def restart_miner():
|
||||
# Attempt to restart via API first, if fails, might need system command
|
||||
|
||||
Reference in New Issue
Block a user