Browse Source

Merge pull request #59 from deaflynx/develop/2.6-edge

edgeEvents refactored
pull/3693/head
VoBa 6 years ago
committed by GitHub
parent
commit
95476b6c0c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      ui/src/app/common/types.constant.js
  2. 4
      ui/src/app/customer/customer-fieldset.tpl.html
  3. 13
      ui/src/app/edge/edge-fieldset.tpl.html
  4. 2
      ui/src/app/event/event-row-edge-event.tpl.html
  5. 18
      ui/src/app/event/event-row.directive.js
  6. 11
      ui/src/app/event/event-table.directive.js
  7. 4
      ui/src/app/locale/locale.constant-de_DE.json
  8. 6
      ui/src/app/locale/locale.constant-en_US.json
  9. 4
      ui/src/app/locale/locale.constant-es_ES.json
  10. 4
      ui/src/app/locale/locale.constant-fr_FR.json

12
ui/src/app/common/types.constant.js

@ -13,6 +13,8 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import { grey300, grey900 } from 'material-ui/styles/colors';
export default angular.module('thingsboard.types', []) export default angular.module('thingsboard.types', [])
.constant('types', .constant('types',
{ {
@ -403,6 +405,16 @@ export default angular.module('thingsboard.types', [])
widgetType: "WIDGET_TYPE", widgetType: "WIDGET_TYPE",
adminSettings: "ADMIN_SETTINGS" adminSettings: "ADMIN_SETTINGS"
}, },
edgeEventStatus: {
"DEPLOYED": {
name: "edge.deployed",
color: grey900
},
"PENDING": {
name: "edge.pending",
color: grey300
}
},
edgeAttributeKeys: { edgeAttributeKeys: {
active: "active", active: "active",
lastConnectTime: "lastConnectTime", lastConnectTime: "lastConnectTime",

4
ui/src/app/customer/customer-fieldset.tpl.html

@ -16,10 +16,10 @@
--> -->
<md-button ng-click="onManageUsers({event: $event})" ng-show="!isEdit && !isPublic" class="md-raised md-primary">{{ 'customer.manage-users' | translate }}</md-button> <md-button ng-click="onManageUsers({event: $event})" ng-show="!isEdit && !isPublic" class="md-raised md-primary">{{ 'customer.manage-users' | translate }}</md-button>
<md-button ng-click="onManageAssets({event: $event})" ng-show="!isEdit && !isPublic" class="md-raised md-primary">{{ 'customer.manage-assets' | translate }}</md-button> <md-button ng-click="onManageAssets({event: $event})" ng-show="!isEdit" class="md-raised md-primary">{{ 'customer.manage-assets' | translate }}</md-button>
<md-button ng-click="onManageDevices({event: $event})" ng-show="!isEdit" class="md-raised md-primary">{{ 'customer.manage-devices' | translate }}</md-button> <md-button ng-click="onManageDevices({event: $event})" ng-show="!isEdit" class="md-raised md-primary">{{ 'customer.manage-devices' | translate }}</md-button>
<md-button ng-click="onManageDashboards({event: $event})" ng-show="!isEdit" class="md-raised md-primary">{{ 'customer.manage-dashboards' | translate }}</md-button> <md-button ng-click="onManageDashboards({event: $event})" ng-show="!isEdit" class="md-raised md-primary">{{ 'customer.manage-dashboards' | translate }}</md-button>
<md-button ng-click="onManageEdges({event: $event})" ng-show="!isEdit && !isPublic" class="md-raised md-primary">{{ 'customer.manage-edges' | translate }}</md-button> <md-button ng-click="onManageEdges({event: $event})" ng-show="!isEdit" class="md-raised md-primary">{{ 'customer.manage-edges' | translate }}</md-button>
<md-button ng-click="onDeleteCustomer({event: $event})" ng-show="!isEdit && !isPublic" class="md-raised md-primary">{{ 'customer.delete' | translate }}</md-button> <md-button ng-click="onDeleteCustomer({event: $event})" ng-show="!isEdit && !isPublic" class="md-raised md-primary">{{ 'customer.delete' | translate }}</md-button>
<div layout="row"> <div layout="row">

13
ui/src/app/edge/edge-fieldset.tpl.html

@ -48,12 +48,6 @@
<md-icon md-svg-icon="mdi:clipboard-arrow-left"></md-icon> <md-icon md-svg-icon="mdi:clipboard-arrow-left"></md-icon>
<span translate>edge.copy-id</span> <span translate>edge.copy-id</span>
</md-button> </md-button>
<md-button ng-click="onEdgeSync(edge.id)"
ng-show="!isEdit"
class="md-raised">
<md-icon md-svg-icon="mdi:sync"></md-icon>
<span translate>edge.sync</span>
</md-button>
<md-button ngclipboard data-clipboard-action="copy" <md-button ngclipboard data-clipboard-action="copy"
ngclipboard-success="onEdgeInfoCopied('key')" ngclipboard-success="onEdgeInfoCopied('key')"
data-clipboard-text="{{edge.routingKey}}" ng-show="!isEdit" data-clipboard-text="{{edge.routingKey}}" ng-show="!isEdit"
@ -68,6 +62,12 @@
<md-icon md-svg-icon="mdi:clipboard-arrow-left"></md-icon> <md-icon md-svg-icon="mdi:clipboard-arrow-left"></md-icon>
<span translate>edge.copy-edge-secret</span> <span translate>edge.copy-edge-secret</span>
</md-button> </md-button>
<md-button ng-click="onEdgeSync(edge.id)"
ng-show="!isEdit"
class="md-raised">
<md-icon md-svg-icon="mdi:sync"></md-icon>
<span translate>edge.sync</span>
</md-button>
</div> </div>
<md-content class="md-padding" layout="column"> <md-content class="md-padding" layout="column">
@ -119,6 +119,7 @@
</md-input-container> </md-input-container>
</fieldset> </fieldset>
<div layout="row"> <div layout="row">
<md-input-container class="md-block" flex> <md-input-container class="md-block" flex>
<label translate>edge.edge-key</label> <label translate>edge.edge-key</label>
<input ng-model="edge.routingKey" disabled> <input ng-model="edge.routingKey" disabled>

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) }}</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(types.edgeEventStatus.DEPLOYED.name);
status = $translate.instant('edge.success'); scope.statusColor = types.edgeEventStatus.DEPLOYED.color;
scope.isPending = false; } else {
} else { status = $translate.instant(types.edgeEventStatus.PENDING.name);
status = $translate.instant('edge.failed'); scope.statusColor = types.edgeEventStatus.PENDING.color;
scope.isPending = true;
}
return status;
} }
return status;
} }
} }

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

@ -142,7 +142,6 @@ export default function EventTableDirective($compile, $templateCache, $rootScope
scope.$watch("entityId", function(newVal, prevVal) { scope.$watch("entityId", function(newVal, prevVal) {
if (newVal && !angular.equals(newVal, prevVal)) { if (newVal && !angular.equals(newVal, prevVal)) {
scope.loadEdgeInfo();
scope.resetFilter(); scope.resetFilter();
scope.reload(); scope.reload();
} }
@ -221,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(
@ -229,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();
} }

4
ui/src/app/locale/locale.constant-de_DE.json

@ -805,8 +805,8 @@
"set-root-rule-chain-to-edges": "Regelkette zur Wurzel machen für die Rand", "set-root-rule-chain-to-edges": "Regelkette zur Wurzel machen für die Rand",
"set-root-rule-chain-to-edges-text": "Die Regelkette zur Wurzel für { count, plural, 1 {1 Rand} other {# Rand} } machen", "set-root-rule-chain-to-edges-text": "Die Regelkette zur Wurzel für { count, plural, 1 {1 Rand} other {# Rand} } machen",
"status": "Von Rand empfangen", "status": "Von Rand empfangen",
"success": "Bereitgestellt", "deployed": "Bereitgestellt",
"failed": "Steht aus", "pending": "Steht aus",
"entity-id": "Entität ID", "entity-id": "Entität ID",
"entity-info": "Entitätsinfo", "entity-info": "Entitätsinfo",
"event-action": "Ereignisaktion", "event-action": "Ereignisaktion",

6
ui/src/app/locale/locale.constant-en_US.json

@ -819,7 +819,7 @@
"make-private-edge-text": "After the confirmation the edge and all its data will be made private and won't be accessible by others.", "make-private-edge-text": "After the confirmation the edge and all its data will be made private and won't be accessible by others.",
"import": "Import edge", "import": "Import edge",
"label": "Label", "label": "Label",
"load-entity-error": "Entity not found. Failed to load info", "load-entity-error": "Failed to load data. Entity not found or has been deleted.",
"assign-new-edge": "Assign new edge", "assign-new-edge": "Assign new edge",
"manage-edge-dashboards": "Manage edge dashboards", "manage-edge-dashboards": "Manage edge dashboards",
"unassign-from-edge": "Unassign from edge", "unassign-from-edge": "Unassign from edge",
@ -843,8 +843,8 @@
"set-root-rule-chain-to-edges": "Set root rule chain for Edge(s)", "set-root-rule-chain-to-edges": "Set root rule chain for Edge(s)",
"set-root-rule-chain-to-edges-text": "Set root rule chain for { count, plural, 1 {1 edge} other {# edges} }", "set-root-rule-chain-to-edges-text": "Set root rule chain for { count, plural, 1 {1 edge} other {# edges} }",
"status": "Received by edge", "status": "Received by edge",
"success": "Deployed", "deployed": "Deployed",
"failed": "Pending" "pending": "Pending"
}, },
"error": { "error": {
"unable-to-connect": "Unable to connect to the server! Please check your internet connection.", "unable-to-connect": "Unable to connect to the server! Please check your internet connection.",

4
ui/src/app/locale/locale.constant-es_ES.json

@ -818,8 +818,8 @@
"set-root-rule-chain-to-edges": "Establecer la cadena de reglas raíz para Edge (s)", "set-root-rule-chain-to-edges": "Establecer la cadena de reglas raíz para Edge (s)",
"set-root-rule-chain-to-edges-text": "Establecer la cadena de la regla raíz para {count, plural, 1 {1 borde} other {# bordes}}", "set-root-rule-chain-to-edges-text": "Establecer la cadena de la regla raíz para {count, plural, 1 {1 borde} other {# bordes}}",
"status": "Recibido por borde", "status": "Recibido por borde",
"success": "Desplegada", "deployed": "Desplegada",
"failed": "Pendiente", "pending": "Pendiente",
"entity-id": "ID de entidad", "entity-id": "ID de entidad",
"entity-info": "Entity info", "entity-info": "Entity info",
"event-action": "Información de la entidad", "event-action": "Información de la entidad",

4
ui/src/app/locale/locale.constant-fr_FR.json

@ -823,8 +823,8 @@
"set-root-rule-chain-to-edges": "Définir la chaîne de règles racine pour bordure(s)", "set-root-rule-chain-to-edges": "Définir la chaîne de règles racine pour bordure(s)",
"set-root-rule-chain-to-edges-text": "Définir la chaîne de règles racine pour {count, plural, 1 {1 bordure} other {# bordures} }", "set-root-rule-chain-to-edges-text": "Définir la chaîne de règles racine pour {count, plural, 1 {1 bordure} other {# bordures} }",
"status": "Reçu par bord", "status": "Reçu par bord",
"success": "Déployée", "deployed": "Déployée",
"failed": "En attente", "pending": "En attente",
"entity-id": "ID d'entité", "entity-id": "ID d'entité",
"entity-info": "Informations sur l'entité", "entity-info": "Informations sur l'entité",
"event-action": "Action d'événement", "event-action": "Action d'événement",

Loading…
Cancel
Save