Dashboard - Add text color settings (#6950)

* Dashboard - Add text color setting
This commit is contained in:
Alex
2024-04-17 16:01:54 -06:00
committed by GitHub
parent 37fd4692c1
commit 1412ed7f68
16 changed files with 398 additions and 209 deletions
+10 -15
View File
@@ -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'] = "";
?>
+105 -1
View File
@@ -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";
?>
?>
+31 -1
View File
@@ -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 "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo $text['label-dashboard_heading_text_color']."\n";
echo "</td>\n";
echo "<td class='vtable' style='position: relative;' align='left'>\n";
echo " <input type='text' class='formfld colorpicker' name='dashboard_heading_text_color' value='".escape($dashboard_heading_text_color)."'>\n";
echo "<br />\n";
echo $text['description-dashboard_heading_text_color']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo $text['label-dashboard_number_text_color']."\n";
echo "</td>\n";
echo "<td class='vtable' style='position: relative;' align='left'>\n";
echo " <input type='text' class='formfld colorpicker' name='dashboard_number_text_color' value='".escape($dashboard_number_text_color)."'>\n";
echo "<br />\n";
echo $text['description-dashboard_number_text_color']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-dashboard_column_span']."\n";
@@ -513,4 +543,4 @@
//include the footer
require_once "resources/footer.php";
?>
?>
+16 -34
View File
@@ -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 "<script src='/resources/chartjs/chart.min.js'></script>";
//chart variables
?>
<script>
var chart_text_font = 'arial';
var chart_text_size = '<?php echo $_SESSION['dashboard']['chart_text_size']['text']; ?>';
var chart_text_color = '<?php echo $_SESSION['dashboard']['chart_text_color']['text']; ?>';
var chart_cutout = '75%';
const chart_counter = {
id: 'chart_counter',
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 = chart_text_color;
ctx.fillText(options.chart_text, width / 2, top + (height / 2));
ctx.save();
}
};
const chart_counter_2 = {
id: 'chart_counter_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 = chart_text_color;
ctx.fillText(options.chart_text + '%', width / 2, top + (height / 2) + 35);
ctx.save();
}
};
</script>
<?php
echo "<script>\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 "</script>\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 "<div class='widget' id='".$dashboard_name."' draggable='false'>\n";
include($row['dashboard_path']);
echo "</div>\n";