Commit 9ee792cac39a3fbf71fe0b33d4d58a91ae7b633b
1 parent
94437d84
Edge events fixed queueStartTs attribute
Showing
3 changed files
with
13 additions
and
17 deletions
@@ -19,7 +19,7 @@ | @@ -19,7 +19,7 @@ | ||
19 | <div class="tb-cell" flex="20">{{ event.type }}</div> | 19 | <div class="tb-cell" flex="20">{{ event.type }}</div> |
20 | <div class="tb-cell" flex="40">{{ event.action }}</div> | 20 | <div class="tb-cell" flex="40">{{ event.action }}</div> |
21 | <div class="tb-cell" flex="20">{{ event.entityId }}</div> | 21 | <div class="tb-cell" flex="20">{{ event.entityId }}</div> |
22 | -<div class="tb-cell" flex="15" ng-style="isPending ? {'color': 'rgba(0, 0, 0, .38)'} : {'color': '#000'}">{{ updateStatus(event.createdTime) | translate }}</div> | 22 | +<div class="tb-cell" flex="15" ng-style="{'color': statusColor}">{{ updateStatus(event.createdTime) | translate }}</div> |
23 | <div class="tb-cell" flex="10"> | 23 | <div class="tb-cell" flex="10"> |
24 | <md-button ng-if="checkEdgeEventType(event.type)" class="md-icon-button md-primary" | 24 | <md-button ng-if="checkEdgeEventType(event.type)" class="md-icon-button md-primary" |
25 | ng-click="showEdgeEntityContent($event, 'edge.entity-info', 'JSON')" | 25 | ng-click="showEdgeEntityContent($event, 'edge.entity-info', 'JSON')" |
@@ -167,17 +167,15 @@ export default function EventRowDirective($compile, $templateCache, $mdDialog, $ | @@ -167,17 +167,15 @@ export default function EventRowDirective($compile, $templateCache, $mdDialog, $ | ||
167 | $compile(element.contents())(scope); | 167 | $compile(element.contents())(scope); |
168 | 168 | ||
169 | scope.updateStatus = function(eventCreatedTime) { | 169 | scope.updateStatus = function(eventCreatedTime) { |
170 | - if (scope.queueStartTs) { | ||
171 | - var status; | ||
172 | - if (eventCreatedTime < scope.queueStartTs) { | ||
173 | - status = $translate.instant('edge.success'); | ||
174 | - scope.isPending = false; | ||
175 | - } else { | ||
176 | - status = $translate.instant('edge.failed'); | ||
177 | - scope.isPending = true; | ||
178 | - } | ||
179 | - return status; | 170 | + var status; |
171 | + if (eventCreatedTime < scope.queueStartTs) { | ||
172 | + status = $translate.instant('edge.success'); | ||
173 | + scope.statusColor = '#000'; | ||
174 | + } else { | ||
175 | + status = $translate.instant('edge.failed'); | ||
176 | + scope.statusColor = 'rgba(0, 0, 0, .38)'; | ||
180 | } | 177 | } |
178 | + return status; | ||
181 | } | 179 | } |
182 | } | 180 | } |
183 | 181 |
@@ -220,7 +220,6 @@ export default function EventTableDirective($compile, $templateCache, $rootScope | @@ -220,7 +220,6 @@ export default function EventTableDirective($compile, $templateCache, $rootScope | ||
220 | } | 220 | } |
221 | 221 | ||
222 | scope.subscriptionId = null; | 222 | scope.subscriptionId = null; |
223 | - scope.queueStartTs = 0; | ||
224 | 223 | ||
225 | scope.loadEdgeInfo = function() { | 224 | scope.loadEdgeInfo = function() { |
226 | attributeService.getEntityAttributesValues( | 225 | attributeService.getEntityAttributesValues( |
@@ -228,11 +227,10 @@ export default function EventTableDirective($compile, $templateCache, $rootScope | @@ -228,11 +227,10 @@ export default function EventTableDirective($compile, $templateCache, $rootScope | ||
228 | scope.entityId, | 227 | scope.entityId, |
229 | types.attributesScope.server.value, | 228 | types.attributesScope.server.value, |
230 | types.edgeAttributeKeys.queueStartTs, | 229 | types.edgeAttributeKeys.queueStartTs, |
231 | - {}) | ||
232 | - .then(function success(attributes) { | ||
233 | - scope.onEdgeAttributesUpdate(attributes); | ||
234 | - }); | ||
235 | - | 230 | + null).then( |
231 | + function success(attributes) { | ||
232 | + attributes.length > 0 ? scope.onEdgeAttributesUpdate(attributes) : scope.queueStartTs = 0; | ||
233 | + }); | ||
236 | scope.checkSubscription(); | 234 | scope.checkSubscription(); |
237 | } | 235 | } |
238 | 236 |