Merge branch 'develop' into 'ent-5756-pantallas-de-configuracion-del-cluster'
This commit is contained in:
parent
5f598c2dcc
commit
57ccd783b0
|
@ -52,7 +52,7 @@ ui_print_info_message(['no_close' => true, 'message' => __('There are no cluster
|
|||
if (check_acl($config['id_user'], 0, 'AW')) {
|
||||
?>
|
||||
|
||||
<form action="index.php?sec=reporting&sec2=enterprise/godmode/reporting/cluster_builder&step=1" method="post">
|
||||
<form action='index.php?sec=estado&sec2=enterprise/operation/cluster/cluster&op=new' method="post">
|
||||
<input style="margin-bottom:20px;" type="submit" class="button_task" value="<?php echo __('Create Cluster'); ?>" />
|
||||
</form>
|
||||
|
||||
|
|
|
@ -161,14 +161,15 @@ class CredentialStore extends Wizard
|
|||
if (! check_acl($config['id_user'], 0, 'AR')) {
|
||||
db_pandora_audit(
|
||||
'ACL Violation',
|
||||
'Trying to access event viewer'
|
||||
'Trying to access credential store'
|
||||
);
|
||||
|
||||
if (is_ajax()) {
|
||||
echo json_encode(['error' => 'noaccess']);
|
||||
} else {
|
||||
include 'general/noaccess.php';
|
||||
}
|
||||
|
||||
include 'general/noaccess.php';
|
||||
exit;
|
||||
}
|
||||
|
||||
|
|
|
@ -342,7 +342,7 @@ class HTML
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public function error($message)
|
||||
public static function error($message)
|
||||
{
|
||||
if (is_ajax()) {
|
||||
echo json_encode(
|
||||
|
@ -363,7 +363,7 @@ class HTML
|
|||
*
|
||||
* @return string HTML code for desired input.
|
||||
*/
|
||||
public function printInput($data)
|
||||
public static function printInput($data)
|
||||
{
|
||||
global $config;
|
||||
|
||||
|
@ -398,7 +398,7 @@ class HTML
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
public function printGoBackButton($url=null)
|
||||
public static function printGoBackButton($url=null)
|
||||
{
|
||||
if (isset($url) === false) {
|
||||
$url = ui_get_full_url(
|
||||
|
@ -425,7 +425,7 @@ class HTML
|
|||
],
|
||||
];
|
||||
|
||||
$this->printForm($form);
|
||||
self::printForm($form);
|
||||
}
|
||||
|
||||
|
||||
|
@ -467,7 +467,7 @@ class HTML
|
|||
*
|
||||
* @return string HTML content.
|
||||
*/
|
||||
public function printBlock(
|
||||
public static function printBlock(
|
||||
array $input,
|
||||
bool $return=false,
|
||||
bool $direct=false
|
||||
|
@ -502,7 +502,7 @@ class HTML
|
|||
$html = '';
|
||||
|
||||
foreach ($input['block_content'] as $in) {
|
||||
$html .= $this->printBlock(
|
||||
$html .= self::printBlock(
|
||||
$in,
|
||||
$return,
|
||||
(bool) $direct
|
||||
|
@ -549,14 +549,14 @@ class HTML
|
|||
}
|
||||
|
||||
$output .= '<label>'.$input['label'].'</label>';
|
||||
$output .= $this->printInput($input['arguments']);
|
||||
$output .= self::printInput($input['arguments']);
|
||||
// Allow dynamic content.
|
||||
$output .= $input['extra'];
|
||||
if (!$direct) {
|
||||
$output .= '</li>';
|
||||
}
|
||||
} else {
|
||||
$output .= $this->printInput($input['arguments']);
|
||||
$output .= self::printInput($input['arguments']);
|
||||
// Allow dynamic content.
|
||||
$output .= $input['extra'];
|
||||
}
|
||||
|
@ -578,7 +578,7 @@ class HTML
|
|||
*
|
||||
* @return string HTML content.
|
||||
*/
|
||||
public function printBlockAsGrid(array $input, bool $return=false)
|
||||
public static function printBlockAsGrid(array $input, bool $return=false)
|
||||
{
|
||||
$output = '';
|
||||
if ($input['hidden'] == 1) {
|
||||
|
@ -596,7 +596,7 @@ class HTML
|
|||
$output .= '<li id="'.$input['block_id'].'" class="'.$class.'">';
|
||||
$output .= '<ul class="wizard '.$input['block_class'].'">';
|
||||
foreach ($input['block_content'] as $input) {
|
||||
$output .= $this->printBlockAsGrid($input, $return);
|
||||
$output .= self::printBlockAsGrid($input, $return);
|
||||
}
|
||||
|
||||
$output .= '</ul></li>';
|
||||
|
@ -635,7 +635,7 @@ class HTML
|
|||
|
||||
if ($input['arguments']['type'] == 'text' || $input['arguments']['type'] == 'text_extended') {
|
||||
$output .= '<div class="discovery_text_input">';
|
||||
$output .= $this->printInput($input['arguments']);
|
||||
$output .= self::printInput($input['arguments']);
|
||||
$output .= '</div>';
|
||||
} else if ($input['arguments']['inline'] == 'true') {
|
||||
if (isset($input['extra'])) {
|
||||
|
@ -646,7 +646,7 @@ class HTML
|
|||
$output .= '<div style="float: right;">';
|
||||
}
|
||||
|
||||
$output .= $this->printInput($input['arguments']);
|
||||
$output .= self::printInput($input['arguments']);
|
||||
$output .= '</div>';
|
||||
$output .= '</div>';
|
||||
|
||||
|
@ -654,14 +654,14 @@ class HTML
|
|||
$output .= '</div>';
|
||||
}
|
||||
} else {
|
||||
$output .= $this->printInput($input['arguments']);
|
||||
$output .= self::printInput($input['arguments']);
|
||||
}
|
||||
|
||||
// Allow dynamic content.
|
||||
$output .= $input['extra'];
|
||||
$output .= '</div>';
|
||||
} else {
|
||||
$output .= $this->printInput($input['arguments']);
|
||||
$output .= self::printInput($input['arguments']);
|
||||
// Allow dynamic content.
|
||||
$output .= $input['extra'];
|
||||
}
|
||||
|
@ -683,7 +683,7 @@ class HTML
|
|||
*
|
||||
* @return string HTML content.
|
||||
*/
|
||||
public function printBlockAsList(array $input, bool $return=false)
|
||||
public static function printBlockAsList(array $input, bool $return=false)
|
||||
{
|
||||
$output = '';
|
||||
if ($input['hidden'] == 1) {
|
||||
|
@ -701,7 +701,7 @@ class HTML
|
|||
$output .= '<li id="'.$input['block_id'].'" class="'.$class.'">';
|
||||
$output .= '<ul class="wizard '.$input['block_class'].'">';
|
||||
foreach ($input['block_content'] as $input) {
|
||||
$output .= $this->printBlockAsList($input, $return);
|
||||
$output .= self::printBlockAsList($input, $return);
|
||||
}
|
||||
|
||||
$output .= '</ul></li>';
|
||||
|
@ -711,12 +711,12 @@ class HTML
|
|||
) {
|
||||
$output .= '<li id="'.$input['id'].'" class="'.$class.'">';
|
||||
$output .= '<label>'.$input['label'].'</label>';
|
||||
$output .= $this->printInput($input['arguments']);
|
||||
$output .= self::printInput($input['arguments']);
|
||||
// Allow dynamic content.
|
||||
$output .= $input['extra'];
|
||||
$output .= '</li>';
|
||||
} else {
|
||||
$output .= $this->printInput($input['arguments']);
|
||||
$output .= self::printInput($input['arguments']);
|
||||
// Allow dynamic content.
|
||||
$output .= $input['extra'];
|
||||
}
|
||||
|
@ -739,7 +739,7 @@ class HTML
|
|||
*
|
||||
* @return string HTML code.
|
||||
*/
|
||||
public function printForm(
|
||||
public static function printForm(
|
||||
array $data,
|
||||
bool $return=false,
|
||||
bool $print_white_box=false
|
||||
|
@ -781,9 +781,9 @@ class HTML
|
|||
|
||||
foreach ($inputs as $input) {
|
||||
if ($input['arguments']['type'] != 'submit') {
|
||||
$output .= $this->printBlock($input, true);
|
||||
$output .= self::printBlock($input, true);
|
||||
} else {
|
||||
$output_submit .= $this->printBlock($input, true);
|
||||
$output_submit .= self::printBlock($input, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -822,7 +822,7 @@ class HTML
|
|||
*
|
||||
* @return string HTML code.
|
||||
*/
|
||||
public function printFormAsGrid(array $data, bool $return=false)
|
||||
public static function printFormAsGrid(array $data, bool $return=false)
|
||||
{
|
||||
$form = $data['form'];
|
||||
|
||||
|
@ -886,9 +886,9 @@ class HTML
|
|||
foreach ($column['inputs'] as $input) {
|
||||
if (is_array($input)) {
|
||||
if ($input['arguments']['type'] != 'submit') {
|
||||
$output .= $this->printBlockAsGrid($input, true);
|
||||
$output .= self::printBlockAsGrid($input, true);
|
||||
} else {
|
||||
$output_submit .= $this->printBlockAsGrid($input, true);
|
||||
$output_submit .= self::printBlockAsGrid($input, true);
|
||||
}
|
||||
} else {
|
||||
$output .= $input;
|
||||
|
@ -933,7 +933,7 @@ class HTML
|
|||
*
|
||||
* @return string HTML code.
|
||||
*/
|
||||
public function printFormAsList(array $data, bool $return=false)
|
||||
public static function printFormAsList(array $data, bool $return=false)
|
||||
{
|
||||
$form = $data['form'];
|
||||
$inputs = $data['inputs'];
|
||||
|
@ -966,9 +966,9 @@ class HTML
|
|||
|
||||
foreach ($inputs as $input) {
|
||||
if ($input['arguments']['type'] != 'submit') {
|
||||
$output .= $this->printBlockAsList($input, true);
|
||||
$output .= self::printBlockAsList($input, true);
|
||||
} else {
|
||||
$output_submit .= $this->printBlockAsList($input, true);
|
||||
$output_submit .= self::printBlockAsList($input, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -356,6 +356,9 @@ define('MODULE_PREDICTION_CLUSTER', 5);
|
|||
define('MODULE_PREDICTION_CLUSTER_AA', 6);
|
||||
define('MODULE_PREDICTION_CLUSTER_AP', 7);
|
||||
|
||||
// Forced agent OS ID for cluster agents.
|
||||
define('CLUSTER_OS_ID', 100);
|
||||
|
||||
// Type of Webserver Modules.
|
||||
define('MODULE_WEBSERVER_CHECK_LATENCY', 30);
|
||||
define('MODULE_WEBSERVER_CHECK_SERVER_RESPONSE', 31);
|
||||
|
|
|
@ -19,7 +19,29 @@
|
|||
|
||||
require_once $config['homedir'].'/include/functions.php';
|
||||
require_once $config['homedir'].'/include/functions_modules.php';
|
||||
require_once $config['homedir'].'/include/functions_users.php';
|
||||
require_once $config['homedir'].'/include/functions_users.php';/**
|
||||
* Return the agent if exists in the DB.
|
||||
*
|
||||
* @param integer $id_agent The agent id.
|
||||
* @param boolean $show_disabled Show the agent found althought it is disabled. By default false.
|
||||
* @param boolean $force_meta
|
||||
*
|
||||
* @return boolean The result to check if the agent is in the DB.
|
||||
*/
|
||||
|
||||
|
||||
function agents_get_agent($id_agent, $show_disabled=true, $force_meta=false)
|
||||
{
|
||||
$agent = db_get_row_filter(
|
||||
$force_meta ? 'tmetaconsole_agent' : 'tagente',
|
||||
[
|
||||
'id_agente' => $id_agent,
|
||||
'disabled' => !$show_disabled,
|
||||
]
|
||||
);
|
||||
|
||||
return $agent;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -605,22 +605,24 @@ function html_print_select(
|
|||
|
||||
$output .= '<select id="'.$id.'" name="'.$name.'"'.$attributes.' '.$styleText.'>';
|
||||
|
||||
if ($nothing != '' || empty($fields)) {
|
||||
if ($nothing == '') {
|
||||
$nothing = __('None');
|
||||
}
|
||||
|
||||
$output .= '<option value="'.$nothing_value.'"';
|
||||
|
||||
if ($nothing_value == $selected) {
|
||||
$output .= ' selected="selected"';
|
||||
} else if (is_array($selected)) {
|
||||
if (in_array($nothing_value, $selected)) {
|
||||
$output .= ' selected="selected"';
|
||||
if ($nothing !== false) {
|
||||
if ($nothing != '' || empty($fields)) {
|
||||
if ($nothing == '') {
|
||||
$nothing = __('None');
|
||||
}
|
||||
}
|
||||
|
||||
$output .= '>'.$nothing.'</option>';
|
||||
$output .= '<option value="'.$nothing_value.'"';
|
||||
|
||||
if ($nothing_value == $selected) {
|
||||
$output .= ' selected="selected"';
|
||||
} else if (is_array($selected)) {
|
||||
if (in_array($nothing_value, $selected)) {
|
||||
$output .= ' selected="selected"';
|
||||
}
|
||||
}
|
||||
|
||||
$output .= '>'.$nothing.'</option>';
|
||||
}
|
||||
}
|
||||
|
||||
if (is_array($fields) && !empty($fields)) {
|
||||
|
@ -702,6 +704,337 @@ function html_print_select(
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generates a multiselect component with filters.
|
||||
*
|
||||
* @param array $available Available.
|
||||
* @param array $selected Selected.
|
||||
* @param string $name Custom identifier (optional).
|
||||
* @param string $class Custom class for main container (optional).
|
||||
* @param boolean $return Dump to output or only return.
|
||||
* @param array $group_filter Ajax information to reload content while
|
||||
* using different group filter (if enabled). Uses:
|
||||
* [
|
||||
* page => 'your/controller/php',
|
||||
* method => 'yourMethodName'
|
||||
* ]
|
||||
* Ensure you return data in json format as:
|
||||
* {id:label,id2:label2...}
|
||||
* Provided by caller.
|
||||
* @param array $texts Texts.
|
||||
* @param array $sections Enables or disables sub-components.
|
||||
*
|
||||
* @return string HTML code with component.
|
||||
*/
|
||||
function html_print_select_multiple_filtered(
|
||||
array $available,
|
||||
array $selected,
|
||||
?string $name=null,
|
||||
string $class='',
|
||||
bool $return=true,
|
||||
array $group_filter=[],
|
||||
array $texts=[],
|
||||
array $sections=[]
|
||||
) {
|
||||
ui_require_css_file('multiselect_filtered');
|
||||
ui_require_javascript_file('multiselect_filtered');
|
||||
|
||||
if (empty($name) === true) {
|
||||
$rid = uniqid();
|
||||
} else {
|
||||
$rid = $name;
|
||||
}
|
||||
|
||||
if (empty($texts) === true) {
|
||||
$texts = [
|
||||
'filter-item' => 'Filter agent alias',
|
||||
'title-add' => 'Add selected',
|
||||
'title-del' => 'Remove selected',
|
||||
'title-left' => 'Available items',
|
||||
'title-right' => 'Selected items',
|
||||
];
|
||||
}
|
||||
|
||||
if (empty($sections) === true) {
|
||||
$sections = [
|
||||
'filters' => 1,
|
||||
'group-filter' => 1,
|
||||
'item-available-filter' => 1,
|
||||
'item-selected-filter' => 1,
|
||||
];
|
||||
}
|
||||
|
||||
if (empty($group_filter) === true) {
|
||||
$sections['group-filter'] = 0;
|
||||
}
|
||||
|
||||
// Main container.
|
||||
$output .= '<div class="multi-select flex-row-vcenter '.$class.'">';
|
||||
|
||||
// Left box.
|
||||
$output .= '<div class="multi-select-container flex-column">';
|
||||
|
||||
// Filtering.
|
||||
if (isset($sections['filters']) === true
|
||||
&& $sections['filters'] === 1
|
||||
) {
|
||||
// Filtering.
|
||||
if (isset($sections['group-filter']) === true
|
||||
&& $sections['group-filter'] === 1
|
||||
) {
|
||||
$output .= '<div class="filter">';
|
||||
|
||||
$output .= '<div class="group-filter flex-row-vcenter">';
|
||||
|
||||
$reload_content = "reloadContent('".$rid."'";
|
||||
$reload_content .= ", '".ui_get_full_url('ajax.php')."'";
|
||||
$reload_content .= ", '".base64_encode(
|
||||
json_encode($group_filter)
|
||||
)."'";
|
||||
$reload_content .= ", 'left'";
|
||||
$reload_content .= ", '".__('None')."')";
|
||||
|
||||
$output .= html_print_input(
|
||||
[
|
||||
'label' => __('Filter group'),
|
||||
'name' => 'id-group-available-select-'.$rid,
|
||||
'returnAllGroup' => true,
|
||||
'privilege' => 'AR',
|
||||
'type' => 'select_groups',
|
||||
'return' => true,
|
||||
'script' => $reload_content,
|
||||
]
|
||||
);
|
||||
|
||||
$output .= html_print_input(
|
||||
[
|
||||
'label' => __('Group recursion'),
|
||||
'name' => 'id-group-recursion-available-select-'.$rid,
|
||||
'type' => 'checkbox',
|
||||
'script' => $reload_content,
|
||||
'return' => true,
|
||||
]
|
||||
);
|
||||
|
||||
$output .= '</div>';
|
||||
|
||||
$output .= '</div>';
|
||||
}
|
||||
|
||||
if (isset($sections['item-available-filter']) === true
|
||||
&& $sections['item-available-filter'] === 1
|
||||
) {
|
||||
$output .= '<div class="item-filter flex-row-vcenter">';
|
||||
|
||||
$output .= html_print_input(
|
||||
[
|
||||
'style' => 'display:none;',
|
||||
'name' => 'tmp-available-select-'.$rid,
|
||||
'type' => 'select',
|
||||
'nothing' => false,
|
||||
'return' => true,
|
||||
]
|
||||
);
|
||||
|
||||
$f = "filterAvailableItems(this.value,'".$rid."','".__('None')."')";
|
||||
$output .= html_print_input(
|
||||
[
|
||||
'label' => __($texts['filter-item']),
|
||||
'name' => 'filter-item-available-'.$rid,
|
||||
'onKeyUp' => $f,
|
||||
'input_class' => 'filter w100p',
|
||||
'size' => 20,
|
||||
'type' => 'text',
|
||||
'return' => true,
|
||||
]
|
||||
);
|
||||
|
||||
$output .= '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
$output .= '<span class="title">'.$texts['title-left'].'</span>';
|
||||
|
||||
// Selector boxes.
|
||||
$output .= html_print_input(
|
||||
[
|
||||
'type' => 'select',
|
||||
'fields' => $available,
|
||||
'name' => 'available-select-'.$rid.'[]',
|
||||
'selected' => '',
|
||||
'script' => '',
|
||||
'nothing' => '',
|
||||
'nothing_value' => 0,
|
||||
'return' => true,
|
||||
'multiple' => true,
|
||||
'sort' => true,
|
||||
'class' => 'select-multiple',
|
||||
'disabled' => false,
|
||||
'style' => false,
|
||||
'option_style' => false,
|
||||
'size' => false,
|
||||
'modal' => false,
|
||||
'message' => '',
|
||||
'select_all' => false,
|
||||
'simple_multiple_options' => false,
|
||||
]
|
||||
);
|
||||
|
||||
$output .= '</div>';
|
||||
|
||||
// Middle buttons actions.
|
||||
$add = "addItems('".$rid."','".__('None')."'); return false";
|
||||
$del = "removeItems('".$rid."','".__('None')."'); return false";
|
||||
|
||||
$output .= '<div class="arrows-container flex-column">';
|
||||
|
||||
$output .= html_print_input(
|
||||
[
|
||||
'type' => 'image',
|
||||
'src' => 'images/darrowright.png',
|
||||
'return' => true,
|
||||
'options' => [
|
||||
'title' => $texts['title-add'],
|
||||
'onclick' => $add,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$output .= html_print_input(
|
||||
[
|
||||
'type' => 'image',
|
||||
'src' => 'images/darrowleft.png',
|
||||
'return' => true,
|
||||
'options' => [
|
||||
'title' => $texts['title-del'],
|
||||
'onclick' => $del,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$output .= '</div>';
|
||||
|
||||
// Left box.
|
||||
$output .= '<div class="multi-select-container flex-column">';
|
||||
|
||||
// Filtering.
|
||||
if (isset($sections['filters']) === true
|
||||
&& $sections['filters'] === 1
|
||||
) {
|
||||
if (isset($sections['group-filter']) === true
|
||||
&& $sections['group-filter'] === 1
|
||||
) {
|
||||
$output .= '<div class="filter">';
|
||||
|
||||
$output .= '<div class="group-filter flex-row-vcenter">';
|
||||
|
||||
$reload_content = "reloadContent('".$rid."'";
|
||||
$reload_content .= ", '".ui_get_full_url('ajax.php')."'";
|
||||
$reload_content .= ", '".base64_encode(
|
||||
json_encode($group_filter)
|
||||
)."'";
|
||||
$reload_content .= ", 'right'";
|
||||
$reload_content .= ", '".__('None')."')";
|
||||
|
||||
$output .= html_print_input(
|
||||
[
|
||||
'label' => __('Filter group'),
|
||||
'name' => 'id-group-selected-select-'.$rid,
|
||||
'returnAllGroup' => true,
|
||||
'privilege' => 'AR',
|
||||
'type' => 'select_groups',
|
||||
'return' => true,
|
||||
'script' => $reload_content,
|
||||
]
|
||||
);
|
||||
|
||||
$output .= html_print_input(
|
||||
[
|
||||
'label' => __('Group recursion'),
|
||||
'name' => 'id-group-recursion-selected-select-'.$rid,
|
||||
'type' => 'checkbox',
|
||||
'script' => $reload_content,
|
||||
'return' => true,
|
||||
]
|
||||
);
|
||||
|
||||
$output .= '</div>';
|
||||
|
||||
$output .= '</div>';
|
||||
}
|
||||
|
||||
// Filtering.
|
||||
if (isset($sections['item-selected-filter']) === true
|
||||
&& $sections['item-selected-filter'] === 1
|
||||
) {
|
||||
$output .= '<div class="item-filter flex-row-vcenter">';
|
||||
|
||||
$output .= html_print_input(
|
||||
[
|
||||
'style' => 'display:none;',
|
||||
'name' => 'tmp-selected-select-'.$rid,
|
||||
'type' => 'select',
|
||||
'nothing' => false,
|
||||
'return' => true,
|
||||
]
|
||||
);
|
||||
|
||||
$f = "filterSelectedItems(this.value,'".$rid."','".__('None')."')";
|
||||
$output .= html_print_input(
|
||||
[
|
||||
'label' => __($texts['filter-item']),
|
||||
'name' => 'filter-item-selected-'.$rid,
|
||||
'onKeyUp' => $f,
|
||||
'input_class' => 'filter w100p',
|
||||
'size' => 20,
|
||||
'type' => 'text',
|
||||
'return' => true,
|
||||
]
|
||||
);
|
||||
|
||||
$output .= '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
$output .= '<span class="title">'.$texts['title-right'].'</span>';
|
||||
|
||||
$output .= html_print_input(
|
||||
[
|
||||
'type' => 'select',
|
||||
'fields' => $selected,
|
||||
'name' => 'selected-select-'.$rid.'[]',
|
||||
'selected' => '',
|
||||
'script' => '',
|
||||
'nothing' => '',
|
||||
'nothing_value' => 0,
|
||||
'return' => true,
|
||||
'multiple' => true,
|
||||
'sort' => true,
|
||||
'class' => 'select-multiple',
|
||||
'disabled' => false,
|
||||
'style' => false,
|
||||
'option_style' => false,
|
||||
'size' => false,
|
||||
'modal' => false,
|
||||
'message' => '',
|
||||
'select_all' => true,
|
||||
'simple_multiple_options' => false,
|
||||
]
|
||||
);
|
||||
|
||||
$output .= '</div>';
|
||||
|
||||
// Close main.
|
||||
$output .= '</div>';
|
||||
|
||||
if ($return === false) {
|
||||
echo $output;
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Prints an array of fields in a popup menu of a form based on a SQL query.
|
||||
* The first and second columns of the query will be used.
|
||||
|
@ -1555,7 +1888,8 @@ function html_print_input_text(
|
|||
$autocomplete='',
|
||||
$autofocus=false,
|
||||
$onKeyDown='',
|
||||
$formTo=''
|
||||
$formTo='',
|
||||
$onKeyUp=''
|
||||
) {
|
||||
if ($maxlength == 0) {
|
||||
$maxlength = 255;
|
||||
|
@ -1584,6 +1918,10 @@ function html_print_input_text(
|
|||
$attr['onkeydown'] = $onKeyDown;
|
||||
}
|
||||
|
||||
if ($onKeyUp != '') {
|
||||
$attr['onkeyup'] = $onKeyUp;
|
||||
}
|
||||
|
||||
if ($autocomplete !== '') {
|
||||
$attr['autocomplete'] = $autocomplete;
|
||||
}
|
||||
|
@ -3471,9 +3809,10 @@ function html_print_input($data, $wrapper='div', $input_only=false)
|
|||
((isset($data['class']) === true) ? $data['class'] : ''),
|
||||
((isset($data['onChange']) === true) ? $data['onChange'] : ''),
|
||||
((isset($data['autocomplete']) === true) ? $data['autocomplete'] : ''),
|
||||
false,
|
||||
((isset($data['autofocus']) === true) ? $data['autofocus'] : false),
|
||||
((isset($data['onKeyDown']) === true) ? $data['onKeyDown'] : ''),
|
||||
((isset($data['form']) === true) ? $data['form'] : '')
|
||||
((isset($data['form']) === true) ? $data['form'] : ''),
|
||||
((isset($data['onKeyUp']) === true) ? $data['onKeyUp'] : '')
|
||||
);
|
||||
break;
|
||||
|
||||
|
@ -3895,6 +4234,19 @@ function html_print_input($data, $wrapper='div', $input_only=false)
|
|||
);
|
||||
break;
|
||||
|
||||
case 'select_multiple_filtered':
|
||||
$output .= html_print_select_multiple_filtered(
|
||||
$data['available'],
|
||||
$data['selected'],
|
||||
((isset($data['name']) === true) ? $data['name'] : null),
|
||||
((isset($data['class']) === true) ? $data['class'] : ''),
|
||||
((isset($data['return']) === true) ? $data['return'] : true),
|
||||
((isset($data['group_filter']) === true) ? $data['group_filter'] : []),
|
||||
((isset($data['texts']) === true) ? $data['texts'] : []),
|
||||
((isset($data['sections']) === true) ? $data['sections'] : [])
|
||||
);
|
||||
break;
|
||||
|
||||
default:
|
||||
// Ignore.
|
||||
break;
|
||||
|
|
|
@ -3157,6 +3157,13 @@ function ui_print_datatable(array $parameters)
|
|||
throw new Exception('[ui_print_datatable]: You must define columns for datatable');
|
||||
}
|
||||
|
||||
if (isset($parameters['column_names'])
|
||||
&& is_array($parameters['column_names'])
|
||||
&& count($parameters['columns']) != count($parameters['column_names'])
|
||||
) {
|
||||
throw new Exception('[ui_print_datatable]: Columns and columns names must have same length');
|
||||
}
|
||||
|
||||
if (!isset($parameters['ajax_url'])) {
|
||||
throw new Exception('[ui_print_datatable]: Parameter ajax_url is required');
|
||||
}
|
||||
|
|
|
@ -1,8 +1,39 @@
|
|||
<?php
|
||||
/**
|
||||
* Loader for views.
|
||||
*
|
||||
* @category Loader
|
||||
* @package Pandora FMS
|
||||
* @subpackage Enterprise
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
|
||||
// Begin.
|
||||
namespace PandoraFMS;
|
||||
|
||||
global $config;
|
||||
|
||||
require_once $config['homedir'].'/include/class/HTML.class.php';
|
||||
use \HTML as HTML;
|
||||
|
||||
/**
|
||||
* View class.
|
||||
*/
|
||||
|
@ -29,8 +60,7 @@ class View
|
|||
if (file_exists($config['homedir'].'/views/'.$page.'.php') === true) {
|
||||
include $config['homedir'].'/views/'.$page.'.php';
|
||||
} else {
|
||||
// TODO: XXX SHOW MESSAGE;
|
||||
echo '???';
|
||||
ui_print_error_message(__('View %s not found', $page), true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -462,29 +462,45 @@ select:-internal-list-box {
|
|||
.mw250px {
|
||||
min-width: 250px;
|
||||
}
|
||||
.mw500px {
|
||||
min-width: 500px;
|
||||
}
|
||||
.mw600px {
|
||||
min-width: 600px;
|
||||
}
|
||||
.mw800px {
|
||||
min-width: 800px;
|
||||
}
|
||||
.w20px {
|
||||
width: 20px;
|
||||
}
|
||||
.w10p {
|
||||
width: 10%;
|
||||
}
|
||||
|
||||
.w20p {
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
.w30p {
|
||||
width: 30%;
|
||||
}
|
||||
|
||||
.w40p {
|
||||
width: 40%;
|
||||
}
|
||||
|
||||
.w50p {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.w60p {
|
||||
width: 60%;
|
||||
}
|
||||
.w70p {
|
||||
width: 70%;
|
||||
}
|
||||
.w80p {
|
||||
width: 80%;
|
||||
}
|
||||
.w90p {
|
||||
width: 90%;
|
||||
}
|
||||
.w100p {
|
||||
width: 100%;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
Copyright (c) Nils Adermann, Jordi Boggiano
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
|
@ -18,4 +17,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
|
|
@ -308,9 +308,44 @@ return array(
|
|||
'Mpdf\\Utils\\NumericString' => $vendorDir . '/mpdf/mpdf/src/Utils/NumericString.php',
|
||||
'Mpdf\\Utils\\PdfDate' => $vendorDir . '/mpdf/mpdf/src/Utils/PdfDate.php',
|
||||
'Mpdf\\Utils\\UtfString' => $vendorDir . '/mpdf/mpdf/src/Utils/UtfString.php',
|
||||
'PandoraFMS\\Agent' => $baseDir . '/include/lib/Agent.php',
|
||||
'PandoraFMS\\Dashboard\\AgentModuleWidget' => $baseDir . '/include/lib/Dashboard/Widgets/agent_module.php',
|
||||
'PandoraFMS\\Dashboard\\AlertsFiredWidget' => $baseDir . '/include/lib/Dashboard/Widgets/alerts_fired.php',
|
||||
'PandoraFMS\\Dashboard\\Cell' => $baseDir . '/include/lib/Dashboard/Cell.php',
|
||||
'PandoraFMS\\Dashboard\\ClockWidget' => $baseDir . '/include/lib/Dashboard/Widgets/clock.php',
|
||||
'PandoraFMS\\Dashboard\\CustomGraphWidget' => $baseDir . '/include/lib/Dashboard/Widgets/custom_graph.php',
|
||||
'PandoraFMS\\Dashboard\\EventsListWidget' => $baseDir . '/include/lib/Dashboard/Widgets/events_list.php',
|
||||
'PandoraFMS\\Dashboard\\GraphModuleHistogramWidget' => $baseDir . '/include/lib/Dashboard/Widgets/graph_module_histogram.php',
|
||||
'PandoraFMS\\Dashboard\\GroupsStatusWidget' => $baseDir . '/include/lib/Dashboard/Widgets/groups_status.php',
|
||||
'PandoraFMS\\Dashboard\\Manager' => $baseDir . '/include/lib/Dashboard/Manager.php',
|
||||
'PandoraFMS\\Dashboard\\MapsMadeByUser' => $baseDir . '/include/lib/Dashboard/Widgets/maps_made_by_user.php',
|
||||
'PandoraFMS\\Dashboard\\MapsStatusWidget' => $baseDir . '/include/lib/Dashboard/Widgets/maps_status.php',
|
||||
'PandoraFMS\\Dashboard\\ModuleIconWidget' => $baseDir . '/include/lib/Dashboard/Widgets/module_icon.php',
|
||||
'PandoraFMS\\Dashboard\\ModuleStatusWidget' => $baseDir . '/include/lib/Dashboard/Widgets/module_status.php',
|
||||
'PandoraFMS\\Dashboard\\ModuleTableValueWidget' => $baseDir . '/include/lib/Dashboard/Widgets/module_table_value.php',
|
||||
'PandoraFMS\\Dashboard\\ModuleValueWidget' => $baseDir . '/include/lib/Dashboard/Widgets/module_value.php',
|
||||
'PandoraFMS\\Dashboard\\MonitorHealthWidget' => $baseDir . '/include/lib/Dashboard/Widgets/monitor_health.php',
|
||||
'PandoraFMS\\Dashboard\\NetworkMapWidget' => $baseDir . '/include/lib/Dashboard/Widgets/network_map.php',
|
||||
'PandoraFMS\\Dashboard\\PostWidget' => $baseDir . '/include/lib/Dashboard/Widgets/post.php',
|
||||
'PandoraFMS\\Dashboard\\ReportsWidget' => $baseDir . '/include/lib/Dashboard/Widgets/reports.php',
|
||||
'PandoraFMS\\Dashboard\\SLAPercentWidget' => $baseDir . '/include/lib/Dashboard/Widgets/sla_percent.php',
|
||||
'PandoraFMS\\Dashboard\\ServiceMapWidget' => $baseDir . '/include/lib/Dashboard/Widgets/service_map.php',
|
||||
'PandoraFMS\\Dashboard\\SingleGraphWidget' => $baseDir . '/include/lib/Dashboard/Widgets/single_graph.php',
|
||||
'PandoraFMS\\Dashboard\\SystemGroupStatusWidget' => $baseDir . '/include/lib/Dashboard/Widgets/system_group_status.php',
|
||||
'PandoraFMS\\Dashboard\\TacticalWidget' => $baseDir . '/include/lib/Dashboard/Widgets/tactical.php',
|
||||
'PandoraFMS\\Dashboard\\TopNEventByGroupWidget' => $baseDir . '/include/lib/Dashboard/Widgets/top_n_events_by_group.php',
|
||||
'PandoraFMS\\Dashboard\\TopNEventByModuleWidget' => $baseDir . '/include/lib/Dashboard/Widgets/top_n_events_by_module.php',
|
||||
'PandoraFMS\\Dashboard\\TopNWidget' => $baseDir . '/include/lib/Dashboard/Widgets/top_n.php',
|
||||
'PandoraFMS\\Dashboard\\TreeViewWidget' => $baseDir . '/include/lib/Dashboard/Widgets/tree_view.php',
|
||||
'PandoraFMS\\Dashboard\\UrlWidget' => $baseDir . '/include/lib/Dashboard/Widgets/url.php',
|
||||
'PandoraFMS\\Dashboard\\WelcomeWidget' => $baseDir . '/include/lib/Dashboard/Widgets/example.php',
|
||||
'PandoraFMS\\Dashboard\\Widget' => $baseDir . '/include/lib/Dashboard/Widget.php',
|
||||
'PandoraFMS\\Dashboard\\WuxStatsWidget' => $baseDir . '/include/lib/Dashboard/Widgets/wux_transaction_stats.php',
|
||||
'PandoraFMS\\Dashboard\\WuxWidget' => $baseDir . '/include/lib/Dashboard/Widgets/wux_transaction.php',
|
||||
'PandoraFMS\\Entity' => $baseDir . '/include/lib/Entity.php',
|
||||
'PandoraFMS\\Group' => $baseDir . '/include/lib/Group.php',
|
||||
'PandoraFMS\\User' => $baseDir . '/include/lib/User.php',
|
||||
'PandoraFMS\\View' => $baseDir . '/include/lib/View.php',
|
||||
'PandoraFMS\\WebSockets\\WSManager' => $baseDir . '/include/lib/WSManager.php',
|
||||
'PandoraFMS\\Websockets\\WebSocketServer' => $baseDir . '/include/lib/WebSocketServer.php',
|
||||
'PandoraFMS\\Websockets\\WebSocketUser' => $baseDir . '/include/lib/WebSocketUser.php',
|
||||
|
|
|
@ -13,6 +13,9 @@ class ComposerAutoloaderInitfdecadadce22e6dde51e9535fe4ad7aa
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Composer\Autoload\ClassLoader
|
||||
*/
|
||||
public static function getLoader()
|
||||
{
|
||||
if (null !== self::$loader) {
|
||||
|
|
|
@ -390,9 +390,44 @@ class ComposerStaticInitfdecadadce22e6dde51e9535fe4ad7aa
|
|||
'Mpdf\\Utils\\NumericString' => __DIR__ . '/..' . '/mpdf/mpdf/src/Utils/NumericString.php',
|
||||
'Mpdf\\Utils\\PdfDate' => __DIR__ . '/..' . '/mpdf/mpdf/src/Utils/PdfDate.php',
|
||||
'Mpdf\\Utils\\UtfString' => __DIR__ . '/..' . '/mpdf/mpdf/src/Utils/UtfString.php',
|
||||
'PandoraFMS\\Agent' => __DIR__ . '/../..' . '/include/lib/Agent.php',
|
||||
'PandoraFMS\\Dashboard\\AgentModuleWidget' => __DIR__ . '/../..' . '/include/lib/Dashboard/Widgets/agent_module.php',
|
||||
'PandoraFMS\\Dashboard\\AlertsFiredWidget' => __DIR__ . '/../..' . '/include/lib/Dashboard/Widgets/alerts_fired.php',
|
||||
'PandoraFMS\\Dashboard\\Cell' => __DIR__ . '/../..' . '/include/lib/Dashboard/Cell.php',
|
||||
'PandoraFMS\\Dashboard\\ClockWidget' => __DIR__ . '/../..' . '/include/lib/Dashboard/Widgets/clock.php',
|
||||
'PandoraFMS\\Dashboard\\CustomGraphWidget' => __DIR__ . '/../..' . '/include/lib/Dashboard/Widgets/custom_graph.php',
|
||||
'PandoraFMS\\Dashboard\\EventsListWidget' => __DIR__ . '/../..' . '/include/lib/Dashboard/Widgets/events_list.php',
|
||||
'PandoraFMS\\Dashboard\\GraphModuleHistogramWidget' => __DIR__ . '/../..' . '/include/lib/Dashboard/Widgets/graph_module_histogram.php',
|
||||
'PandoraFMS\\Dashboard\\GroupsStatusWidget' => __DIR__ . '/../..' . '/include/lib/Dashboard/Widgets/groups_status.php',
|
||||
'PandoraFMS\\Dashboard\\Manager' => __DIR__ . '/../..' . '/include/lib/Dashboard/Manager.php',
|
||||
'PandoraFMS\\Dashboard\\MapsMadeByUser' => __DIR__ . '/../..' . '/include/lib/Dashboard/Widgets/maps_made_by_user.php',
|
||||
'PandoraFMS\\Dashboard\\MapsStatusWidget' => __DIR__ . '/../..' . '/include/lib/Dashboard/Widgets/maps_status.php',
|
||||
'PandoraFMS\\Dashboard\\ModuleIconWidget' => __DIR__ . '/../..' . '/include/lib/Dashboard/Widgets/module_icon.php',
|
||||
'PandoraFMS\\Dashboard\\ModuleStatusWidget' => __DIR__ . '/../..' . '/include/lib/Dashboard/Widgets/module_status.php',
|
||||
'PandoraFMS\\Dashboard\\ModuleTableValueWidget' => __DIR__ . '/../..' . '/include/lib/Dashboard/Widgets/module_table_value.php',
|
||||
'PandoraFMS\\Dashboard\\ModuleValueWidget' => __DIR__ . '/../..' . '/include/lib/Dashboard/Widgets/module_value.php',
|
||||
'PandoraFMS\\Dashboard\\MonitorHealthWidget' => __DIR__ . '/../..' . '/include/lib/Dashboard/Widgets/monitor_health.php',
|
||||
'PandoraFMS\\Dashboard\\NetworkMapWidget' => __DIR__ . '/../..' . '/include/lib/Dashboard/Widgets/network_map.php',
|
||||
'PandoraFMS\\Dashboard\\PostWidget' => __DIR__ . '/../..' . '/include/lib/Dashboard/Widgets/post.php',
|
||||
'PandoraFMS\\Dashboard\\ReportsWidget' => __DIR__ . '/../..' . '/include/lib/Dashboard/Widgets/reports.php',
|
||||
'PandoraFMS\\Dashboard\\SLAPercentWidget' => __DIR__ . '/../..' . '/include/lib/Dashboard/Widgets/sla_percent.php',
|
||||
'PandoraFMS\\Dashboard\\ServiceMapWidget' => __DIR__ . '/../..' . '/include/lib/Dashboard/Widgets/service_map.php',
|
||||
'PandoraFMS\\Dashboard\\SingleGraphWidget' => __DIR__ . '/../..' . '/include/lib/Dashboard/Widgets/single_graph.php',
|
||||
'PandoraFMS\\Dashboard\\SystemGroupStatusWidget' => __DIR__ . '/../..' . '/include/lib/Dashboard/Widgets/system_group_status.php',
|
||||
'PandoraFMS\\Dashboard\\TacticalWidget' => __DIR__ . '/../..' . '/include/lib/Dashboard/Widgets/tactical.php',
|
||||
'PandoraFMS\\Dashboard\\TopNEventByGroupWidget' => __DIR__ . '/../..' . '/include/lib/Dashboard/Widgets/top_n_events_by_group.php',
|
||||
'PandoraFMS\\Dashboard\\TopNEventByModuleWidget' => __DIR__ . '/../..' . '/include/lib/Dashboard/Widgets/top_n_events_by_module.php',
|
||||
'PandoraFMS\\Dashboard\\TopNWidget' => __DIR__ . '/../..' . '/include/lib/Dashboard/Widgets/top_n.php',
|
||||
'PandoraFMS\\Dashboard\\TreeViewWidget' => __DIR__ . '/../..' . '/include/lib/Dashboard/Widgets/tree_view.php',
|
||||
'PandoraFMS\\Dashboard\\UrlWidget' => __DIR__ . '/../..' . '/include/lib/Dashboard/Widgets/url.php',
|
||||
'PandoraFMS\\Dashboard\\WelcomeWidget' => __DIR__ . '/../..' . '/include/lib/Dashboard/Widgets/example.php',
|
||||
'PandoraFMS\\Dashboard\\Widget' => __DIR__ . '/../..' . '/include/lib/Dashboard/Widget.php',
|
||||
'PandoraFMS\\Dashboard\\WuxStatsWidget' => __DIR__ . '/../..' . '/include/lib/Dashboard/Widgets/wux_transaction_stats.php',
|
||||
'PandoraFMS\\Dashboard\\WuxWidget' => __DIR__ . '/../..' . '/include/lib/Dashboard/Widgets/wux_transaction.php',
|
||||
'PandoraFMS\\Entity' => __DIR__ . '/../..' . '/include/lib/Entity.php',
|
||||
'PandoraFMS\\Group' => __DIR__ . '/../..' . '/include/lib/Group.php',
|
||||
'PandoraFMS\\User' => __DIR__ . '/../..' . '/include/lib/User.php',
|
||||
'PandoraFMS\\View' => __DIR__ . '/../..' . '/include/lib/View.php',
|
||||
'PandoraFMS\\WebSockets\\WSManager' => __DIR__ . '/../..' . '/include/lib/WSManager.php',
|
||||
'PandoraFMS\\Websockets\\WebSocketServer' => __DIR__ . '/../..' . '/include/lib/WebSocketServer.php',
|
||||
'PandoraFMS\\Websockets\\WebSocketUser' => __DIR__ . '/../..' . '/include/lib/WebSocketUser.php',
|
||||
|
|
|
@ -47,8 +47,7 @@ $form = [
|
|||
'extra' => 'novalidate',
|
||||
];
|
||||
|
||||
$html = new HTML();
|
||||
$html->printForm(
|
||||
HTML::printForm(
|
||||
[
|
||||
'form' => $form,
|
||||
'inputs' => $htmlInputs,
|
||||
|
|
|
@ -120,8 +120,7 @@ $inputs = [
|
|||
],
|
||||
];
|
||||
|
||||
$html = new HTML();
|
||||
$html->printForm(
|
||||
HTML::printForm(
|
||||
[
|
||||
'form' => $form,
|
||||
'inputs' => $inputs,
|
||||
|
|
|
@ -84,8 +84,7 @@ $inputs[] = [
|
|||
],
|
||||
];
|
||||
|
||||
$html = new HTML();
|
||||
$html->printForm(
|
||||
HTML::printForm(
|
||||
[
|
||||
'form' => $form,
|
||||
'inputs' => $inputs,
|
||||
|
|
|
@ -52,8 +52,7 @@ $inputs = [
|
|||
],
|
||||
];
|
||||
|
||||
$html = new HTML();
|
||||
$html->printForm(
|
||||
HTML::printForm(
|
||||
[
|
||||
'form' => $form,
|
||||
'inputs' => $inputs,
|
||||
|
|
Loading…
Reference in New Issue