Entity view fixes
This commit is contained in:
parent
5139299fd1
commit
33fc8f0ba5
@ -157,7 +157,7 @@ function EntityViewService($http, $q, $window, userService, attributeService, cu
|
|||||||
var url = '/api/entityView';
|
var url = '/api/entityView';
|
||||||
|
|
||||||
entityView.keys = {};
|
entityView.keys = {};
|
||||||
entityView.keys.timeseries = ['a', 'b'];
|
entityView.keys.timeseries = ['temp'];
|
||||||
|
|
||||||
$http.post(url, entityView).then(function success(response) {
|
$http.post(url, entityView).then(function success(response) {
|
||||||
deferred.resolve(response.data);
|
deferred.resolve(response.data);
|
||||||
|
|||||||
@ -20,8 +20,9 @@ export default angular.module('thingsboard.api.entity', [thingsboardTypes])
|
|||||||
.name;
|
.name;
|
||||||
|
|
||||||
/*@ngInject*/
|
/*@ngInject*/
|
||||||
function EntityService($http, $q, $filter, $translate, $log, userService, deviceService,
|
function EntityService($http, $q, $filter, $translate, $log, userService, deviceService, assetService, tenantService,
|
||||||
assetService, tenantService, customerService, ruleChainService, dashboardService, entityRelationService, attributeService, types, utils) {
|
customerService, ruleChainService, dashboardService, entityRelationService, attributeService,
|
||||||
|
entityViewService, types, utils) {
|
||||||
var service = {
|
var service = {
|
||||||
getEntity: getEntity,
|
getEntity: getEntity,
|
||||||
getEntities: getEntities,
|
getEntities: getEntities,
|
||||||
@ -54,6 +55,9 @@ function EntityService($http, $q, $filter, $translate, $log, userService, device
|
|||||||
case types.entityType.asset:
|
case types.entityType.asset:
|
||||||
promise = assetService.getAsset(entityId, true, config);
|
promise = assetService.getAsset(entityId, true, config);
|
||||||
break;
|
break;
|
||||||
|
case types.entityType.entityView:
|
||||||
|
promise = entityViewService.getEntityView(entityId, true, config);
|
||||||
|
break;
|
||||||
case types.entityType.tenant:
|
case types.entityType.tenant:
|
||||||
promise = tenantService.getTenant(entityId, config);
|
promise = tenantService.getTenant(entityId, config);
|
||||||
break;
|
break;
|
||||||
@ -239,6 +243,13 @@ function EntityService($http, $q, $filter, $translate, $log, userService, device
|
|||||||
promise = assetService.getTenantAssets(pageLink, false, config, subType);
|
promise = assetService.getTenantAssets(pageLink, false, config, subType);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case types.entityType.entityView:
|
||||||
|
if (user.authority === 'CUSTOMER_USER') {
|
||||||
|
promise = entityViewService.getCustomerEntityViews(customerId, pageLink, false, config, subType);
|
||||||
|
} else {
|
||||||
|
promise = entityViewService.getTenantEntityViews(pageLink, false, config, subType);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case types.entityType.tenant:
|
case types.entityType.tenant:
|
||||||
if (user.authority === 'TENANT_ADMIN') {
|
if (user.authority === 'TENANT_ADMIN') {
|
||||||
promise = getSingleTenantByPageLinkPromise(pageLink, config);
|
promise = getSingleTenantByPageLinkPromise(pageLink, config);
|
||||||
@ -725,6 +736,7 @@ function EntityService($http, $q, $filter, $translate, $log, userService, device
|
|||||||
case 'TENANT_ADMIN':
|
case 'TENANT_ADMIN':
|
||||||
entityTypes.device = types.entityType.device;
|
entityTypes.device = types.entityType.device;
|
||||||
entityTypes.asset = types.entityType.asset;
|
entityTypes.asset = types.entityType.asset;
|
||||||
|
entityTypes.entityView = types.entityType.entityView;
|
||||||
entityTypes.tenant = types.entityType.tenant;
|
entityTypes.tenant = types.entityType.tenant;
|
||||||
entityTypes.customer = types.entityType.customer;
|
entityTypes.customer = types.entityType.customer;
|
||||||
entityTypes.dashboard = types.entityType.dashboard;
|
entityTypes.dashboard = types.entityType.dashboard;
|
||||||
@ -735,6 +747,7 @@ function EntityService($http, $q, $filter, $translate, $log, userService, device
|
|||||||
case 'CUSTOMER_USER':
|
case 'CUSTOMER_USER':
|
||||||
entityTypes.device = types.entityType.device;
|
entityTypes.device = types.entityType.device;
|
||||||
entityTypes.asset = types.entityType.asset;
|
entityTypes.asset = types.entityType.asset;
|
||||||
|
entityTypes.entityView = types.entityType.entityView;
|
||||||
entityTypes.customer = types.entityType.customer;
|
entityTypes.customer = types.entityType.customer;
|
||||||
entityTypes.dashboard = types.entityType.dashboard;
|
entityTypes.dashboard = types.entityType.dashboard;
|
||||||
if (useAliasEntityTypes) {
|
if (useAliasEntityTypes) {
|
||||||
|
|||||||
@ -346,6 +346,12 @@ export default angular.module('thingsboard.types', [])
|
|||||||
list: 'entity.list-of-assets',
|
list: 'entity.list-of-assets',
|
||||||
nameStartsWith: 'entity.asset-name-starts-with'
|
nameStartsWith: 'entity.asset-name-starts-with'
|
||||||
},
|
},
|
||||||
|
"ENTITY_VIEW": {
|
||||||
|
type: 'entity.type-entity-view',
|
||||||
|
typePlural: 'entity.type-entity-views',
|
||||||
|
list: 'entity.list-of-entity-views',
|
||||||
|
nameStartsWith: 'entity.entity-view-name-starts-with'
|
||||||
|
},
|
||||||
"TENANT": {
|
"TENANT": {
|
||||||
type: 'entity.type-tenant',
|
type: 'entity.type-tenant',
|
||||||
typePlural: 'entity.type-tenants',
|
typePlural: 'entity.type-tenants',
|
||||||
|
|||||||
@ -47,8 +47,8 @@ export default function EntityViewDirective($compile, $templateCache, $filter, t
|
|||||||
scope.isPublic = false;
|
scope.isPublic = false;
|
||||||
scope.assignedCustomer = null;
|
scope.assignedCustomer = null;
|
||||||
}
|
}
|
||||||
scope.startTs = $filter('date')(scope.entityView.endTs, 'yyyy-MM-dd HH:mm:ss');
|
scope.startTs = new Date(scope.entityView.startTs);
|
||||||
scope.endTs = $filter('date')(scope.entityView.startTs, 'yyyy-MM-dd HH:mm:ss');
|
scope.endTs = new Date(scope.entityView.endTs);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -131,6 +131,12 @@ export default function EntityAutocomplete($compile, $templateCache, $q, $filter
|
|||||||
scope.noEntitiesMatchingText = 'device.no-devices-matching';
|
scope.noEntitiesMatchingText = 'device.no-devices-matching';
|
||||||
scope.entityRequiredText = 'device.device-required';
|
scope.entityRequiredText = 'device.device-required';
|
||||||
break;
|
break;
|
||||||
|
case types.entityType.entityView:
|
||||||
|
scope.selectEntityText = 'entity-view.select-entity-view';
|
||||||
|
scope.entityText = 'entity-view.entity-view';
|
||||||
|
scope.noEntitiesMatchingText = 'entity-view.no-entity-views-matching';
|
||||||
|
scope.entityRequiredText = 'entity-view.entity-view-required';
|
||||||
|
break;
|
||||||
case types.entityType.rulechain:
|
case types.entityType.rulechain:
|
||||||
scope.selectEntityText = 'rulechain.select-rulechain';
|
scope.selectEntityText = 'rulechain.select-rulechain';
|
||||||
scope.entityText = 'rulechain.rulechain';
|
scope.entityText = 'rulechain.rulechain';
|
||||||
|
|||||||
@ -708,6 +708,10 @@
|
|||||||
"type-assets": "Assets",
|
"type-assets": "Assets",
|
||||||
"list-of-assets": "{ count, plural, 1 {One asset} other {List of # assets} }",
|
"list-of-assets": "{ count, plural, 1 {One asset} other {List of # assets} }",
|
||||||
"asset-name-starts-with": "Assets whose names start with '{{prefix}}'",
|
"asset-name-starts-with": "Assets whose names start with '{{prefix}}'",
|
||||||
|
"type-entity-view": "Entity View",
|
||||||
|
"type-entity-views": "Entity Views",
|
||||||
|
"list-of-entity-views": "{ count, plural, 1 {One entity view} other {List of # entity views} }",
|
||||||
|
"entity-view-name-starts-with": "Entity Views whose names start with '{{prefix}}'",
|
||||||
"type-rule": "Rule",
|
"type-rule": "Rule",
|
||||||
"type-rules": "Rules",
|
"type-rules": "Rules",
|
||||||
"list-of-rules": "{ count, plural, 1 {One rule} other {List of # rules} }",
|
"list-of-rules": "{ count, plural, 1 {One rule} other {List of # rules} }",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user