Commit 0546cb1e859a1f11bb2bb3333534075912315b92
Committed by
Andrew Shvayka
1 parent
42a451fc
Added description to the device card. Allows viewing of the description of a dev…
…ice or more importantly can have a friendly name showing on the device card instead of a long unique mac id.
Showing
3 changed files
with
5 additions
and
2 deletions
@@ -146,6 +146,7 @@ export default class AliasController { | @@ -146,6 +146,7 @@ export default class AliasController { | ||
146 | newDatasource.entityId = resolvedEntity.id; | 146 | newDatasource.entityId = resolvedEntity.id; |
147 | newDatasource.entityType = resolvedEntity.entityType; | 147 | newDatasource.entityType = resolvedEntity.entityType; |
148 | newDatasource.entityName = resolvedEntity.name; | 148 | newDatasource.entityName = resolvedEntity.name; |
149 | + newDatasource.entityDescription = resolvedEntity.entityDescription | ||
149 | newDatasource.name = resolvedEntity.name; | 150 | newDatasource.name = resolvedEntity.name; |
150 | newDatasource.generated = i > 0 ? true : false; | 151 | newDatasource.generated = i > 0 ? true : false; |
151 | datasources.push(newDatasource); | 152 | datasources.push(newDatasource); |
@@ -167,6 +168,7 @@ export default class AliasController { | @@ -167,6 +168,7 @@ export default class AliasController { | ||
167 | datasource.entityType = entity.entityType; | 168 | datasource.entityType = entity.entityType; |
168 | datasource.entityName = entity.name; | 169 | datasource.entityName = entity.name; |
169 | datasource.name = entity.name; | 170 | datasource.name = entity.name; |
171 | + datasource.entityDescription = entity.entityDescription; | ||
170 | deferred.resolve([datasource]); | 172 | deferred.resolve([datasource]); |
171 | } else { | 173 | } else { |
172 | if (aliasInfo.stateEntity) { | 174 | if (aliasInfo.stateEntity) { |
@@ -329,7 +329,7 @@ function EntityService($http, $q, $filter, $translate, $log, userService, device | @@ -329,7 +329,7 @@ function EntityService($http, $q, $filter, $translate, $log, userService, device | ||
329 | } | 329 | } |
330 | 330 | ||
331 | function entityToEntityInfo(entity) { | 331 | function entityToEntityInfo(entity) { |
332 | - return { name: entity.name, entityType: entity.id.entityType, id: entity.id.id }; | 332 | + return { name: entity.name, entityType: entity.id.entityType, id: entity.id.id, entityDescription: entity.additionalInfo?entity.additionalInfo.description:"" }; |
333 | } | 333 | } |
334 | 334 | ||
335 | function entityRelationInfoToEntityInfo(entityRelationInfo, direction) { | 335 | function entityRelationInfoToEntityInfo(entityRelationInfo, direction) { |
@@ -16,7 +16,8 @@ | @@ -16,7 +16,8 @@ | ||
16 | 16 | ||
17 | --> | 17 | --> |
18 | <div flex layout="column" style="margin-top: -10px;"> | 18 | <div flex layout="column" style="margin-top: -10px;"> |
19 | - <div style="text-transform: uppercase; padding-bottom: 10px;">{{vm.item.type}}</div> | 19 | + <div flex>{{vm.item.additionalInfo.description}}</div> |
20 | + <div flex style="text-transform: uppercase; padding-bottom: 10px;">{{vm.item.type}}</div> | ||
20 | <div class="tb-small" ng-show="vm.isAssignedToCustomer()">{{'device.assignedToCustomer' | translate}} '{{vm.item.assignedCustomer.title}}'</div> | 21 | <div class="tb-small" ng-show="vm.isAssignedToCustomer()">{{'device.assignedToCustomer' | translate}} '{{vm.item.assignedCustomer.title}}'</div> |
21 | <div class="tb-small" ng-show="vm.isPublic()">{{'device.public' | translate}}</div> | 22 | <div class="tb-small" ng-show="vm.isPublic()">{{'device.public' | translate}}</div> |
22 | </div> | 23 | </div> |