JS/ui: create new simple filter URLs
This commit is contained in:
parent
f2c67ea047
commit
f98d8f7fc5
|
@ -403,19 +403,17 @@
|
||||||
|
|
||||||
// create new url
|
// create new url
|
||||||
if (selectionData.length < 2) {
|
if (selectionData.length < 2) {
|
||||||
// single-selection
|
this.icinga.logger.error('Something went wrong, we should never multiselect just one row');
|
||||||
$.each(selectionData[0], function(key, value){
|
|
||||||
queries.push(key + '=' + encodeURIComponent(value));
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
// multi-selection
|
|
||||||
$.each(selectionData, function(i, el){
|
$.each(selectionData, function(i, el){
|
||||||
|
var parts = []
|
||||||
$.each(el, function(key, value) {
|
$.each(el, function(key, value) {
|
||||||
queries.push(key + '[' + i + ']=' + encodeURIComponent(value));
|
parts.push(encodeURIComponent(key) + '=' + encodeURIComponent(value));
|
||||||
});
|
});
|
||||||
|
queries.push('(' + parts.join('&') + ')');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return queries.join('&');
|
return '(' + queries.join('|') + ')';
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue