{% extends 'admin-layout.html' %} {% block title %}Home | Admin |Hiddify{% endblock %} {% block body %} {% macro info_box(id,icon,title,number,percentage,description,coloring=False) -%}
90 else ("warning" if percentage>75 else ""))) if coloring else ""}}">
{{title}} {{number}}
{{description}}
{%- endmacro -%} {% macro info_box2(id,icon,title,number,percentage,description,coloring=False) -%}
90 else ("warning" if percentage>75 else ""))) if coloring else ""}}">

{{title}}

{{number}}
{{description}}
{%- endmacro -%}
{{info_box("today","fa-solid fa-calendar", _("Today Usage"), ((usage_history['today']['usage']/1024**3)|round(1)) ~ " GB", usage_history['today']['online']/total_users*100, _("Online Users") ~": "~ usage_history['today']['online'] ~ " / "~ total_users )}} {{info_box("yesterday","fa-solid fa-calendar-day", _("Yesterday Usage"), ((usage_history['yesterday']['usage']/1024**3)|round(1)) ~ " GB", usage_history['yesterday']['online']/total_users*100, _("Online Users") ~": "~ usage_history['yesterday']['online'] ~ " / "~ total_users )}} {{info_box("last_30_days","fa-solid fa-calendar-days", _("Month Usage"), ((usage_history['last_30_days']['usage']/1024**3)|round(1)) ~ " GB", usage_history['last_30_days']['online']/total_users*100, _("Online Users") ~": "~ usage_history['last_30_days']['online'] ~ " / "~ total_users )}} {{info_box("total","fa-solid fa-chart-pie", _("Total Usage"), ((usage_history['total']['usage']/1024**3)|round(1)) ~ " GB", usage_history['total']['online']/total_users*100, _("Online Users") ~": "~ usage_history['total']['online'] ~ " / "~ total_users )}} {{info_box("online","fa-solid fa-users", _("Online Users"), onlines ~ " / "~ total_users, onlines/total_users*100, _('In 24 hours'))}} {{info_box("cpu","fa-solid fa-microchip", _("CPU"), ((stats['system']['load_avg_5min']*100)|int) ~ " % " , (stats['system']['load_avg_5min']*100)|int, (' '|safe) ~ stats['top5']['cpu'][0][0] ~ " ‏"|safe ~ ((stats['top5']['cpu'][0][1])|int) ~ "% ‏"|safe~ (' '|safe) ~ stats['top5']['cpu'][1][0] ~ " ‏"|safe ~ ((stats['top5']['cpu'][1][1])|int) ~ "% ‏"|safe~ (' '|safe) ~ stats['top5']['cpu'][2][0] ~ " ‏"|safe ~ ((stats['top5']['cpu'][2][1])|int) ~ "%", coloring=True )}} {{info_box("ram","fa-solid fa-memory", _("RAM"), (stats['system']['ram_used']|round(1)) ~ " / " ~ (stats['system']['ram_total']|round(1)) ~ "GB (" ~((stats['system']['ram_used']*100/stats['system']['ram_total'])|int)~" %)", stats['system']['ram_used']*100/stats['system']['ram_total'], (' '|safe) ~ stats['top5']['memory'][0][0] ~ " ‏"|safe ~ ((stats['top5']['memory'][0][1]*100/stats['system']['ram_total'])|int) ~ "% ‏"|safe~ (' '|safe) ~ stats['top5']['memory'][1][0] ~ " ‏"|safe ~ ((stats['top5']['memory'][1][1]*100/stats['system']['ram_total'])|int) ~ "% ‏"|safe~ (' '|safe) ~ stats['top5']['memory'][2][0] ~ " ‏"|safe ~ ((stats['top5']['memory'][2][1]*100/stats['system']['ram_total'])|int) ~ "% ", coloring=True )}} {{info_box("network","fa-solid fa-network-wired", _("Network"), (stats['system']['net_sent_cumulative_GB']|round(1)) ~ "GB", 0, _("From Last Restart") )}} {#info_box("connections","fa-solid fa-signal", _("Connections/IP"), stats['system']['total_unique_ips'] ~ " / " ~ stats['system']['total_connections'], stats['system']['total_unique_ips']*100/stats['system']['total_connections'], _("CDN make it incorrect") )#} {{info_box("disk","fa-solid fa-hard-drive", _("Disk"), (stats['system']['disk_used']|round(1)) ~ " / "~(stats['system']['disk_total']|round(1))~"GB", stats['system']['disk_used']*100/stats['system']['disk_total'], _("Hiddify") ~ ": " ~ (stats['system']['hiddify_used']|round(1)) ~ "GB", coloring=True )}}
{% endblock %} %block tail_js {{super()}} %endblock