Sort done notifications and convert epoch into local date (#2782)

This commit is contained in:
Christophe Maudoux 2022-08-05 00:03:42 +02:00
parent e321b1ebed
commit 2ab940840e
4 changed files with 30 additions and 12 deletions

View File

@ -212,13 +212,21 @@ llapp.controller 'SessionsExplorerCtrl', ['$scope', '$translator', '$location',
_insert = (re, title) ->
tmp = []
reg = new RegExp(re)
cv = ""
for key,value of session
if key.match(reg) and value
tmp.push
title: key
value: value
cv += "#{value}:#{key},"
delete session[key]
if tmp.length > 0
if cv
cv = cv.replace(/,$/, '')
tab = cv.split ','
tab.sort()
tab.reverse()
for val in tab
vk = val.split ':'
tmp.push
title: vk[1]
value: $scope.localeDate vk[0]
res.push
title: title
nodes: tmp

View File

@ -233,20 +233,30 @@
transformSession = function(session) {
var _insert, array, attr, attrs, category, cv, element, epoch, i, j, k, key, l, len, len1, len2, len3, len4, len5, m, name, o, oidcConsent, p, real, ref, ref1, res, sfDevice, spoof, subres, tab, time, title, tmp, value;
_insert = function(re, title) {
var key, reg, tmp, value;
var cv, i, key, len, reg, tab, tmp, val, value, vk;
tmp = [];
reg = new RegExp(re);
cv = "";
for (key in session) {
value = session[key];
if (key.match(reg) && value) {
tmp.push({
title: key,
value: value
});
cv += value + ":" + key + ",";
delete session[key];
}
}
if (tmp.length > 0) {
if (cv) {
cv = cv.replace(/,$/, '');
tab = cv.split(',');
tab.sort();
tab.reverse();
for (i = 0, len = tab.length; i < len; i++) {
val = tab[i];
vk = val.split(':');
tmp.push({
title: vk[1],
value: $scope.localeDate(vk[0])
});
}
return res.push({
title: title,
nodes: tmp

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long