GUAC-932: Fix display of history.

This commit is contained in:
Michael Jumper
2014-12-21 20:14:11 -08:00
parent c3bdbcd013
commit 60f249aa6f
2 changed files with 5 additions and 8 deletions

View File

@@ -43,12 +43,11 @@ angular.module('manage').controller('connectionEditModalController', ['$scope',
if(!$scope.connection.protocol)
$scope.connection.protocol = "vnc";
$scope.historyEntryWrappers = [];
// Wrap all the history entries
if (!newConnection) {
connectionService.getConnectionHistory($scope.connection.identifier).success(function wrapHistoryEntries(historyEntries) {
$scope.historyEntryWrappers = [];
historyEntries.forEach(function wrapHistoryEntry(historyEntry) {
$scope.historyEntryWrappers.push(new HistoryEntryWrapper(historyEntry));
});
@@ -60,6 +59,7 @@ angular.module('manage').controller('connectionEditModalController', ['$scope',
}
else {
$scope.historyEntryWrappers = [];
$scope.connection.parameters = {};
}

View File

@@ -84,13 +84,10 @@ THE SOFTWARE.
<!-- History connection area -->
<dt>{{'manage.edit.connection.history.usageHistory' | translate}}</dt>
<dd ng-hide="connection.history.length">
<p>{{'manage.edit.connection.history.connectionNotUsed' | translate}}</p>
</dd>
<!-- History connection list -->
<dd ng-show="connection.history.length">
<table class="history section">
<dd ng-class="{loading: !historyEntryWrappers}">
<p ng-hide="historyEntryWrappers.length">{{'manage.edit.connection.history.connectionNotUsed' | translate}}</p>
<table class="history section" ng-show="historyEntryWrappers.length">
<tr>
<th>{{'manage.edit.connection.history.username' | translate}}</th>
<th>{{'manage.edit.connection.history.startTime' | translate}}</th>