mirror of https://github.com/MISP/MISP
fix: [UI] Cleanup querybuilderTool variable
parent
be5ee0f736
commit
206b1409e0
|
@ -25,7 +25,7 @@ $relatedEventsValues = json_encode($relatedEventsValues, JSON_UNESCAPED_UNICODE)
|
|||
?>
|
||||
<script>
|
||||
var defaultFilteringRules = <?= json_encode($defaultFilteringRules); ?>;
|
||||
var querybuilderTool;
|
||||
var querybuilderTool = undefined;
|
||||
function triggerEventFilteringTool(hide) {
|
||||
var qbOptions = {
|
||||
plugins: {
|
||||
|
@ -549,18 +549,8 @@ function cleanRules(rules) {
|
|||
|
||||
function performQuery(rules) {
|
||||
var res = cleanRules(rules);
|
||||
var url = "/events/viewEventAttributes/<?php echo h($event['Event']['id']); ?>";
|
||||
xhr({
|
||||
type: "post",
|
||||
url: url,
|
||||
data: res,
|
||||
success: function (data) {
|
||||
$("#attributes_div").html(data);
|
||||
},
|
||||
error: function() {
|
||||
showMessage('fail', 'Something went wrong - could not fetch attributes.');
|
||||
}
|
||||
});
|
||||
var url = "/events/viewEventAttributes/<?= intval($event['Event']['id']); ?>";
|
||||
fetchAttributes(url, res);
|
||||
}
|
||||
|
||||
function clickMessage(clicked) {
|
||||
|
|
|
@ -3653,16 +3653,7 @@ function filterAttributes(filter, event_id) {
|
|||
url += filter.length > 0 ? "/searchFor:" + filter : "";
|
||||
}
|
||||
if (deleted) url += '/deleted:true';
|
||||
xhr({
|
||||
type: "get",
|
||||
url: url,
|
||||
success: function(data) {
|
||||
$("#attributes_div").html(data);
|
||||
},
|
||||
error: function() {
|
||||
showMessage('fail', 'Something went wrong - could not fetch attributes.');
|
||||
}
|
||||
});
|
||||
fetchAttributes(url);
|
||||
}
|
||||
|
||||
function eventIndexColumnsToggle(columnName) {
|
||||
|
@ -3714,16 +3705,7 @@ function pivotObjectReferences(url, uuid) {
|
|||
}
|
||||
|
||||
url += '/focus:' + uuid;
|
||||
xhr({
|
||||
type: "get",
|
||||
url: url,
|
||||
success: function (data) {
|
||||
$("#attributes_div").html(data);
|
||||
},
|
||||
error: function() {
|
||||
showMessage('fail', 'Something went wrong - could not fetch attributes.');
|
||||
},
|
||||
});
|
||||
fetchAttributes(url);
|
||||
}
|
||||
|
||||
function toggleBoolFilter(url, param) {
|
||||
|
@ -3755,17 +3737,26 @@ function toggleBoolFilter(url, param) {
|
|||
|
||||
url += buildFilterURL(res);
|
||||
url = url.replace(/view\//i, 'viewEventAttributes/');
|
||||
xhr({
|
||||
fetchAttributes(url);
|
||||
querybuilderTool = undefined;
|
||||
}
|
||||
|
||||
function fetchAttributes(url, data) {
|
||||
var options = {
|
||||
type: "get",
|
||||
url: url,
|
||||
success: function (data) {
|
||||
$("#attributes_div").html(data);
|
||||
querybuilderTool = undefined;
|
||||
},
|
||||
error: function() {
|
||||
showMessage('fail', 'Something went wrong - could not fetch attributes.');
|
||||
}
|
||||
});
|
||||
};
|
||||
if (data !== undefined) {
|
||||
options["type"] = "post";
|
||||
options["data"] = data;
|
||||
}
|
||||
xhr(options);
|
||||
}
|
||||
|
||||
function mergeOrganisationUpdate() {
|
||||
|
|
Loading…
Reference in New Issue