UI improvement
This commit is contained in:
parent
575edc836d
commit
9a272ee959
16 changed files with 2477 additions and 1604 deletions
|
|
@ -6,19 +6,13 @@ import sanitize
|
|||
bp = Blueprint('action_apply_general', __name__)
|
||||
|
||||
|
||||
|
||||
@bp.route('/action/apply_general', methods=['POST'])
|
||||
@require_level('administrator')
|
||||
def apply_general():
|
||||
wan_interface = sanitize.interface_name(request.form.get('wan_interface', ''))
|
||||
log_max_kb_raw = request.form.get('log_max_kb', '').strip()
|
||||
log_errors_only = 'log_errors_only' in request.form
|
||||
dnsmasq_log_queries = 'dnsmasq_log_queries' in request.form
|
||||
daily_execute_time = sanitize.time_24h(request.form.get('daily_execute_time_24hr_local', ''))
|
||||
|
||||
if not wan_interface:
|
||||
flash('WAN Interface is required.', 'error')
|
||||
return redirect('/view/view_general')
|
||||
log_max_kb_raw = request.form.get('log_max_kb', '').strip()
|
||||
log_errors_only = 'log_errors_only' in request.form
|
||||
dnsmasq_log_queries = 'dnsmasq_log_queries' in request.form
|
||||
daily_execute_time = sanitize.time_24h(request.form.get('daily_execute_time_24hr_local', ''))
|
||||
|
||||
try:
|
||||
log_max_kb = int(log_max_kb_raw)
|
||||
|
|
@ -34,10 +28,9 @@ def apply_general():
|
|||
|
||||
core = load_core()
|
||||
core.setdefault('general', {}).update({
|
||||
'wan_interface': wan_interface,
|
||||
'log_max_kb': log_max_kb,
|
||||
'log_errors_only': log_errors_only,
|
||||
'dnsmasq_log_queries': dnsmasq_log_queries,
|
||||
'log_max_kb': log_max_kb,
|
||||
'log_errors_only': log_errors_only,
|
||||
'dnsmasq_log_queries': dnsmasq_log_queries,
|
||||
'daily_execute_time_24hr_local': daily_execute_time,
|
||||
})
|
||||
save_core(core)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue