thingsboard-memoizeit

Added description to the device card. Allows viewing of the

6/13/2018 1:27:29 AM

Details

diff --git a/ui/src/app/api/alias-controller.js b/ui/src/app/api/alias-controller.js
index 10b1107..66781a8 100644
--- a/ui/src/app/api/alias-controller.js
+++ b/ui/src/app/api/alias-controller.js
@@ -146,6 +146,7 @@ export default class AliasController {
                                     newDatasource.entityId = resolvedEntity.id;
                                     newDatasource.entityType = resolvedEntity.entityType;
                                     newDatasource.entityName = resolvedEntity.name;
+                                    newDatasource.entityDescription = resolvedEntity.entityDescription
                                     newDatasource.name = resolvedEntity.name;
                                     newDatasource.generated = i > 0 ? true : false;
                                     datasources.push(newDatasource);
@@ -167,6 +168,7 @@ export default class AliasController {
                                 datasource.entityType = entity.entityType;
                                 datasource.entityName = entity.name;
                                 datasource.name = entity.name;
+                                datasource.entityDescription = entity.entityDescription;
                                 deferred.resolve([datasource]);
                             } else {
                                 if (aliasInfo.stateEntity) {
diff --git a/ui/src/app/api/entity.service.js b/ui/src/app/api/entity.service.js
index 762bf1a..2e29238 100644
--- a/ui/src/app/api/entity.service.js
+++ b/ui/src/app/api/entity.service.js
@@ -329,7 +329,7 @@ function EntityService($http, $q, $filter, $translate, $log, userService, device
     }
 
     function entityToEntityInfo(entity) {
-        return { name: entity.name, entityType: entity.id.entityType, id: entity.id.id };
+        return { name: entity.name, entityType: entity.id.entityType, id: entity.id.id, entityDescription: entity.additionalInfo?entity.additionalInfo.description:"" };
     }
 
     function entityRelationInfoToEntityInfo(entityRelationInfo, direction) {
diff --git a/ui/src/app/device/device-card.tpl.html b/ui/src/app/device/device-card.tpl.html
index 522f1ab..de8b7ee 100644
--- a/ui/src/app/device/device-card.tpl.html
+++ b/ui/src/app/device/device-card.tpl.html
@@ -16,7 +16,8 @@
 
 -->
 <div flex layout="column" style="margin-top: -10px;">
-    <div style="text-transform: uppercase; padding-bottom: 10px;">{{vm.item.type}}</div>
+	<div flex>{{vm.item.additionalInfo.description}}</div>
+    <div flex style="text-transform: uppercase; padding-bottom: 10px;">{{vm.item.type}}</div>
     <div class="tb-small" ng-show="vm.isAssignedToCustomer()">{{'device.assignedToCustomer' | translate}} '{{vm.item.assignedCustomer.title}}'</div>
     <div class="tb-small" ng-show="vm.isPublic()">{{'device.public' | translate}}</div>
 </div>