Move low mem warning to status page

This commit is contained in:
Taylor Helsper 2021-03-11 22:47:16 -06:00
parent b8c437d937
commit 78b4252ce0
3 changed files with 13 additions and 8 deletions

View File

@ -616,8 +616,6 @@ def index():
"product_key_error": pk_error,
"fsck_error": has_fsck_error(),
"fsck_results": get_fsck_results(),
"oom_error": has_oom_error(),
"oom_info": get_oom_error_info(),
"sd_rw_error": has_sd_rw_error(),
"drive_usage": drive_usage,
"low_drive_space_error": low_drive_space_error,
@ -868,12 +866,6 @@ def page_clear_fsck_error():
clear_fsck_error()
return redirect("/")
@app.route("/clear-oom-error")
def page_clear_oom_error():
check_logged_in()
clear_oom_error()
return redirect("/")
@app.route("/login", methods=["GET","POST"])
def page_login():
templateData = {

View File

@ -85,6 +85,8 @@ def page_settings():
"date": date,
"local_ip": local_ip,
"throttled_data": get_throttled_data(),
"oom_error": has_oom_error(),
"oom_info": get_oom_error_info(),
"drive_usage": get_drive_usage(),
"cpu_usage": get_cpu_usage(),
"ram_usage": get_ram_usage(),
@ -256,6 +258,8 @@ def page_status():
"date": date,
"local_ip": local_ip,
"throttled_data": get_throttled_data(),
"oom_error": has_oom_error(),
"oom_info": get_oom_error_info(),
"drive_usage": get_drive_usage(),
"cpu_usage": get_cpu_usage(),
"ram_usage": get_ram_usage(),
@ -888,3 +892,10 @@ def modify_swap_page():
"ui_settings": read_ui_settings()
}
return render_template('reboot.html', **templateData)
@mynode_settings.route("/settings/clear-oom-error")
def page_clear_oom_error():
check_logged_in()
clear_oom_error()
flash("Warning Cleared", category="message")
return redirect("/settings")

View File

@ -27,6 +27,7 @@
{% endif %}
{% if oom_error %}
<!--
<div class="main_page_warning_block">
<center>
<p><b>Low Memory Warning</b><br/>Your device was running low on memory and a process has been killed. Please disable some applications and reboot the device.</p>
@ -34,6 +35,7 @@
<a href="/clear-oom-error" class="ui-button ui-widget ui-corner-all settings_button_small">OK</a>
</center>
</div>
-->
{% endif %}
{% if not has_changed_password %}