Commit f4313932 authored by Christophe Maudoux's avatar Christophe Maudoux 🐛

Append history custom values in session explorer (#1501)

parent 550c8e45
......@@ -287,17 +287,27 @@ llapp.controller 'SessionsExplorerCtrl', ['$scope', '$translator', '$location',
if session._loginHistory
tmp = []
if session._loginHistory.successLogin
# History custom values
cv = ""
for l in session._loginHistory.successLogin
for key, value of l
if key.match /^(_utime|ipAddr|error)$/ then 1
else cv = cv + ", #{key} : #{value}"
tmp.push
t: l._utime
title: $scope.localeDate l._utime
value: "Success (IP #{l.ipAddr})"
value: "Success (IP #{l.ipAddr})" + cv
if session._loginHistory.failedLogin
# History custom values
cv = ""
for l in session._loginHistory.failedLogin
for key, value of l
if key.match /^(_utime|ipAddr|error)$/ then 1
else cv = cv + ", #{key} : #{value}"
tmp.push
t: l._utime
title: $scope.localeDate l._utime
value: "#{l.error} (IP #{l.ipAddr})"
value: "Error #{l.error} (IP #{l.ipAddr})" + cv
delete session._loginHistory
tmp.sort (a,b) ->
a.t - b.t
......
......@@ -199,7 +199,7 @@
$scope.displaySession = function(scope) {
var sessionId, transformSession;
transformSession = function(session) {
var _insert, _stToStr, array, arrayDate, attr, attrs, category, epoch, i, id, j, k, key, l, len, len1, len2, len3, len4, m, name, o, oidcConsent, pattern, ref, ref1, res, sfDevice, subres, time, title, tmp, value;
var _insert, _stToStr, array, arrayDate, attr, attrs, category, cv, epoch, i, id, j, k, key, l, len, len1, len2, len3, len4, m, name, o, oidcConsent, pattern, ref, ref1, res, sfDevice, subres, time, title, tmp, value;
_stToStr = function(s) {
return s;
};
......@@ -341,24 +341,42 @@
if (session._loginHistory) {
tmp = [];
if (session._loginHistory.successLogin) {
cv = "";
ref = session._loginHistory.successLogin;
for (m = 0, len3 = ref.length; m < len3; m++) {
l = ref[m];
for (key in l) {
value = l[key];
if (key.match(/^(_utime|ipAddr)$/)) {
1;
} else {
cv = cv + (", " + key + " : " + value);
}
}
tmp.push({
t: l._utime,
title: $scope.localeDate(l._utime),
value: "Success (IP " + l.ipAddr + ")"
value: ("Success (IP " + l.ipAddr + ")") + cv
});
}
}
if (session._loginHistory.failedLogin) {
cv = "";
ref1 = session._loginHistory.failedLogin;
for (o = 0, len4 = ref1.length; o < len4; o++) {
l = ref1[o];
for (key in l) {
value = l[key];
if (key.match(/^(_utime|ipAddr|error)$/)) {
1;
} else {
cv = cv + (", " + key + " : " + value);
}
}
tmp.push({
t: l._utime,
title: $scope.localeDate(l._utime),
value: l.error + " (IP " + l.ipAddr + ")"
value: ("Error " + l.error + " (IP " + l.ipAddr + ")") + cv
});
}
}
......
......@@ -94,9 +94,9 @@
<th ng-if="node.td!='1' && node.td!='2'">{{translate(node.title)}}</th>
<td class="data-{{node.epoch}}" ng-if="node.td>='1'">{{node.title}}</td>
<th ng-if="node.title=='type' || node.title=='rp'">{{translate(node.value)}}</th>
<td class="col-md-3 data-{{node.epoch}}" ng-if="node.title!='type' && node.title!='rp'" >{{node.value}}</td>
<td class="col-md-4 data-{{node.epoch}}" ng-if="node.title!='type' && node.title!='rp'>{{node.value}}</td>
<th ng-if="node.title=='type' || node.title=='rp'">{{translate(node.epoch)}}</th>
<td class="col-md-3 data-{{node.epoch}}" ng-if="node.epoch > 1500000000">{{localeDate(node.epoch)}}</td>
<td class="col-md-4 data-{{node.epoch}}" ng-if="node.epoch > 1500000000">{{localeDate(node.epoch)}}</td>
<td class="data-{{node.epoch}}">
<span ng-if="node.td=='2'" class="link text-danger glyphicon glyphicon-minus-sign" ng-click="deleteOIDCConsent(node.title, node.epoch)"></span>
<!--
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment