Edge events fixed queueStartTs attribute

This commit is contained in:
Artem Babak 2020-11-05 09:31:05 +02:00
parent 94437d84fb
commit 9ee792cac3
3 changed files with 13 additions and 17 deletions

View File

@ -19,7 +19,7 @@
<div class="tb-cell" flex="20">{{ event.type }}</div> <div class="tb-cell" flex="20">{{ event.type }}</div>
<div class="tb-cell" flex="40">{{ event.action }}</div> <div class="tb-cell" flex="40">{{ event.action }}</div>
<div class="tb-cell" flex="20">{{ event.entityId }}</div> <div class="tb-cell" flex="20">{{ event.entityId }}</div>
<div class="tb-cell" flex="15" ng-style="isPending ? {'color': 'rgba(0, 0, 0, .38)'} : {'color': '#000'}">{{ updateStatus(event.createdTime) | translate }}</div> <div class="tb-cell" flex="15" ng-style="{'color': statusColor}">{{ updateStatus(event.createdTime) | translate }}</div>
<div class="tb-cell" flex="10"> <div class="tb-cell" flex="10">
<md-button ng-if="checkEdgeEventType(event.type)" class="md-icon-button md-primary" <md-button ng-if="checkEdgeEventType(event.type)" class="md-icon-button md-primary"
ng-click="showEdgeEntityContent($event, 'edge.entity-info', 'JSON')" ng-click="showEdgeEntityContent($event, 'edge.entity-info', 'JSON')"

View File

@ -167,17 +167,15 @@ export default function EventRowDirective($compile, $templateCache, $mdDialog, $
$compile(element.contents())(scope); $compile(element.contents())(scope);
scope.updateStatus = function(eventCreatedTime) { scope.updateStatus = function(eventCreatedTime) {
if (scope.queueStartTs) { var status;
var status; if (eventCreatedTime < scope.queueStartTs) {
if (eventCreatedTime < scope.queueStartTs) { status = $translate.instant('edge.success');
status = $translate.instant('edge.success'); scope.statusColor = '#000';
scope.isPending = false; } else {
} else { status = $translate.instant('edge.failed');
status = $translate.instant('edge.failed'); scope.statusColor = 'rgba(0, 0, 0, .38)';
scope.isPending = true;
}
return status;
} }
return status;
} }
} }

View File

@ -220,7 +220,6 @@ export default function EventTableDirective($compile, $templateCache, $rootScope
} }
scope.subscriptionId = null; scope.subscriptionId = null;
scope.queueStartTs = 0;
scope.loadEdgeInfo = function() { scope.loadEdgeInfo = function() {
attributeService.getEntityAttributesValues( attributeService.getEntityAttributesValues(
@ -228,11 +227,10 @@ export default function EventTableDirective($compile, $templateCache, $rootScope
scope.entityId, scope.entityId,
types.attributesScope.server.value, types.attributesScope.server.value,
types.edgeAttributeKeys.queueStartTs, types.edgeAttributeKeys.queueStartTs,
{}) null).then(
.then(function success(attributes) { function success(attributes) {
scope.onEdgeAttributesUpdate(attributes); attributes.length > 0 ? scope.onEdgeAttributesUpdate(attributes) : scope.queueStartTs = 0;
}); });
scope.checkSubscription(); scope.checkSubscription();
} }