Browse Source

Edge events fixed queueStartTs attribute

pull/2436/head
Artem Babak 6 years ago
parent
commit
9ee792cac3
  1. 2
      ui/src/app/event/event-row-edge-event.tpl.html
  2. 18
      ui/src/app/event/event-row.directive.js
  3. 10
      ui/src/app/event/event-table.directive.js

2
ui/src/app/event/event-row-edge-event.tpl.html

@ -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')"

18
ui/src/app/event/event-row.directive.js

@ -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;
} }
} }

10
ui/src/app/event/event-table.directive.js

@ -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();
} }

Loading…
Cancel
Save