Commit 7582d503fbb27f4b6fa46d7502c82dadd64bcb33

Authored by Artem Babak
1 parent 9ee792ca

edgeEvents refactoring

... ... @@ -13,6 +13,8 @@
13 13 * See the License for the specific language governing permissions and
14 14 * limitations under the License.
15 15 */
  16 +import { grey300, grey900 } from 'material-ui/styles/colors';
  17 +
16 18 export default angular.module('thingsboard.types', [])
17 19 .constant('types',
18 20 {
... ... @@ -403,6 +405,16 @@ export default angular.module('thingsboard.types', [])
403 405 widgetType: "WIDGET_TYPE",
404 406 adminSettings: "ADMIN_SETTINGS"
405 407 },
  408 + edgeEventStatus: {
  409 + "DEPLOYED": {
  410 + name: "edge.deployed",
  411 + color: grey900
  412 + },
  413 + "PENDING": {
  414 + name: "edge.pending",
  415 + color: grey300
  416 + }
  417 + },
406 418 edgeAttributeKeys: {
407 419 active: "active",
408 420 lastConnectTime: "lastConnectTime",
... ...
... ... @@ -19,7 +19,7 @@
19 19 <div class="tb-cell" flex="20">{{ event.type }}</div>
20 20 <div class="tb-cell" flex="40">{{ event.action }}</div>
21 21 <div class="tb-cell" flex="20">{{ event.entityId }}</div>
22   -<div class="tb-cell" flex="15" ng-style="{'color': statusColor}">{{ updateStatus(event.createdTime) | translate }}</div>
  22 +<div class="tb-cell" flex="15" ng-style="{'color': statusColor}">{{ updateStatus(event.createdTime) }}</div>
23 23 <div class="tb-cell" flex="10">
24 24 <md-button ng-if="checkEdgeEventType(event.type)" class="md-icon-button md-primary"
25 25 ng-click="showEdgeEntityContent($event, 'edge.entity-info', 'JSON')"
... ...
... ... @@ -169,11 +169,11 @@ export default function EventRowDirective($compile, $templateCache, $mdDialog, $
169 169 scope.updateStatus = function(eventCreatedTime) {
170 170 var status;
171 171 if (eventCreatedTime < scope.queueStartTs) {
172   - status = $translate.instant('edge.success');
173   - scope.statusColor = '#000';
  172 + status = $translate.instant(types.edgeEventStatus.DEPLOYED.name);
  173 + scope.statusColor = types.edgeEventStatus.DEPLOYED.color;
174 174 } else {
175   - status = $translate.instant('edge.failed');
176   - scope.statusColor = 'rgba(0, 0, 0, .38)';
  175 + status = $translate.instant(types.edgeEventStatus.PENDING.name);
  176 + scope.statusColor = types.edgeEventStatus.PENDING.color;
177 177 }
178 178 return status;
179 179 }
... ...
... ... @@ -805,8 +805,8 @@
805 805 "set-root-rule-chain-to-edges": "Regelkette zur Wurzel machen für die Rand",
806 806 "set-root-rule-chain-to-edges-text": "Die Regelkette zur Wurzel für { count, plural, 1 {1 Rand} other {# Rand} } machen",
807 807 "status": "Von Rand empfangen",
808   - "success": "Bereitgestellt",
809   - "failed": "Steht aus",
  808 + "deployed": "Bereitgestellt",
  809 + "pending": "Steht aus",
810 810 "entity-id": "Entität ID",
811 811 "entity-info": "Entitätsinfo",
812 812 "event-action": "Ereignisaktion",
... ...
... ... @@ -817,7 +817,7 @@
817 817 "make-private-edge-text": "After the confirmation the edge and all its data will be made private and won't be accessible by others.",
818 818 "import": "Import edge",
819 819 "label": "Label",
820   - "load-entity-error": "Entity not found. Failed to load info",
  820 + "load-entity-error": "Failed to load data. Entity not found or has been deleted.",
821 821 "assign-new-edge": "Assign new edge",
822 822 "manage-edge-dashboards": "Manage edge dashboards",
823 823 "unassign-from-edge": "Unassign from edge",
... ... @@ -841,8 +841,8 @@
841 841 "set-root-rule-chain-to-edges": "Set root rule chain for Edge(s)",
842 842 "set-root-rule-chain-to-edges-text": "Set root rule chain for { count, plural, 1 {1 edge} other {# edges} }",
843 843 "status": "Received by edge",
844   - "success": "Deployed",
845   - "failed": "Pending"
  844 + "deployed": "Deployed",
  845 + "pending": "Pending"
846 846 },
847 847 "error": {
848 848 "unable-to-connect": "Unable to connect to the server! Please check your internet connection.",
... ...
... ... @@ -818,8 +818,8 @@
818 818 "set-root-rule-chain-to-edges": "Establecer la cadena de reglas raíz para Edge (s)",
819 819 "set-root-rule-chain-to-edges-text": "Establecer la cadena de la regla raíz para {count, plural, 1 {1 borde} other {# bordes}}",
820 820 "status": "Recibido por borde",
821   - "success": "Desplegada",
822   - "failed": "Pendiente",
  821 + "deployed": "Desplegada",
  822 + "pending": "Pendiente",
823 823 "entity-id": "ID de entidad",
824 824 "entity-info": "Entity info",
825 825 "event-action": "Información de la entidad",
... ...
... ... @@ -823,8 +823,8 @@
823 823 "set-root-rule-chain-to-edges": "Définir la chaîne de règles racine pour bordure(s)",
824 824 "set-root-rule-chain-to-edges-text": "Définir la chaîne de règles racine pour {count, plural, 1 {1 bordure} other {# bordures} }",
825 825 "status": "Reçu par bord",
826   - "success": "Déployée",
827   - "failed": "En attente",
  826 + "deployed": "Déployée",
  827 + "pending": "En attente",
828 828 "entity-id": "ID d'entité",
829 829 "entity-info": "Informations sur l'entité",
830 830 "event-action": "Action d'événement",
... ...