Merge branch 'ent-4194-Revision-de-CSS-alternativos' into 'develop'

Created black theme - #4194

See merge request artica/pandorafms!2564
This commit is contained in:
Daniel Rodriguez 2019-07-10 11:47:21 +02:00
commit 96fbca35a4
16 changed files with 476 additions and 7877 deletions

View File

@ -270,6 +270,12 @@ function mainModuleGroups()
$table->style[0] = 'color: #ffffff; background-color: #373737; font-weight: bolder; min-width: 230px;'; $table->style[0] = 'color: #ffffff; background-color: #373737; font-weight: bolder; min-width: 230px;';
$table->width = '100%'; $table->width = '100%';
if ($config['style'] === 'pandora_black') {
$background_color = '#333';
} else {
$background_color = '#fff';
}
$head[0] = __('Groups'); $head[0] = __('Groups');
$headstyle[0] = 'width: 20%; font-weight: bolder;'; $headstyle[0] = 'width: 20%; font-weight: bolder;';
foreach ($array_module_group as $key => $value) { foreach ($array_module_group as $key => $value) {
@ -314,7 +320,7 @@ function mainModuleGroups()
$data[$i][$j] .= $array_data[$key][$k]['total_count']; $data[$i][$j] .= $array_data[$key][$k]['total_count'];
$data[$i][$j] .= '</a></div>'; $data[$i][$j] .= '</a></div>';
} else { } else {
$data[$i][$j] = "<div style='background:white;".$cell_style."'>"; $data[$i][$j] = "<div style='background:".$background_color.';'.$cell_style."'>";
$data[$i][$j] .= 0; $data[$i][$j] .= 0;
$data[$i][$j] .= '</div>'; $data[$i][$j] .= '</div>';
} }
@ -323,7 +329,7 @@ function mainModuleGroups()
} }
} else { } else {
foreach ($value['gm'] as $k => $v) { foreach ($value['gm'] as $k => $v) {
$data[$i][$j] = "<div style='background:white; min-width: 60px;max-width:5%;overflow:hidden; margin-left: auto; margin-right: auto; text-align: center; padding: 5px;padding-bottom:10px;font-size: 18px;line-height:25px;'>"; $data[$i][$j] = "<div style='background:".$background_color."; min-width: 60px;max-width:5%;overflow:hidden; margin-left: auto; margin-right: auto; text-align: center; padding: 5px;padding-bottom:10px;font-size: 18px;line-height:25px;'>";
$data[$i][$j] .= 0; $data[$i][$j] .= 0;
$data[$i][$j] .= '</div>'; $data[$i][$j] .= '</div>';
$j++; $j++;

View File

@ -362,7 +362,7 @@ if ($console_mode == 1) {
true true
); );
echo "<table width='1000px' border='0' style='border:0px;' class='databox data' cellpadding='4' cellspacing='4'>"; echo "<table id='diagnostic_info' width='1000px' border='0' style='border:0px;' class='databox data' cellpadding='4' cellspacing='4'>";
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__('Pandora status info').'</th></tr>'; echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__('Pandora status info').'</th></tr>';
} }

View File

@ -78,6 +78,13 @@ function push_table_advanced($row, $id=false)
function add_component_selection($id_network_component_type) function add_component_selection($id_network_component_type)
{ {
global $table_simple; global $table_simple;
global $config;
if ($config['style'] === 'pandora_black') {
$background_row = 'background-color: #444';
} else {
$background_row = 'background-color: #cfcfcf';
}
$data = []; $data = [];
$data[0] = __('Using module component').' '; $data[0] = __('Using module component').' ';
@ -116,7 +123,7 @@ function add_component_selection($id_network_component_type)
$data[1] .= '</span>'; $data[1] .= '</span>';
$table_simple->colspan['module_component'][1] = 3; $table_simple->colspan['module_component'][1] = 3;
$table_simple->rowstyle['module_component'] = 'background-color: #cfcfcf'; $table_simple->rowstyle['module_component'] = $background_row;
prepend_table_simple($data, 'module_component'); prepend_table_simple($data, 'module_component');
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -3391,11 +3391,22 @@ function agents_get_image_status($status)
*/ */
function agents_get_status_animation($up=true) function agents_get_status_animation($up=true)
{ {
global $config;
// Gif with black background or white background
if ($config['style'] === 'pandora_black') {
$heartbeat_green = 'images/heartbeat_green_black.gif';
$heartbeat_red = 'images/heartbeat_red_black.gif';
} else {
$heartbeat_green = 'images/heartbeat_green.gif';
$heartbeat_red = 'images/heartbeat_red.gif';
}
switch ($up) { switch ($up) {
case true: case true:
default: default:
return html_print_image( return html_print_image(
'images/heartbeat_green.gif', $heartbeat_green,
true, true,
[ [
'width' => '170', 'width' => '170',
@ -3405,7 +3416,7 @@ function agents_get_status_animation($up=true)
case false: case false:
return html_print_image( return html_print_image(
'images/heartbeat_red.gif', $heartbeat_red,
true, true,
[ [
'width' => '170', 'width' => '170',

View File

@ -107,9 +107,15 @@ function html_do_report_info($report)
{ {
global $config; global $config;
if ($config['style'] === 'pandora_black') {
$background_color = '#222';
} else {
$background_color = '#f5f5f5';
}
$date_today = date($config['date_format']); $date_today = date($config['date_format']);
$html = '<div style="border: 1px dashed #999; padding: 10px 15px; background: #f5f5f5;margin-top:20px;margin-bottom:20px;"><table> $html = '<div style="border: 1px dashed #999; padding: 10px 15px; background: '.$background_color.';margin-top:20px;margin-bottom:20px;"><table>
<tr> <tr>
<td><b>'.__('Generated').': </b></td><td>'.$date_today.'</td> <td><b>'.__('Generated').': </b></td><td>'.$date_today.'</td>
</tr> </tr>

View File

@ -1755,6 +1755,12 @@ function ui_process_page_head($string, $bitfield)
// Add the dialog styles CSS. // Add the dialog styles CSS.
$config['css']['dialog'] = 'include/styles/js/introjs.css'; $config['css']['dialog'] = 'include/styles/js/introjs.css';
// If the theme is the default, we don't load it twice.
if ($config['style'] !== 'pandora') {
// It loads the last of all.
$config['css']['theme'] = 'include/styles/'.$config['style'].'.css';
}
// If skin's css files exists then add them. // If skin's css files exists then add them.
if ($exists_css) { if ($exists_css) {
foreach ($skin_styles as $filename => $name) { foreach ($skin_styles as $filename => $name) {
@ -1766,10 +1772,10 @@ function ui_process_page_head($string, $bitfield)
// User style should go last so it can rewrite common styles. // User style should go last so it can rewrite common styles.
$config['css'] = array_merge( $config['css'] = array_merge(
[ [
'common' => 'include/styles/common.css', 'common' => 'include/styles/common.css',
'menu' => 'include/styles/menu.css', 'menu' => 'include/styles/menu.css',
'tables' => 'include/styles/tables.css', 'tables' => 'include/styles/tables.css',
$config['style'] => 'include/styles/'.$config['style'].'.css', 'general' => 'include/styles/pandora.css',
], ],
$config['css'] $config['css']
); );

View File

@ -740,6 +740,8 @@ function print_donut_narrow_graph(
array $data, array $data,
$data_total $data_total
) { ) {
global $config;
if (empty($data)) { if (empty($data)) {
return graph_nodata_image($width, $height, 'pie'); return graph_nodata_image($width, $height, 'pie');
} }
@ -754,10 +756,31 @@ function print_donut_narrow_graph(
$graph_id = uniqid('graph_'); $graph_id = uniqid('graph_');
// This is for "Style template" in visual styles.
switch ($config['style']) {
case 'pandora':
$textColor = '#000';
$strokeColor = '#fff';
break;
case 'pandora_black':
$textColor = '#fff';
$strokeColor = '#222';
break;
default:
$textColor = '#000';
$strokeColor = '#fff';
break;
}
$textColor = json_encode($textColor);
$strokeColor = json_encode($strokeColor);
$out = "<div id='$graph_id'></div>"; $out = "<div id='$graph_id'></div>";
$out .= include_javascript_d3(true); $out .= include_javascript_d3(true);
$out .= "<script type='text/javascript'> $out .= "<script type='text/javascript'>
donutNarrowGraph($colors, $width, $height, $data_total) donutNarrowGraph($colors, $width, $height, $data_total, $textColor, $strokeColor)
.donutbody(d3.select($graph_id)) .donutbody(d3.select($graph_id))
.data($data) .data($data)
.render(); .render();

View File

@ -2762,7 +2762,14 @@ function valueToBytes(value) {
return value.toFixed(2) + shorts[pos] + "B"; return value.toFixed(2) + shorts[pos] + "B";
} }
function donutNarrowGraph(colores, width, height, total) { function donutNarrowGraph(
colores,
width,
height,
total,
textColor,
strokeColor
) {
// Default settings // Default settings
var donutbody = d3.select("body"); var donutbody = d3.select("body");
var data = {}; var data = {};
@ -2848,7 +2855,7 @@ function donutNarrowGraph(colores, width, height, total) {
this._current = d; this._current = d;
}) })
.attr("d", arc) .attr("d", arc)
.attr("stroke", "white") .attr("stroke", strokeColor)
.style("fill", function(d) { .style("fill", function(d) {
return color(d.data.key); return color(d.data.key);
}); });
@ -2872,7 +2879,7 @@ function donutNarrowGraph(colores, width, height, total) {
.attr("y", 0 + radius / 10) .attr("y", 0 + radius / 10)
.attr("class", "text-tooltip") .attr("class", "text-tooltip")
.style("text-anchor", "middle") .style("text-anchor", "middle")
//.attr("fill", "#82b92e") .attr("fill", textColor)
.style("font-size", function(d) { .style("font-size", function(d) {
if (normal_status) { if (normal_status) {
percentage_normal = (normal_status * 100) / total; percentage_normal = (normal_status * 100) / total;
@ -2902,6 +2909,7 @@ function donutNarrowGraph(colores, width, height, total) {
/* .attr("fill", function(d) { /* .attr("fill", function(d) {
return color(obj.data.key); return color(obj.data.key);
})*/ })*/
.attr("fill", textColor)
.style("font-size", function(d) { .style("font-size", function(d) {
percentage = (d[obj.data.key] * 100) / total; percentage = (d[obj.data.key] * 100) / total;
if (Number.isInteger(percentage)) { if (Number.isInteger(percentage)) {

View File

@ -1,4 +1,6 @@
/** /**
* Exclude css from visual styles
*
* Extension to manage a list of gateways and the node address where they should * Extension to manage a list of gateways and the node address where they should
* point to. * point to.
* *

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1217,14 +1217,16 @@ echo "\n<!-- Page generated in $run_time seconds -->\n";
// Values from PHP to be recovered from JAVASCRIPT // Values from PHP to be recovered from JAVASCRIPT
require 'include/php_to_js_values.php'; require 'include/php_to_js_values.php';
?> ?>
<script type="text/javascript" language="javascript"> <script type="text/javascript" language="javascript">
// When there are less than 5 rows, all rows must be white // When there are less than 5 rows, all rows must be white
if($('table.info_table tr').length < 5){ var theme = "<?php echo $config['style']; ?>";
$('table.info_table tbody > tr').css('background-color', '#fff'); if(theme === 'pandora'){
if($('table.info_table tr').length < 5){
$('table.info_table tbody > tr').css('background-color', '#fff');
}
} }
// When the user scrolls down 400px from the top of the document, show the button. // When the user scrolls down 400px from the top of the document, show the button.

View File

@ -22,7 +22,7 @@ $searchReports = check_acl($config['id_user'], 0, 'RR');
$searchUsers = check_acl($config['id_user'], 0, 'UM'); $searchUsers = check_acl($config['id_user'], 0, 'UM');
$searchHelps = true; $searchHelps = true;
echo '<br><div style="margin:auto; width:90%; padding: 10px; background: #fff">'; echo '<br><div style="margin:auto; width:90%; padding: 10px;">';
$anyfound = false; $anyfound = false;