Dashboard - Minor changes (#6993)

This commit is contained in:
Alex 2024-06-03 10:40:05 -07:00 committed by GitHub
parent d48208456b
commit f6e6750efc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 66 additions and 35 deletions

View File

@ -106,7 +106,7 @@
echo " <span class='hud_title'>".$text['header-call_forward']."</span>\n";
//doughnut chart
if ($dashboard_chart_type == "doughnut") {
if (!isset($dashboard_chart_type) || $dashboard_chart_type == "doughnut") {
echo "<div class='hud_chart' style='width: 275px;'><canvas id='call_forward_chart'></canvas></div>\n";
echo "<script>\n";
@ -191,7 +191,7 @@
echo " );\n";
echo "</script>\n";
}
if ($dashboard_chart_type == "none") {
if ($dashboard_chart_type == "number") {
echo " <span class='hud_stat'>".$stats['call_forward']."</span>";
}
echo " </div>\n";

View File

@ -114,7 +114,7 @@
echo " <span class='hud_title'>".$text['label-domain_limits']."</span>\n";
//doughnut chart
if ($dashboard_chart_type == "doughnut") {
if (!isset($dashboard_chart_type) || $dashboard_chart_type == "doughnut") {
echo "<div class='hud_chart' style='width: 275px;'><canvas id='domain_limits_chart'></canvas></div>\n";
echo "<script>\n";
@ -173,7 +173,7 @@
echo " );\n";
echo "</script>\n";
}
if ($dashboard_chart_type == "none") {
if ($dashboard_chart_type == "number") {
echo " <span class='hud_stat'>".$hud_stat_used."</span>";
}
echo " </div>\n";

View File

@ -177,7 +177,7 @@
echo " <span class='hud_title'>".$text['label-caller_id_number']."</span>\n";
//doughnut chart
if ($dashboard_chart_type == "doughnut") {
if (!isset($dashboard_chart_type) || $dashboard_chart_type == "doughnut") {
echo "<div class='hud_chart' style='width: 275px;'><canvas id='caller_id_chart'></canvas></div>\n";
echo "<script>\n";
@ -237,7 +237,7 @@
echo " );\n";
echo "</script>\n";
}
if ($dashboard_chart_type == "none") {
if ($dashboard_chart_type == "number") {
echo " <span class='hud_stat'>".$stats['undefined']."</span>";
}
echo " </div>\n";

View File

@ -157,7 +157,7 @@
echo " <span class='hud_title'>".$text['header-ring-group-forward']."</span>\n";
//doughnut chart
if ($dashboard_chart_type == "doughnut") {
if (!isset($dashboard_chart_type) ||$dashboard_chart_type == "doughnut") {
echo " <div class='hud_chart' style='width: 275px;'><canvas id='ring_group_forward_chart'></canvas></div>\n";
echo "<script>\n";
@ -221,7 +221,7 @@
echo " );\n";
echo "</script>\n";
}
if ($dashboard_chart_type == "none") {
if ($dashboard_chart_type == "number") {
echo " <span class='hud_stat'>".$stats['forwarding']."</span>";
}
echo " </div>\n";

View File

@ -80,7 +80,7 @@
echo "<div class='hud_container' ".($dashboard_details_state == "disabled" ?: "onclick=\"$('#hud_switch_status_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_name."')\"").">\n";
echo " <span class='hud_title'>".$text['label-switch_status']."</span>\n";
if ($dashboard_chart_type == "doughnut") {
if (!isset($dashboard_chart_type) || $dashboard_chart_type == "doughnut") {
//add doughnut chart
?>
<div class='hud_chart'><canvas id='switch_status_chart'></canvas></div>
@ -125,7 +125,7 @@
</script>
<?php
}
if ($dashboard_chart_type == "none") {
if ($dashboard_chart_type == "number") {
echo " <span class='hud_stat'>".$registrations."</span>";
}
echo " </div>\n";

View File

@ -298,7 +298,7 @@
echo "<div class='hud_container' ".($dashboard_details_state == "disabled" ?: "onclick=\"$('#hud_system_counts_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_name."')\"").">\n";
echo " <span class='hud_title' onclick=\"document.location.href='".PROJECT_PATH."/app/system/system.php'\">".$text['label-system_counts']."</span>\n";
if ($dashboard_chart_type == "doughnut") {
if (!isset($dashboard_chart_type) || $dashboard_chart_type == "doughnut") {
//add doughnut chart
?>
<div class='hud_chart' style='width: 250px;'><canvas id='system_counts_chart'></canvas></div>
@ -354,7 +354,7 @@
</script>
<?php
}
if ($dashboard_chart_type == "none") {
if ($dashboard_chart_type == "number") {
echo " <span class='hud_stat'>".$domain_total."</span>";
}
echo " </div>\n";

View File

@ -55,7 +55,7 @@
echo " <span class='hud_title' onclick=\"document.location.href='".PROJECT_PATH."/app/system/system.php'\">".$text['label-cpu_usage']."</span>\n";
//add half doughnut chart
if ($dashboard_chart_type == "doughnut") {
if (!isset($dashboard_chart_type) || $dashboard_chart_type == "doughnut") {
?>
<div class='hud_chart' style='width: 175px;'><canvas id='system_cpu_status_chart'></canvas></div>
@ -113,7 +113,7 @@
</script>
<?php
}
if ($dashboard_chart_type == "none") {
if ($dashboard_chart_type == "number") {
echo "<span class='hud_stat'>".round($percent_cpu)."%</span>";
}
echo "</div>\n";

View File

@ -40,7 +40,7 @@
echo " <div class='hud_container' ".($dashboard_details_state == "disabled" ?: "onclick=\"$('#hud_system_status_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_name."')\"").">\n";
echo " <span class='hud_title' onclick=\"document.location.href='".PROJECT_PATH."/app/system/system.php'\">".$text['label-disk_usage']."</span>\n";
if ($dashboard_chart_type == "doughnut") {
if (!isset($dashboard_chart_type) || $dashboard_chart_type == "doughnut") {
?>
<div class='hud_chart' style='width: 175px;'><canvas id='system_status_chart'></canvas></div>
@ -94,7 +94,7 @@
</script>
<?php
}
if ($dashboard_chart_type == "none") {
if ($dashboard_chart_type == "number") {
echo " <span class='hud_stat'>".round($percent_disk_usage)."%</span>";
}
echo " </div>\n";

View File

@ -55,7 +55,7 @@
echo "<div class='hud_container' ".($dashboard_details_state == "disabled" ?: "onclick=\"$('#hud_voicemail_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_name."')\"").">\n";
echo " <span class='hud_title' onclick=\"document.location.href='".PROJECT_PATH."/app/voicemails/voicemail_messages.php'\">".$text['label-new_messages']."</span>";
if (isset($row['dashboard_chart_type']) && $row['dashboard_chart_type'] == "doughnut") {
if (isset($dashboard_chart_type) && $dashboard_chart_type == "doughnut") {
//add doughnut chart
?>
<div class='hud_chart'><canvas id='new_messages_chart'></canvas></div>
@ -100,7 +100,7 @@
</script>
<?php
}
if (!isset($row['dashboard_chart_type']) || $row['dashboard_chart_type'] == "none") {
if (!isset($dashboard_chart_type) || $dashboard_chart_type == "number") {
echo " <span class='hud_stat'>".$messages['new']."</span>";
}
echo "</div>\n";

View File

@ -93,7 +93,7 @@
echo "<div class='hud_container' ".($dashboard_details_state == "disabled" ?: "onclick=\"$('#hud_missed_calls_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_name."')\"").">\n";
echo " <span class='hud_title' onclick=\"document.location.href='".PROJECT_PATH."/app/xml_cdr/xml_cdr.php?call_result=missed'\">".$text['label-missed_calls']."</span>";
if ($row['dashboard_chart_type'] == "doughnut") {
if ($dashboard_chart_type == "doughnut") {
//add doughnut chart
?>
<div class='hud_chart'><canvas id='missed_calls_chart'></canvas></div>
@ -138,7 +138,7 @@
</script>
<?php
}
if ($row['dashboard_chart_type'] == "none" || !isset($row['dashboard_chart_type'])) {
if (!isset($dashboard_chart_type) || $dashboard_chart_type == "number") {
echo "<span class='hud_stat'>".$num_rows."</span>";
}
echo "</div>\n";

View File

@ -90,7 +90,7 @@
echo "<div class='hud_container' ".($dashboard_details_state == "disabled" ?: "onclick=\"$('#hud_recent_calls_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_name."')\"").">\n";
echo " <span class='hud_title' onclick=\"document.location.href='".PROJECT_PATH."/app/xml_cdr/xml_cdr.php';\">".$text['label-recent_calls']."</span>\n";
if ($row['dashboard_chart_type'] == "doughnut") {
if ($dashboard_chart_type == "doughnut") {
//add doughnut chart
?>
@ -136,7 +136,7 @@
</script>
<?php
}
if ($row['dashboard_chart_type'] == "none" || !isset($row['dashboard_chart_type'])) {
if (!isset($dashboard_chart_type) || $dashboard_chart_type == "number") {
echo "<span class='hud_stat'>".$num_rows."</span>";
}
echo "</div>\n";

View File

@ -318,19 +318,16 @@
}
//add a default value to $dashboard_details_state
if (!isset($row['dashboard_details_state']) && in_array($dashboard_path, ['app/voicemails/resources/dashboard/voicemails.php', 'app/xml_cdr/resources/dashboard/missed_calls.php', 'app/xml_cdr/resources/dashboard/recent_calls.php'])) {
$dashboard_details_state = "hidden";
}
if (!isset($dashboard_details_state)) {
$dashboard_details_state = "expanded";
}
//add a default value to $dashboard_chart_type
if (!isset($dashboard_chart_type) && $dashboard_path == 'app/voicemails/resources/dashboard/voicemails.php') {
$dashboard_chart_type = "none";
}
if (!isset($dashboard_chart_type) && $dashboard_path == 'app/xml_cdr/resources/dashboard/missed_calls.php') {
$dashboard_chart_type = "none";
}
if (!isset($dashboard_chart_type) && $dashboard_path == 'app/xml_cdr/resources/dashboard/recent_calls.php') {
$dashboard_chart_type = "none";
if (!isset($dashboard_chart_type) && in_array($dashboard_path, ['app/voicemails/resources/dashboard/voicemails.php', 'app/xml_cdr/resources/dashboard/missed_calls.php', 'app/xml_cdr/resources/dashboard/recent_calls.php'])) {
$dashboard_chart_type = "number";
}
//add an empty row
@ -555,11 +552,11 @@
else {
echo " <option value='doughnut'>".$text['label-doughnut']."</option>\n";
}
if ($dashboard_chart_type == "none") {
echo " <option value='none' selected='selected'>".$text['label-none']."</option>\n";
if ($dashboard_chart_type == "number") {
echo " <option value='number' selected='selected'>".$text['label-number']."</option>\n";
}
else {
echo " <option value='none'>".$text['label-none']."</option>\n";
echo " <option value='number'>".$text['label-number']."</option>\n";
}
echo " </select>\n";
echo "<br />\n";

View File

@ -299,6 +299,14 @@ span.hud_stat { padding-bottom: 27px; }
echo " display: none;\n";
echo "}\n";
}
if (!isset($row['dashboard_details_state']) && $dashboard_name == "new_messages" ||
!isset($row['dashboard_details_state']) && $dashboard_name == "missed_calls" ||
!isset($row['dashboard_details_state']) && $dashboard_name == "recent_calls") {
echo "#".$dashboard_name." .hud_box .hud_expander, \n";
echo "#".$dashboard_name." .hud_box .hud_details {\n";
echo " display: none;\n";
echo "}\n";
}
}
?>
}
@ -350,11 +358,11 @@ function toggle_grid_row_end(dashboard_name) {
$dashboard_name = $row['dashboard_name'];
$dashboard_icon = $row['dashboard_icon'] ?? '';
$dashboard_url = $row['dashboard_url'] ?? '';
$dashboard_chart_type = $row['dashboard_chart_type'] ?? 'doughnut';
$dashboard_chart_type = $row['dashboard_chart_type'];
$dashboard_heading_text_color = $row['dashboard_heading_text_color'] ?? $settings->get('theme', 'dashboard_heading_text_color');
$dashboard_number_text_color = $row['dashboard_number_text_color'] ?? $settings->get('theme', 'dashboard_number_text_color');
$dashboard_details_state = $row['dashboard_details_state'];
$grid_row_end = ($dashboard_details_state == "expanded" || empty($dashboard_details_state)) ? "grid-row-end: span 5;" : "grid-row-end: span 2;";
$grid_row_end = (!isset($dashboard_details_state) && in_array($dashboard_name, ["New Messages", "Missed Calls", "Recent Calls"]) ? "grid-row-end: span 2;" : ($dashboard_details_state == "expanded" || empty($dashboard_details_state) ? "grid-row-end: span 5;" : "grid-row-end: span 2;"));
echo "<div class='widget' style='".$grid_row_end."' id='".str_replace(" ", "_", strtolower($row['dashboard_name']))."' draggable='false'>\n";
include($row['dashboard_path']);

View File

@ -4884,6 +4884,32 @@ $text['label-characters']['zh-cn'] = "来电显示名称";
$text['label-characters']['ja-jp'] = "発信者ID名";
$text['label-characters']['ko-kr'] = "발신자 ID 이름";
$text['label-number']['en-us'] = "Number";
$text['label-number']['en-gb'] = "Number";
$text['label-number']['ar-eg'] = "رقم";
$text['label-number']['de-at'] = "Nummer";
$text['label-number']['de-ch'] = "Nummer";
$text['label-number']['de-de'] = "Nummer";
$text['label-number']['el-gr'] = "Αριθμός";
$text['label-number']['es-cl'] = "Número";
$text['label-number']['es-mx'] = "Número";
$text['label-number']['fr-ca'] = "Nombre";
$text['label-number']['fr-fr'] = "Nombre";
$text['label-number']['he-il'] = "מספר";
$text['label-number']['it-it'] = "Numero";
$text['label-number']['nl-nl'] = "Nummer";
$text['label-number']['pl-pl'] = "Numer";
$text['label-number']['pt-br'] = "Número";
$text['label-number']['pt-pt'] = "Número";
$text['label-number']['ro-ro'] = "Număr";
$text['label-number']['ru-ru'] = "Число";
$text['label-number']['sv-se'] = "siffra";
$text['label-number']['uk-ua'] = "Номер";
$text['label-number']['tr-tr'] = "Sayı";
$text['label-number']['zh-cn'] = "数字";
$text['label-number']['ja-jp'] = "番号";
$text['label-number']['ko-kr'] = "숫자";
$text['label-numbers']['en-us'] = "Numbers";
$text['label-numbers']['en-gb'] = "Numbers";
$text['label-numbers']['ar-eg'] = "أرقام";