mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
Dashboard - Use the uuid instead of name for widget ids (#7443)
* Dashboard - Use the uuid instead of name for widget ids * Update active_calls.php * Update domain_limits.php * Update caller_id.php * Update registrations.php * Update ring_group_forward.php * Update switch_status.php * Update system_counts.php * Update system_cpu_status.php * Update system_services.php * Update system_status.php * Update voicemails.php * Update missed_calls.php * Update recent_calls.php * Update content.php * Update icon.php * Update parent.php * Update domains.php
This commit is contained in:
@@ -68,7 +68,7 @@ $row_style["0"] = "row_style0";
|
||||
$row_style["1"] = "row_style1";
|
||||
|
||||
//icon and count
|
||||
echo "<div class='hud_content' ".($dashboard_details_state == "disabled" ?: "onclick=\"$('#hud_active_calls_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_name."')\"").">\n";
|
||||
echo "<div class='hud_content' ".($dashboard_details_state == "disabled" ?: "onclick=\"$('#hud_active_calls_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_id."')\"").">\n";
|
||||
echo "<span class='hud_title'><a onclick=\"document.location.href='".PROJECT_PATH."/app/active_calls/active_calls.php'\">".$text['title']."</a></span>\n";
|
||||
echo "<div style='position: relative; display: inline-block;'>\n";
|
||||
echo "<span class='hud_stat'><i class=\"fas ".$dashboard_icon." \"></i></span>\n";
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2017-2023
|
||||
Portions created by the Initial Developer are Copyright (C) 2017-2025
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -110,7 +110,7 @@
|
||||
$hud_stat_title = $text['label-destinations'];
|
||||
}
|
||||
|
||||
echo " <div class='hud_content' ".($dashboard_details_state == "disabled" ?: "onclick=\"$('#hud_domain_limits_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_name."')\"").">\n";
|
||||
echo " <div class='hud_content' ".($dashboard_details_state == "disabled" ?: "onclick=\"$('#hud_domain_limits_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_id."');\"").">\n";
|
||||
echo " <span class='hud_title'>".$text['label-domain_limits']."</span>\n";
|
||||
|
||||
//doughnut chart
|
||||
@@ -240,7 +240,7 @@
|
||||
echo "</div>";
|
||||
//$n++;
|
||||
|
||||
echo "<span class='hud_expander' onclick=\"$('#hud_domain_limits_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_name."')\"><span class='fas fa-ellipsis-h'></span></span>";
|
||||
echo "<span class='hud_expander' onclick=\"$('#hud_domain_limits_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_id."');\"><span class='fas fa-ellipsis-h'></span></span>";
|
||||
}
|
||||
echo "</div>\n";
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2017-2023
|
||||
Portions created by the Initial Developer are Copyright (C) 2017-2025
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -172,7 +172,7 @@
|
||||
//caller id
|
||||
echo "<div class='hud_box'>\n";
|
||||
|
||||
echo " <div class='hud_content' ".($dashboard_details_state == "disabled" ?: "onclick=\"$('#hud_caller_id_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_name."')\"").">\n";
|
||||
echo " <div class='hud_content' ".($dashboard_details_state == "disabled" ?: "onclick=\"$('#hud_caller_id_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_id."');\"").">\n";
|
||||
echo " <span class='hud_title'>".$text['label-caller_id_number']."</span>\n";
|
||||
|
||||
//doughnut chart
|
||||
@@ -310,7 +310,7 @@
|
||||
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
||||
echo "</form>\n";
|
||||
|
||||
echo "<span class='hud_expander' onclick=\"$('#hud_caller_id_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_name."')\"><span class='fas fa-ellipsis-h'></span></span>";
|
||||
echo "<span class='hud_expander' onclick=\"$('#hud_caller_id_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_id."');\"><span class='fas fa-ellipsis-h'></span></span>";
|
||||
}
|
||||
echo "</div>\n";
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
//dashboard icon
|
||||
echo "<div class='hud_box'>\n";
|
||||
echo " <div class='hud_content' ".(empty($dashboard_details_state) || $dashboard_details_state != "disabled" ? "onclick=\"$('#hud_icon_details').slideToggle('fast'); toggle_grid_row_end('".trim(preg_replace("/[^a-z]/", '_', strtolower($row['dashboard_name'])),'_')."');\"" : null).">\n";
|
||||
echo " <div class='hud_content' ".(empty($dashboard_details_state) || $dashboard_details_state != "disabled" ? "onclick=\"$('#hud_icon_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_id."');\"" : null).">\n";
|
||||
echo " <span class='hud_title' onclick=\"window.open('".$dashboard_url."', '".$dashboard_target."', '".$window_parameters."')\">".escape($dashboard_label)."</span>";
|
||||
echo " <div style='position: relative; display: inline-block;'>\n";
|
||||
echo " <span class='hud_stat' onclick=\"window.open('".$dashboard_url."', '".$dashboard_target."', '".$window_parameters."')\"><i class=\"fas ".$dashboard_icon."\"></i></span>\n";
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2013-2023
|
||||
Portions created by the Initial Developer are Copyright (C) 2013-2025
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -153,7 +153,7 @@
|
||||
//ring group forward
|
||||
echo "<div class='hud_box'>\n";
|
||||
|
||||
echo " <div class='hud_content' ".($dashboard_details_state == "disabled" ?: "onclick=\"$('#hud_ring_group_forward_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_name."')\"").">\n";
|
||||
echo " <div class='hud_content' ".($dashboard_details_state == "disabled" ?: "onclick=\"$('#hud_ring_group_forward_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_id."');\"").">\n";
|
||||
echo " <span class='hud_title'>".$text['header-ring-group-forward']."</span>\n";
|
||||
|
||||
//doughnut chart
|
||||
@@ -307,7 +307,7 @@
|
||||
echo "</form>\n";
|
||||
}
|
||||
|
||||
echo "<span class='hud_expander' onclick=\"$('#hud_ring_group_forward_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_name."')\"><span class='fas fa-ellipsis-h'></span></span>";
|
||||
echo "<span class='hud_expander' onclick=\"$('#hud_ring_group_forward_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_id."');\"><span class='fas fa-ellipsis-h'></span></span>";
|
||||
}
|
||||
echo "</div>\n";
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
}
|
||||
|
||||
//show the content
|
||||
echo "<div class='hud_content' ".($dashboard_details_state == "disabled" ?: "onclick=\"$('#hud_switch_status_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_name."')\"").">\n";
|
||||
echo "<div class='hud_content' ".($dashboard_details_state == "disabled" ?: "onclick=\"$('#hud_switch_status_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_id."');\"").">\n";
|
||||
echo " <span class='hud_title'>".$text['label-switch_status']."</span>\n";
|
||||
|
||||
if (!isset($dashboard_chart_type) || $dashboard_chart_type == "doughnut") {
|
||||
@@ -178,7 +178,7 @@
|
||||
echo "</div>";
|
||||
//$n++;
|
||||
|
||||
echo "<span class='hud_expander' onclick=\"$('#hud_switch_status_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_name."')\"><span class='fas fa-ellipsis-h'></span></span>";
|
||||
echo "<span class='hud_expander' onclick=\"$('#hud_switch_status_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_id."');\"><span class='fas fa-ellipsis-h'></span></span>";
|
||||
}
|
||||
echo "</div>\n";
|
||||
|
||||
|
||||
@@ -295,7 +295,7 @@
|
||||
echo "<div class='hud_box'>\n";
|
||||
if ($show_stat) {
|
||||
|
||||
echo "<div class='hud_content' ".($dashboard_details_state == "disabled" ?: "onclick=\"$('#hud_system_counts_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_name."')\"").">\n";
|
||||
echo "<div class='hud_content' ".($dashboard_details_state == "disabled" ?: "onclick=\"$('#hud_system_counts_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_id."');\"").">\n";
|
||||
echo " <span class='hud_title'><a onclick=\"document.location.href='".PROJECT_PATH."/app/system/system.php'\">".$text['label-system_counts']."</a></span>\n";
|
||||
|
||||
if (!isset($dashboard_chart_type) || $dashboard_chart_type == "doughnut") {
|
||||
@@ -499,7 +499,7 @@
|
||||
echo "</div>";
|
||||
//$n++;
|
||||
|
||||
echo "<span class='hud_expander' onclick=\"$('#hud_system_counts_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_name."')\"><span class='fas fa-ellipsis-h'></span></span>\n";
|
||||
echo "<span class='hud_expander' onclick=\"$('#hud_system_counts_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_id."');\"><span class='fas fa-ellipsis-h'></span></span>\n";
|
||||
}
|
||||
echo "</div>\n";
|
||||
?>
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
}
|
||||
|
||||
//show the content
|
||||
echo "<div class='hud_content' ".($dashboard_details_state == "disabled" ?: "onclick=\"$('#hud_system_cpu_status_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_name."')\"").">\n";
|
||||
echo "<div class='hud_content' ".($dashboard_details_state == "disabled" ?: "onclick=\"$('#hud_system_cpu_status_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_id."');\"").">\n";
|
||||
echo " <span class='hud_title'><a onclick=\"document.location.href='".PROJECT_PATH."/app/system/system.php'\">".$text['label-cpu_usage']."</a></span>\n";
|
||||
|
||||
$token = (new token())->create($_SERVER['PHP_SELF']);
|
||||
@@ -379,7 +379,7 @@
|
||||
echo "</div>";
|
||||
//$n++;
|
||||
|
||||
echo "<span class='hud_expander' onclick=\"$('#hud_system_cpu_status_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_name."')\"><span class='fas fa-ellipsis-h'></span></span>";
|
||||
echo "<span class='hud_expander' onclick=\"$('#hud_system_cpu_status_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_id."');\"><span class='fas fa-ellipsis-h'></span></span>";
|
||||
}
|
||||
echo "</div>\n";
|
||||
|
||||
|
||||
@@ -39,8 +39,6 @@
|
||||
exit;
|
||||
}
|
||||
|
||||
$dashboard_name = "System Services";
|
||||
|
||||
//function to parse a FusionPBX service from a .service file
|
||||
if (!function_exists('get_classname')) {
|
||||
function get_classname(string $file) {
|
||||
@@ -161,7 +159,7 @@
|
||||
|
||||
//show the results
|
||||
echo "<div class='hud_box'>\n";
|
||||
echo " <div class='hud_content' ".($dashboard_details_state == 'disabled' ?: "onclick=\"$('#hud_system_services_details').slideToggle('fast'); toggle_grid_row_end('$dashboard_name')\""). ">\n";
|
||||
echo " <div class='hud_content' ".($dashboard_details_state == 'disabled' ?: "onclick=\"$('#hud_system_services_details').slideToggle('fast'); toggle_grid_row_end('$dashboard_id');\""). ">\n";
|
||||
echo " <span class='hud_title'>System Services</span>\n";
|
||||
|
||||
//doughnut chart
|
||||
|
||||
@@ -120,7 +120,7 @@
|
||||
<?php
|
||||
|
||||
//show the results
|
||||
echo " <div class='hud_content' ".($dashboard_details_state == "disabled" ?: "onclick=\"$('#hud_system_status_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_name."')\"").">\n";
|
||||
echo " <div class='hud_content' ".($dashboard_details_state == "disabled" ?: "onclick=\"$('#hud_system_status_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_id."');\"").">\n";
|
||||
echo " <span class='hud_title'><a onclick=\"document.location.href='".PROJECT_PATH."/app/system/system.php'\">".$text['label-system_status']."</a></span>\n";
|
||||
|
||||
if ($dashboard_chart_type == "doughnut") {
|
||||
@@ -406,7 +406,7 @@
|
||||
echo "</div>";
|
||||
//$n++;
|
||||
|
||||
echo "<span class='hud_expander' onclick=\"$('#hud_system_status_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_name."')\"><span class='fas fa-ellipsis-h'></span></span>";
|
||||
echo "<span class='hud_expander' onclick=\"$('#hud_system_status_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_id."');\"><span class='fas fa-ellipsis-h'></span></span>";
|
||||
}
|
||||
echo "</div>\n";
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
echo "<div class='hud_content' ".($dashboard_details_state == "disabled" ?: "onclick=\"$('#hud_voicemail_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_name."')\"").">\n";
|
||||
echo "<div class='hud_content' ".($dashboard_details_state == "disabled" ?: "onclick=\"$('#hud_voicemail_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_id."');\"").">\n";
|
||||
echo " <span class='hud_title'><a onclick=\"document.location.href='".PROJECT_PATH."/app/voicemails/voicemail_messages.php'\">".$text['label-new_messages']."</a></span>";
|
||||
|
||||
if (isset($dashboard_chart_type) && $dashboard_chart_type == "doughnut") {
|
||||
@@ -147,7 +147,7 @@
|
||||
echo "</div>";
|
||||
//$n++;
|
||||
|
||||
echo "<span class='hud_expander' onclick=\"$('#hud_voicemail_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_name."')\"><span class='fas fa-ellipsis-h'></span></span>";
|
||||
echo "<span class='hud_expander' onclick=\"$('#hud_voicemail_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_id."');\"><span class='fas fa-ellipsis-h'></span></span>";
|
||||
}
|
||||
|
||||
echo "</div>\n";
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
//missed calls
|
||||
echo "<div class='hud_box'>\n";
|
||||
|
||||
echo "<div class='hud_content' ".($dashboard_details_state == "disabled" ?: "onclick=\"$('#hud_missed_calls_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_name."')\"").">\n";
|
||||
echo "<div class='hud_content' ".($dashboard_details_state == "disabled" ?: "onclick=\"$('#hud_missed_calls_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_id."');\"").">\n";
|
||||
echo " <span class='hud_title'><a onclick=\"document.location.href='".PROJECT_PATH."/app/xml_cdr/xml_cdr.php?call_result=missed'\">".$text['label-missed_calls']."</a></span>";
|
||||
|
||||
if ($dashboard_chart_type == "doughnut") {
|
||||
@@ -214,7 +214,7 @@
|
||||
echo "</div>";
|
||||
//$n++;
|
||||
|
||||
echo "<span class='hud_expander' onclick=\"$('#hud_missed_calls_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_name."')\"><span class='fas fa-ellipsis-h'></span></span>";
|
||||
echo "<span class='hud_expander' onclick=\"$('#hud_missed_calls_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_id."');\"><span class='fas fa-ellipsis-h'></span></span>";
|
||||
}
|
||||
echo "</div>\n";
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
//recent calls
|
||||
echo "<div class='hud_box'>\n";
|
||||
|
||||
echo "<div class='hud_content' ".($dashboard_details_state == "disabled" ?: "onclick=\"$('#hud_recent_calls_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_name."')\"").">\n";
|
||||
echo "<div class='hud_content' ".($dashboard_details_state == "disabled" ?: "onclick=\"$('#hud_recent_calls_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_id."');\"").">\n";
|
||||
echo " <span class='hud_title'><a onclick=\"document.location.href='".PROJECT_PATH."/app/xml_cdr/xml_cdr.php';\">".$text['label-recent_calls']."</a></span>\n";
|
||||
|
||||
if ($dashboard_chart_type == "doughnut") {
|
||||
@@ -234,7 +234,7 @@
|
||||
echo "<span style='display: block; margin: 6px 0 7px 0;'><a href='".PROJECT_PATH."/app/xml_cdr/xml_cdr.php'>".$text['label-view_all']."</a></span>\n";
|
||||
echo "</div>";
|
||||
|
||||
echo "<span class='hud_expander' onclick=\"$('#hud_recent_calls_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_name."')\"><span class='fas fa-ellipsis-h'></span></span>";
|
||||
echo "<span class='hud_expander' onclick=\"$('#hud_recent_calls_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_id."');\"><span class='fas fa-ellipsis-h'></span></span>";
|
||||
}
|
||||
echo "</div>\n";
|
||||
|
||||
|
||||
@@ -130,13 +130,13 @@
|
||||
$parent_uuid = null;
|
||||
|
||||
foreach ($dashboard as $row) {
|
||||
$dashboard_name = trim(preg_replace("/[^a-z0-9_]/", '_', strtolower($row['dashboard_name'])),'_');
|
||||
if ($widget_id == $dashboard_name) {
|
||||
$dashboard_id = 'id_'.md5(preg_replace('/[^-A-Fa-f0-9]/', '', $row['dashboard_uuid']));
|
||||
if ($widget_id == $dashboard_id) {
|
||||
if (!empty($parent_id)) {
|
||||
//find parent uuid
|
||||
foreach ($dashboard as $parent_row) {
|
||||
$parent_dashboard_name = trim(preg_replace("/[^a-z0-9_]/", '_', strtolower($parent_row['dashboard_name'])), '_');
|
||||
if ($parent_dashboard_name === $parent_id) {
|
||||
$parent_dashboard_id = 'id_'.md5(preg_replace('/[^-A-Fa-f0-9]/', '', $parent_row['dashboard_uuid']));
|
||||
if ($parent_dashboard_id === $parent_id) {
|
||||
$parent_uuid = $parent_row['dashboard_uuid'];
|
||||
break;
|
||||
}
|
||||
@@ -284,48 +284,48 @@ div.hud_chart {
|
||||
/* dashboard settings */
|
||||
<?php
|
||||
foreach ($dashboard as $row) {
|
||||
$dashboard_name = trim(preg_replace("/[^a-z0-9_]/", '_', strtolower($row['dashboard_name'])),'_');
|
||||
$dashboard_id = 'id_'.md5(preg_replace('/[^-A-Fa-f0-9]/', '', $row['dashboard_uuid']));
|
||||
if (!empty($row['dashboard_icon_color'])) {
|
||||
echo "#".$dashboard_name." .hud_stat:has(i) {\n";
|
||||
echo "#".$dashboard_id." .hud_stat:has(i) {\n";
|
||||
echo " color: ".$row['dashboard_icon_color'].";\n";
|
||||
echo "}\n";
|
||||
}
|
||||
if ($row['dashboard_label_enabled'] == 'false') {
|
||||
echo "#".$dashboard_name." .hud_title:first-of-type {\n";
|
||||
echo "#".$dashboard_id." .hud_title:first-of-type {\n";
|
||||
echo " display: none;\n";
|
||||
echo "}\n";
|
||||
echo "#".$dashboard_name." .hud_content {\n";
|
||||
echo "#".$dashboard_id." .hud_content {\n";
|
||||
echo " align-content: center;\n";
|
||||
echo "}\n";
|
||||
echo "#".$dashboard_name." .hud_chart {\n";
|
||||
echo "#".$dashboard_id." .hud_chart {\n";
|
||||
echo " padding-top: 0;\n";
|
||||
echo "}\n";
|
||||
}
|
||||
if (!empty($row['dashboard_label_text_color']) || !empty($row['dashboard_label_background_color'])) {
|
||||
echo "#".$dashboard_name." .hud_title:first-of-type {\n";
|
||||
echo "#".$dashboard_id." .hud_title:first-of-type {\n";
|
||||
if (!empty($row['dashboard_label_text_color'])) { echo " color: ".$row['dashboard_label_text_color'].";\n"; }
|
||||
if (!empty($row['dashboard_label_background_color'])) { echo " background-color: ".$row['dashboard_label_background_color'].";\n"; }
|
||||
echo "}\n";
|
||||
}
|
||||
if (!empty($row['dashboard_label_text_color_hover']) || !empty($row['dashboard_label_background_color_hover'])) {
|
||||
echo "#".$dashboard_name.":hover .hud_title:first-of-type {\n";
|
||||
echo "#".$dashboard_id.":hover .hud_title:first-of-type {\n";
|
||||
if (!empty($row['dashboard_label_text_color_hover'])) { echo " color: ".$row['dashboard_label_text_color_hover'].";\n"; }
|
||||
if (!empty($row['dashboard_label_background_color_hover'])) { echo " background-color: ".$row['dashboard_label_background_color_hover'].";\n"; }
|
||||
echo "}\n";
|
||||
}
|
||||
if (!empty($row['dashboard_number_text_color'])) {
|
||||
echo "#".$dashboard_name." .hud_stat {\n";
|
||||
echo "#".$dashboard_id." .hud_stat {\n";
|
||||
echo " color: ".$row['dashboard_number_text_color'].";\n";
|
||||
echo "}\n";
|
||||
}
|
||||
if (!empty($row['dashboard_number_text_color_hover'])) {
|
||||
echo "#".$dashboard_name.":hover .hud_stat {\n";
|
||||
echo "#".$dashboard_id.":hover .hud_stat {\n";
|
||||
echo " color: ".$row['dashboard_number_text_color_hover'].";\n";
|
||||
echo "}\n";
|
||||
}
|
||||
if (!empty($row['dashboard_background_color'])) {
|
||||
$background_color = json_decode($row['dashboard_background_color'], true);
|
||||
echo "#".$dashboard_name." .hud_content {\n";
|
||||
echo "#".$dashboard_id." .hud_content {\n";
|
||||
echo " background: ".$background_color[0].";\n";
|
||||
if (empty($row['dashboard_background_gradient_style']) || $row['dashboard_background_gradient_style'] == 'mirror') {
|
||||
echo " background-image: linear-gradient(".(empty($row['dashboard_background_gradient_angle']) ? '0deg' : $row['dashboard_background_gradient_angle'].'deg').", ".$background_color[1]." 0%, ".$background_color[0]." 30%, ".$background_color[0]." 70%, ".$background_color[1]." 100%);\n";
|
||||
@@ -337,7 +337,7 @@ foreach ($dashboard as $row) {
|
||||
}
|
||||
if (!empty($row['dashboard_background_color_hover'])) {
|
||||
$background_color_hover = json_decode($row['dashboard_background_color_hover'], true);
|
||||
echo "#".$dashboard_name.":hover .hud_content {\n";
|
||||
echo "#".$dashboard_id.":hover .hud_content {\n";
|
||||
echo " background: ".$background_color_hover[0].";\n";
|
||||
if (empty($row['dashboard_background_gradient_style']) || $row['dashboard_background_gradient_style'] == 'mirror') {
|
||||
echo " background-image: linear-gradient(".(empty($row['dashboard_background_gradient_angle']) ? '0deg' : $row['dashboard_background_gradient_angle'].'deg').", ".$background_color_hover[1]." 0%, ".$background_color_hover[0]." 30%, ".$background_color_hover[0]." 70%, ".$background_color_hover[1]." 100%);\n";
|
||||
@@ -349,7 +349,7 @@ foreach ($dashboard as $row) {
|
||||
}
|
||||
if (!empty($row['dashboard_detail_background_color'])) {
|
||||
$detail_background_color = json_decode($row['dashboard_detail_background_color'], true);
|
||||
echo "#".$dashboard_name." .hud_details {\n";
|
||||
echo "#".$dashboard_id." .hud_details {\n";
|
||||
echo " background: ".$detail_background_color[0].";\n";
|
||||
if (empty($row['dashboard_background_gradient_style']) || $row['dashboard_background_gradient_style'] == 'mirror') {
|
||||
echo " background-image: linear-gradient(".(empty($row['dashboard_background_gradient_angle']) ? '0deg' : $row['dashboard_background_gradient_angle'].'deg').", ".$detail_background_color[1]." 0%, ".$detail_background_color[0]." 30%, ".$detail_background_color[0]." 70%, ".$detail_background_color[1]." 100%);\n";
|
||||
@@ -360,48 +360,48 @@ foreach ($dashboard as $row) {
|
||||
echo "}\n";
|
||||
}
|
||||
if ($row['dashboard_path'] == "dashboard/icon") {
|
||||
echo "#".$dashboard_name." div.hud_content,\n";
|
||||
echo "#".$dashboard_name." span.hud_title,\n";
|
||||
echo "#".$dashboard_name." span.hud_stat {\n";
|
||||
echo "#".$dashboard_id." div.hud_content,\n";
|
||||
echo "#".$dashboard_id." span.hud_title,\n";
|
||||
echo "#".$dashboard_id." span.hud_stat {\n";
|
||||
echo " transition: .4s;\n";
|
||||
echo "}\n";
|
||||
}
|
||||
switch ($row['dashboard_row_span']) {
|
||||
case 1:
|
||||
echo "#".$dashboard_name." .hud_content {\n";
|
||||
echo "#".$dashboard_id." .hud_content {\n";
|
||||
echo " height: 89.5px;\n";
|
||||
echo "}\n";
|
||||
echo "#".$dashboard_name." .hud_stat {\n";
|
||||
echo "#".$dashboard_id." .hud_stat {\n";
|
||||
echo " line-height: 0;\n";
|
||||
echo " font-size: 30pt;\n";
|
||||
echo "}\n";
|
||||
echo "#".$dashboard_name." .hud_chart {\n";
|
||||
echo "#".$dashboard_id." .hud_chart {\n";
|
||||
echo " height: 54px;\n";
|
||||
echo " width: 180px;\n";
|
||||
echo " padding-top: 0;\n";
|
||||
echo "}\n";
|
||||
echo "#".$dashboard_name." div.hud_content .fas {\n";
|
||||
echo "#".$dashboard_id." div.hud_content .fas {\n";
|
||||
echo " line-height: 0;\n";
|
||||
echo " font-size: 24pt;\n";
|
||||
echo "}\n";
|
||||
break;
|
||||
case 2:
|
||||
echo "#".$dashboard_name." .hud_content {\n";
|
||||
echo "#".$dashboard_id." .hud_content {\n";
|
||||
echo " height: 195px;\n";
|
||||
echo "}\n";
|
||||
break;
|
||||
case 3:
|
||||
echo "#".$dashboard_name." .hud_content {\n";
|
||||
echo "#".$dashboard_id." .hud_content {\n";
|
||||
echo " height: 300.5px;\n";
|
||||
echo "}\n";
|
||||
break;
|
||||
case 4:
|
||||
echo "#".$dashboard_name." .hud_content {\n";
|
||||
echo "#".$dashboard_id." .hud_content {\n";
|
||||
echo " height: 406px;\n";
|
||||
echo "}\n";
|
||||
break;
|
||||
default: //if empty
|
||||
echo "#".$dashboard_name." .hud_content {\n";
|
||||
echo "#".$dashboard_id." .hud_content {\n";
|
||||
echo " height: 195px;\n";
|
||||
echo "}\n";
|
||||
}
|
||||
@@ -414,15 +414,15 @@ foreach ($dashboard as $row) {
|
||||
.col-num { grid-column: span 1; }
|
||||
<?php
|
||||
foreach ($dashboard as $row) {
|
||||
$dashboard_name = trim(preg_replace("/[^a-z0-9_]/", '_', strtolower($row['dashboard_name'])),'_');
|
||||
$dashboard_id = 'id_'.md5(preg_replace('/[^-A-Fa-f0-9]/', '', $row['dashboard_uuid']));
|
||||
if (isset($row['dashboard_column_span']) && is_numeric($row['dashboard_column_span'])) {
|
||||
echo "#".$dashboard_name." {\n";
|
||||
echo "#".$dashboard_id." {\n";
|
||||
echo " grid-column: span 1;\n";
|
||||
echo "}\n";
|
||||
}
|
||||
if ($row['dashboard_details_state'] == "hidden" || $row['dashboard_details_state'] == "disabled") {
|
||||
echo "#".$dashboard_name." .hud_box .hud_expander, \n";
|
||||
echo "#".$dashboard_name." .hud_box .hud_details {\n";
|
||||
echo "#".$dashboard_id." .hud_box .hud_expander, \n";
|
||||
echo "#".$dashboard_id." .hud_box .hud_details {\n";
|
||||
echo " display: none;\n";
|
||||
echo "}\n";
|
||||
}
|
||||
@@ -436,25 +436,25 @@ foreach ($dashboard as $row) {
|
||||
.col-num { grid-column: span 2; }
|
||||
<?php
|
||||
foreach ($dashboard as $row) {
|
||||
$dashboard_name = trim(preg_replace("/[^a-z0-9_]/", '_', strtolower($row['dashboard_name'])),'_');
|
||||
$dashboard_id = 'id_'.md5(preg_replace('/[^-A-Fa-f0-9]/', '', $row['dashboard_uuid']));
|
||||
if (is_numeric($row['dashboard_column_span']) && $row['dashboard_column_span'] > 2) {
|
||||
echo "#".$dashboard_name." {\n";
|
||||
echo "#".$dashboard_id." {\n";
|
||||
echo " grid-column: span 2;\n";
|
||||
echo "}\n";
|
||||
}
|
||||
else if (is_numeric($row['dashboard_column_span'])) {
|
||||
echo "#".$dashboard_name." {\n";
|
||||
echo "#".$dashboard_id." {\n";
|
||||
echo " grid-column: span ".$row['dashboard_column_span'].";\n";
|
||||
echo "}\n";
|
||||
}
|
||||
if ($row['dashboard_details_state'] == "contracted") {
|
||||
echo "#".$dashboard_name." .hud_box .hud_details {\n";
|
||||
echo "#".$dashboard_id." .hud_box .hud_details {\n";
|
||||
echo " display: none;\n";
|
||||
echo "}\n";
|
||||
}
|
||||
if ($row['dashboard_details_state'] == "hidden" || $row['dashboard_details_state'] == "disabled") {
|
||||
echo "#".$dashboard_name." .hud_box .hud_expander, \n";
|
||||
echo "#".$dashboard_name." .hud_box .hud_details {\n";
|
||||
echo "#".$dashboard_id." .hud_box .hud_expander, \n";
|
||||
echo "#".$dashboard_id." .hud_box .hud_details {\n";
|
||||
echo " display: none;\n";
|
||||
echo "}\n";
|
||||
}
|
||||
@@ -468,9 +468,9 @@ foreach ($dashboard as $row) {
|
||||
.col-num { grid-column: span 2; }
|
||||
<?php
|
||||
foreach ($dashboard as $row) {
|
||||
$dashboard_name = trim(preg_replace("/[^a-z0-9_]/", '_', strtolower($row['dashboard_name'])),'_');
|
||||
$dashboard_id = 'id_'.md5(preg_replace('/[^-A-Fa-f0-9]/', '', $row['dashboard_uuid']));
|
||||
if (is_numeric($row['dashboard_column_span'])) {
|
||||
echo "#".$dashboard_name." {\n";
|
||||
echo "#".$dashboard_id." {\n";
|
||||
echo " grid-column: span ".$row['dashboard_column_span'].";\n";
|
||||
echo "}\n";
|
||||
}
|
||||
@@ -575,8 +575,8 @@ function toggle_grid_row_end_all() {
|
||||
|
||||
//sanitize the data
|
||||
$dashboard_uuid = preg_replace($uuid_pattern, '', $dashboard_uuid);
|
||||
$dashboard_id = 'id_'.md5($dashboard_uuid);
|
||||
$dashboard_name = trim(preg_replace($text_pattern, '', $dashboard_name));
|
||||
$dashboard_name_id = trim(preg_replace("/[^a-z0-9_]/", '_', strtolower($dashboard_name)),'_');
|
||||
$dashboard_icon = preg_replace($text_pattern, '', $dashboard_icon);
|
||||
$dashboard_url = trim(preg_replace($text_pattern, '', $dashboard_url));
|
||||
$dashboard_target = trim(preg_replace($text_pattern, '', $dashboard_target));
|
||||
@@ -602,7 +602,7 @@ function toggle_grid_row_end_all() {
|
||||
$path_array = glob(dirname(__DIR__, 2).'/*/'.$application_name.'/resources/dashboard/'.$widget_name.'.php');
|
||||
|
||||
if (empty($row['dashboard_parent_uuid'])) {
|
||||
echo "<div class='widget' style='grid-row-end: span ".$dashboard_row_span.";' data-state='".$dashboard_details_state."' id='".$dashboard_name_id."' draggable='false'>\n";
|
||||
echo "<div class='widget' style='grid-row-end: span ".$dashboard_row_span.";' data-state='".$dashboard_details_state."' id='".$dashboard_id."' draggable='false'>\n";
|
||||
if (file_exists($path_array[0])) {
|
||||
include $path_array[0];
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
//dashboard icon
|
||||
echo "<div class='hud_box'>\n";
|
||||
echo " <div class='hud_content' ".(!empty($row['dashboard_background_color']) ? "style='background: ".$row['dashboard_background_color'].";'" : null)." ".(empty($dashboard_details_state) || $dashboard_details_state != "disabled" ? "onclick=\"$('#hud_content_details').slideToggle('fast'); toggle_grid_row_end('".trim(preg_replace("/[^a-z]/", '_', strtolower($row['dashboard_name'])),'_')."');\"" : null).">\n";
|
||||
echo " <div class='hud_content' ".(!empty($row['dashboard_background_color']) ? "style='background: ".$row['dashboard_background_color'].";'" : null)." ".(empty($dashboard_details_state) || $dashboard_details_state != "disabled" ? "onclick=\"$('#hud_content_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_id."');\"" : null).">\n";
|
||||
echo " <span class='hud_title' ".(!empty($row['dashboard_label_background_color']) ? "style='background: ".$row['dashboard_label_background_color'].";'" : null).">".escape($dashboard_name)."</span>";
|
||||
echo " <span style='padding: 12px; height: ".$dashboard_content_height."; max-height: ".$dashboard_content_height."; text-align: ".$row['dashboard_content_text_align']."; vertical-align: ".$dashboard_content_text_vertical_align."; overflow: auto; ".(!empty($row['dashboard_number_text_color']) ? "color: ".$row['dashboard_number_text_color'].";" : null)."'>".$dashboard_content."</span>\n";
|
||||
echo " </div>\n";
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
//dashboard icon
|
||||
echo "<div class='hud_box'>\n";
|
||||
echo " <div class='hud_content' ".(empty($dashboard_details_state) || $dashboard_details_state != "disabled" ? "onclick=\"$('#hud_icon_details').slideToggle('fast'); toggle_grid_row_end('".trim(preg_replace("/[^a-z]/", '_', strtolower($row['dashboard_name'])),'_')."');\"" : null).">\n";
|
||||
echo " <div class='hud_content' ".(empty($dashboard_details_state) || $dashboard_details_state != "disabled" ? "onclick=\"$('#hud_icon_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_id."');\"" : null).">\n";
|
||||
echo " <span class='hud_title'><a style='padding: 10px 0;' onclick=\"window.open('".$dashboard_url."', '".$dashboard_target."', '".$window_parameters."'); return false;\">".escape($dashboard_label)."</a></span>\n";
|
||||
echo " <span class='hud_stat'><a style='padding: 10px 20px;' onclick=\"window.open('".$dashboard_url."', '".$dashboard_target."', '".$window_parameters."'); return false;\"><i class=\"fas ".$dashboard_icon."\"></i></a></span>\n";
|
||||
echo " </div>\n";
|
||||
|
||||
@@ -117,78 +117,78 @@ div.child_widget.editable:hover:has(i) div.hud_box {
|
||||
/* dashboard settings */
|
||||
<?php
|
||||
foreach ($parent_widgets as $row) {
|
||||
$dashboard_name = trim(preg_replace("/[^a-z0-9_]/", '_', strtolower($row['dashboard_name'])),'_');
|
||||
$dashboard_id = 'id_'.md5(preg_replace('/[^-A-Fa-f0-9]/', '', $row['dashboard_uuid']));
|
||||
if (!empty($row['dashboard_icon_color'])) {
|
||||
echo "#".$dashboard_name." .hud_stat:has(i) {\n";
|
||||
echo "#".$dashboard_id." .hud_stat:has(i) {\n";
|
||||
echo " color: ".$row['dashboard_icon_color'].";\n";
|
||||
echo "}\n";
|
||||
}
|
||||
if (!empty($row['dashboard_label_text_color']) || !empty($row['dashboard_label_background_color'])) {
|
||||
echo "#".$dashboard_name." .hud_title {\n";
|
||||
echo "#".$dashboard_id." .hud_title {\n";
|
||||
if (!empty($row['dashboard_label_text_color'])) { echo " color: ".$row['dashboard_label_text_color'].";\n"; }
|
||||
if (!empty($row['dashboard_label_background_color'])) { echo " background-color: ".$row['dashboard_label_background_color'].";\n"; }
|
||||
echo "}\n";
|
||||
}
|
||||
if (!empty($row['dashboard_label_text_color_hover']) || !empty($row['dashboard_label_background_color_hover'])) {
|
||||
echo "#".$dashboard_name.":hover .hud_title {\n";
|
||||
echo "#".$dashboard_id.":hover .hud_title {\n";
|
||||
if (!empty($row['dashboard_label_text_color_hover'])) { echo " color: ".$row['dashboard_label_text_color_hover'].";\n"; }
|
||||
if (!empty($row['dashboard_label_background_color_hover'])) { echo " background-color: ".$row['dashboard_label_background_color_hover'].";\n"; }
|
||||
echo "}\n";
|
||||
}
|
||||
if (!empty($row['dashboard_number_text_color'])) {
|
||||
echo "#".$dashboard_name." .hud_stat {\n";
|
||||
echo "#".$dashboard_id." .hud_stat {\n";
|
||||
echo " color: ".$row['dashboard_number_text_color'].";\n";
|
||||
echo "}\n";
|
||||
}
|
||||
if (!empty($row['dashboard_number_text_color_hover'])) {
|
||||
echo "#".$dashboard_name.":hover .hud_stat {\n";
|
||||
echo "#".$dashboard_id.":hover .hud_stat {\n";
|
||||
echo " color: ".$row['dashboard_number_text_color_hover'].";\n";
|
||||
echo "}\n";
|
||||
}
|
||||
if (!empty($row['dashboard_background_color'])) {
|
||||
$background_color = json_decode($row['dashboard_background_color'], true);
|
||||
echo "#".$dashboard_name." {\n";
|
||||
echo "#".$dashboard_id." {\n";
|
||||
echo " background: ".$background_color[0].";\n";
|
||||
echo " background-image: linear-gradient(to right, ".$background_color[1]." 0%, ".$background_color[0]." 30%, ".$background_color[0]." 70%, ".$background_color[1]." 100%);\n";
|
||||
echo "}\n";
|
||||
}
|
||||
if (!empty($row['dashboard_background_color_hover'])) {
|
||||
$background_color_hover = json_decode($row['dashboard_background_color_hover'], true);
|
||||
echo "#".$dashboard_name.":hover {\n";
|
||||
echo "#".$dashboard_id.":hover {\n";
|
||||
echo " background: ".$background_color_hover[0].";\n";
|
||||
echo " background-image: linear-gradient(to right, ".$background_color_hover[1]." 0%, ".$background_color_hover[0]." 30%, ".$background_color_hover[0]." 70%, ".$background_color_hover[1]." 100%);\n";
|
||||
echo "}\n";
|
||||
}
|
||||
if (!empty($row['dashboard_detail_background_color'])) {
|
||||
$detail_background_color = json_decode($row['dashboard_detail_background_color'], true);
|
||||
echo "#".$dashboard_name." .hud_details {\n";
|
||||
echo "#".$dashboard_id." .hud_details {\n";
|
||||
echo " background: ".$detail_background_color[0].";\n";
|
||||
echo " background-image: linear-gradient(to right, ".$detail_background_color[1]." 0%, ".$detail_background_color[0]." 30%, ".$detail_background_color[0]." 70%, ".$detail_background_color[1]." 100%);\n";
|
||||
echo "}\n";
|
||||
}
|
||||
if ($row['dashboard_label_enabled'] == 'false') {
|
||||
echo "#".$dashboard_name." .hud_title {\n";
|
||||
echo "#".$dashboard_id." .hud_title {\n";
|
||||
echo " display: none;\n";
|
||||
echo "}\n";
|
||||
echo "#".$dashboard_name." .hud_content {\n";
|
||||
echo "#".$dashboard_id." .hud_content {\n";
|
||||
echo " align-content: center;\n";
|
||||
echo "}\n";
|
||||
}
|
||||
if ($row['dashboard_path'] == "dashboard/icon") {
|
||||
echo "#".$dashboard_name.",\n";
|
||||
echo "#".$dashboard_name." span.hud_title,\n";
|
||||
echo "#".$dashboard_name." span.hud_stat {\n";
|
||||
echo "#".$dashboard_id.",\n";
|
||||
echo "#".$dashboard_id." span.hud_title,\n";
|
||||
echo "#".$dashboard_id." span.hud_stat {\n";
|
||||
echo " transition: .4s;\n";
|
||||
echo " border-radius: 5px;\n";
|
||||
echo "}\n";
|
||||
}
|
||||
if ($row['dashboard_column_span'] > 1) {
|
||||
echo "#".$dashboard_name.".child_widget {\n";
|
||||
echo "#".$dashboard_id.".child_widget {\n";
|
||||
echo " grid-column: span ".preg_replace($number_pattern, '', $row['dashboard_column_span']).";\n";
|
||||
echo "}\n";
|
||||
}
|
||||
else if ($row['dashboard_row_span'] > 1) {
|
||||
echo "#".$dashboard_name.".child_widget {\n";
|
||||
echo "#".$dashboard_id.".child_widget {\n";
|
||||
echo " grid-column: span 2;\n";
|
||||
echo "}\n";
|
||||
}
|
||||
@@ -231,8 +231,8 @@ foreach ($parent_widgets as $row) {
|
||||
|
||||
//sanitize the data
|
||||
$dashboard_uuid = preg_replace($uuid_pattern, '', $dashboard_uuid);
|
||||
$dashboard_id = 'id_'.md5($dashboard_uuid);
|
||||
$dashboard_name = trim(preg_replace($text_pattern, '', $dashboard_name));
|
||||
$dashboard_name_id = trim(preg_replace("/[^a-z0-9_]/", '_', strtolower($dashboard_name)),'_');
|
||||
$dashboard_icon = preg_replace($text_pattern, '', $dashboard_icon);
|
||||
$dashboard_url = trim(preg_replace($text_pattern, '', $dashboard_url));
|
||||
$dashboard_target = trim(preg_replace($text_pattern, '', $dashboard_target));
|
||||
@@ -257,7 +257,7 @@ foreach ($parent_widgets as $row) {
|
||||
$child_widget_name = $dashboard_path_array[1];
|
||||
$path_array = glob(dirname(__DIR__, 4).'/*/'.$application_name.'/resources/dashboard/'.$child_widget_name.'.php');
|
||||
|
||||
echo "<div class='child_widget' style='grid-row-end: span ".$dashboard_row_span.";' data-state='".$dashboard_details_state."' id='".$dashboard_name_id."' draggable='false'>\n";
|
||||
echo "<div class='child_widget' style='grid-row-end: span ".$dashboard_row_span.";' data-state='".$dashboard_details_state."' id='".$dashboard_id."' draggable='false'>\n";
|
||||
if (file_exists($path_array[0])) {
|
||||
include $path_array[0];
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
//dashboard icon
|
||||
echo "<div class='hud_box'>\n";
|
||||
echo " <div class='hud_content' ".(empty($dashboard_details_state) || $dashboard_details_state != "disabled" ? "onclick=\"$('#hud_icon_details').slideToggle('fast'); toggle_grid_row_end('".trim(preg_replace("/[^a-z]/", '_', strtolower($row['dashboard_name'])),'_')."');\"" : null).">\n";
|
||||
echo " <div class='hud_content' ".(empty($dashboard_details_state) || $dashboard_details_state != "disabled" ? "onclick=\"$('#hud_icon_details').slideToggle('fast'); toggle_grid_row_end('".$dashboard_id."');\"" : null).">\n";
|
||||
echo " <span class='hud_title' onclick=\"window.open('".$dashboard_url."', '".$dashboard_target."', '".$window_parameters."')\">".escape($dashboard_label)."</span>";
|
||||
echo " <div style='position: relative; display: inline-block;'>\n";
|
||||
echo " <span class='hud_stat' onclick=\"window.open('".$dashboard_url."', '".$dashboard_target."', '".$window_parameters."')\"><i class=\"fas ".$dashboard_icon."\"></i></span>\n";
|
||||
|
||||
Reference in New Issue
Block a user