{% extends 'admin-layout.html' %} {% block title %}Home | Admin |Hiddify{% endblock %} {% block body %} {% macro info_box(id,icon,title,number,percentage,description,coloring=False,color_class='secondary') -%}
90 else ("warning" if percentage>75 else ""))) if coloring else ""}} {%if "disk"==id %} d-none d-md-flex {%endif%}">
{{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 -%}
%set onlines=usage_history['m5']['online'] %set total_users=usage_history['total']['users'] {{info_box("today","fa-solid fa-calendar", _("Today Usage"), ((usage_history['today']['usage']/1024**3)|round(1)) ~ " GB", usage_history['today']['online']/((1,total_users)|max)*100, _("Online Users") ~": "~ usage_history['today']['online'] ~ " / "~ total_users, color_class="orange" )}} {{info_box("yesterday","fa-solid fa-calendar-day", _("Yesterday Usage"), ((usage_history['yesterday']['usage']/1024**3)|round(1)) ~ " GB", usage_history['yesterday']['online']/((1,total_users)|max)*100, _("Online Users") ~": "~ usage_history['yesterday']['online'] ~ " / "~ total_users, color_class="maroon" )}} {{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']/((1,total_users)|max)*100, _("Online Users") ~": "~ usage_history['last_30_days']['online'] ~ " / "~ total_users, color_class="olive" )}} {{info_box("total","fa-solid fa-chart-pie", _("Total Usage"), ((usage_history['total']['usage']/1024**3)|round(1)) ~ " GB", usage_history['total']['online']/((1,total_users)|max)*100, _("Online Users") ~": "~ usage_history['total']['online'] ~ " / "~ total_users, color_class="navy" )}} {{info_box("online","fa-solid fa-users", _("Online Users"), onlines ~ " / "~ total_users, onlines/((1,total_users)|max)*100, _('In 5 minutes'), color_class="lightblue" )}} {{info_box("network","fa-solid fa-network-wired", _("Network"), (' Mb/s    Mb/s')|safe, 0, (stats['system']['net_sent_cumulative_GB']|round(1)) ~ "GB " ~_("From Last Restart"), color_class="info" )}} {{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, color_class="teal" )}} {{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, color_class="purple" )}} {#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, color_class='secondary' )}}
% if hconfig(ConfigEnum.is_parent) {% include 'parent_dash.html' %} %endif {% endblock %} %block tail_js {{super()}} %endblock