mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 08:45:12 +02:00
Rewrited all the data retrieving functionality of the different tree views
This commit is contained in:
parent
702922c831
commit
d6c51fb559
@ -31,27 +31,17 @@ if (is_ajax ()) {
|
|||||||
|
|
||||||
if ($getChildren) {
|
if ($getChildren) {
|
||||||
$type = get_parameter('type', 'group');
|
$type = get_parameter('type', 'group');
|
||||||
|
$rootType = get_parameter('rootType', '');
|
||||||
|
$id = get_parameter('id', -1);
|
||||||
|
$rootID = get_parameter('rootID', -1);
|
||||||
$filter = get_parameter('filter', array('searchAgent' => '', 'statusAgent' => AGENT_STATUS_ALL));
|
$filter = get_parameter('filter', array('searchAgent' => '', 'statusAgent' => AGENT_STATUS_ALL));
|
||||||
$id = get_parameter('id', 0);
|
|
||||||
$childrenMethod = get_parameter('childrenMethod', 'on_demand');
|
$childrenMethod = get_parameter('childrenMethod', 'on_demand');
|
||||||
$countModuleStatusMethod = get_parameter('countModuleStatusMethod', 'on_demand');
|
|
||||||
$countAgentStatusMethod = get_parameter('countAgentStatusMethod', 'live');
|
|
||||||
|
|
||||||
if (class_exists('TreeEnterprise')) {
|
if (class_exists('TreeEnterprise')) {
|
||||||
$tree = new TreeEnterprise($type,
|
$tree = new TreeEnterprise($type, $rootType, $id, $rootID, $childrenMethod);
|
||||||
$id,
|
|
||||||
$childrenMethod,
|
|
||||||
$countModuleStatusMethod,
|
|
||||||
$countAgentStatusMethod
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$tree = new Tree($type,
|
$tree = new Tree($type, $rootType, $id, $rootID, $childrenMethod);
|
||||||
$id,
|
|
||||||
$childrenMethod,
|
|
||||||
$countModuleStatusMethod,
|
|
||||||
$countAgentStatusMethod
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$tree->setFilter(array(
|
$tree->setFilter(array(
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -349,37 +349,42 @@ TreeController = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Graph pop-up
|
// Graph pop-up
|
||||||
var $graphImage = $('<img src="'+(controller.baseURL.length > 0 ? controller.baseURL : '')
|
if (typeof element.moduleGraph != 'undefined') {
|
||||||
+'images/chart_curve.png" /> ');
|
var $graphImage = $('<img src="'+(controller.baseURL.length > 0 ? controller.baseURL : '')
|
||||||
$graphImage
|
+'images/chart_curve.png" /> ');
|
||||||
.addClass('module-graph')
|
$graphImage
|
||||||
.click(function (e) {
|
.addClass('module-graph')
|
||||||
e.preventDefault();
|
.click(function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
winopeng(element.moduleGraph.url, element.moduleGraph.handle);
|
winopeng(element.moduleGraph.url, element.moduleGraph.handle);
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Data pop-up
|
// Data pop-up
|
||||||
var $dataImage = $('<img src="'+(controller.baseURL.length > 0 ? controller.baseURL : '')
|
if (typeof element.id != 'undefined'
|
||||||
+'images/binary.png" /> ');
|
&& !isNaN(element.id)) {
|
||||||
$dataImage
|
var $dataImage = $('<img src="'+(controller.baseURL.length > 0 ? controller.baseURL : '')
|
||||||
.addClass('module-data')
|
+'images/binary.png" /> ');
|
||||||
.click(function (e) {
|
$dataImage
|
||||||
e.preventDefault();
|
.addClass('module-data')
|
||||||
|
.click(function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($("#module_details_window").length > 0)
|
if ($("#module_details_window").length > 0)
|
||||||
show_module_detail_dialog(element.id, '', '', 0, 86400);
|
show_module_detail_dialog(element.id, '', '', 0, 86400);
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
$content
|
$content
|
||||||
.append($graphImage)
|
.append($graphImage)
|
||||||
@ -492,10 +497,9 @@ TreeController = {
|
|||||||
getChildren: 1,
|
getChildren: 1,
|
||||||
id: element.id,
|
id: element.id,
|
||||||
type: element.type,
|
type: element.type,
|
||||||
filter: controller.filter,
|
rootID: element.rootID,
|
||||||
childrenMethod: 'live',
|
rootType: element.rootType,
|
||||||
countModuleStatusMethod: 'live',
|
filter: controller.filter
|
||||||
countAgentStatusMethod: 'live'
|
|
||||||
},
|
},
|
||||||
complete: function(xhr, textStatus) {
|
complete: function(xhr, textStatus) {
|
||||||
$node.removeClass("leaf-loading");
|
$node.removeClass("leaf-loading");
|
||||||
|
@ -168,10 +168,7 @@ echo "</div>";
|
|||||||
parameters['filter'] = {};
|
parameters['filter'] = {};
|
||||||
parameters['type'] = "<?php echo $tab; ?>";
|
parameters['type'] = "<?php echo $tab; ?>";
|
||||||
parameters['filter']['searchAgent'] = $("input#text-search").val();
|
parameters['filter']['searchAgent'] = $("input#text-search").val();
|
||||||
parameters['filter']['status'] = $("select#status").val();
|
parameters['filter']['statusAgent'] = $("select#status").val();
|
||||||
parameters['childrenMethod'] = 'live';
|
|
||||||
parameters['countModuleStatusMethod'] = 'live';
|
|
||||||
parameters['countAgentStatusMethod'] = 'live';
|
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user