2026-05-17 03:26:01 -04:00
|
|
|
from flask import Blueprint, redirect, flash
|
|
|
|
|
from auth import require_level
|
2026-05-24 00:47:43 -04:00
|
|
|
from config_utils import CONFIGS_DIR
|
2026-05-17 03:26:01 -04:00
|
|
|
|
|
|
|
|
bp = Blueprint('action_clear_ddns_log', __name__)
|
|
|
|
|
|
2026-05-24 00:47:43 -04:00
|
|
|
LOG_FILE = f'{CONFIGS_DIR}/ddns.log'
|
2026-05-17 03:26:01 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
@bp.route('/action/clear_ddns_log', methods=['POST'])
|
|
|
|
|
@require_level('administrator')
|
|
|
|
|
def clear_ddns_log():
|
|
|
|
|
try:
|
|
|
|
|
open(LOG_FILE, 'w').close()
|
|
|
|
|
flash('DDNS log cleared.', 'success')
|
|
|
|
|
except Exception as ex:
|
|
|
|
|
flash(f'Could not clear log: {ex}', 'error')
|
|
|
|
|
return redirect('/view/view_ddns')
|