Dashboard - Add background color settings (#6959)

* Dashboard - Add background color settings

* Update missed_calls.php

* Update recent_calls.php

* Update app_languages.php

* Update app_config.php

* Update dashboard_edit.php

* Update index.php

* Update css.php

* Update system_status.php

* Update system_cpu_status.php

* Update system_counts.php

* Update system_counts.php

* Update switch_status.php

* Update index.php

* Update system_counts.php

* Update domain_limits.php

* Update call_forward.php

* Update caller_id.php

* Update ring_group_forward.php
This commit is contained in:
Alex
2024-04-24 13:14:24 -07:00
committed by GitHub
parent f8771c4f10
commit 28efea22fd
16 changed files with 260 additions and 114 deletions

View File

@@ -102,12 +102,12 @@
//begin widget
echo "<div class='hud_box'>\n";
echo " <div style='display: flex; flex-wrap: wrap; justify-content: center; padding-bottom: 20px;' onclick=\"$('#hud_call_forward_details').slideToggle('fast');\">\n";
echo " <span class='hud_title' style='color: ".$dashboard_heading_text_color.";'>".$text['header-call_forward']."</span>\n";
echo " <div style='display: flex; flex-wrap: wrap; justify-content: center; padding-bottom: 13px; background-color: ".$dashboard_number_background_color.";' onclick=\"$('#hud_call_forward_details').slideToggle('fast');\">\n";
echo " <span class='hud_title' style='background-color: ".$dashboard_heading_background_color."; color: ".$dashboard_heading_text_color.";'>".$text['header-call_forward']."</span>\n";
//doughnut chart
if ($dashboard_chart_type == "doughnut") {
echo "<div style='width: 275px; height: 143px;'><canvas id='call_forward_chart'></canvas></div>\n";
echo "<div style='width: 275px; height: 150px; padding-top: 7px'><canvas id='call_forward_chart'></canvas></div>\n";
echo "<script>\n";
echo " const call_forward_chart = new Chart(\n";
@@ -179,7 +179,7 @@
echo " id: 'chart_number',\n";
echo " beforeDraw(chart, args, options){\n";
echo " const {ctx, chartArea: {top, right, bottom, left, width, height} } = chart;\n";
echo " ctx.font = chart_text_size + 'px ' + chart_text_font;\n";
echo " ctx.font = chart_text_size + ' ' + chart_text_font;\n";
echo " ctx.textBaseline = 'middle';\n";
echo " ctx.textAlign = 'center';\n";
echo " ctx.fillStyle = '".$dashboard_number_text_color."';\n";
@@ -192,7 +192,7 @@
echo "</script>\n";
}
if ($dashboard_chart_type == "none") {
echo " <span class='hud_stat' style='color: ".$dashboard_number_text_color.";'>".$stats['call_forward']."</span>";
echo " <span class='hud_stat' style='color: ".$dashboard_number_text_color."; padding-bottom: 27px;'>".$stats['call_forward']."</span>";
}
echo " </div>\n";

View File

@@ -110,12 +110,12 @@
$hud_stat_title = $text['label-destinations'];
}
echo " <div style='display: flex; flex-wrap: wrap; justify-content: center; padding-bottom: 20px;' onclick=\"$('#hud_domain_limits_details').slideToggle('fast');\">\n";
echo " <span class='hud_title' style='color: ".$dashboard_heading_text_color.";'>".$text['label-domain_limits']."</span>\n";
echo " <div style='display: flex; flex-wrap: wrap; justify-content: center; padding-bottom: 13px; background-color: ".$dashboard_number_background_color.";' onclick=\"$('#hud_domain_limits_details').slideToggle('fast');\">\n";
echo " <span class='hud_title' style='background-color: ".$dashboard_heading_background_color."; color: ".$dashboard_heading_text_color.";'>".$text['label-domain_limits']."</span>\n";
//doughnut chart
if ($dashboard_chart_type == "doughnut") {
echo "<div style='width: 275px; height: 143px;'><canvas id='domain_limits_chart'></canvas></div>\n";
echo "<div style='width: 275px; height: 150px; padding-top: 7px;'><canvas id='domain_limits_chart'></canvas></div>\n";
echo "<script>\n";
echo " const domain_limits_chart = new Chart(\n";
@@ -161,7 +161,7 @@
echo " id: 'chart_number',\n";
echo " beforeDraw(chart, args, options){\n";
echo " const {ctx, chartArea: {top, right, bottom, left, width, height} } = chart;\n";
echo " ctx.font = chart_text_size + 'px ' + chart_text_font;\n";
echo " ctx.font = chart_text_size + ' ' + chart_text_font;\n";
echo " ctx.textBaseline = 'middle';\n";
echo " ctx.textAlign = 'center';\n";
echo " ctx.fillStyle = '".$dashboard_number_text_color."';\n";
@@ -174,7 +174,7 @@
echo "</script>\n";
}
if ($dashboard_chart_type == "none") {
echo " <span class='hud_stat' style='color: ".$dashboard_number_text_color.";'>".$hud_stat_used."</span>";
echo " <span class='hud_stat' style='color: ".$dashboard_number_text_color."; padding-bottom: 27px;'>".$hud_stat_used."</span>";
}
echo " </div>\n";

View File

@@ -173,12 +173,12 @@
//caller id
echo "<div class='hud_box'>\n";
echo " <div style='display: flex; flex-wrap: wrap; justify-content: center; padding-bottom: 20px;' onclick=\"$('#hud_caller_id_details').slideToggle('fast');\">\n";
echo " <span class='hud_title' style='color: ".$dashboard_heading_text_color.";'>".$text['label-caller_id_number']."</span>\n";
echo " <div style='display: flex; flex-wrap: wrap; justify-content: center; padding-bottom: 13px; background-color: ".$dashboard_number_background_color.";' onclick=\"$('#hud_caller_id_details').slideToggle('fast');\">\n";
echo " <span class='hud_title' style='background-color: ".$dashboard_heading_background_color."; color: ".$dashboard_heading_text_color.";'>".$text['label-caller_id_number']."</span>\n";
//doughnut chart
if ($dashboard_chart_type == "doughnut") {
echo "<div style='width: 275px; height: 143px;'><canvas id='caller_id_chart'></canvas></div>\n";
echo "<div style='width: 275px; height: 150px; padding-top: 7px;'><canvas id='caller_id_chart'></canvas></div>\n";
echo "<script>\n";
echo " const caller_id_chart = new Chart(\n";
@@ -225,7 +225,7 @@
echo " id: 'chart_number',\n";
echo " beforeDraw(chart, args, options){\n";
echo " const {ctx, chartArea: {top, right, bottom, left, width, height} } = chart;\n";
echo " ctx.font = chart_text_size + 'px ' + chart_text_font;\n";
echo " ctx.font = chart_text_size + ' ' + chart_text_font;\n";
echo " ctx.textBaseline = 'middle';\n";
echo " ctx.textAlign = 'center';\n";
echo " ctx.fillStyle = '".$dashboard_number_text_color."';\n";
@@ -238,7 +238,7 @@
echo "</script>\n";
}
if ($dashboard_chart_type == "none") {
echo " <span class='hud_stat' style='color: ".$dashboard_number_text_color.";'>".$stats['undefined']."</span>";
echo " <span class='hud_stat' style='color: ".$dashboard_number_text_color."; padding-bottom: 27px;'>".$stats['undefined']."</span>";
}
echo " </div>\n";

View File

@@ -152,15 +152,15 @@
//ring group forward
echo "<div class='hud_box'>\n";
echo " <div style='display: flex; flex-wrap: wrap; justify-content: center; padding-bottom: 20px;' onclick=\"$('#hud_ring_group_forward_details').slideToggle('fast');\">\n";
echo " <span class='hud_title' style='color: ".$dashboard_heading_text_color.";'>".$text['header-ring-group-forward']."</span>\n";
echo " <div style='display: flex; flex-wrap: wrap; justify-content: center; padding-bottom: 13px; background-color: ".$dashboard_number_background_color.";' onclick=\"$('#hud_ring_group_forward_details').slideToggle('fast');\">\n";
echo " <span class='hud_title' style='background-color: ".$dashboard_heading_background_color."; color: ".$dashboard_heading_text_color.";'>".$text['header-ring-group-forward']."</span>\n";
//doughnut chart
if ($dashboard_chart_type == "doughnut") {
echo " <div style='width: 275px; height: 143px;'><canvas id='ring_group_forward_chart'></canvas></div>\n";
echo " <div style='width: 275px; height: 150px; padding-top: 7px;'><canvas id='ring_group_forward_chart'></canvas></div>\n";
echo "<script>\n";
echo " const ring_group_forward_chart = new Chart(\n";
echo " document.getElementById('ring_group_forward_chart').getContext('2d'),\n";
@@ -210,7 +210,7 @@
echo " id: 'chart_number',\n";
echo " beforeDraw(chart, args, options){\n";
echo " const {ctx, chartArea: {top, right, bottom, left, width, height} } = chart;\n";
echo " ctx.font = chart_text_size + 'px ' + chart_text_font;\n";
echo " ctx.font = chart_text_size + ' ' + chart_text_font;\n";
echo " ctx.textBaseline = 'middle';\n";
echo " ctx.textAlign = 'center';\n";
echo " ctx.fillStyle = '".$dashboard_number_text_color."';\n";
@@ -223,7 +223,7 @@
echo "</script>\n";
}
if ($dashboard_chart_type == "none") {
echo " <span class='hud_stat' style='color: ".$dashboard_number_text_color.";'>".$stats['forwarding']."</span>";
echo " <span class='hud_stat' style='color: ".$dashboard_number_text_color."; padding-bottom: 27px;'>".$stats['forwarding']."</span>";
}
echo " </div>\n";

View File

@@ -76,13 +76,13 @@
$registrations = $registration->count();
}
echo "<div style='display: flex; flex-wrap: wrap; justify-content: center; padding-bottom: 20px;' onclick=\"$('#hud_switch_status_details').slideToggle('fast');\">\n";
echo " <span class='hud_title' style='color: ".$dashboard_heading_text_color.";'>".$text['label-switch_status']."</span>\n";
echo "<div style='display: flex; flex-wrap: wrap; justify-content: center; padding-bottom: 13px; background-color: ".$dashboard_number_background_color.";' onclick=\"$('#hud_switch_status_details').slideToggle('fast');\">\n";
echo " <span class='hud_title' style='background-color: ".$dashboard_heading_background_color."; color: ".$dashboard_heading_text_color.";'>".$text['label-switch_status']."</span>\n";
if ($dashboard_chart_type == "doughnut") {
//add doughnut chart
?>
<div style='height: 143px;'><canvas id='switch_status_chart'></canvas></div>
<div style='height: 150px; padding-top: 7px;'><canvas id='switch_status_chart'></canvas></div>
<script>
const switch_status_chart = new Chart(
@@ -109,7 +109,7 @@
id: 'chart_number',
beforeDraw(chart, args, options){
const {ctx, chartArea: {top, right, bottom, left, width, height} } = chart;
ctx.font = chart_text_size + 'px ' + chart_text_font;
ctx.font = chart_text_size + ' ' + chart_text_font;
ctx.textBaseline = 'middle';
ctx.textAlign = 'center';
ctx.fillStyle = '<?php echo $dashboard_number_text_color; ?>';
@@ -123,7 +123,7 @@
<?php
}
if ($dashboard_chart_type == "none") {
echo " <span class='hud_stat' style='color: ".$dashboard_number_text_color.";'>".$registrations."</span>";
echo " <span class='hud_stat' style='padding-bottom: 27px; color: ".$dashboard_number_text_color.";'>".$registrations."</span>";
}
echo " </div>\n";

View File

@@ -295,13 +295,13 @@
echo "<div class='hud_box'>\n";
if ($show_stat) {
echo "<div style='display: flex; flex-wrap: wrap; justify-content: center; padding-bottom: 20px;' onclick=\"$('#hud_system_counts_details').slideToggle('fast');\">\n";
echo " <span class='hud_title' style='color: ".$dashboard_heading_text_color.";' onclick=\"document.location.href='".PROJECT_PATH."/app/system/system.php'\">".$text['label-system_counts']."</span>\n";
echo "<div style='display: flex; flex-wrap: wrap; justify-content: center; padding-bottom: 13px; background-color: ".$dashboard_number_background_color.";' onclick=\"$('#hud_system_counts_details').slideToggle('fast');\">\n";
echo " <span class='hud_title' style='background-color: ".$dashboard_heading_background_color."; color: ".$dashboard_heading_text_color.";' onclick=\"document.location.href='".PROJECT_PATH."/app/system/system.php'\">".$text['label-system_counts']."</span>\n";
if ($dashboard_chart_type == "doughnut") {
//add doughnut chart
?>
<div style='height: 143px;'><canvas id='system_counts_chart'></canvas></div>
<div style='height: 150px; padding-top: 7px;'><canvas id='system_counts_chart'></canvas></div>
<script>
const system_counts_chart = new Chart(
@@ -341,7 +341,7 @@
id: 'chart_number',
beforeDraw(chart, args, options){
const {ctx, chartArea: {top, right, bottom, left, width, height} } = chart;
ctx.font = chart_text_size + 'px ' + chart_text_font;
ctx.font = chart_text_size + ' ' + chart_text_font;
ctx.textBaseline = 'middle';
ctx.textAlign = 'center';
ctx.fillStyle = '<?php echo $dashboard_number_text_color; ?>';
@@ -355,7 +355,7 @@
<?php
}
if ($dashboard_chart_type == "none") {
echo " <span class='hud_stat' style='color: ".$dashboard_number_text_color.";'>".$domain_total."</span>";
echo " <span class='hud_stat' style='color: ".$dashboard_number_text_color."; padding-bottom: 27px;'>".$domain_total."</span>";
}
echo " </div>\n";
}

View File

@@ -51,8 +51,8 @@
}
//add half doughnut chart
echo " <div style='display: flex; flex-wrap: wrap; justify-content: center; padding-bottom: 20px;' onclick=\"$('#hud_system_cpu_status_details').slideToggle('fast');\">\n";
echo " <span class='hud_title' style='color: ".$dashboard_heading_text_color.";' onclick=\"document.location.href='".PROJECT_PATH."/app/system/system.php'\">".$text['label-cpu_usage']."</span>\n";
echo "<div style='display: flex; flex-wrap: wrap; justify-content: center; padding-bottom: 20px; background-color: ".$dashboard_number_background_color.";' onclick=\"$('#hud_system_cpu_status_details').slideToggle('fast');\">\n";
echo " <span class='hud_title' style='background-color: ".$dashboard_heading_background_color."; color: ".$dashboard_heading_text_color.";' onclick=\"document.location.href='".PROJECT_PATH."/app/system/system.php'\">".$text['label-cpu_usage']."</span>\n";
if ($dashboard_chart_type == "doughnut") {
?>
@@ -99,7 +99,7 @@
id: 'chart_number_2',
beforeDraw(chart, args, options){
const {ctx, chartArea: {top, right, bottom, left, width, height} } = chart;
ctx.font = (chart_text_size - 7) + 'px ' + chart_text_font;
ctx.font = chart_text_size + ' ' + chart_text_font;
ctx.textBaseline = 'middle';
ctx.textAlign = 'center';
ctx.fillStyle = '<?php echo $dashboard_number_text_color; ?>';
@@ -113,9 +113,9 @@
<?php
}
if ($dashboard_chart_type == "none") {
echo " <span class='hud_stat' style='color: ".$dashboard_number_text_color.";'>".round($percent_cpu)."%</span>";
echo "<span class='hud_stat' style='color: ".$dashboard_number_text_color.";'>".round($percent_cpu)."%</span>";
}
echo " </div>\n";
echo "</div>\n";
//show the content
echo "<div class='hud_details hud_box' id='hud_system_cpu_status_details'>";

View File

@@ -37,8 +37,8 @@
if (!empty($percent_disk_usage)) {
//add half doughnut chart
echo " <div style='display: flex; flex-wrap: wrap; justify-content: center; padding-bottom: 20px;' onclick=\"$('#hud_system_status_details').slideToggle('fast');\">\n";
echo " <span class='hud_title' style='color: ".$dashboard_heading_text_color.";' onclick=\"document.location.href='".PROJECT_PATH."/app/system/system.php'\">".$text['label-disk_usage']."</span>\n";
echo " <div style='display: flex; flex-wrap: wrap; justify-content: center; padding-bottom: 20px; background-color: ".$dashboard_number_background_color.";' onclick=\"$('#hud_system_status_details').slideToggle('fast');\">\n";
echo " <span class='hud_title' style='background-color: ".$dashboard_heading_background_color."; color: ".$dashboard_heading_text_color.";' onclick=\"document.location.href='".PROJECT_PATH."/app/system/system.php'\">".$text['label-disk_usage']."</span>\n";
if ($dashboard_chart_type == "doughnut") {
?>
@@ -81,7 +81,7 @@
id: 'chart_number_2',
beforeDraw(chart, args, options){
const {ctx, chartArea: {top, right, bottom, left, width, height} } = chart;
ctx.font = (chart_text_size - 7) + 'px ' + chart_text_font;
ctx.font = chart_text_size + ' ' + chart_text_font;
ctx.textBaseline = 'middle';
ctx.textAlign = 'center';
ctx.fillStyle = '<?php echo $dashboard_number_text_color; ?>';

View File

@@ -52,13 +52,13 @@
}
}
echo " <div style='display: flex; flex-wrap: wrap; justify-content: center; padding-bottom: 20px;' onclick=\"$('#hud_voicemail_details').slideToggle('fast');\">\n";
echo " <span class='hud_title' style='color: ".$dashboard_heading_text_color.";' onclick=\"document.location.href='".PROJECT_PATH."/app/voicemails/voicemail_messages.php'\">".$text['label-new_messages']."</span>";
echo "<div style='display: flex; flex-wrap: wrap; justify-content: center; padding-bottom: 13px; background-color: ".$dashboard_number_background_color.";' onclick=\"$('#hud_voicemail_details').slideToggle('fast');\">\n";
echo " <span class='hud_title' style='background-color: ".$dashboard_heading_background_color."; color: ".$dashboard_heading_text_color.";' onclick=\"document.location.href='".PROJECT_PATH."/app/voicemails/voicemail_messages.php'\">".$text['label-new_messages']."</span>";
if ($dashboard_chart_type == "doughnut") {
//add doughnut chart
?>
<div style='height: 143px;'><canvas id='new_messages_chart'></canvas></div>
<div style='width: 150px; height: 150px; padding-top: 7px;'><canvas id='new_messages_chart'></canvas></div>
<script>
const new_messages_chart = new Chart(
@@ -87,7 +87,7 @@
id: 'chart_number',
beforeDraw(chart, args, options){
const {ctx, chartArea: {top, right, bottom, left, width, height} } = chart;
ctx.font = chart_text_size + 'px ' + chart_text_font;
ctx.font = chart_text_size + ' ' + chart_text_font;
ctx.textBaseline = 'middle';
ctx.textAlign = 'center';
ctx.fillStyle = '<?php echo $dashboard_number_text_color; ?>';
@@ -101,9 +101,9 @@
<?php
}
if ($dashboard_chart_type == "none") {
echo " <span class='hud_stat' style='color: ".$dashboard_number_text_color.";'>".$messages['new']."</span>";
echo " <span class='hud_stat' style='padding-bottom: 27px; color: ".$dashboard_number_text_color.";'>".$messages['new']."</span>";
}
echo " </div>\n";
echo "</div>\n";
echo "<div class='hud_details hud_box' id='hud_voicemail_details'>";
if (sizeof($voicemails) > 0) {

View File

@@ -90,13 +90,13 @@
//missed calls
echo "<div class='hud_box'>\n";
echo " <div style='display: flex; flex-wrap: wrap; justify-content: center; padding-bottom: 20px;' onclick=\"$('#hud_missed_calls_details').slideToggle('fast');\">\n";
echo " <span class='hud_title' style='color: ".$dashboard_heading_text_color.";' onclick=\"document.location.href='".PROJECT_PATH."/app/xml_cdr/xml_cdr.php?call_result=missed'\">".$text['label-missed_calls']."</span>";
echo "<div style='display: flex; flex-wrap: wrap; justify-content: center; padding-bottom: 13px; background-color: ".$dashboard_number_background_color.";' onclick=\"$('#hud_missed_calls_details').slideToggle('fast');\">\n";
echo " <span class='hud_title' style='background-color: ".$dashboard_heading_background_color."; color: ".$dashboard_heading_text_color.";' onclick=\"document.location.href='".PROJECT_PATH."/app/xml_cdr/xml_cdr.php?call_result=missed'\">".$text['label-missed_calls']."</span>";
if ($dashboard_chart_type == "doughnut") {
//add doughnut chart
?>
<div style='height: 143px;'><canvas id='missed_calls_chart'></canvas></div>
<div style='height: 150px; padding-top: 7px;'><canvas id='missed_calls_chart'></canvas></div>
<script>
const missed_calls_chart = new Chart(
@@ -125,7 +125,7 @@
id: 'chart_number',
beforeDraw(chart, args, options){
const {ctx, chartArea: {top, right, bottom, left, width, height} } = chart;
ctx.font = chart_text_size + 'px ' + chart_text_font;
ctx.font = chart_text_size + ' ' + chart_text_font;
ctx.textBaseline = 'middle';
ctx.textAlign = 'center';
ctx.fillStyle = '<?php echo $dashboard_number_text_color; ?>';
@@ -139,9 +139,9 @@
<?php
}
if ($dashboard_chart_type == "none") {
echo " <span class='hud_stat' style='color: ".$dashboard_number_text_color.";'>".$num_rows."</span>";
echo "<span class='hud_stat' style='padding-bottom: 27px; color: ".$dashboard_number_text_color.";' onclick=\"$('#hud_missed_calls_details').slideToggle('fast');\">".$num_rows."</span>";
}
echo " </div>\n";
echo "</div>\n";
echo "<div class='hud_details hud_box' id='hud_missed_calls_details'>";
echo "<table class='tr_hover' width='100%' cellpadding='0' cellspacing='0' border='0'>\n";

View File

@@ -87,13 +87,15 @@
//recent calls
echo "<div class='hud_box'>\n";
echo " <div style='display: flex; flex-wrap: wrap; justify-content: center; padding-bottom: 20px;' onclick=\"$('#hud_recent_calls_details').slideToggle('fast');\">\n";
echo " <span class='hud_title' style='color: ".$dashboard_heading_text_color.";' onclick=\"document.location.href='".PROJECT_PATH."/app/xml_cdr/xml_cdr.php';\">".$text['label-recent_calls']."</span>\n";
echo "<div style='display: flex; flex-wrap: wrap; justify-content: center; padding-bottom: 13px; background-color: ".$dashboard_number_background_color.";' onclick=\"$('#hud_recent_calls_details').slideToggle('fast');\">\n";
echo " <span class='hud_title' style='background-color: ".$dashboard_heading_background_color."; color: ".$dashboard_heading_text_color.";' onclick=\"document.location.href='".PROJECT_PATH."/app/xml_cdr/xml_cdr.php';\">".$text['label-recent_calls']."</span>\n";
if ($dashboard_chart_type == "doughnut") {
//add doughnut chart
?>
<div style='height: 143px;'><canvas id='recent_calls_chart'></canvas></div>
<div style='width: 150px; height: 150px; padding-top: 7px;'><canvas id='recent_calls_chart'></canvas></div>
<script>
const recent_calls_chart = new Chart(
document.getElementById('recent_calls_chart').getContext('2d'),
@@ -121,7 +123,7 @@
id: 'chart_number',
beforeDraw(chart, args, options){
const {ctx, chartArea: {top, right, bottom, left, width, height} } = chart;
ctx.font = chart_text_size + 'px ' + chart_text_font;
ctx.font = chart_text_size + ' ' + chart_text_font;
ctx.textBaseline = 'middle';
ctx.textAlign = 'center';
ctx.fillStyle = '<?php echo $dashboard_number_text_color; ?>';
@@ -135,9 +137,9 @@
<?php
}
if ($dashboard_chart_type == "none") {
echo " <span class='hud_stat' style='color: ".$dashboard_number_text_color.";'>".$num_rows."</span>";
echo "<span class='hud_stat' style='padding-bottom: 27px; color: ".$dashboard_number_text_color.";'>".$num_rows."</span>";
}
echo " </div>\n";
echo "</div>\n";
echo "<div class='hud_details hud_box' id='hud_recent_calls_details'>";
echo "<table class='tr_hover' width='100%' cellpadding='0' cellspacing='0' border='0'>\n";