Spaces:
Paused
Paused
Update app.py
Browse files37 unmodified lines38394041424344454647484950515226 unmodified lines79808137 unmodified linesdisk_used_gb = disk_info.used / (1024 ** 3)disk_total_gb = disk_info.total / (1024 ** 3)system_info_placeholder.write("## Server Information")system_info_placeholder.write(f"**RAM Usage:** {ram_info.percent}% used ({ram_used_gb:.2f} GB of {ram_total_gb:.2f} GB)")system_info_placeholder.write(f"**Disk Usage:** {disk_info.percent}% used ({disk_used_gb:.2f} GB of {disk_total_gb:.2f} GB)")# Initial system information updateupdate_system_info()# Continuously update system information every 5 secondsst.experimental_rerun() # Optional: Force a rerun to refresh dataif st.button("Download"):with st.spinner("Downloading... Please wait."):26 unmodified linesst.error("Download failed. Please check the URL and try again.")except Exception as e:st.error(f"An error occurred: {str(e)}")37 unmodified lines3839404142434445464748495051525326 unmodified lines80818283848586878837 unmodified linesdisk_used_gb = disk_info.used / (1024 ** 3)disk_total_gb = disk_info.total / (1024 ** 3)system_info_placeholder.markdown("## Server Information")system_info_placeholder.markdown(f"**RAM Usage:** {ram_info.percent}% used ({ram_used_gb:.2f} GB of {ram_total_gb:.2f} GB)")system_info_placeholder.markdown(f"**Disk Usage:** {disk_info.percent}% used ({disk_used_gb:.2f} GB of {disk_total_gb:.2f} GB)")# Initial system information updateupdate_system_info()# Button to update system informationif st.button("Update System Information"):update_system_info()if st.button("Download"):with st.spinner("Downloading... Please wait."):26 unmodified linesst.error("Download failed. Please check the URL and try again.")except Exception as e:st.error(f"An error occurred: {str(e)}")# Periodically update the system informationwhile True:update_system_info()time.sleep(5)st.experimental_rerun()
app.py+12-5