Dashboard - Add text color settings (#6950)

* Dashboard - Add text color setting
This commit is contained in:
Alex
2024-04-17 15:01:54 -07:00
committed by GitHub
parent 37fd4692c1
commit 1412ed7f68
16 changed files with 398 additions and 209 deletions

View File

@@ -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";