Development
This commit is contained in:
parent
9f1b4a9119
commit
8eec61a1df
8 changed files with 697 additions and 56 deletions
|
|
@ -45,12 +45,12 @@ def options_save():
|
|||
return redirect(f'/{_PAGE}')
|
||||
|
||||
cfg = load_config()
|
||||
before = copy.deepcopy(cfg.get('free_radius', {}).get('options', {}))
|
||||
before = copy.deepcopy(cfg.get('radius', {}).get('options', {}))
|
||||
after = {'mac_format': mac_format, 'apply_to': apply_to}
|
||||
cfg.setdefault('free_radius', {})['options'] = after
|
||||
cfg.setdefault('radius', {})['options'] = after
|
||||
|
||||
changes = diff_fields(before, after)
|
||||
flash(record_group(cfg, 'free_radius.options', 'setting', 'free_radius', changes, 'core apply'), 'success')
|
||||
flash(record_group(cfg, 'radius.options', 'setting', 'radius', changes, 'core apply'), 'success')
|
||||
return redirect(f'/{_PAGE}')
|
||||
|
||||
|
||||
|
|
@ -64,12 +64,12 @@ def logging_save():
|
|||
logging = 'logging' in request.form
|
||||
|
||||
cfg = load_config()
|
||||
before = copy.deepcopy(cfg.get('free_radius', {}).get('general', {}))
|
||||
before = copy.deepcopy(cfg.get('radius', {}).get('general', {}))
|
||||
after = {'logging': logging, 'log_max_kb': log_max_kb}
|
||||
cfg.setdefault('free_radius', {})['general'] = after
|
||||
cfg.setdefault('radius', {})['general'] = after
|
||||
|
||||
changes = diff_fields(before, after)
|
||||
flash(record_group(cfg, 'free_radius.general', 'setting', 'free_radius', changes, 'core apply'), 'success')
|
||||
flash(record_group(cfg, 'radius.general', 'setting', 'radius', changes, 'core apply'), 'success')
|
||||
return redirect(f'/{_PAGE}')
|
||||
|
||||
|
||||
|
|
@ -97,7 +97,7 @@ def logging_download():
|
|||
def api_log_tail():
|
||||
try:
|
||||
cfg = load_config()
|
||||
log_max_kb = cfg.get('free_radius', {}).get('general', {}).get('log_max_kb', 1024)
|
||||
log_max_kb = cfg.get('radius', {}).get('general', {}).get('log_max_kb', 1024)
|
||||
size_kb = os.path.getsize(RADIUS_LOG_FILE) / 1024
|
||||
with open(RADIUS_LOG_FILE) as f:
|
||||
lines = f.readlines()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue