From ea386d76d0b3ff4d453c4db8ed035804a70a8afa Mon Sep 17 00:00:00 2001 From: Terrtia Date: Wed, 10 Mar 2021 13:01:30 +0100 Subject: [PATCH] chg: [UI] add update note --- var/www/blueprints/root.py | 11 +++-- var/www/modules/dashboard/Flask_dashboard.py | 3 ++ .../modules/dashboard/templates/index.html | 10 ++--- .../settings/templates/settings_index.html | 2 + var/www/templates/dashboard/update_modal.html | 42 +++++++++++++++++++ 5 files changed, 59 insertions(+), 9 deletions(-) create mode 100644 var/www/templates/dashboard/update_modal.html diff --git a/var/www/blueprints/root.py b/var/www/blueprints/root.py index 2c69be46..9e9a62da 100644 --- a/var/www/blueprints/root.py +++ b/var/www/blueprints/root.py @@ -74,10 +74,13 @@ def login(): if user.request_password_change(): return redirect(url_for('root.change_password')) else: - if next_page and next_page!='None': + # update note + # next page + if next_page and next_page!='None' and next_page!='/': return redirect(next_page) + # dashboard else: - return redirect(url_for('dashboard.index')) + return redirect(url_for('dashboard.index', update_note=True)) # login failed else: # set brute force protection @@ -113,7 +116,9 @@ def change_password(): if check_password_strength(password1): user_id = current_user.get_id() create_user_db(user_id , password1, update=True) - return redirect(url_for('dashboard.index')) + # update Note + # dashboard + return redirect(url_for('dashboard.index', update_note=True)) else: error = 'Incorrect password' return render_template("change_password.html", error=error) diff --git a/var/www/modules/dashboard/Flask_dashboard.py b/var/www/modules/dashboard/Flask_dashboard.py index d57c4e67..7ba7b165 100644 --- a/var/www/modules/dashboard/Flask_dashboard.py +++ b/var/www/modules/dashboard/Flask_dashboard.py @@ -155,6 +155,8 @@ def stuff(): @login_required @login_read_only def index(): + update_note = request.args.get('update_note') + default_minute = config_loader.get_config_str("Flask", "minute_processed_paste") threshold_stucked_module = config_loader.get_config_int("Module_ModuleInformation", "threshold_stucked_module") log_select = {10, 25, 50, 100} @@ -176,6 +178,7 @@ def index(): return render_template("index.html", default_minute = default_minute, threshold_stucked_module=threshold_stucked_module, log_select=log_select, selected=max_dashboard_logs, update_warning_message=update_warning_message, update_in_progress=update_in_progress, + update_note=update_note, update_warning_message_notice_me=update_warning_message_notice_me) # ========= REGISTRATION ========= diff --git a/var/www/modules/dashboard/templates/index.html b/var/www/modules/dashboard/templates/index.html index 5d40df1c..19f86147 100644 --- a/var/www/modules/dashboard/templates/index.html +++ b/var/www/modules/dashboard/templates/index.html @@ -72,12 +72,10 @@ {%endif%} - + + {%if update_note%} + {% include 'dashboard/update_modal.html' %} + {%endif%}
diff --git a/var/www/modules/settings/templates/settings_index.html b/var/www/modules/settings/templates/settings_index.html index fd608a64..d03343c7 100644 --- a/var/www/modules/settings/templates/settings_index.html +++ b/var/www/modules/settings/templates/settings_index.html @@ -29,6 +29,8 @@
+ {% include 'dashboard/update_modal.html' %} +
AIL-framework Status :
diff --git a/var/www/templates/dashboard/update_modal.html b/var/www/templates/dashboard/update_modal.html new file mode 100644 index 00000000..54bee18e --- /dev/null +++ b/var/www/templates/dashboard/update_modal.html @@ -0,0 +1,42 @@ + + + + +