9868 Remove footer and create About section

This commit is contained in:
Pablo Aragon 2022-12-29 16:21:36 +01:00
parent 0217a02da7
commit ab54a26815
8 changed files with 451 additions and 51 deletions

View File

@ -1,4 +1,5 @@
<?php
/**
* Godmode menu.
*
@ -578,6 +579,14 @@ if ($access_console_node === true) {
}
}
if ($access_console_node === true) {
// About.
$menu_godmode['about']['text'] = __('About');
$menu_godmode['about']['id'] = 'about';
}
if ((bool) $config['pure'] === false) {
menu_print_menu($menu_godmode);
}
echo '<div id="about-div"></div>';

Binary file not shown.

After

Width:  |  Height:  |  Size: 759 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 563 B

View File

@ -772,3 +772,292 @@ function menu_pepare_acl_select_data($pages, $sec)
return $pages;
}
if (is_ajax()) {
$about = (bool) get_parameter('about');
if ($about) {
global $config;
global $pandora_version;
global $build_version;
$product_name = io_safe_output(get_product_name());
include_once $config['homedir'].'/include/class/Diagnostics.class.php';
$d = new Diagnostics;
$db_health = json_decode($d->getDatabaseHealthStatus());
$db_info = json_decode($d->getDatabaseStatusInfo());
$db_fragmentation = json_decode($d->getTablesFragmentation());
$sys_info = json_decode($d->getSystemInfo());
$php_sys = json_decode($d->getPHPSetup());
$fragmentation_status = '';
if ($db_fragmentation->data->tablesFragmentationStatus->status === 1) {
$fragmentation_status = html_print_image(
'images/exito.png',
true,
[
'title' => __('Successfully'),
'style' => 'width:15px;',
]
);
} else {
$fragmentation_status = html_print_image(
'images/error_1.png',
true,
[
'title' => __('Error'),
'style' => 'width:15px;',
]
);
}
$dialog = '
<div id="about-tabs" class="invisible overflow-hidden">
<ul>
<li><a href="#tab-general-view">'.__('Information').'</a></li>
<li><a href="#tab-database">'.__('Database').'</a></li>
<li><a href="#tab-system-info">'.__('System Info').'</a></li>
<li><a href="#tab-php-system">'.__('PHP System').'</a></li>
<li class="ui-tabs-close-button" style="float:right!important;">
<img id="about-close" style="cursor: pointer;" src="'.ui_get_full_url('/include/styles/images/dialog-titlebar-close.png', false, false, false).'" alt="'.__('Close').'" title="'.__('Close').'" width="25px">
</li>
</ul>
<div id="tab-general-view">
<table class="table-about">
<tbody>
<tr>
<th style="width: 40%;">
<img src="'.ui_get_full_url('/images/custom_logo/'.$config['custom_logo'], false, false, false).'" alt="logo" width="70%">
</th>
<th style="width: 60%; text-align: left;">
<h1>'.$product_name.'</h1>
<p><span>'.__('Version').' '.$pandora_version.' - '.(enterprise_installed() ? 'Enterprise' : 'Community').'</span></p>
<p><span>'.__('MR version').'</span> MR'.$config['MR'].'</p>
<p><span>'.__('Build').'</span> '.$build_version.'</p>
<p style="margin-bottom: 20px!important;"><span>'.__('Support expires').'</span> 2023/04/26</p>';
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
$dialog .= '
<div style="display: inline;">
<button class="sub" onclick="location.href=\''.ui_get_full_url('/index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=history', false, false, false).'\'">'.__('Update manager').'</button>
<button class="sub" onclick="location.href=\''.ui_get_full_url('/index.php?sec=gextensions&sec2=tools/diagnostics', false, false, false).'\'">'.__('System report').'</button>
</div>
';
}
$dialog .= '</th>
</tr>
</tbody>
</table>
<p class="trademark-copyright">Trademark and copyright 2004 - '.date('Y').' Pandora FMS. All rights reserved</p>
</div>
<div id="tab-database" class="div-scroll">
<table class="table-about">
<tbody style="text-align: left;">
<tr>
<th colspan="2">
<h2><span> - </span>'.__('Database health status').'</h2>
</th>
</tr>
<tr>
<th style="width: 50%;">
<p><span>'.$db_health->data->unknownAgents->name.'</span></p>
</th>
<th style="width: 50%;">
<p>'.$db_health->data->unknownAgents->value.'</p>
</th>
</tr>
<tr>
<th style="width: 50%;">
<p><span>'.$db_health->data->notInitAgents->name.'</span></p>
</th>
<th style="width: 50%;">
<p>'.$db_health->data->notInitAgents->value.'</p>
</th>
</tr>
<tr class="about-last-tr">
<th style="width: 50%;">
<p class="about-last-p"><span>'.$db_health->data->pandoraDbLastRun->name.'</span></p>
</th>
<th style="width: 50%;">
<p class="about-last-p">'.$db_health->data->pandoraDbLastRun->value.'</p>
</th>
</tr>
<tr>
<th colspan="2">
<h2><span> - </span>'.__('Database status info').'</h2>
</th>
</tr>
<tr>
<th style="width: 50%;">
<p><span>'.$db_info->data->dbSchemeFirstVersion->name.'</span></p>
</th>
<th style="width: 50%;">
<p>'.$db_info->data->dbSchemeFirstVersion->value.'</p>
</th>
</tr>
<tr>
<th style="width: 50%;">
<p><span>'.$db_info->data->dbSchemeVersion->name.'</span></p>
</th>
<th style="width: 50%;">
<p>'.$db_info->data->dbSchemeVersion->value.'</p>
</th>
</tr>
<tr>
<th style="width: 50%;">
<p><span>'.$db_info->data->dbSchemeBuild->name.'</span></p>
</th>
<th style="width: 50%;">
<p>'.$db_info->data->dbSchemeBuild->value.'</p>
</th>
</tr>
<tr class="about-last-tr">
<th style="width: 50%;">
<p class="about-last-p"><span>'.$db_info->data->dbSize->name.'</span></p>
</th>
<th style="width: 50%;">
<p class="about-last-p">'.$db_info->data->dbSize->value.'</p>
</th>
</tr>
<tr>
<th colspan="2">
<h2><span> - </span>'.__('Tables fragmentation in the %s database', $product_name).'</h2>
</th>
</tr>
<tr>
<th style="width: 50%;">
<p><span>'.$db_fragmentation->data->tablesFragmentationMax->name.'</span></p>
</th>
<th style="width: 50%;">
<p>'.$db_fragmentation->data->tablesFragmentationMax->value.'</p>
</th>
</tr>
<tr>
<th style="width: 50%;">
<p><span>'.$db_fragmentation->data->tablesFragmentationValue->name.'</span></p>
</th>
<th style="width: 50%;">
<p>'.$db_fragmentation->data->tablesFragmentationValue->value.'</p>
</th>
</tr>
<tr>
<th style="width: 50%;">
<p><span>'.$db_fragmentation->data->tablesFragmentationStatus->name.'</span></p>
</th>
<th style="width: 50%;">
<p>'.$fragmentation_status.'</p>
</th>
</tr>
</tbody>
</table>
</div>
<div id="tab-system-info">
<table class="table-about">
<tbody style="text-align: left;">
<tr>
<th colspan="2">
<h2><span> - </span>'.__('System Info').'</h2>
</th>
</tr>
<tr>
<th style="width: 15%;">
<p><span>'.$sys_info->data->cpuInfo->name.'</span></p>
</th>
<th style="width: 85%;">
<p>'.$sys_info->data->cpuInfo->value.'</p>
</th>
</tr>
<tr>
<th style="width: 15%;">
<p><span>'.$sys_info->data->ramInfo->name.'</span></p>
</th>
<th style="width: 85%;">
<p>'.$sys_info->data->ramInfo->value.'</p>
</th>
</tr>
<tr>
<th style="width: 15%;">
<p><span>'.$sys_info->data->osInfo->name.'</span></p>
</th>
<th style="width: 85%;">
<p>'.$sys_info->data->osInfo->value.'</p>
</th>
</tr>
<tr>
<th style="width: 15%;">
<p><span>'.$sys_info->data->hostnameInfo->name.'</span></p>
</th>
<th style="width: 85%;">
<p>'.$sys_info->data->hostnameInfo->value.'</p>
</th>
</tr>
<tr>
<th style="width: 15%;">
<p><span>'.$sys_info->data->ipInfo->name.'</span></p>
</th>
<th style="width: 85%;">
<p>'.$sys_info->data->ipInfo->value.'</p>
</th>
</tr>
</tbody>
</table>
</div>
<div id="tab-php-system">
<table class="table-about">
<tbody style="text-align: left;">
<tr>
<th colspan="2">
<h2><span> - </span>'.__('PHP system').'</h2>
</th>
</tr>
<tr>
<th style="width: 35%;">
<p><span>'.$php_sys->data->phpVersion->name.'</span></p>
</th>
<th style="width: 65%;">
<p>'.$php_sys->data->phpVersion->value.'</p>
</th>
</tr>
<tr>
<th style="width: 35%;">
<p><span>'.$php_sys->data->maxExecutionTime->name.'</span></p>
</th>
<th style="width: 65%;">
<p>'.$php_sys->data->maxExecutionTime->value.'</p>
</th>
</tr>
<tr>
<th style="width: 35%;">
<p><span>'.$php_sys->data->maxInputTime->name.'</span></p>
</th>
<th style="width: 65%;">
<p>'.$php_sys->data->maxInputTime->value.'</p>
</th>
</tr>
<tr>
<th style="width: 35%;">
<p><span>'.$php_sys->data->memoryLimit->name.'</span></p>
</th>
<th style="width: 65%;">
<p>'.$php_sys->data->memoryLimit->value.'</p>
</th>
</tr>
<tr>
<th style="width: 35%;">
<p><span>'.$php_sys->data->sessionLifetime->name.'</span></p>
</th>
<th style="width: 65%;">
<p>'.$php_sys->data->sessionLifetime->value.'</p>
</th>
</tr>
</tbody>
</table>
</div>
</div>
';
echo $dialog;
}
}

View File

@ -2241,3 +2241,58 @@ var formatterDataVerticalBar = function(value, ctx) {
return percentage;
}
};
// Show about section
$(document).ready(function() {
$("#icon_about").click(function() {
$("#icon_about").addClass("selected");
jQuery.post(
"ajax.php",
{
page: "include/functions_menu",
about: "true"
},
function(data) {
$("div.ui-dialog").remove();
$("#about-div").html("");
if (data) {
$("#about-div").html(data);
openAbout();
}
},
"html"
);
});
function openAbout() {
$("#about-tabs").dialog({
// title: "About",
resizable: false,
draggable: false,
modal: true,
show: {
effect: "fade",
duration: 200
},
hide: {
effect: "fade",
duration: 200
},
closeOnEscape: true,
width: 700,
height: 450,
create: function() {
$("#about-tabs").tabs({});
$(".ui-dialog-titlebar").remove();
$("#about-close").click(function() {
$("#about-tabs").dialog("close");
$("div.ui-dialog").remove();
$("#icon_about").removeClass("selected");
});
}
});
}
});

View File

@ -212,6 +212,9 @@ li.sub_subMenu.selected {
#icon_god-module_library {
background-image: url(../../images/menu/gm_library.menu_gray.png);
}
#icon_about {
background-image: url(../../images/menu/about.menu_gray.png);
}
#menu_container {
z-index: 3;
@ -375,6 +378,9 @@ ul li {
.selected#icon_god-module_library {
background-image: url(../../images/menu/gm_library.menu_white.png);
}
.selected#icon_about {
background-image: url(../../images/menu/about.menu_white.png);
}
#menu_full {
height: 100%;

View File

@ -9169,3 +9169,92 @@ div#err_msg_centralised {
justify-content: start;
padding-left: 10px;
}
/* Table about dialog */
.table-about {
background-color: white !important;
width: 100%;
border-collapse: collapse;
}
.table-about th {
background-color: white !important;
width: 100%;
}
.table-about h1 {
text-transform: none !important;
font-size: 28px !important;
color: #454545;
margin-top: 34px;
margin-left: 9px;
}
.table-about h2 {
text-transform: none !important;
font-size: 15px !important;
margin-bottom: 5px;
margin-left: 9px;
color: #14524f;
}
.table-about h2 span {
color: #14524f;
font-size: large;
font-weight: bolder;
}
.table-about p {
color: #454545;
font-size: 15px;
font-weight: normal;
margin: 7px;
margin-left: 9px;
}
.table-about p span {
color: #454545;
font-size: 15px;
font-weight: bold;
margin: 9px;
margin-left: 0px;
}
.table-about p.about-last-p {
padding-bottom: 17px;
}
.table-about .about-last-tr {
border-bottom: 1px solid #eaeaea;
}
.about-copyright-div {
width: 100%;
height: 100%;
}
p.trademark-copyright {
width: 90%;
color: #8a96a6;
font-size: 13px;
margin-top: 20px;
margin-bottom: 0px;
text-align: center !important;
position: absolute;
bottom: 0;
}
#about-tabs,
#tab-general-view {
padding-bottom: 0px;
margin-bottom: 0px;
}
#about-tabs {
overflow: hidden;
}
#tab-database {
height: 80%;
overflow: auto;
}

View File

@ -227,6 +227,9 @@ ob_start('ui_process_page_head');
// Enterprise main.
enterprise_include_once('index.php');
// Load event.css to display the about section dialog with correct styles.
echo '<link rel="stylesheet" href="'.ui_get_full_url('/include/styles/events.css', false, false, false).'" type="text/css" />';
echo '<script type="text/javascript">';
echo 'var dispositivo = navigator.userAgent.toLowerCase();';
echo 'if( dispositivo.search(/iphone|ipod|ipad|android/) > -1 ){';
@ -1472,9 +1475,6 @@ if ($config['pure'] == 0) {
echo '</div>';
echo '<div id="both"></div>';
echo '</div>';
echo '<div id="foot">';
include 'general/footer.php';
}
// Clippy function.
@ -1537,29 +1537,6 @@ require 'include/php_to_js_values.php';
}, 500);
}
// Initial load of page.
$(document).ready(adjustFooter);
// Every resize of window.
$(window).resize(adjustFooter);
// Every show/hide call may need footer re-layout.
(function() {
var oShow = jQuery.fn.show;
var oHide = jQuery.fn.hide;
jQuery.fn.show = function () {
var rv = oShow.apply(this, arguments);
adjustFooter();
return rv;
};
jQuery.fn.hide = function() {
var rv = oHide.apply(this, arguments);
adjustFooter();
return rv;
};
})();
function first_time_identification() {
jQuery.post("ajax.php", {
"page": "general/register",
@ -1645,31 +1622,6 @@ require 'include/php_to_js_values.php';
"html"
);
}
//Dynamically assign footer position and width.
function adjustFooter() {
/*
if (document.readyState !== 'complete' || $('#container').position() == undefined) {
return;
}
// minimum top value (upper limit) for div#foot
var ulim = $('#container').position().top + $('#container').outerHeight(true);
// window height. $(window).height() returns wrong value on Opera and Google Chrome.
var wh = document.documentElement.clientHeight;
// save div#foot's height for latter use
var h = $('#foot').height();
// new top value for div#foot
var t = (ulim + $('#foot').outerHeight() > wh) ? ulim : wh - $('#foot').outerHeight();
/*
if ($('#foot').position().top != t) {
$('#foot').css({ position: "absolute", top: t, left: $('#foot').offset().left});
$('#foot').height(h);
}
if ($('#foot').width() != $(window).width()) {
$('#foot').width($(window).width());
}
*/
}
</script>
<?php
if (__PAN_XHPROF__ === 1) {