From ed96f27603043e3fbf423a83ff047feb5196083b Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Wed, 10 Dec 2014 08:48:54 -0800 Subject: [PATCH] GUAC-933 Cleaned up history entry display logic a bit. --- .../webapp/app/manage/templates/editableConnection.html | 8 +++++--- .../main/webapp/app/manage/types/HistoryEntryWrapper.js | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/guacamole/src/main/webapp/app/manage/templates/editableConnection.html b/guacamole/src/main/webapp/app/manage/templates/editableConnection.html index 2d8e5805a..a78f498b1 100644 --- a/guacamole/src/main/webapp/app/manage/templates/editableConnection.html +++ b/guacamole/src/main/webapp/app/manage/templates/editableConnection.html @@ -97,9 +97,11 @@ THE SOFTWARE. {{wrapper.entry.username}} {{wrapper.entry.startDate | date:'short'}} - {{'manage.edit.connection.history.formattedDuration' | translate:"{VALUE: wrapper.duration.value, UNIT: wrapper.duration.unit}"}} - {{'manage.edit.connection.history.unknownEnd' | translate}} - {{'manage.edit.connection.history.activeNow' | translate}} + + {{'manage.edit.connection.history.formattedDuration' | translate:"{VALUE: wrapper.duration.value, UNIT: wrapper.duration.unit}"}} + {{'manage.edit.connection.history.activeNow' | translate}} + {{'manage.edit.connection.history.unknownEnd' | translate}} + diff --git a/guacamole/src/main/webapp/app/manage/types/HistoryEntryWrapper.js b/guacamole/src/main/webapp/app/manage/types/HistoryEntryWrapper.js index f40f40a42..6d12c57bf 100644 --- a/guacamole/src/main/webapp/app/manage/types/HistoryEntryWrapper.js +++ b/guacamole/src/main/webapp/app/manage/types/HistoryEntryWrapper.js @@ -103,8 +103,8 @@ angular.module('manage').factory('HistoryEntryWrapper', [function defineHistoryE */ this.duration = null; - // Set the duration if the necessary information is present - if (historyEntry.endDate && historyEntry.startDate) + // Set the duration if the necessary information is present and the entry is not still active + if (historyEntry.endDate && historyEntry.startDate && !historyEntry.active) this.duration = formatMilliseconds(historyEntry.endDate - historyEntry.startDate); };