From 1412ed7f6894c883ee09634460cd0b5bbd997e1f Mon Sep 17 00:00:00 2001 From: Alex <40072887+alexdcrane@users.noreply.github.com> Date: Wed, 17 Apr 2024 15:01:54 -0700 Subject: [PATCH] Dashboard - Add text color settings (#6950) * Dashboard - Add text color setting --- .../resources/dashboard/call_forward.php | 32 ++++-- .../resources/dashboard/domain_limits.php | 24 ++-- .../resources/dashboard/caller_id.php | 32 ++++-- .../dashboard/ring_group_forward.php | 32 ++++-- .../resources/dashboard/switch_status.php | 37 +++--- .../resources/dashboard/system_counts.php | 34 ++++-- .../resources/dashboard/system_cpu_status.php | 50 +++++---- .../resources/dashboard/system_status.php | 52 +++++---- .../resources/dashboard/voicemails.php | 35 +++--- .../resources/dashboard/missed_calls.php | 27 +++-- .../resources/dashboard/recent_calls.php | 29 +++-- core/dashboard/app_config.php | 25 ++--- core/dashboard/app_languages.php | 106 +++++++++++++++++- core/dashboard/dashboard_edit.php | 32 +++++- core/dashboard/index.php | 50 +++------ themes/default/app_config.php | 10 +- 16 files changed, 398 insertions(+), 209 deletions(-) diff --git a/app/call_forward/resources/dashboard/call_forward.php b/app/call_forward/resources/dashboard/call_forward.php index 4cbcd8eaa5..4aefc3a8e4 100644 --- a/app/call_forward/resources/dashboard/call_forward.php +++ b/app/call_forward/resources/dashboard/call_forward.php @@ -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 "\n"; diff --git a/app/domain_limits/resources/dashboard/domain_limits.php b/app/domain_limits/resources/dashboard/domain_limits.php index cc0f9c6506..4795a3096c 100644 --- a/app/domain_limits/resources/dashboard/domain_limits.php +++ b/app/domain_limits/resources/dashboard/domain_limits.php @@ -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 "\n"; diff --git a/app/extensions/resources/dashboard/caller_id.php b/app/extensions/resources/dashboard/caller_id.php index 855db17ea5..f470da5892 100644 --- a/app/extensions/resources/dashboard/caller_id.php +++ b/app/extensions/resources/dashboard/caller_id.php @@ -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 "\n"; @@ -302,4 +312,4 @@ } -?> \ No newline at end of file +?> diff --git a/app/ring_groups/resources/dashboard/ring_group_forward.php b/app/ring_groups/resources/dashboard/ring_group_forward.php index 75bf39cfd9..4ea6f4db4f 100644 --- a/app/ring_groups/resources/dashboard/ring_group_forward.php +++ b/app/ring_groups/resources/dashboard/ring_group_forward.php @@ -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 "\n"; diff --git a/app/switch/resources/dashboard/switch_status.php b/app/switch/resources/dashboard/switch_status.php index a870392d64..734dde05a2 100644 --- a/app/switch/resources/dashboard/switch_status.php +++ b/app/switch/resources/dashboard/switch_status.php @@ -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: ['', ''], borderColor: '', - borderWidth: '', - cutout: chart_cutout + borderWidth: '' }] }, options: { - responsive: true, - maintainAspectRatio: false, plugins: { - chart_counter: { - chart_text: '' - }, - legend: { - display: false + chart_number: { + text: '' }, title: { - display: true, - text: '' + 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 = ''; + ctx.fillText(options.text, width / 2, top + (height / 2)); + ctx.save(); + } + }] } ); diff --git a/app/system/resources/dashboard/system_counts.php b/app/system/resources/dashboard/system_counts.php index 8ce8292e1a..19ae278a9c 100644 --- a/app/system/resources/dashboard/system_counts.php +++ b/app/system/resources/dashboard/system_counts.php @@ -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: '', borderWidth: '', - cutout: chart_cutout }] }, options: { - responsive: true, - maintainAspectRatio: false, plugins: { - chart_counter: { - chart_text: '' + chart_number: { + text: '' }, legend: { + display: true, position: 'right', reverse: true, labels: { usePointStyle: true, - pointStyle: 'rect' + pointStyle: 'rect', + color: '' } }, title: { - display: true, - text: '' + 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 = ''; + ctx.fillText(options.text, width / 2, top + (height / 2)); + ctx.save(); + } + }] } ); diff --git a/app/system/resources/dashboard/system_cpu_status.php b/app/system/resources/dashboard/system_cpu_status.php index a2ff11ff40..7d780de394 100644 --- a/app/system/resources/dashboard/system_cpu_status.php +++ b/app/system/resources/dashboard/system_cpu_status.php @@ -47,7 +47,7 @@ //uptime $result = shell_exec('uptime'); $load_average = sys_getloadavg(); - + } //add half doughnut chart @@ -57,15 +57,6 @@ diff --git a/app/system/resources/dashboard/system_status.php b/app/system/resources/dashboard/system_status.php index 330a28dda7..0c51c693e0 100644 --- a/app/system/resources/dashboard/system_status.php +++ b/app/system/resources/dashboard/system_status.php @@ -42,15 +42,6 @@ diff --git a/app/voicemails/resources/dashboard/voicemails.php b/app/voicemails/resources/dashboard/voicemails.php index d0dbf1ff6d..949a20cd36 100644 --- a/app/voicemails/resources/dashboard/voicemails.php +++ b/app/voicemails/resources/dashboard/voicemails.php @@ -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 "
\n"; @@ -52,6 +52,7 @@ } } + //add doughnut chart ?>
@@ -67,32 +68,36 @@ datasets: [{ data: ['', 0.00001], backgroundColor: [ - '', + '', '' ], borderColor: '', borderWidth: '', - cutout: chart_cutout }] }, options: { - responsive: true, - maintainAspectRatio: false, plugins: { - chart_counter: { - chart_text: '', - }, - legend: { - display: false + chart_number: { + text: '' }, title: { - display: true, text: '', - fontFamily: chart_text_font + 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 = ''; + ctx.fillText(options.text, width / 2, top + (height / 2)); + ctx.save(); + } + }] } ); @@ -130,8 +135,8 @@ } echo "
"; //$n++; - + echo ""; echo "
\n"; -?> \ No newline at end of file +?> diff --git a/app/xml_cdr/resources/dashboard/missed_calls.php b/app/xml_cdr/resources/dashboard/missed_calls.php index 02611ef3eb..e19a4f9f4e 100644 --- a/app/xml_cdr/resources/dashboard/missed_calls.php +++ b/app/xml_cdr/resources/dashboard/missed_calls.php @@ -110,26 +110,31 @@ ], borderColor: '', borderWidth: '', - cutout: chart_cutout }] }, options: { - responsive: true, - maintainAspectRatio: false, plugins: { - chart_counter: { - chart_text: '' - }, - legend: { - display: false + chart_number: { + text: '' }, title: { - display: true, - text: '' + 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 = ''; + ctx.fillText(options.text, width / 2, top + (height / 2)); + ctx.save(); + } + }] } ); diff --git a/app/xml_cdr/resources/dashboard/recent_calls.php b/app/xml_cdr/resources/dashboard/recent_calls.php index 0fc21e660d..d5a044719b 100644 --- a/app/xml_cdr/resources/dashboard/recent_calls.php +++ b/app/xml_cdr/resources/dashboard/recent_calls.php @@ -105,27 +105,32 @@ '' ], borderColor: '', - borderWidth: '', - cutout: chart_cutout + borderWidth: '' }] }, options: { - responsive: true, - maintainAspectRatio: false, plugins: { - chart_counter: { - chart_text: '' - }, - legend: { - display: false + chart_number: { + text: '' }, title: { - display: true, - text: '' + 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 = ''; + ctx.fillText(options.text, width / 2, top + (height / 2)); + ctx.save(); + } + }] } ); diff --git a/core/dashboard/app_config.php b/core/dashboard/app_config.php index a312990cb9..edb4d26df5 100644 --- a/core/dashboard/app_config.php +++ b/core/dashboard/app_config.php @@ -72,6 +72,16 @@ $apps[$x]['db'][$y]['fields'][$z]['search_by'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the dashboard path.'; $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = 'dashboard_heading_text_color'; + $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; + $apps[$x]['db'][$y]['fields'][$z]['search_by'] = ''; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the heading text color.'; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = 'dashboard_number_text_color'; + $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; + $apps[$x]['db'][$y]['fields'][$z]['search_by'] = ''; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the number text color.'; + $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = 'dashboard_column_span'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric'; $apps[$x]['db'][$y]['fields'][$z]['search_by'] = ''; @@ -173,20 +183,5 @@ //default settings $y=0; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "8e44f758-e2ec-41e0-aa81-464fefb3bdb3"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "dashboard"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "chart_text_size"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "30"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = ""; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "6e797ac7-31bc-497c-88e3-c41fc12e7e45"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "dashboard"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "chart_text_color"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "#444444"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = ""; ?> diff --git a/core/dashboard/app_languages.php b/core/dashboard/app_languages.php index 60be68812c..b94982e9b9 100644 --- a/core/dashboard/app_languages.php +++ b/core/dashboard/app_languages.php @@ -260,6 +260,110 @@ $text['description-dashboard_groups']['zh-cn'] = "添加有权访问此小部件 $text['description-dashboard_groups']['ja-jp'] = "このウィジェットに対する権限を持つグループを追加します。"; $text['description-dashboard_groups']['ko-kr'] = "이 위젯에 대한 권한이 있는 그룹을 추가하십시오."; +$text['label-dashboard_heading_text_color']['en-us'] = "Heading Text Color"; +$text['label-dashboard_heading_text_color']['en-gb'] = "Heading Text Color"; +$text['label-dashboard_heading_text_color']['ar-eg'] = "لون نص العنوان"; +$text['label-dashboard_heading_text_color']['de-at'] = "Farbe des Überschriftentextes"; +$text['label-dashboard_heading_text_color']['de-ch'] = "Farbe des Überschriftentextes"; +$text['label-dashboard_heading_text_color']['de-de'] = "Farbe des Überschriftentextes"; +$text['label-dashboard_heading_text_color']['el-gr'] = "Χρώμα κειμένου επικεφαλίδας"; +$text['label-dashboard_heading_text_color']['es-cl'] = "Color del texto del encabezado"; +$text['label-dashboard_heading_text_color']['es-mx'] = "Color del texto del encabezado"; +$text['label-dashboard_heading_text_color']['fr-ca'] = "Couleur du texte du titre"; +$text['label-dashboard_heading_text_color']['fr-fr'] = "Couleur du texte du titre"; +$text['label-dashboard_heading_text_color']['he-il'] = "צבע טקסט כותרת"; +$text['label-dashboard_heading_text_color']['it-it'] = "Colore del testo dell'intestazione"; +$text['label-dashboard_heading_text_color']['nl-nl'] = "Kleur van de koptekst"; +$text['label-dashboard_heading_text_color']['pl-pl'] = "Kolor tekstu nagłówka"; +$text['label-dashboard_heading_text_color']['pt-br'] = "Cor do texto do título"; +$text['label-dashboard_heading_text_color']['pt-pt'] = "Cor do texto do título"; +$text['label-dashboard_heading_text_color']['ro-ro'] = "Culoarea textului titlului"; +$text['label-dashboard_heading_text_color']['ru-ru'] = "Цвет текста заголовка"; +$text['label-dashboard_heading_text_color']['sv-se'] = "Rubrik Textfärg"; +$text['label-dashboard_heading_text_color']['uk-ua'] = "Колір тексту заголовка"; +$text['label-dashboard_heading_text_color']['tr-tr'] = "Başlık Metni Rengi"; +$text['label-dashboard_heading_text_color']['zh-cn'] = "标题文字颜色"; +$text['label-dashboard_heading_text_color']['ja-jp'] = "見出しの文字色"; +$text['label-dashboard_heading_text_color']['ko-kr'] = "제목 텍스트 색상"; + +$text['description-dashboard_heading_text_color']['en-us'] = "Enter the dashboard widget heading text color."; +$text['description-dashboard_heading_text_color']['en-gb'] = "Enter the dashboard widget heading text color."; +$text['description-dashboard_heading_text_color']['ar-eg'] = "أدخل لون نص عنوان عنصر واجهة المستخدم للوحة المعلومات."; +$text['description-dashboard_heading_text_color']['de-at'] = "Geben Sie die Textfarbe für die Überschrift des Dashboard-Widgets ein."; +$text['description-dashboard_heading_text_color']['de-ch'] = "Geben Sie die Textfarbe für die Überschrift des Dashboard-Widgets ein."; +$text['description-dashboard_heading_text_color']['de-de'] = "Geben Sie die Textfarbe für die Überschrift des Dashboard-Widgets ein."; +$text['description-dashboard_heading_text_color']['el-gr'] = "Εισαγάγετε το χρώμα κειμένου της επικεφαλίδας του γραφικού πίνακα εργαλείων."; +$text['description-dashboard_heading_text_color']['es-cl'] = "Ingrese el color del texto del encabezado del widget del panel."; +$text['description-dashboard_heading_text_color']['es-mx'] = "Ingrese el color del texto del encabezado del widget del panel."; +$text['description-dashboard_heading_text_color']['fr-ca'] = "Entrez la couleur du texte du titre du widget du tableau de bord."; +$text['description-dashboard_heading_text_color']['fr-fr'] = "Entrez la couleur du texte du titre du widget du tableau de bord."; +$text['description-dashboard_heading_text_color']['he-il'] = "הזן את צבע הטקסט של ווידג'ט לוח המחוונים."; +$text['description-dashboard_heading_text_color']['it-it'] = "Inserisci il colore del testo dell'intestazione del widget del dashboard."; +$text['description-dashboard_heading_text_color']['nl-nl'] = "Voer de tekstkleur van de dashboardwidgetkop in."; +$text['description-dashboard_heading_text_color']['pl-pl'] = "Wprowadź kolor tekstu nagłówka widżetu panelu kontrolnego."; +$text['description-dashboard_heading_text_color']['pt-br'] = "Insira a cor do texto do cabeçalho do widget do painel."; +$text['description-dashboard_heading_text_color']['pt-pt'] = "Insira a cor do texto do cabeçalho do widget do painel."; +$text['description-dashboard_heading_text_color']['ro-ro'] = "Introduceți culoarea textului pentru antetul widgetului tabloului de bord."; +$text['description-dashboard_heading_text_color']['ru-ru'] = "Введите цвет текста заголовка виджета информационной панели."; +$text['description-dashboard_heading_text_color']['sv-se'] = "Ange textfärg för instrumentpanelwidgetens rubrik."; +$text['description-dashboard_heading_text_color']['uk-ua'] = "Введіть колір тексту заголовка віджета інформаційної панелі."; +$text['description-dashboard_heading_text_color']['tr-tr'] = "Kontrol paneli widget'ı başlık metni rengini girin."; +$text['description-dashboard_heading_text_color']['zh-cn'] = "输入仪表板小部件标题文本颜色。"; +$text['description-dashboard_heading_text_color']['ja-jp'] = "ダッシュボード ウィジェットの見出しのテキストの色を入力します。"; +$text['description-dashboard_heading_text_color']['ko-kr'] = "대시보드 위젯 제목 텍스트 색상을 입력합니다."; + +$text['label-dashboard_number_text_color']['en-us'] = "Number Text Color"; +$text['label-dashboard_number_text_color']['en-gb'] = "Number Text Color"; +$text['label-dashboard_number_text_color']['ar-eg'] = "رقم لون النص"; +$text['label-dashboard_number_text_color']['de-at'] = "Zahlentextfarbe"; +$text['label-dashboard_number_text_color']['de-ch'] = "Zahlentextfarbe"; +$text['label-dashboard_number_text_color']['de-de'] = "Zahlentextfarbe"; +$text['label-dashboard_number_text_color']['el-gr'] = "Χρώμα κειμένου αριθμού"; +$text['label-dashboard_number_text_color']['es-cl'] = "Número Color del texto"; +$text['label-dashboard_number_text_color']['es-mx'] = "Número Color del texto"; +$text['label-dashboard_number_text_color']['fr-ca'] = "Couleur du texte numérique"; +$text['label-dashboard_number_text_color']['fr-fr'] = "Couleur du texte numérique"; +$text['label-dashboard_number_text_color']['he-il'] = "צבע טקסט מספר"; +$text['label-dashboard_number_text_color']['it-it'] = "Colore del testo numerico"; +$text['label-dashboard_number_text_color']['nl-nl'] = "Nummer tekstkleur"; +$text['label-dashboard_number_text_color']['pl-pl'] = "Kolor tekstu liczbowego"; +$text['label-dashboard_number_text_color']['pt-br'] = "Cor do texto numérico"; +$text['label-dashboard_number_text_color']['pt-pt'] = "Cor do texto numérico"; +$text['label-dashboard_number_text_color']['ro-ro'] = "Număr Text Culoare"; +$text['label-dashboard_number_text_color']['ru-ru'] = "Цвет текста номера"; +$text['label-dashboard_number_text_color']['sv-se'] = "Nummertextfärg"; +$text['label-dashboard_number_text_color']['uk-ua'] = "Номер Колір тексту"; +$text['label-dashboard_number_text_color']['tr-tr'] = "Sayı Metin Rengi"; +$text['label-dashboard_number_text_color']['zh-cn'] = "数字文字颜色"; +$text['label-dashboard_number_text_color']['ja-jp'] = "数字のテキストの色"; +$text['label-dashboard_number_text_color']['ko-kr'] = "숫자 텍스트 색상"; + +$text['description-dashboard_number_text_color']['en-us'] = "Enter the dashboard widget number text color."; +$text['description-dashboard_number_text_color']['en-gb'] = "Enter the dashboard widget number text color."; +$text['description-dashboard_number_text_color']['ar-eg'] = "أدخل لون نص رقم عنصر واجهة المستخدم للوحة المعلومات."; +$text['description-dashboard_number_text_color']['de-at'] = "Geben Sie die Textfarbe für die Nummer des Dashboard-Widgets ein."; +$text['description-dashboard_number_text_color']['de-ch'] = "Geben Sie die Textfarbe für die Nummer des Dashboard-Widgets ein."; +$text['description-dashboard_number_text_color']['de-de'] = "Geben Sie die Textfarbe für die Nummer des Dashboard-Widgets ein."; +$text['description-dashboard_number_text_color']['el-gr'] = "Εισαγάγετε το χρώμα κειμένου του αριθμού γραφικού στοιχείου του πίνακα εργαλείων."; +$text['description-dashboard_number_text_color']['es-cl'] = "Ingrese el color del texto del número del widget del panel."; +$text['description-dashboard_number_text_color']['es-mx'] = "Ingrese el color del texto del número del widget del panel."; +$text['description-dashboard_number_text_color']['fr-ca'] = "Entrez la couleur du texte du numéro du widget du tableau de bord."; +$text['description-dashboard_number_text_color']['fr-fr'] = "Entrez la couleur du texte du numéro du widget du tableau de bord."; +$text['description-dashboard_number_text_color']['he-il'] = "הזן את צבע הטקסט של מספר הווידג'ט של לוח המחוונים."; +$text['description-dashboard_number_text_color']['it-it'] = "Inserisci il colore del testo del numero del widget del dashboard."; +$text['description-dashboard_number_text_color']['nl-nl'] = "Voer de tekstkleur van het dashboardwidgetnummer in."; +$text['description-dashboard_number_text_color']['pl-pl'] = "Wprowadź kolor tekstu numeru widżetu panelu kontrolnego."; +$text['description-dashboard_number_text_color']['pt-br'] = "Insira a cor do texto do número do widget do painel."; +$text['description-dashboard_number_text_color']['pt-pt'] = "Insira a cor do texto do número do widget do painel."; +$text['description-dashboard_number_text_color']['ro-ro'] = "Introduceți culoarea textului cu numărul widget-ului tabloului de bord."; +$text['description-dashboard_number_text_color']['ru-ru'] = "Введите цвет текста номера виджета панели управления."; +$text['description-dashboard_number_text_color']['sv-se'] = "Ange instrumentpanelens widgets textfärg."; +$text['description-dashboard_number_text_color']['uk-ua'] = "Введіть колір тексту номера віджета приладової панелі."; +$text['description-dashboard_number_text_color']['tr-tr'] = "Kontrol paneli widget numarası metin rengini girin."; +$text['description-dashboard_number_text_color']['zh-cn'] = "输入仪表板小部件编号文本颜色。"; +$text['description-dashboard_number_text_color']['ja-jp'] = "ダッシュボード ウィジェット番号のテキストの色を入力します。"; +$text['description-dashboard_number_text_color']['ko-kr'] = "대시보드 위젯 번호 텍스트 색상을 입력하세요."; + $text['label-dashboard_column_span']['en-us'] = "Column Span"; $text['label-dashboard_column_span']['en-gb'] = "Column Span"; $text['label-dashboard_column_span']['ar-eg'] = "العمود سبان"; @@ -624,4 +728,4 @@ $text['login-message_dismiss']['zh-cn'] = "Dismiss Message"; $text['login-message_dismiss']['ja-jp'] = "Dismiss Message"; $text['login-message_dismiss']['ko-kr'] = "Dismiss Message"; -?> +?> \ No newline at end of file diff --git a/core/dashboard/dashboard_edit.php b/core/dashboard/dashboard_edit.php index eb470bebd9..8781f0df3a 100644 --- a/core/dashboard/dashboard_edit.php +++ b/core/dashboard/dashboard_edit.php @@ -65,6 +65,8 @@ $dashboard_name = $_POST["dashboard_name"] ?? ''; $dashboard_path = $_POST["dashboard_path"] ?? ''; $dashboard_groups = $_POST["dashboard_groups"] ?? ''; + $dashboard_heading_text_color = $_POST["dashboard_heading_text_color"] ?? ''; + $dashboard_number_text_color = $_POST["dashboard_number_text_color"] ?? ''; $dashboard_column_span = $_POST["dashboard_column_span"] ?? ''; $dashboard_details_state = $_POST["dashboard_details_state"] ?? ''; $dashboard_order = $_POST["dashboard_order"] ?? ''; @@ -163,6 +165,8 @@ $array['dashboard'][0]['dashboard_uuid'] = $dashboard_uuid; $array['dashboard'][0]['dashboard_name'] = $dashboard_name; $array['dashboard'][0]['dashboard_path'] = $dashboard_path; + $array['dashboard'][0]['dashboard_heading_text_color'] = $dashboard_heading_text_color; + $array['dashboard'][0]['dashboard_number_text_color'] = $dashboard_number_text_color; $array['dashboard'][0]['dashboard_column_span'] = $dashboard_column_span; $array['dashboard'][0]['dashboard_details_state'] = $dashboard_details_state; $array['dashboard'][0]['dashboard_order'] = $dashboard_order; @@ -208,6 +212,8 @@ $sql .= " dashboard_uuid, "; $sql .= " dashboard_name, "; $sql .= " dashboard_path, "; + $sql .= " dashboard_heading_text_color, "; + $sql .= " dashboard_number_text_color, "; $sql .= " dashboard_column_span, "; $sql .= " dashboard_details_state, "; $sql .= " dashboard_order, "; @@ -221,6 +227,8 @@ if (is_array($row) && @sizeof($row) != 0) { $dashboard_name = $row["dashboard_name"]; $dashboard_path = $row["dashboard_path"]; + $dashboard_heading_text_color = $row["dashboard_heading_text_color"]; + $dashboard_number_text_color = $row["dashboard_number_text_color"]; $dashboard_column_span = $row["dashboard_column_span"]; $dashboard_details_state = $row["dashboard_details_state"]; $dashboard_order = $row["dashboard_order"]; @@ -396,6 +404,28 @@ echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; + echo $text['label-dashboard_heading_text_color']."\n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-dashboard_heading_text_color']."\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo $text['label-dashboard_number_text_color']."\n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-dashboard_number_text_color']."\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo " ".$text['label-dashboard_column_span']."\n"; @@ -513,4 +543,4 @@ //include the footer require_once "resources/footer.php"; -?> +?> \ No newline at end of file diff --git a/core/dashboard/index.php b/core/dashboard/index.php index 4c1bc92b8e..dfcad2e06c 100644 --- a/core/dashboard/index.php +++ b/core/dashboard/index.php @@ -72,6 +72,8 @@ $sql .= "dashboard_uuid, \n"; $sql .= "dashboard_name, \n"; $sql .= "dashboard_path, \n"; + $sql .= "dashboard_heading_text_color, \n"; + $sql .= "dashboard_number_text_color, \n"; $sql .= "dashboard_column_span, \n"; $sql .= "dashboard_details_state, \n"; $sql .= "dashboard_order, \n"; @@ -127,6 +129,9 @@ $language = new text; $text = $language->get(); +//add the settings object + $settings = new settings(["domain_uuid" => $_SESSION['domain_uuid'], "user_uuid" => $_SESSION['user_uuid']]); + //load the header $document['title'] = $text['title-dashboard']; require_once "resources/header.php"; @@ -138,40 +143,15 @@ echo ""; //chart variables - ?> - - \n"; + echo " var chart_text_font = 'arial';\n"; + echo " var chart_text_size = 30;\n"; + echo " Chart.defaults.responsive = true;\n"; + echo " Chart.defaults.maintainAspectRatio = false;\n"; + echo " Chart.defaults.plugins.legend.display = false;\n"; + echo " Chart.defaults.plugins.title.display = true;\n"; + echo " Chart.overrides.doughnut.cutout = '75%';\n"; + echo "\n"; // determine initial state all button to display $expanded_all = true; @@ -323,6 +303,8 @@ foreach($dashboard as $row) { $dashboard_name = strtolower($row['dashboard_name']); $dashboard_name = str_replace(" ", "_", $dashboard_name); + $dashboard_heading_text_color = $row['dashboard_heading_text_color'] ?? $settings->get('theme', 'dashboard_heading_text_color'); + $dashboard_number_text_color = $row['dashboard_heading_text_color'] ?? $settings->get('theme', 'dashboard_number_text_color'); echo "
\n"; include($row['dashboard_path']); echo "
\n"; diff --git a/themes/default/app_config.php b/themes/default/app_config.php index de53e21b81..9bd2c842c3 100644 --- a/themes/default/app_config.php +++ b/themes/default/app_config.php @@ -899,8 +899,8 @@ $apps[$x]['default_settings'][$y]['default_setting_category'] = "theme"; $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "dashboard_heading_text_color"; $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "#ffffff"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "#444444"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "Set the color (and opacity) of the Dashboard block heading text."; $y++; $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "b09126da-c68b-473c-83f8-8e9a7523ce37"; @@ -963,8 +963,8 @@ $apps[$x]['default_settings'][$y]['default_setting_category'] = "theme"; $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "dashboard_number_text_color"; $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "#ffffff"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "#444444"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "Set the color (and opacity) of the Dashboard block number."; $y++; $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "1d829bf8-6b4e-44e8-8cb5-962f8b91d64e"; @@ -2695,4 +2695,4 @@ $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "Display A-leg/left and B-leg/right channel audio waveforms on a single axis."; -?> \ No newline at end of file +?>