Skip to content

Commit

Permalink
Display creation and modification timestamp in hermes-console
Browse files Browse the repository at this point in the history
  • Loading branch information
jewertow committed Jan 4, 2020
1 parent 9320dc9 commit b34144a
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,20 @@ subscriptions.controller('SubscriptionController', ['SubscriptionRepository', 'S
var topicName = $scope.topicName = $stateParams.topicName;
var subscriptionName = $scope.subscriptionName = $stateParams.subscriptionName;

$scope.subscription = subscriptionRepository.get(topicName, subscriptionName);
subscriptionRepository.get(topicName, subscriptionName).$promise
.then(function(subscription) {
$scope.subscription = subscription;
if (subscription && subscription.createdAt && subscription.modifiedAt) {
var createdAt = new Date(0);
createdAt.setUTCSeconds(subscription.createdAt);
$scope.subscription.createdAt = createdAt;

var modifiedAt = new Date(0);
modifiedAt.setUTCSeconds(subscription.modifiedAt);
$scope.subscription.modifiedAt = modifiedAt;
}
});

$scope.retransmissionLoading = false;

$scope.endpointAddressResolverMetadataConfig = config.endpointAddressResolverMetadata;
Expand Down
9 changes: 9 additions & 0 deletions hermes-console/static/js/console/topic/TopicController.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ topics.controller('TopicController', ['TOPIC_CONFIG', 'TopicRepository', 'TopicM
topicRepository.get(topicName).then(function(topicWithSchema) {
$scope.topic = topicWithSchema;
$scope.topic.shortName = $scope.topic.name.substring($scope.topic.name.lastIndexOf('.') + 1);
if (topicWithSchema && topicWithSchema.createdAt && topicWithSchema.modifiedAt) {
var createdAt = new Date(0);
createdAt.setUTCSeconds(topicWithSchema.createdAt);
$scope.topic.createdAt = createdAt;

var modifiedAt = new Date(0);
modifiedAt.setUTCSeconds(topicWithSchema.modifiedAt);
$scope.topic.modifiedAt = modifiedAt;
}
try {
$scope.messageSchema = topicWithSchema.schema ? JSON.stringify(JSON.parse(topicWithSchema.schema), null, 2) : null;
} catch (e) {
Expand Down
8 changes: 8 additions & 0 deletions hermes-console/static/partials/subscription.html
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,14 @@ <h3 class="panel-title">Properties</h3>
<p ng-repeat="(key, value) in notSupportedEndpointAddressResolverMetadataEntries(subscription.endpointAddressResolverMetadata)">
<strong>{{key}}:</strong> {{value}}
</p>

<hr/>
<p ng-show="subscription.createdAt">
<strong>Creation date:</strong> {{subscription.createdAt}}
</p>
<p ng-show="subscription.modifiedAt">
<strong>Modification date:</strong> {{subscription.modifiedAt}}
</p>
</div>
</div>

Expand Down
8 changes: 8 additions & 0 deletions hermes-console/static/partials/topic.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,14 @@ <h3 class="panel-title">Properties</h3>
<span uib-popover='For how long should this topic be stored in offline storage.' popover-trigger="mouseenter" class="fa helpme pull-right">&#xf128;</span>
</p>

<hr/>
<p ng-show="topic.createdAt">
<strong>Creation date:</strong> {{topic.createdAt}}
</p>
<p ng-show="topic.modifiedAt">
<strong>Modification date:</strong> {{topic.modifiedAt}}
</p>

</div>
</div>
</div>
Expand Down

0 comments on commit b34144a

Please sign in to comment.