Add warning for subnet conflicts

This commit is contained in:
Taylor Helsper 2022-04-10 23:34:38 -05:00
parent a0319a02ed
commit b27ad0ccf2
3 changed files with 14 additions and 1 deletions

View File

@ -363,6 +363,12 @@ def get_local_ip():
return local_ip
def get_local_ip_subnet_conflict():
ip = get_local_ip()
if ip.startswith("172."):
return True
return False
def get_device_changelog():
changelog = ""
try:

View File

@ -99,6 +99,7 @@ def page_settings():
"uptime": uptime,
"date": date,
"local_ip": local_ip,
"local_ip_subnet_conflit": get_local_ip_subnet_conflict(),
"throttled_data": get_throttled_data(),
"oom_error": has_oom_error(),
"oom_info": get_oom_error_info(),
@ -289,6 +290,7 @@ def page_status():
"uptime": uptime,
"date": date,
"local_ip": local_ip,
"local_ip_subnet_conflit": get_local_ip_subnet_conflict(),
"throttled_data": get_throttled_data(),
"oom_error": has_oom_error(),
"oom_info": get_oom_error_info(),

View File

@ -34,7 +34,12 @@
</tr>
<tr>
<th>Local IP</th>
<td>{{local_ip}}</td>
<td>
{{local_ip}}
{% if local_ip_subnet_conflit %}
<br/><span style="color: red; font-size: 10px;">*Your IP address may conflict with internal subnets and cause issues</span>
{% endif %}
</td>
</tr>
{% if throttled_data['RAW_DATA'] != "0x0" and throttled_data['RAW_DATA'] != "MISSING" %}
{% if throttled_data['UNDERVOLTED'] or throttled_data['CAPPED'] or throttled_data['THROTTLED'] or throttled_data['SOFT_TEMPLIMIT'] %}