mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
Merge branch 'ent-9610-filtrar-por-os-en-bulk-operations' into 'develop'
Ent 9610 filtrar por os en bulk operations See merge request artica/pandorafms!5863
This commit is contained in:
commit
aa7186512c
@ -107,6 +107,8 @@ if (is_ajax() === true) {
|
|||||||
// Ids of agents to be include in the SQL clause as id_agent IN ().
|
// Ids of agents to be include in the SQL clause as id_agent IN ().
|
||||||
$filter_agents_json = (string) get_parameter('filter_agents_json', '');
|
$filter_agents_json = (string) get_parameter('filter_agents_json', '');
|
||||||
$status_agents = (int) get_parameter('status_agents', AGENT_STATUS_ALL);
|
$status_agents = (int) get_parameter('status_agents', AGENT_STATUS_ALL);
|
||||||
|
$os_agent = (int) get_parameter('os_agent', 0);
|
||||||
|
$os_agent_version = (string) get_parameter('os_agent_version', '');
|
||||||
// Juanma (22/05/2014) Fix: If setted remove void agents from result
|
// Juanma (22/05/2014) Fix: If setted remove void agents from result
|
||||||
// (by default and for compatibility show void agents).
|
// (by default and for compatibility show void agents).
|
||||||
$show_void_agents = (int) get_parameter('show_void_agents', 1);
|
$show_void_agents = (int) get_parameter('show_void_agents', 1);
|
||||||
@ -152,6 +154,14 @@ if (is_ajax() === true) {
|
|||||||
$filter['status'] = $status_agents;
|
$filter['status'] = $status_agents;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($os_agent !== 0) {
|
||||||
|
$filter['id_os'] = $os_agent;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($os_agent_version !== '') {
|
||||||
|
$filter['os_version'] = $os_agent_version;
|
||||||
|
}
|
||||||
|
|
||||||
if ($id_os !== 0) {
|
if ($id_os !== 0) {
|
||||||
$filter['id_os'] = $id_os;
|
$filter['id_os'] = $id_os;
|
||||||
}
|
}
|
||||||
|
@ -214,10 +214,33 @@ function get_table_inputs_masive_agents($params)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$table->data[3][0] = __('Agents');
|
$os_list = os_get_os(true);
|
||||||
$table->data[3][0] .= '<span id="agent_loading" class="invisible">';
|
|
||||||
$table->data[3][0] .= html_print_image('images/spinner.png', true);
|
$table->data[3][0] = __('OS');
|
||||||
$table->data[3][0] .= '</span>';
|
$table->data[3][1] = html_print_select(
|
||||||
|
$os_list,
|
||||||
|
'os_agent',
|
||||||
|
'selected',
|
||||||
|
'',
|
||||||
|
__('All'),
|
||||||
|
'',
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
|
$table->data[3][2] = __('OS Version');
|
||||||
|
$table->data[3][3] = html_print_input_text(
|
||||||
|
'os_agent_version',
|
||||||
|
'',
|
||||||
|
__('Select OS version'),
|
||||||
|
35,
|
||||||
|
255,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
|
$table->data[4][0] = __('Agents');
|
||||||
|
$table->data[4][0] .= '<span id="agent_loading" class="invisible">';
|
||||||
|
$table->data[4][0] .= html_print_image('images/spinner.png', true);
|
||||||
|
$table->data[4][0] .= '</span>';
|
||||||
|
|
||||||
$agents = [];
|
$agents = [];
|
||||||
if (is_metaconsole() === false) {
|
if (is_metaconsole() === false) {
|
||||||
@ -228,7 +251,7 @@ function get_table_inputs_masive_agents($params)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$table->data[3][1] = html_print_select(
|
$table->data[4][1] = html_print_select(
|
||||||
$agents,
|
$agents,
|
||||||
'id_agents[]',
|
'id_agents[]',
|
||||||
0,
|
0,
|
||||||
|
@ -22,7 +22,9 @@
|
|||||||
privilege: "",
|
privilege: "",
|
||||||
serialized: false,
|
serialized: false,
|
||||||
serialized_separator: "",
|
serialized_separator: "",
|
||||||
nodes: []
|
nodes: [],
|
||||||
|
id_os: -1,
|
||||||
|
os_agent_version: ""
|
||||||
};
|
};
|
||||||
|
|
||||||
/* public methods */
|
/* public methods */
|
||||||
@ -53,7 +55,7 @@
|
|||||||
} else {
|
} else {
|
||||||
recursion_value = config.recursion;
|
recursion_value = config.recursion;
|
||||||
}
|
}
|
||||||
|
|
||||||
var opts = {
|
var opts = {
|
||||||
page: "godmode/groups/group_list",
|
page: "godmode/groups/group_list",
|
||||||
get_group_agents: 1,
|
get_group_agents: 1,
|
||||||
@ -74,7 +76,9 @@
|
|||||||
nodes:
|
nodes:
|
||||||
typeof config.nodes === "function"
|
typeof config.nodes === "function"
|
||||||
? config.nodes()
|
? config.nodes()
|
||||||
: config.disabled
|
: config.disabled,
|
||||||
|
os_agent: config.os_agent,
|
||||||
|
os_agent_version: config.os_agent_version
|
||||||
};
|
};
|
||||||
|
|
||||||
jQuery.post(
|
jQuery.post(
|
||||||
@ -319,7 +323,6 @@
|
|||||||
let href = $("a", config.spanPreview).attr("href");
|
let href = $("a", config.spanPreview).attr("href");
|
||||||
let hrefPosition = href.search("group_id=");
|
let hrefPosition = href.search("group_id=");
|
||||||
let hrefNew = href.slice(0, hrefPosition) + "group_id=" + id_group;
|
let hrefNew = href.slice(0, hrefPosition) + "group_id=" + id_group;
|
||||||
|
|
||||||
jQuery.post(
|
jQuery.post(
|
||||||
"ajax.php",
|
"ajax.php",
|
||||||
{
|
{
|
||||||
|
@ -110,6 +110,18 @@ function form_controls_massive_operations_agents(metaconsole) {
|
|||||||
$("#id_group").trigger("change");
|
$("#id_group").trigger("change");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var os_agent;
|
||||||
|
$("#os_agent").change(function() {
|
||||||
|
os_agent = this.value;
|
||||||
|
$("#id_group").trigger("change");
|
||||||
|
});
|
||||||
|
|
||||||
|
var os_agent_version;
|
||||||
|
$("#text-os_agent_version").keyup(function() {
|
||||||
|
os_agent_version = this.value;
|
||||||
|
$("#id_group").trigger("change");
|
||||||
|
});
|
||||||
|
|
||||||
if (metaconsole == 1) {
|
if (metaconsole == 1) {
|
||||||
$("#nodes").change(function() {
|
$("#nodes").change(function() {
|
||||||
disabled = $("#disabled").val();
|
disabled = $("#disabled").val();
|
||||||
@ -142,6 +154,13 @@ function form_controls_massive_operations_agents(metaconsole) {
|
|||||||
},
|
},
|
||||||
disabled: function() {
|
disabled: function() {
|
||||||
return disabled;
|
return disabled;
|
||||||
|
},
|
||||||
|
os_agent: function() {
|
||||||
|
return os_agent;
|
||||||
|
},
|
||||||
|
os_agent_version: function() {
|
||||||
|
console.log(os_agent_version);
|
||||||
|
return os_agent_version;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user