Dashboard - Add text color settings (#6950)
* Dashboard - Add text color setting
This commit is contained in:
@@ -124,7 +124,7 @@
|
||||
echo " '".$text['label-call_forward'].": ".$stats['call_forward']."',\n";
|
||||
}
|
||||
echo " '".$text['label-active'].": ".$stats['active']."',\n";
|
||||
echo " ],\n";
|
||||
echo " ],\n";
|
||||
echo " datasets: [{\n";
|
||||
echo " data: [\n";
|
||||
if (permission_exists('do_not_disturb')) {
|
||||
@@ -138,7 +138,7 @@
|
||||
}
|
||||
echo " '".$stats['active']."',\n";
|
||||
echo " 0.00001,\n";
|
||||
echo " ],\n";
|
||||
echo " ],\n";
|
||||
echo " backgroundColor: [\n";
|
||||
if (permission_exists('do_not_disturb')) {
|
||||
echo " '".$_SESSION['dashboard']['call_forward_chart_color_do_not_disturb']['text']."',\n";
|
||||
@@ -154,31 +154,41 @@
|
||||
echo " ],\n";
|
||||
echo " borderColor: '".$_SESSION['dashboard']['call_forward_chart_border_color']['text']."',\n";
|
||||
echo " borderWidth: '".$_SESSION['dashboard']['call_forward_chart_border_width']['text']."',\n";
|
||||
echo " cutout: chart_cutout,\n";
|
||||
echo " }]\n";
|
||||
echo " },\n";
|
||||
echo " options: {\n";
|
||||
echo " responsive: true,\n";
|
||||
echo " maintainAspectRatio: false,\n";
|
||||
echo " plugins: {\n";
|
||||
echo " chart_counter: {\n";
|
||||
echo " chart_text: '".$stats['call_forward']."'\n";
|
||||
echo " chart_number: {\n";
|
||||
echo " text: '".$stats['call_forward']."'\n";
|
||||
echo " },\n";
|
||||
echo " legend: {\n";
|
||||
echo " display: true,\n";
|
||||
echo " position: 'right',\n";
|
||||
echo " reverse: true,\n";
|
||||
echo " labels: {\n";
|
||||
echo " usePointStyle: true,\n";
|
||||
echo " pointStyle: 'rect'\n";
|
||||
echo " pointStyle: 'rect',\n";
|
||||
echo " color: '".$dashboard_heading_text_color."'\n";
|
||||
echo " }\n";
|
||||
echo " },\n";
|
||||
echo " title: {\n";
|
||||
echo " display: true,\n";
|
||||
echo " text: '".$text['header-call_forward']."'\n";
|
||||
echo " text: '".$text['header-call_forward']."',\n";
|
||||
echo " color: '".$dashboard_heading_text_color."'\n";
|
||||
echo " }\n";
|
||||
echo " }\n";
|
||||
echo " },\n";
|
||||
echo " plugins: [chart_counter],\n";
|
||||
echo " plugins: [{\n";
|
||||
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.textBaseline = 'middle';\n";
|
||||
echo " ctx.textAlign = 'center';\n";
|
||||
echo " ctx.fillStyle = '".$dashboard_number_text_color."';\n";
|
||||
echo " ctx.fillText(options.text, width / 2, top + (height / 2));\n";
|
||||
echo " ctx.save();\n";
|
||||
echo " }\n";
|
||||
echo " }]\n";
|
||||
echo " }\n";
|
||||
echo " );\n";
|
||||
echo "</script>\n";
|
||||
|
||||
@@ -137,17 +137,15 @@
|
||||
echo " ],\n";
|
||||
echo " borderColor: '".$_SESSION['dashboard']['domain_limits_chart_border_color']['text']."',\n";
|
||||
echo " borderWidth: '".$_SESSION['dashboard']['domain_limits_chart_border_width']['text']."',\n";
|
||||
echo " cutout: chart_cutout,\n";
|
||||
echo " }]\n";
|
||||
echo " },\n";
|
||||
echo " options: {\n";
|
||||
echo " responsive: true,\n";
|
||||
echo " maintainAspectRatio: false,\n";
|
||||
echo " plugins: {\n";
|
||||
echo " chart_counter: {\n";
|
||||
echo " chart_text: '".$hud_stat_used."'\n";
|
||||
echo " chart_number: {\n";
|
||||
echo " text: '".$hud_stat_used."'\n";
|
||||
echo " },\n";
|
||||
echo " legend: {\n";
|
||||
echo " display: true,\n";
|
||||
echo " position: 'right',\n";
|
||||
echo " reverse: false,\n";
|
||||
echo " labels: {\n";
|
||||
@@ -156,13 +154,23 @@
|
||||
echo " }\n";
|
||||
echo " },\n";
|
||||
echo " title: {\n";
|
||||
echo " display: true,\n";
|
||||
echo " text: '".$text['label-domain_limits']."',\n";
|
||||
echo " fontFamily: chart_text_font\n";
|
||||
echo " color: '".$dashboard_heading_text_color."'\n";
|
||||
echo " }\n";
|
||||
echo " }\n";
|
||||
echo " },\n";
|
||||
echo " plugins: [chart_counter],\n";
|
||||
echo " plugins: [{\n";
|
||||
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.textBaseline = 'middle';\n";
|
||||
echo " ctx.textAlign = 'center';\n";
|
||||
echo " ctx.fillStyle = '".$dashboard_number_text_color."';\n";
|
||||
echo " ctx.fillText(options.text, width / 2, top + (height / 2));\n";
|
||||
echo " ctx.save();\n";
|
||||
echo " }\n";
|
||||
echo " }]\n";
|
||||
echo " }\n";
|
||||
echo " );\n";
|
||||
echo "</script>\n";
|
||||
|
||||
@@ -199,32 +199,42 @@
|
||||
echo " '".$_SESSION['dashboard']['caller_id_chart_color_undefined']['text']."',\n";
|
||||
echo " ],\n";
|
||||
echo " borderColor: '".$_SESSION['dashboard']['caller_id_chart_border_color']['text']."',\n";
|
||||
echo " borderWidth: '".$_SESSION['dashboard']['caller_id_chart_border_width']['text']."',\n";
|
||||
echo " cutout: chart_cutout,\n";
|
||||
echo " borderWidth: '".$_SESSION['dashboard']['caller_id_chart_border_width']['text']."'\n";
|
||||
echo " }]\n";
|
||||
echo " },\n";
|
||||
echo " options: {\n";
|
||||
echo " responsive: true,\n";
|
||||
echo " maintainAspectRatio: false,\n";
|
||||
echo " plugins: {\n";
|
||||
echo " chart_counter: {\n";
|
||||
echo " chart_text: '".$stats['undefined']."'\n";
|
||||
echo " chart_number: {\n";
|
||||
echo " text: '".$stats['undefined']."'\n";
|
||||
echo " },\n";
|
||||
echo " legend: {\n";
|
||||
echo " display: true,\n";
|
||||
echo " position: 'right',\n";
|
||||
echo " reverse: true,\n";
|
||||
echo " labels: {\n";
|
||||
echo " usePointStyle: true,\n";
|
||||
echo " pointStyle: 'rect'\n";
|
||||
echo " pointStyle: 'rect',\n";
|
||||
echo " color: '".$dashboard_heading_text_color."'\n";
|
||||
echo " }\n";
|
||||
echo " },\n";
|
||||
echo " title: {\n";
|
||||
echo " display: true,\n";
|
||||
echo " text: '".$text['label-caller_id_number']."'\n";
|
||||
echo " text: '".$text['label-caller_id_number']."',\n";
|
||||
echo " color: '".$dashboard_heading_text_color."'\n";
|
||||
echo " }\n";
|
||||
echo " }\n";
|
||||
echo " },\n";
|
||||
echo " plugins: [chart_counter],\n";
|
||||
echo " plugins: [{\n";
|
||||
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.textBaseline = 'middle';\n";
|
||||
echo " ctx.textAlign = 'center';\n";
|
||||
echo " ctx.fillStyle = '".$dashboard_number_text_color."';\n";
|
||||
echo " ctx.fillText(options.text, width / 2, top + (height / 2));\n";
|
||||
echo " ctx.save();\n";
|
||||
echo " }\n";
|
||||
echo " }]\n";
|
||||
echo " }\n";
|
||||
echo " );\n";
|
||||
echo "</script>\n";
|
||||
@@ -302,4 +312,4 @@
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -167,44 +167,54 @@
|
||||
echo " labels: [\n";
|
||||
echo " '".$text['label-active'].": ".$stats['active']."',\n";
|
||||
echo " '".$text['label-forwarding'].": ".$stats['forwarding']."',\n";
|
||||
echo " ],\n";
|
||||
echo " ],\n";
|
||||
echo " datasets: [{\n";
|
||||
echo " data: [\n";
|
||||
echo " '".$stats['active']."',\n";
|
||||
echo " '".$stats['forwarding']."',\n";
|
||||
echo " 0.00001,\n";
|
||||
echo " ],\n";
|
||||
echo " ],\n";
|
||||
echo " backgroundColor: [\n";
|
||||
echo " '".$_SESSION['dashboard']['ring_group_forward_chart_color_active']['text']."',\n";
|
||||
echo " '".$_SESSION['dashboard']['ring_group_forward_chart_color_forwarding']['text']."',\n";
|
||||
echo " ],\n";
|
||||
echo " borderColor: '".$_SESSION['dashboard']['ring_group_forward_chart_border_color']['text']."',\n";
|
||||
echo " borderWidth: '".$_SESSION['dashboard']['ring_group_forward_chart_border_width']['text']."',\n";
|
||||
echo " cutout: chart_cutout,\n";
|
||||
echo " }]\n";
|
||||
echo " },\n";
|
||||
echo " options: {\n";
|
||||
echo " responsive: true,\n";
|
||||
echo " maintainAspectRatio: false,\n";
|
||||
echo " plugins: {\n";
|
||||
echo " chart_counter: {\n";
|
||||
echo " chart_text: '".$stats['forwarding']."'\n";
|
||||
echo " chart_number: {\n";
|
||||
echo " text: '".$stats['forwarding']."'\n";
|
||||
echo " },\n";
|
||||
echo " legend: {\n";
|
||||
echo " display: true,\n";
|
||||
echo " position: 'right',\n";
|
||||
echo " reverse: true,\n";
|
||||
echo " labels: {\n";
|
||||
echo " usePointStyle: true,\n";
|
||||
echo " pointStyle: 'rect'\n";
|
||||
echo " pointStyle: 'rect',\n";
|
||||
echo " color: '".$dashboard_heading_text_color."'\n";
|
||||
echo " }\n";
|
||||
echo " },\n";
|
||||
echo " title: {\n";
|
||||
echo " display: true,\n";
|
||||
echo " text: '".$text['header-ring-group-forward']."'\n";
|
||||
echo " text: '".$text['header-ring-group-forward']."',\n";
|
||||
echo " color: '".$dashboard_heading_text_color."'\n";
|
||||
echo " }\n";
|
||||
echo " }\n";
|
||||
echo " },\n";
|
||||
echo " plugins: [chart_counter],\n";
|
||||
echo " plugins: [{\n";
|
||||
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.textBaseline = 'middle';\n";
|
||||
echo " ctx.textAlign = 'center';\n";
|
||||
echo " ctx.fillStyle = '".$dashboard_number_text_color."';\n";
|
||||
echo " ctx.fillText(options.text, width / 2, top + (height / 2));\n";
|
||||
echo " ctx.save();\n";
|
||||
echo " }\n";
|
||||
echo " }]\n";
|
||||
echo " }\n";
|
||||
echo " );\n";
|
||||
echo "</script>\n";
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
|
||||
//check permisions
|
||||
require_once "resources/check_auth.php";
|
||||
if (permission_exists("switch_version")
|
||||
|| permission_exists("switch_uptime")
|
||||
|| permission_exists("switch_channels")
|
||||
|| permission_exists("switch_registrations")
|
||||
if (permission_exists("switch_version")
|
||||
|| permission_exists("switch_uptime")
|
||||
|| permission_exists("switch_channels")
|
||||
|| permission_exists("switch_registrations")
|
||||
|| permission_exists("registration_all")) {
|
||||
//access granted
|
||||
}
|
||||
@@ -93,27 +93,32 @@
|
||||
backgroundColor: ['<?php echo $_SESSION['dashboard']['switch_status_chart_main_background_color']['text']; ?>',
|
||||
'<?php echo $_SESSION['dashboard']['switch_status_chart_sub_background_color']['text']; ?>'],
|
||||
borderColor: '<?php echo $_SESSION['dashboard']['switch_status_chart_border_color']['text']; ?>',
|
||||
borderWidth: '<?php echo $_SESSION['dashboard']['switch_status_chart_border_width']['text']; ?>',
|
||||
cutout: chart_cutout
|
||||
borderWidth: '<?php echo $_SESSION['dashboard']['switch_status_chart_border_width']['text']; ?>'
|
||||
}]
|
||||
},
|
||||
options: {
|
||||
responsive: true,
|
||||
maintainAspectRatio: false,
|
||||
plugins: {
|
||||
chart_counter: {
|
||||
chart_text: '<?php echo $registrations; ?>'
|
||||
},
|
||||
legend: {
|
||||
display: false
|
||||
chart_number: {
|
||||
text: '<?php echo $registrations; ?>'
|
||||
},
|
||||
title: {
|
||||
display: true,
|
||||
text: '<?php echo $text['label-switch_status']; ?>'
|
||||
text: '<?php echo $text['label-switch_status']; ?>',
|
||||
color: '<?php echo $dashboard_heading_text_color; ?>'
|
||||
}
|
||||
}
|
||||
},
|
||||
plugins: [chart_counter],
|
||||
plugins: [{
|
||||
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.textBaseline = 'middle';
|
||||
ctx.textAlign = 'center';
|
||||
ctx.fillStyle = '<?php echo $dashboard_number_text_color; ?>';
|
||||
ctx.fillText(options.text, width / 2, top + (height / 2));
|
||||
ctx.save();
|
||||
}
|
||||
}]
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
@@ -231,7 +231,7 @@
|
||||
$sql .= "FROM v_voicemail_messages WHERE domain_uuid = :domain_uuid ";
|
||||
$parameters["domain_uuid"] = $_SESSION['domain_uuid'];
|
||||
$result = $database->select($sql, $parameters, 'all');
|
||||
|
||||
|
||||
if (is_array($result) && sizeof($result) != 0) {
|
||||
foreach ($result as $row) {
|
||||
$stats['domain']['messages']['total'] = $row['total'];
|
||||
@@ -239,11 +239,11 @@
|
||||
}
|
||||
}
|
||||
unset($sql, $result, $parameters);
|
||||
|
||||
|
||||
$sql = "SELECT count(*) total, count(*) FILTER(WHERE message_status IS DISTINCT FROM 'saved') AS new ";
|
||||
$sql .= "FROM v_voicemail_messages ";
|
||||
$result = $database->select($sql, null, 'all');
|
||||
|
||||
|
||||
if (is_array($result) && sizeof($result) != 0) {
|
||||
foreach ($result as $row) {
|
||||
$stats['system']['messages']['total'] = $row['total'];
|
||||
@@ -315,31 +315,41 @@
|
||||
],
|
||||
borderColor: '<?php echo $_SESSION['dashboard']['system_counts_chart_border_color']['text']; ?>',
|
||||
borderWidth: '<?php echo $_SESSION['dashboard']['system_counts_chart_border_width']['text']; ?>',
|
||||
cutout: chart_cutout
|
||||
}]
|
||||
},
|
||||
options: {
|
||||
responsive: true,
|
||||
maintainAspectRatio: false,
|
||||
plugins: {
|
||||
chart_counter: {
|
||||
chart_text: '<?php echo $domain_total; ?>'
|
||||
chart_number: {
|
||||
text: '<?php echo $domain_total; ?>'
|
||||
},
|
||||
legend: {
|
||||
display: true,
|
||||
position: 'right',
|
||||
reverse: true,
|
||||
labels: {
|
||||
usePointStyle: true,
|
||||
pointStyle: 'rect'
|
||||
pointStyle: 'rect',
|
||||
color: '<?php echo $dashboard_heading_text_color; ?>'
|
||||
}
|
||||
},
|
||||
title: {
|
||||
display: true,
|
||||
text: '<?php echo $text['label-system_counts']; ?>'
|
||||
text: '<?php echo $text['label-system_counts']; ?>',
|
||||
color: '<?php echo $dashboard_heading_text_color; ?>'
|
||||
}
|
||||
}
|
||||
},
|
||||
plugins: [chart_counter],
|
||||
plugins: [{
|
||||
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.textBaseline = 'middle';
|
||||
ctx.textAlign = 'center';
|
||||
ctx.fillStyle = '<?php echo $dashboard_number_text_color; ?>';
|
||||
ctx.fillText(options.text, width / 2, top + (height / 2));
|
||||
ctx.save();
|
||||
}
|
||||
}]
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
//uptime
|
||||
$result = shell_exec('uptime');
|
||||
$load_average = sys_getloadavg();
|
||||
|
||||
|
||||
}
|
||||
|
||||
//add half doughnut chart
|
||||
@@ -57,15 +57,6 @@
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var system_cpu_status_chart_background_color;
|
||||
if ('<?php echo $percent_cpu; ?>' <= 60) {
|
||||
system_cpu_status_chart_background_color = '<?php echo $_SESSION['dashboard']['cpu_usage_chart_main_background_color'][0]; ?>';
|
||||
} else if ('<?php echo $percent_cpu; ?>' <= 80) {
|
||||
system_cpu_status_chart_background_color = '<?php echo $_SESSION['dashboard']['cpu_usage_chart_main_background_color'][1]; ?>';
|
||||
} else if ('<?php echo $percent_cpu; ?>' > 80) {
|
||||
system_cpu_status_chart_background_color = '<?php echo $_SESSION['dashboard']['cpu_usage_chart_main_background_color'][2]; ?>';
|
||||
}
|
||||
|
||||
const system_cpu_status_chart = new Chart(
|
||||
document.getElementById('system_cpu_status_chart').getContext('2d'),
|
||||
{
|
||||
@@ -74,37 +65,50 @@
|
||||
datasets: [{
|
||||
data: ['<?php echo $percent_cpu; ?>', 100 - '<?php echo $percent_cpu; ?>'],
|
||||
backgroundColor: [
|
||||
system_cpu_status_chart_background_color,
|
||||
<?php
|
||||
if ($percent_cpu <= 60) {
|
||||
echo "'".$_SESSION['dashboard']['cpu_usage_chart_main_background_color'][0]."',\n";
|
||||
} else if ($percent_cpu <= 80) {
|
||||
echo "'".$_SESSION['dashboard']['cpu_usage_chart_main_background_color'][1]."',\n";
|
||||
} else if ($percent_cpu > 80) {
|
||||
echo "'".$_SESSION['dashboard']['cpu_usage_chart_main_background_color'][2]."',\n";
|
||||
}
|
||||
?>
|
||||
'<?php echo $_SESSION['dashboard']['cpu_usage_chart_sub_background_color']['text']; ?>'
|
||||
],
|
||||
borderColor: '<?php echo $_SESSION['dashboard']['cpu_usage_chart_border_color']['text']; ?>',
|
||||
borderWidth: '<?php echo $_SESSION['dashboard']['cpu_usage_chart_border_width']['text']; ?>',
|
||||
cutout: chart_cutout
|
||||
borderWidth: '<?php echo $_SESSION['dashboard']['cpu_usage_chart_border_width']['text']; ?>'
|
||||
}]
|
||||
},
|
||||
options: {
|
||||
responsive: true,
|
||||
maintainAspectRatio: false,
|
||||
circumference: 180,
|
||||
rotation: 270,
|
||||
plugins: {
|
||||
chart_counter_2: {
|
||||
chart_text: '<?php echo $percent_cpu; ?>'
|
||||
},
|
||||
legend: {
|
||||
display: false,
|
||||
chart_number_2: {
|
||||
text: '<?php echo $percent_cpu; ?>'
|
||||
},
|
||||
tooltip: {
|
||||
yAlign: 'bottom',
|
||||
displayColors: false,
|
||||
},
|
||||
title: {
|
||||
display: true,
|
||||
text: '<?php echo $text['label-cpu_usage']; ?>'
|
||||
text: '<?php echo $text['label-cpu_usage']; ?>',
|
||||
color: '<?php echo $dashboard_heading_text_color; ?>'
|
||||
}
|
||||
}
|
||||
},
|
||||
plugins: [chart_counter_2],
|
||||
plugins: [{
|
||||
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.textBaseline = 'middle';
|
||||
ctx.textAlign = 'center';
|
||||
ctx.fillStyle = '<?php echo $dashboard_number_text_color; ?>';
|
||||
ctx.fillText(options.text + '%', width / 2, top + (height / 2) + 35);
|
||||
ctx.save();
|
||||
}
|
||||
}]
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
@@ -42,15 +42,6 @@
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var system_status_chart_background_color;
|
||||
if ('<?php echo $percent_disk_usage; ?>' <= 80) {
|
||||
system_status_chart_background_color = '<?php echo $_SESSION['dashboard']['disk_usage_chart_main_background_color'][0]; ?>';
|
||||
} else if ('<?php echo $percent_disk_usage; ?>' <= 90) {
|
||||
system_status_chart_background_color = '<?php echo $_SESSION['dashboard']['disk_usage_chart_main_background_color'][1]; ?>';
|
||||
} else if ('<?php echo $percent_disk_usage; ?>' > 90) {
|
||||
system_status_chart_background_color = '<?php echo $_SESSION['dashboard']['disk_usage_chart_main_background_color'][2]; ?>';
|
||||
}
|
||||
|
||||
const system_status_chart = new Chart(
|
||||
document.getElementById('system_status_chart').getContext('2d'),
|
||||
{
|
||||
@@ -58,32 +49,47 @@
|
||||
data: {
|
||||
datasets: [{
|
||||
data: ['<?php echo $percent_disk_usage; ?>', 100 - '<?php echo $percent_disk_usage; ?>'],
|
||||
backgroundColor: [system_status_chart_background_color,
|
||||
'<?php echo $_SESSION['dashboard']['disk_usage_chart_sub_background_color']['text']; ?>'],
|
||||
backgroundColor: [
|
||||
<?php
|
||||
if ($percent_disk_usage <= 80) {
|
||||
echo "'".$_SESSION['dashboard']['disk_usage_chart_main_background_color'][0]."',\n";
|
||||
} else if ($percent_disk_usage <= 90) {
|
||||
echo "'".$_SESSION['dashboard']['disk_usage_chart_main_background_color'][1]."',\n";
|
||||
} else if ($percent_disk_usage > 90) {
|
||||
echo "'".$_SESSION['dashboard']['disk_usage_chart_main_background_color'][2]."',\n";
|
||||
}
|
||||
?>
|
||||
'<?php echo $_SESSION['dashboard']['disk_usage_chart_sub_background_color']['text']; ?>'
|
||||
],
|
||||
borderColor: '<?php echo $_SESSION['dashboard']['disk_usage_chart_border_color']['text']; ?>',
|
||||
borderWidth: '<?php echo $_SESSION['dashboard']['disk_usage_chart_border_width']['text']; ?>',
|
||||
cutout: chart_cutout
|
||||
borderWidth: '<?php echo $_SESSION['dashboard']['disk_usage_chart_border_width']['text']; ?>'
|
||||
}]
|
||||
},
|
||||
options: {
|
||||
responsive: true,
|
||||
maintainAspectRatio: false,
|
||||
circumference: 180,
|
||||
rotation: 270,
|
||||
plugins: {
|
||||
chart_counter_2: {
|
||||
chart_text: '<?php echo $percent_disk_usage; ?>'
|
||||
},
|
||||
legend: {
|
||||
display: false
|
||||
chart_number_2: {
|
||||
text: '<?php echo $percent_disk_usage; ?>'
|
||||
},
|
||||
title: {
|
||||
display: true,
|
||||
text: '<?php echo $text['label-disk_usage']; ?>'
|
||||
text: '<?php echo $text['label-disk_usage']; ?>',
|
||||
color: '<?php echo $dashboard_heading_text_color; ?>'
|
||||
}
|
||||
}
|
||||
},
|
||||
plugins: [chart_counter_2],
|
||||
plugins: [{
|
||||
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.textBaseline = 'middle';
|
||||
ctx.textAlign = 'center';
|
||||
ctx.fillStyle = '<?php echo $dashboard_number_text_color; ?>';
|
||||
ctx.fillText(options.text + '%', width / 2, top + (height / 2) + 35);
|
||||
ctx.save();
|
||||
}
|
||||
}]
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
$text = $language->get($_SESSION['domain']['language']['code'], 'core/user_settings');
|
||||
|
||||
//used for missed and recent calls
|
||||
$theme_image_path = $_SERVER["DOCUMENT_ROOT"]."/themes/".$_SESSION['domain']['template']['name']."/images/";
|
||||
$theme_image_path = $_SERVER["DOCUMENT_ROOT"]."/themes/".$_SESSION['domain']['template']['name']."/images/";
|
||||
|
||||
//voicemail
|
||||
echo "<div class='hud_box'>\n";
|
||||
@@ -52,6 +52,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//add doughnut chart
|
||||
?>
|
||||
<div style='display: flex; flex-wrap: wrap; justify-content: center; padding-bottom: 20px;' onclick="$('#hud_voicemail_details').slideToggle('fast');">
|
||||
@@ -67,32 +68,36 @@
|
||||
datasets: [{
|
||||
data: ['<?php echo $messages['new']; ?>', 0.00001],
|
||||
backgroundColor: [
|
||||
'<?php echo $_SESSION['dashboard']['new_messages_chart_main_background_color']['text']; ?>',
|
||||
'<?php echo $_SESSION['dashboard']['new_messages_chart_main_background_color']['text']; ?>',
|
||||
'<?php echo $_SESSION['dashboard']['new_messages_chart_sub_background_color']['text']; ?>'
|
||||
],
|
||||
borderColor: '<?php echo $_SESSION['dashboard']['new_messages_chart_border_color']['text']; ?>',
|
||||
borderWidth: '<?php echo $_SESSION['dashboard']['new_messages_chart_border_width']['text']; ?>',
|
||||
cutout: chart_cutout
|
||||
}]
|
||||
},
|
||||
options: {
|
||||
responsive: true,
|
||||
maintainAspectRatio: false,
|
||||
plugins: {
|
||||
chart_counter: {
|
||||
chart_text: '<?php echo $messages['new']; ?>',
|
||||
},
|
||||
legend: {
|
||||
display: false
|
||||
chart_number: {
|
||||
text: '<?php echo $messages['new']; ?>'
|
||||
},
|
||||
title: {
|
||||
display: true,
|
||||
text: '<?php echo $text['label-new_messages']; ?>',
|
||||
fontFamily: chart_text_font
|
||||
color: '<?php echo $dashboard_heading_text_color; ?>'
|
||||
}
|
||||
}
|
||||
},
|
||||
plugins: [chart_counter],
|
||||
plugins: [{
|
||||
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.textBaseline = 'middle';
|
||||
ctx.textAlign = 'center';
|
||||
ctx.fillStyle = '<?php echo $dashboard_number_text_color; ?>';
|
||||
ctx.fillText(options.text, width / 2, top + (height / 2));
|
||||
ctx.save();
|
||||
}
|
||||
}]
|
||||
}
|
||||
);
|
||||
</script>
|
||||
@@ -130,8 +135,8 @@
|
||||
}
|
||||
echo "</div>";
|
||||
//$n++;
|
||||
|
||||
|
||||
echo "<span class='hud_expander' onclick=\"$('#hud_voicemail_details').slideToggle('fast');\"><span class='fas fa-ellipsis-h'></span></span>";
|
||||
echo "</div>\n";
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -110,26 +110,31 @@
|
||||
],
|
||||
borderColor: '<?php echo $_SESSION['dashboard']['missed_calls_chart_border_color']['text']; ?>',
|
||||
borderWidth: '<?php echo $_SESSION['dashboard']['missed_calls_chart_border_width']['text']; ?>',
|
||||
cutout: chart_cutout
|
||||
}]
|
||||
},
|
||||
options: {
|
||||
responsive: true,
|
||||
maintainAspectRatio: false,
|
||||
plugins: {
|
||||
chart_counter: {
|
||||
chart_text: '<?php echo $num_rows; ?>'
|
||||
},
|
||||
legend: {
|
||||
display: false
|
||||
chart_number: {
|
||||
text: '<?php echo $num_rows; ?>'
|
||||
},
|
||||
title: {
|
||||
display: true,
|
||||
text: '<?php echo $text['label-missed_calls']; ?>'
|
||||
text: '<?php echo $text['label-missed_calls']; ?>',
|
||||
color: '<?php echo $dashboard_heading_text_color; ?>'
|
||||
}
|
||||
}
|
||||
},
|
||||
plugins: [chart_counter],
|
||||
plugins: [{
|
||||
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.textBaseline = 'middle';
|
||||
ctx.textAlign = 'center';
|
||||
ctx.fillStyle = '<?php echo $dashboard_number_text_color; ?>';
|
||||
ctx.fillText(options.text, width / 2, top + (height / 2));
|
||||
ctx.save();
|
||||
}
|
||||
}]
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
@@ -105,27 +105,32 @@
|
||||
'<?php echo $_SESSION['dashboard']['recent_calls_chart_sub_background_color']['text']; ?>'
|
||||
],
|
||||
borderColor: '<?php echo $_SESSION['dashboard']['recent_calls_chart_border_color']['text']; ?>',
|
||||
borderWidth: '<?php echo $_SESSION['dashboard']['recent_calls_chart_border_width']['text']; ?>',
|
||||
cutout: chart_cutout
|
||||
borderWidth: '<?php echo $_SESSION['dashboard']['recent_calls_chart_border_width']['text']; ?>'
|
||||
}]
|
||||
},
|
||||
options: {
|
||||
responsive: true,
|
||||
maintainAspectRatio: false,
|
||||
plugins: {
|
||||
chart_counter: {
|
||||
chart_text: '<?php echo $num_rows; ?>'
|
||||
},
|
||||
legend: {
|
||||
display: false
|
||||
chart_number: {
|
||||
text: '<?php echo $num_rows; ?>'
|
||||
},
|
||||
title: {
|
||||
display: true,
|
||||
text: '<?php echo $text['label-recent_calls']; ?>'
|
||||
text: '<?php echo $text['label-recent_calls']; ?>',
|
||||
color: '<?php echo $dashboard_heading_text_color; ?>'
|
||||
}
|
||||
}
|
||||
},
|
||||
plugins: [chart_counter],
|
||||
plugins: [{
|
||||
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.textBaseline = 'middle';
|
||||
ctx.textAlign = 'center';
|
||||
ctx.fillStyle = '<?php echo $dashboard_number_text_color; ?>';
|
||||
ctx.fillText(options.text, width / 2, top + (height / 2));
|
||||
ctx.save();
|
||||
}
|
||||
}]
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user