Merge branch 'ent-8791-base-de-datos-historica-para-metaconsola' into 'develop'

add historical database setup in metaconsole pandora_enterprise#8791

See merge request 
This commit is contained in:
Diego Muñoz-Reja 2022-09-21 15:23:38 +00:00
commit fd04dda6d8
3 changed files with 19 additions and 13 deletions
pandora_console/include

@ -4101,17 +4101,20 @@ function ui_toggle(
// JQuery Toggle.
$output .= '<script type="text/javascript">'."\n";
$output .= ' var hide_tgl_ctrl_'.$uniqid.' = '.(int) $hidden_default.";\n";
$output .= ' var is_metaconsole = '.(int) is_metaconsole().";\n";
$output .= ' /* <![CDATA[ */'."\n";
$output .= " $(document).ready (function () {\n";
$output .= " $('#checkbox-".$switch_name."').click(function() {\n";
$output .= ' if (hide_tgl_ctrl_'.$uniqid.") {\n";
$output .= ' hide_tgl_ctrl_'.$uniqid." = 0;\n";
$output .= " $('#tgl_div_".$uniqid."').toggle();\n";
$output .= " }\n";
$output .= " else {\n";
$output .= ' hide_tgl_ctrl_'.$uniqid." = 1;\n";
$output .= " $('#tgl_div_".$uniqid."').toggle();\n";
$output .= " }\n";
$output .= ' if (is_metaconsole == 0) {';
$output .= ' if (hide_tgl_ctrl_'.$uniqid.") {\n";
$output .= ' hide_tgl_ctrl_'.$uniqid." = 0;\n";
$output .= " $('#tgl_div_".$uniqid."').toggle();\n";
$output .= " }\n";
$output .= " else {\n";
$output .= ' hide_tgl_ctrl_'.$uniqid." = 1;\n";
$output .= " $('#tgl_div_".$uniqid."').toggle();\n";
$output .= " }\n";
$output .= " }\n";
$output .= " });\n";
$output .= " $('#tgl_ctrl_".$uniqid."').click(function() {\n";
$output .= ' if (hide_tgl_ctrl_'.$uniqid.") {\n";

@ -73,7 +73,7 @@ final class Config
$config['history_db_user'],
io_output_password($config['history_db_pass']),
$config['history_db_name'],
$config['history_db_port']
(int) $config['history_db_port']
);
if ($rc === false) {
@ -84,7 +84,7 @@ final class Config
$config['history_db_name'],
$config['history_db_user'],
io_output_password($config['history_db_pass']),
$config['history_db_port'],
(int) $config['history_db_port'],
false
);
}

@ -135,9 +135,9 @@ final class DBMaintainer
$this->user = $params['user'];
$this->pass = io_output_password($params['pass']);
$this->host = $params['host'];
$this->port = $params['port'];
$this->port = (int) $params['port'];
$this->name = $params['name'];
$this->charset = $params['charset'];
$this->charset = (isset($params['charset']) === true) ? $params['charset'] : '';
// Try to connect.
$this->connect();
@ -170,7 +170,10 @@ final class DBMaintainer
if ($rc === false) {
$this->dbh = null;
$this->connected = false;
$this->lastError = __('Connection problems');
$this->lastError = __(
'Connection problems: %s',
mysqli_connect_error()
);
} else {
$dbc = new \mysqli(
$this->host,