Show total RAM on settings page

This commit is contained in:
Taylor Helsper 2020-04-16 21:19:11 -05:00
parent d5a3e4bc00
commit dfd33190b4
3 changed files with 10 additions and 0 deletions

View File

@ -181,6 +181,10 @@ def get_device_type():
device = subprocess.check_output("mynode-get-device-type", shell=True) device = subprocess.check_output("mynode-get-device-type", shell=True)
return device return device
def get_device_ram():
ram = subprocess.check_output("free --giga | grep Mem | awk '{print $2}'", shell=True)
return ram
def get_local_ip(): def get_local_ip():
local_ip = "unknown" local_ip = "unknown"
try: try:

View File

@ -74,6 +74,7 @@ def page_settings():
changelog = get_device_changelog() changelog = get_device_changelog()
serial_number = get_device_serial() serial_number = get_device_serial()
device_type = get_device_type() device_type = get_device_type()
device_ram = get_device_ram()
product_key = get_product_key() product_key = get_product_key()
pk_skipped = skipped_product_key() pk_skipped = skipped_product_key()
pk_error = not is_valid_product_key() pk_error = not is_valid_product_key()
@ -141,6 +142,7 @@ def page_settings():
"upgrade_logs": get_recent_upgrade_logs(), "upgrade_logs": get_recent_upgrade_logs(),
"serial_number": serial_number, "serial_number": serial_number,
"device_type": device_type, "device_type": device_type,
"device_ram": device_ram,
"product_key": product_key, "product_key": product_key,
"product_key_skipped": pk_skipped, "product_key_skipped": pk_skipped,
"product_key_error": pk_error, "product_key_error": pk_error,

View File

@ -490,6 +490,10 @@
<td>Device Type</td> <td>Device Type</td>
<td style="padding-left: 20px;">{{device_type}}</td> <td style="padding-left: 20px;">{{device_type}}</td>
</tr> </tr>
<tr>
<td>Device RAM</td>
<td style="padding-left: 20px;">{{device_ram}} GB</td>
</tr>
<!-- <!--
<tr> <tr>
<td>Public IP</td> <td>Public IP</td>