Add progress bar to system status dashboard (#7131)

* Add progress bar to system status dashboard

* Update dashboard_edit.php

* Update app_languages.php

* Update config.php
This commit is contained in:
Alex
2024-09-13 17:00:21 -06:00
committed by GitHub
parent 8c67b31441
commit 5e6d494796
4 changed files with 78 additions and 4 deletions
+4 -2
View File
@@ -1,15 +1,17 @@
<?php
$x++;
$array['dashboard'][$x]['dashboard_uuid'] = 'ab48bcca-5cb1-40f0-b36f-ba1ad510ba5a';
$array['dashboard'][$x]['dashboard_uuid'] = 'c388de65-85ad-4662-bbc3-a65fe9ddc319';
$array['dashboard'][$x]['dashboard_name'] = 'System Status';
$array['dashboard'][$x]['dashboard_path'] = 'system/system_status';
$array['dashboard'][$x]['dashboard_order'] = '90';
$array['dashboard'][$x]['dashboard_enabled'] = 'true';
$array['dashboard'][$x]['dashboard_chart_type'] = 'progress_bar';
$array['dashboard'][$x]['dashboard_number_text_color'] = '#fff';
$array['dashboard'][$x]['dashboard_description'] = 'System information like Disk usage.';
$y = 0;
$array['dashboard'][$x]['dashboard_groups'][$y]['dashboard_group_uuid'] = '5e1998c1-d3be-42f0-80ac-659e2e7934cb';
$array['dashboard'][$x]['dashboard_groups'][$y]['dashboard_uuid'] = 'ab48bcca-5cb1-40f0-b36f-ba1ad510ba5a';
$array['dashboard'][$x]['dashboard_groups'][$y]['dashboard_uuid'] = 'c388de65-85ad-4662-bbc3-a65fe9ddc319';
$array['dashboard'][$x]['dashboard_groups'][$y]['group_name'] = 'superadmin';
$x++;
@@ -38,7 +38,7 @@
//add half doughnut chart
echo " <div class='hud_content' ".($dashboard_details_state == "disabled" ?: "onclick=\"$('#hud_system_status_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_name."')\"").">\n";
echo " <span class='hud_title'><a onclick=\"document.location.href='".PROJECT_PATH."/app/system/system.php'\">".$text['label-disk_usage']."</a></span>\n";
echo " <span class='hud_title'><a onclick=\"document.location.href='".PROJECT_PATH."/app/system/system.php'\">".$text['label-system_status']."</a></span>\n";
if (!isset($dashboard_chart_type) || $dashboard_chart_type == "doughnut") {
?>
@@ -97,6 +97,20 @@
if ($dashboard_chart_type == "number") {
echo " <span class='hud_stat'>".round($percent_disk_usage)."%</span>";
}
if ($dashboard_chart_type == "progress_bar") {
echo " <span class='hud_title' style='text-align: left; font-size: 11px; line-height: 1.8; font-weight: unset; padding-left: 41px;'>".$text['label-disk_usage']."</span>\n";
echo " <div class='progress_container' style='width: 80%; height: 15px; border-radius: 4px; background: ".($settings->get('theme', 'dashboard_disk_usage_chart_sub_color') ?? '#d4d4d4').";'>\n";
echo " <div class='progress_bar' style='width: ".$percent_disk_usage."%; height: 15px; border-radius: 4px; font-size: x-small; color: ".$row['dashboard_number_text_color']."; background: ".($settings->get('theme', 'dashboard_disk_usage_chart_main_color') ?? '#03c04a').";'>".round($percent_disk_usage)."%</div>\n";
echo " </div>\n";
}
/*
if ($dashboard_chart_type == "progress_bar") {
echo " <span class='hud_title' style='text-align: left; font-size: 11px; line-height: 1.8; font-weight: unset; padding-left: 41px;'>".$text['label-cpu_usage']."</span>\n";
echo " <div class='progress_container' style='width: 80%; height: 15px; border-radius: 4px; background: ".($settings->get('theme', 'dashboard_cpu_usage_chart_sub_color') ?? '#d4d4d4').";'>\n";
echo " <div class='progress_bar' style='width: ".$percent_cpu."%; height: 15px; border-radius: 4px; font-size: x-small; color: ".$row['dashboard_number_text_color']."; background: ".($settings->get('theme', 'dashboard_cpu_usage_chart_main_color') ?? '#03c04a').";'>".round($percent_cpu)."%</div>\n";
echo " </div>\n";
}
*/
echo " </div>\n";
}
}