Development
This commit is contained in:
parent
3ee1a6f0de
commit
73d2df6be5
3 changed files with 86 additions and 97 deletions
|
|
@ -2,7 +2,7 @@ from flask import Blueprint, request, redirect, flash, session
|
|||
from auth import require_level
|
||||
from config_utils import (flush_pending_to_queue, get_dashboard_pending,
|
||||
revert_snapshot_to_config, queued_msg,
|
||||
_is_locked, _format_timing, _seconds_until_next_run)
|
||||
_timing_status_msg)
|
||||
|
||||
bp = Blueprint('action_actions', __name__)
|
||||
|
||||
|
|
@ -24,22 +24,7 @@ def actions_cardpending_applynow():
|
|||
flash('No pending changes to apply.', 'info')
|
||||
return redirect(_VIEW)
|
||||
flush_pending_to_queue()
|
||||
if _is_locked():
|
||||
msg = 'Changes queued. They are being applied now.'
|
||||
else:
|
||||
timing = _format_timing(_seconds_until_next_run())
|
||||
if timing:
|
||||
msg = f'Changes queued. They will be applied {timing}.'
|
||||
else:
|
||||
msg = 'Changes queued. The processing service is not running.'
|
||||
flash(msg, 'success')
|
||||
return redirect(_VIEW)
|
||||
|
||||
|
||||
@bp.route('/action/queue_core_apply', methods=['POST'])
|
||||
@require_level('administrator')
|
||||
def queue_core_apply():
|
||||
flash(queued_msg('core apply', action_label='Apply queued'), 'success')
|
||||
flash(_timing_status_msg(None, 'Changes queued'), 'success')
|
||||
return redirect(_VIEW)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue