Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -38,15 +38,16 @@ def update_system_info():
|
|
| 38 |
disk_used_gb = disk_info.used / (1024 ** 3)
|
| 39 |
disk_total_gb = disk_info.total / (1024 ** 3)
|
| 40 |
|
| 41 |
-
system_info_placeholder.
|
| 42 |
-
system_info_placeholder.
|
| 43 |
-
system_info_placeholder.
|
| 44 |
|
| 45 |
# Initial system information update
|
| 46 |
update_system_info()
|
| 47 |
|
| 48 |
-
#
|
| 49 |
-
st.
|
|
|
|
| 50 |
|
| 51 |
if st.button("Download"):
|
| 52 |
with st.spinner("Downloading... Please wait."):
|
|
@@ -79,3 +80,9 @@ if st.button("Download"):
|
|
| 79 |
st.error("Download failed. Please check the URL and try again.")
|
| 80 |
except Exception as e:
|
| 81 |
st.error(f"An error occurred: {str(e)}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
disk_used_gb = disk_info.used / (1024 ** 3)
|
| 39 |
disk_total_gb = disk_info.total / (1024 ** 3)
|
| 40 |
|
| 41 |
+
system_info_placeholder.markdown("## Server Information")
|
| 42 |
+
system_info_placeholder.markdown(f"**RAM Usage:** {ram_info.percent}% used ({ram_used_gb:.2f} GB of {ram_total_gb:.2f} GB)")
|
| 43 |
+
system_info_placeholder.markdown(f"**Disk Usage:** {disk_info.percent}% used ({disk_used_gb:.2f} GB of {disk_total_gb:.2f} GB)")
|
| 44 |
|
| 45 |
# Initial system information update
|
| 46 |
update_system_info()
|
| 47 |
|
| 48 |
+
# Button to update system information
|
| 49 |
+
if st.button("Update System Information"):
|
| 50 |
+
update_system_info()
|
| 51 |
|
| 52 |
if st.button("Download"):
|
| 53 |
with st.spinner("Downloading... Please wait."):
|
|
|
|
| 80 |
st.error("Download failed. Please check the URL and try again.")
|
| 81 |
except Exception as e:
|
| 82 |
st.error(f"An error occurred: {str(e)}")
|
| 83 |
+
|
| 84 |
+
# Periodically update the system information
|
| 85 |
+
while True:
|
| 86 |
+
update_system_info()
|
| 87 |
+
time.sleep(5)
|
| 88 |
+
st.experimental_rerun()
|