Dashboard - Minor bug fixes (#7440)

* Dashboard - Minor bug fixes

* Update config.php

* Update config.php

* Fix label background color

* Update dashboard_edit.php

* Update parent.php

* Update index.php

* Update index.php
This commit is contained in:
Alex
2025-07-31 16:18:33 -07:00
committed by GitHub
parent cd8d4101f5
commit b1dd179f85
7 changed files with 100 additions and 102 deletions

View File

@@ -13,7 +13,7 @@ $array['dashboard'][$x]['dashboard_height'] = '';
$array['dashboard'][$x]['dashboard_content'] = '';
$array['dashboard'][$x]['dashboard_content_text_align'] = '';
$array['dashboard'][$x]['dashboard_content_details'] = '';
$array['dashboard'][$x]['dashboard_chart_type'] = '';
$array['dashboard'][$x]['dashboard_chart_type'] = 'doughnut';
$array['dashboard'][$x]['dashboard_label_enabled'] = 'true';
$array['dashboard'][$x]['dashboard_label_text_color'] = '';
$array['dashboard'][$x]['dashboard_label_text_color_hover'] = '';
@@ -22,7 +22,7 @@ $array['dashboard'][$x]['dashboard_label_background_color_hover'] = '';
$array['dashboard'][$x]['dashboard_number_text_color'] = '';
$array['dashboard'][$x]['dashboard_number_text_color_hover'] = '';
$array['dashboard'][$x]['dashboard_number_background_color'] = '';
$array['dashboard'][$x]['dashboard_background_color'] ='';
$array['dashboard'][$x]['dashboard_background_color'] = '';
$array['dashboard'][$x]['dashboard_background_color_hover'] = '';
$array['dashboard'][$x]['dashboard_detail_background_color'] = '';
$array['dashboard'][$x]['dashboard_column_span'] = '1';
@@ -66,7 +66,7 @@ $array['dashboard'][$x]['dashboard_label_background_color_hover'] = '';
$array['dashboard'][$x]['dashboard_number_background_color'] = '';
$array['dashboard'][$x]['dashboard_number_text_color'] = '#0292ff';
$array['dashboard'][$x]['dashboard_number_text_color_hover'] = '';
$array['dashboard'][$x]['dashboard_background_color'] ='';
$array['dashboard'][$x]['dashboard_background_color'] = '';
$array['dashboard'][$x]['dashboard_background_color_hover'] = '';
$array['dashboard'][$x]['dashboard_detail_background_color'] = '';
$array['dashboard'][$x]['dashboard_column_span'] = '1';

View File

@@ -26,7 +26,7 @@ $array['dashboard'][$x]['dashboard_background_color_hover'] = '';
$array['dashboard'][$x]['dashboard_detail_background_color'] = '#ffffff';
$array['dashboard'][$x]['dashboard_column_span'] = '1';
$array['dashboard'][$x]['dashboard_row_span'] = '2';
$array['dashboard'][$x]['dashboard_details_state'] = 'expanded';
$array['dashboard'][$x]['dashboard_details_state'] = 'hidden';
$array['dashboard'][$x]['dashboard_order'] = '120';
$array['dashboard'][$x]['dashboard_enabled'] = 'false';
$array['dashboard'][$x]['dashboard_description'] = '';

View File

@@ -13,7 +13,7 @@ $array['dashboard'][$x]['dashboard_height'] = '';
$array['dashboard'][$x]['dashboard_content'] = '';
$array['dashboard'][$x]['dashboard_content_text_align'] = '';
$array['dashboard'][$x]['dashboard_content_details'] = '';
$array['dashboard'][$x]['dashboard_chart_type'] = '';
$array['dashboard'][$x]['dashboard_chart_type'] = 'doughnut';
$array['dashboard'][$x]['dashboard_label_enabled'] = 'true';
$array['dashboard'][$x]['dashboard_label_text_color'] = '#444444';
$array['dashboard'][$x]['dashboard_label_text_color_hover'] = '';

View File

@@ -828,10 +828,8 @@
echo "<td class='vtable' style='position: relative;' align='left'>\n";
echo " <select name='dashboard_chart_type' class='formfld'>\n";
echo " <option value='doughnut'>".$text['label-doughnut']."</option>\n";
if ($dashboard_chart_type === 'line') {
echo " <option value='line' selected='selected'>".$text['label-line']."</option>\n";
} else {
echo " <option value='line'>".$text['label-line']."</option>\n";
if ($dashboard_chart_type == 'line' || $dashboard_path == 'system/system_cpu_status') {
echo " <option value='line' ".($dashboard_chart_type == "line" ? "selected='selected'" : null).">".$text['label-line']."</option>\n";
}
if ($dashboard_chart_type == "icon" || in_array($dashboard_path, ['domains/domains', 'xml_cdr/missed_calls', 'voicemails/voicemails', 'xml_cdr/recent_calls', 'registrations/registrations'])) {
echo " <option value='icon' ".($dashboard_chart_type == "icon" ? "selected='selected'" : null).">".$text['label-icon']."</option>\n";
@@ -931,7 +929,7 @@
echo "</tr>\n";
}
if ($dashboard_chart_type == "icon" || in_array($dashboard_path, ['domains/domains', 'xml_cdr/missed_calls', 'voicemails/voicemails', 'xml_cdr/recent_calls', 'registrations/registrations'])) {
if ($dashboard_chart_type == "icon" || in_array($dashboard_path, ['active_calls/active_calls', 'domains/domains', 'xml_cdr/missed_calls', 'voicemails/voicemails', 'xml_cdr/recent_calls', 'registrations/registrations'])) {
echo "<tr class='type_icon'>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo $text['label-dashboard_number_text_color_hover']."\n";
@@ -988,8 +986,8 @@
echo "</td>\n";
echo "</tr>\n";
if ($action == "add" || $dashboard_path == "dashboard/icon") {
echo "<tr class='type_icon' ".($dashboard_path != 'dashboard/icon' ? "style='display: none;'" : null).">\n";
if ($action == "add" || $dashboard_path == "dashboard/icon" || $dashboard_chart_type == "icon") {
echo "<tr class='type_icon' ".($dashboard_path != "dashboard/icon" || $dashboard_chart_type != "icon" ? null : "style='display: none;'").">\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo $text['label-dashboard_background_color_hover']."\n";
echo "</td>\n";
@@ -1023,40 +1021,38 @@
echo "</tr>\n";
}
if ($dashboard_details_state != "none") {
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo $text['label-dashboard_detail_background_color']."\n";
echo "</td>\n";
echo "<td class='vtable' style='position: relative;' align='left'>\n";
if (!empty($dashboard_detail_background_color) && is_array($dashboard_detail_background_color)) {
foreach ($dashboard_detail_background_color as $c => $detail_background_color) {
echo " <input type='text' class='formfld colorpicker' id='dashboard_detail_background_color_".$c."' name='dashboard_detail_background_color[]' value='".escape($detail_background_color)."'>\n";
if ($c < sizeof($dashboard_detail_background_color) - 1) { echo "<br />\n"; }
}
//swap button
if (!empty($dashboard_detail_background_color) && is_array($dashboard_detail_background_color) && sizeof($dashboard_detail_background_color) > 1) {
echo " <input type='hidden' id='dashboard_detail_background_color_temp'>\n";
echo button::create(['type'=>'button','title'=>$text['button-swap'],'icon'=>'fa-solid fa-arrow-right-arrow-left fa-rotate-90','style'=>"z-index: 0; position: absolute; display: inline-block; margin: -14px 0 0 7px;",'onclick'=>"document.getElementById('dashboard_detail_background_color_temp').value = document.getElementById('dashboard_detail_background_color_0').value; document.getElementById('dashboard_detail_background_color_0').value = document.getElementById('dashboard_detail_background_color_1').value; document.getElementById('dashboard_detail_background_color_1').value = document.getElementById('dashboard_detail_background_color_temp').value; this.blur();"])."<br>\n";
}
else {
echo "<br />\n";
}
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo $text['label-dashboard_detail_background_color']."\n";
echo "</td>\n";
echo "<td class='vtable' style='position: relative;' align='left'>\n";
if (!empty($dashboard_detail_background_color) && is_array($dashboard_detail_background_color)) {
foreach ($dashboard_detail_background_color as $c => $detail_background_color) {
echo " <input type='text' class='formfld colorpicker' id='dashboard_detail_background_color_".$c."' name='dashboard_detail_background_color[]' value='".escape($detail_background_color)."'>\n";
if ($c < sizeof($dashboard_detail_background_color) - 1) { echo "<br />\n"; }
}
if (empty($dashboard_detail_background_color) || (is_array($dashboard_detail_background_color) && count($dashboard_detail_background_color) < 2)) {
echo " <input type='text' class='formfld colorpicker' style='display: block;' name='dashboard_detail_background_color[]' value='' onclick=\"document.getElementById('detail_background_color_gradient').style.display = 'block';\">\n";
if (empty($dashboard_detail_background_color)) {
echo " <input id='detail_background_color_gradient' style='display: none;' type='text' class='formfld colorpicker' name='dashboard_detail_background_color[]'>\n";
}
//swap button
if (!empty($dashboard_detail_background_color) && is_array($dashboard_detail_background_color) && sizeof($dashboard_detail_background_color) > 1) {
echo " <input type='hidden' id='dashboard_detail_background_color_temp'>\n";
echo button::create(['type'=>'button','title'=>$text['button-swap'],'icon'=>'fa-solid fa-arrow-right-arrow-left fa-rotate-90','style'=>"z-index: 0; position: absolute; display: inline-block; margin: -14px 0 0 7px;",'onclick'=>"document.getElementById('dashboard_detail_background_color_temp').value = document.getElementById('dashboard_detail_background_color_0').value; document.getElementById('dashboard_detail_background_color_0').value = document.getElementById('dashboard_detail_background_color_1').value; document.getElementById('dashboard_detail_background_color_1').value = document.getElementById('dashboard_detail_background_color_temp').value; this.blur();"])."<br>\n";
}
if (!empty($dashboard_detail_background_color) && !is_array($dashboard_detail_background_color)) {
echo " <input type='text' class='formfld colorpicker' name='dashboard_detail_background_color[]' value='".escape([$dashboard_detail_background_color])."'><br />\n";
echo " <input type='text' class='formfld colorpicker' name='dashboard_detail_background_color[]' value=''><br />\n";
else {
echo "<br />\n";
}
echo $text['description-dashboard_detail_background_color']."\n";
echo "</td>\n";
echo "</tr>\n";
}
if (empty($dashboard_detail_background_color) || (is_array($dashboard_detail_background_color) && count($dashboard_detail_background_color) < 2)) {
echo " <input type='text' class='formfld colorpicker' style='display: block;' name='dashboard_detail_background_color[]' value='' onclick=\"document.getElementById('detail_background_color_gradient').style.display = 'block';\">\n";
if (empty($dashboard_detail_background_color)) {
echo " <input id='detail_background_color_gradient' style='display: none;' type='text' class='formfld colorpicker' name='dashboard_detail_background_color[]'>\n";
}
}
if (!empty($dashboard_detail_background_color) && !is_array($dashboard_detail_background_color)) {
echo " <input type='text' class='formfld colorpicker' name='dashboard_detail_background_color[]' value='".escape([$dashboard_detail_background_color])."'><br />\n";
echo " <input type='text' class='formfld colorpicker' name='dashboard_detail_background_color[]' value=''><br />\n";
}
echo $text['description-dashboard_detail_background_color']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
@@ -1096,7 +1092,7 @@
echo "<td class='vtable' style='position: relative;' align='left'>\n";
echo " <select name='dashboard_column_span' class='formfld'>\n";
$i=1;
while ($i <= 3) {
while ($i <= 4) {
$selected = ($i == $dashboard_column_span) ? "selected" : null;
echo " <option value='$i' ".$selected.">$i</option>\n";
$i++;
@@ -1114,7 +1110,7 @@
echo "<td class='vtable' style='position: relative;' align='left'>\n";
echo " <select name='dashboard_row_span' class='formfld'>\n";
$i=1;
while ($i <= 3) {
while ($i <= 4) {
$selected = ($i == $dashboard_row_span) ? "selected" : null;
echo " <option value='$i' ".$selected.">$i</option>\n";
$i++;
@@ -1125,23 +1121,21 @@
echo "</td>\n";
echo "</tr>\n";
if ($dashboard_details_state != "none") {
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-dashboard_details_state']."\n";
echo "</td>\n";
echo "<td class='vtable' style='position: relative;' align='left'>\n";
echo " <select name='dashboard_details_state' class='formfld'>\n";
echo " <option value='expanded'>".$text['option-expanded']."</option>\n";
echo " <option value='contracted' ".($dashboard_details_state == "contracted" ? "selected='selected'" : null).">".$text['option-contracted']."</option>\n";
echo " <option value='hidden' ".($dashboard_details_state == "hidden" ? "selected='selected'" : null).">".$text['option-hidden']."</option>\n";
echo " <option value='disabled' ".($dashboard_details_state == "disabled" || empty($dashboard_details_state) ? "selected='selected'" : null).">".$text['label-disabled']."</option>\n";
echo " </select>\n";
echo "<br />\n";
echo $text['description-dashboard_details_state']."\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_details_state']."\n";
echo "</td>\n";
echo "<td class='vtable' style='position: relative;' align='left'>\n";
echo " <select name='dashboard_details_state' class='formfld'>\n";
echo " <option value='expanded'>".$text['option-expanded']."</option>\n";
echo " <option value='contracted' ".($dashboard_details_state == "contracted" ? "selected='selected'" : null).">".$text['option-contracted']."</option>\n";
echo " <option value='hidden' ".($dashboard_details_state == "hidden" ? "selected='selected'" : null).">".$text['option-hidden']."</option>\n";
echo " <option value='disabled' ".($dashboard_details_state == "disabled" || empty($dashboard_details_state) ? "selected='selected'" : null).">".$text['label-disabled']."</option>\n";
echo " </select>\n";
echo "<br />\n";
echo $text['description-dashboard_details_state']."\n";
echo "</td>\n";
echo "</tr>\n";
if (permission_exists('dashboard_parent_uuid')) {
echo " <tr>";

View File

@@ -1,4 +1,3 @@
<?php
/*
FusionPBX
@@ -291,14 +290,25 @@ foreach ($dashboard as $row) {
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 " display: none;\n";
echo "}\n";
echo "#".$dashboard_name." .hud_content {\n";
echo " align-content: center;\n";
echo "}\n";
echo "#".$dashboard_name." .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 {\n";
echo "#".$dashboard_name." .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 {\n";
echo "#".$dashboard_name.":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";
@@ -349,17 +359,6 @@ foreach ($dashboard as $row) {
}
echo "}\n";
}
if ($row['dashboard_label_enabled'] == 'false') {
echo "#".$dashboard_name." .hud_title {\n";
echo " display: none;\n";
echo "}\n";
echo "#".$dashboard_name." .hud_content {\n";
echo " align-content: center;\n";
echo "}\n";
echo "#".$dashboard_name." .hud_chart {\n";
echo " padding-top: 0;\n";
echo "}\n";
}
if ($row['dashboard_path'] == "dashboard/icon") {
echo "#".$dashboard_name." div.hud_content,\n";
echo "#".$dashboard_name." span.hud_title,\n";
@@ -396,6 +395,11 @@ foreach ($dashboard as $row) {
echo " height: 300.5px;\n";
echo "}\n";
break;
case 4:
echo "#".$dashboard_name." .hud_content {\n";
echo " height: 406px;\n";
echo "}\n";
break;
default: //if empty
echo "#".$dashboard_name." .hud_content {\n";
echo " height: 195px;\n";
@@ -485,9 +489,11 @@ foreach ($dashboard as $row) {
.widgets { grid-template-columns: repeat(5, minmax(100px, 1fr)); }
.col-num { grid-column: span 2; }
}
</style>
<script>
function toggle_grid_row_end(dashboard_name) {
let widget = document.getElementById(dashboard_name.toLowerCase().replace(/ /g, '_'));
let state = widget.getAttribute('data-state');
@@ -559,7 +565,7 @@ function toggle_grid_row_end_all() {
$dashboard_label_text_color = $row['dashboard_label_text_color'] ?? $settings->get('theme', 'dashboard_label_text_color', '');
$dashboard_number_text_color = $row['dashboard_number_text_color'] ?? $settings->get('theme', 'dashboard_number_text_color', '');
$dashboard_number_background_color = $row['dashboard_number_background_color'] ?? $settings->get('theme', 'dashboard_number_background_color', '');
$dashboard_details_state = $row['dashboard_details_state'] ?? 'expanded';
$dashboard_details_state = $row['dashboard_details_state'] ?? 'hidden';
$dashboard_row_span = $row['dashboard_row_span'] ?? 2;
//define the regex patterns
@@ -663,7 +669,7 @@ function toggle_grid_row_end_all() {
$('.hud_box').addClass('editable');
$('#btn_back, #btn_save').show();
$('div.widget').attr('draggable',true).addClass('editable');
$('div.parent_widget').attr('draggable',true).addClass('editable');
$('div.child_widget').attr('draggable',true).addClass('editable');
function update_widget_order() {
let widget_ids_list = [];
@@ -677,9 +683,9 @@ function toggle_grid_row_end_all() {
order += 10;
//add the nested widgets to the list
const nested_container = widget.querySelector('.parent_widgets');
const nested_container = widget.querySelector('.parent_widget');
if (nested_container) {
nested_container.querySelectorAll(':scope > div.parent_widget[id]').forEach(nested => {
nested_container.querySelectorAll(':scope > div.child_widget[id]').forEach(nested => {
const child_id = nested.id;
widget_ids_list.push(`${child_id}|${widget_id}|${order}`);
order += 10;
@@ -699,30 +705,30 @@ function toggle_grid_row_end_all() {
onSort: update_widget_order,
onAdd: function (evt) {
evt.item.classList.add('widget');
evt.item.classList.remove('child_widget');
update_widget_order();
},
onRemove: function (evt) {
evt.item.classList.remove('widget');
evt.item.classList.add('child_widget');
update_widget_order();
},
});
document.querySelectorAll('.parent_widgets').forEach(function(container) {
document.querySelectorAll('.parent_widget').forEach(function(container) {
Sortable.create(container, {
group: 'nested',
animation: 150,
draggable: '.parent_widget',
draggable: '.child_widget',
ghostClass: 'ghost',
fallbackOnBody: true,
onSort: update_widget_order,
onAdd: function (evt) {
evt.item.classList.add('parent_widget');
update_widget_order();
let current_row_end = evt.item.style.gridRowEnd;
evt.item.style.gridColumn = current_row_end;
},
onRemove: function (evt) {
evt.item.classList.remove('parent_widget');
update_widget_order();
evt.item.style.gridColumn = '';
},
@@ -733,13 +739,13 @@ function toggle_grid_row_end_all() {
else { // off
$('div.widget').attr('draggable',false).removeClass('editable');
$('div.parent_widget').attr('draggable',false).removeClass('editable');
$('div.child_widget').attr('draggable',false).removeClass('editable');
$('.hud_box').removeClass('editable');
$('#btn_back, #btn_save').hide();
$('span#expand_contract, #btn_edit, #btn_add').show();
sortable.option('disabled', true);
document.querySelectorAll('.parent_widgets').forEach(el => {
document.querySelectorAll('.parent_widget').forEach(el => {
const nested_sortable = Sortable.get(el);
if (nested_sortable) {
nested_sortable.option('disabled', true);

View File

@@ -24,10 +24,8 @@
//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 " <a href='".$dashboard_url."' onclick=\"window.open('".$dashboard_url."', '".$dashboard_target."', '".$window_parameters."'); return false;\" style=''>\n";
echo " <span class='hud_title'>".escape($dashboard_label)."</span>\n";
echo " <span class='hud_stat'><i class=\"fas ".$dashboard_icon."\"></i></span>\n";
echo " </a>\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";
if (empty($dashboard_details_state) || $dashboard_details_state != "disabled") {

View File

@@ -75,7 +75,7 @@
<style>
div.parent_widgets {
div.parent_widget {
max-width: 100%;
margin: 0 auto;
display: grid;
@@ -83,7 +83,7 @@ div.parent_widgets {
row-gap: 1rem;
}
div.parent_widget div.hud_box:first-of-type {
div.child_widget div.hud_box:first-of-type {
/*min-width: 120px;*/
background: rgba(0,0,0,0);
border: 0px dashed rgba(0,0,0,0);
@@ -94,20 +94,20 @@ div.parent_widget div.hud_box:first-of-type {
transition: .1s;
}
div.parent_widget.editable div.hud_box:first-of-type {
div.child_widget.editable div.hud_box:first-of-type {
border: 1px dashed rgba(0,0,0,0.4);
}
div.parent_widget:not(:has(.parent_widgets)) .hud_content {
div.child_widget:not(:has(.parent_widget)) .hud_content {
align-content: center;
}
div.parent_widget div.hud_chart {
div.child_widget div.hud_chart {
padding: 7px;
}
div.parent_widget:hover:has(i) div.hud_box,
div.parent_widget.editable:hover:has(i) div.hud_box {
div.child_widget:hover:has(i) div.hud_box,
div.child_widget.editable:hover:has(i) div.hud_box {
transform: scale(1.05, 1.05);
-webkit-transition: .1s;
-moz-transition: .1s;
@@ -183,12 +183,12 @@ foreach ($parent_widgets as $row) {
echo "}\n";
}
if ($row['dashboard_column_span'] > 1) {
echo "#".$dashboard_name.".parent_widget {\n";
echo "#".$dashboard_name.".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.".parent_widget {\n";
echo "#".$dashboard_name.".child_widget {\n";
echo " grid-column: span 2;\n";
echo "}\n";
}
@@ -201,7 +201,7 @@ foreach ($parent_widgets as $row) {
//include the dashboards
echo "<div class='hud_box' style='overflow-y: auto;'>\n";
echo " <div class='hud_content parent_widgets'>\n";
echo " <div class='hud_content parent_widget'>\n";
$x = 0;
foreach ($parent_widgets as $row) {
@@ -254,10 +254,10 @@ foreach ($parent_widgets as $row) {
//find the application and widget
$dashboard_path_array = explode('/', $dashboard_path);
$application_name = $dashboard_path_array[0];
$parent_widget_name = $dashboard_path_array[1];
$path_array = glob(dirname(__DIR__, 4).'/*/'.$application_name.'/resources/dashboard/'.$parent_widget_name.'.php');
$child_widget_name = $dashboard_path_array[1];
$path_array = glob(dirname(__DIR__, 4).'/*/'.$application_name.'/resources/dashboard/'.$child_widget_name.'.php');
echo "<div class='parent_widget' style='grid-row-end: span ".$dashboard_row_span.";' data-state='".$dashboard_details_state."' onclick=\"".(!empty($dashboard_url && $dashboard_path == "dashboard/icon") ? "window.open('". $dashboard_url ."', '". $dashboard_target ."', '". $window_parameters ."')" : "")."\" 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_name_id."' draggable='false'>\n";
if (file_exists($path_array[0])) {
include $path_array[0];
}