Merge branch 'master' into feature/geofencing-cf

This commit is contained in:
dshvaika 2025-08-28 12:56:55 +03:00
commit c9e4904135
15 changed files with 1234 additions and 1436 deletions

View File

@ -18,6 +18,7 @@ package org.thingsboard.server.dao.sql.cf;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.thingsboard.server.common.data.id.CalculatedFieldId; import org.thingsboard.server.common.data.id.CalculatedFieldId;
import org.thingsboard.server.dao.model.sql.CalculatedFieldEntity; import org.thingsboard.server.dao.model.sql.CalculatedFieldEntity;
@ -36,7 +37,10 @@ public interface CalculatedFieldRepository extends JpaRepository<CalculatedField
Page<CalculatedFieldEntity> findAllByTenantId(UUID tenantId, Pageable pageable); Page<CalculatedFieldEntity> findAllByTenantId(UUID tenantId, Pageable pageable);
Page<CalculatedFieldEntity> findAllByTenantIdAndEntityId(UUID tenantId, UUID entityId, Pageable pageable); @Query("SELECT cf FROM CalculatedFieldEntity cf WHERE cf.tenantId = :tenantId " +
"AND cf.entityId = :entityId " +
"AND (:textSearch IS NULL OR ilike(cf.name, CONCAT('%', :textSearch, '%')) = true)")
Page<CalculatedFieldEntity> findAllByTenantIdAndEntityId(UUID tenantId, UUID entityId, String textSearch, Pageable pageable);
List<CalculatedFieldEntity> findAllByTenantId(UUID tenantId); List<CalculatedFieldEntity> findAllByTenantId(UUID tenantId);

View File

@ -85,7 +85,7 @@ public class JpaCalculatedFieldDao extends JpaAbstractDao<CalculatedFieldEntity,
@Override @Override
public PageData<CalculatedField> findAllByEntityId(TenantId tenantId, EntityId entityId, PageLink pageLink) { public PageData<CalculatedField> findAllByEntityId(TenantId tenantId, EntityId entityId, PageLink pageLink) {
log.debug("Try to find calculated fields by entityId[{}] and pageLink [{}]", entityId, pageLink); log.debug("Try to find calculated fields by entityId[{}] and pageLink [{}]", entityId, pageLink);
return DaoUtil.toPageData(calculatedFieldRepository.findAllByTenantIdAndEntityId(tenantId.getId(), entityId.getId(), DaoUtil.toPageable(pageLink))); return DaoUtil.toPageData(calculatedFieldRepository.findAllByTenantIdAndEntityId(tenantId.getId(), entityId.getId(), pageLink.getTextSearch(), DaoUtil.toPageable(pageLink)));
} }
@Override @Override

View File

@ -14,7 +14,7 @@
# limitations under the License. # limitations under the License.
# #
FROM thingsboard/node:20.18.0-bookworm-slim FROM thingsboard/node:22.18.0-bookworm-slim
ENV NODE_ENV production ENV NODE_ENV production
ENV DOCKER_MODE true ENV DOCKER_MODE true

View File

@ -6,20 +6,20 @@
"main": "server.ts", "main": "server.ts",
"bin": "server.js", "bin": "server.js",
"scripts": { "scripts": {
"pkg": "tsc && pkg -t node18-linux-x64,node18-win-x64 --out-path ./target ./target/src && node install.js", "pkg": "tsc && pkg -t node22-linux-x64,node22-win-x64 --out-path ./target ./target/src && node install.js",
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"start": "nodemon --watch '.' --ext 'ts' --exec 'ts-node server.ts'", "start": "nodemon --watch '.' --ext 'ts' --exec 'ts-node server.ts'",
"start-prod": "nodemon --watch '.' --ext 'ts' --exec 'NODE_ENV=production ts-node server.ts'", "start-prod": "nodemon --watch '.' --ext 'ts' --exec 'NODE_ENV=production ts-node server.ts'",
"build": "tsc" "build": "tsc"
}, },
"dependencies": { "dependencies": {
"config": "^3.3.12", "config": "^4.1.1",
"express": "^4.21.1", "express": "^5.1.0",
"js-yaml": "^4.1.0", "js-yaml": "^4.1.0",
"kafkajs": "^2.2.4", "kafkajs": "^2.2.4",
"long": "^5.2.3", "long": "^5.3.2",
"uuid-parse": "^1.1.0", "uuid-parse": "^1.1.0",
"winston": "^3.16.0", "winston": "^3.17.0",
"winston-daily-rotate-file": "^5.0.0" "winston-daily-rotate-file": "^5.0.0"
}, },
"nyc": { "nyc": {
@ -32,14 +32,14 @@
}, },
"devDependencies": { "devDependencies": {
"@types/config": "^3.3.5", "@types/config": "^3.3.5",
"@types/express": "~4.17.21", "@types/express": "~5.0.3",
"@types/node": "~20.17.6", "@types/node": "~22.17.2",
"@types/uuid-parse": "^1.0.2", "@types/uuid-parse": "^1.0.2",
"fs-extra": "^11.2.0", "@yao-pkg/pkg": "^6.6.0",
"nodemon": "^3.1.7", "fs-extra": "^11.3.1",
"pkg": "^5.8.1", "nodemon": "^3.1.10",
"ts-node": "^10.9.2", "ts-node": "^10.9.2",
"typescript": "5.5.4" "typescript": "5.9.2"
}, },
"pkg": { "pkg": {
"assets": [ "assets": [

View File

@ -71,7 +71,7 @@
<goal>install-node-and-yarn</goal> <goal>install-node-and-yarn</goal>
</goals> </goals>
<configuration> <configuration>
<nodeVersion>v20.18.0</nodeVersion> <nodeVersion>v22.18.0</nodeVersion>
<yarnVersion>v1.22.22</yarnVersion> <yarnVersion>v1.22.22</yarnVersion>
</configuration> </configuration>
</execution> </execution>

File diff suppressed because it is too large Load Diff

View File

@ -14,7 +14,7 @@
# limitations under the License. # limitations under the License.
# #
FROM thingsboard/node:20.18.0-bookworm-slim FROM thingsboard/node:22.18.0-bookworm-slim
ENV NODE_ENV production ENV NODE_ENV production
ENV DOCKER_MODE true ENV DOCKER_MODE true

View File

@ -6,21 +6,21 @@
"main": "server.ts", "main": "server.ts",
"bin": "server.js", "bin": "server.js",
"scripts": { "scripts": {
"pkg": "tsc && pkg -t node18-linux-x64,node18-win-x64 --out-path ./target ./target/src && node install.js", "pkg": "tsc && pkg -t node22-linux-x64,node22-win-x64 --out-path ./target ./target/src && node install.js",
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"start": "nodemon --watch '.' --ext 'ts' --exec 'WEB_FOLDER=./target/web ts-node server.ts'", "start": "nodemon --watch '.' --ext 'ts' --exec 'WEB_FOLDER=./target/web ts-node server.ts'",
"start-prod": "nodemon --watch '.' --ext 'ts' --exec 'WEB_FOLDER=./target/web NODE_ENV=production ts-node server.ts'", "start-prod": "nodemon --watch '.' --ext 'ts' --exec 'WEB_FOLDER=./target/web NODE_ENV=production ts-node server.ts'",
"build": "tsc" "build": "tsc"
}, },
"dependencies": { "dependencies": {
"compression": "^1.7.5", "compression": "^1.8.1",
"config": "^3.3.12", "config": "^3.3.12",
"connect-history-api-fallback": "^1.6.0", "connect-history-api-fallback": "1.6.0",
"express": "^4.21.1", "express": "^5.1.0",
"http": "0.0.0", "http": "0.0.0",
"http-proxy": "^1.18.1", "http-proxy": "^1.18.1",
"js-yaml": "^4.1.0", "js-yaml": "^4.1.0",
"winston": "^3.16.0", "winston": "^3.17.0",
"winston-daily-rotate-file": "^5.0.0" "winston-daily-rotate-file": "^5.0.0"
}, },
"nyc": { "nyc": {
@ -32,17 +32,17 @@
] ]
}, },
"devDependencies": { "devDependencies": {
"@types/compression": "^1.7.5", "@types/compression": "^1.8.1",
"@types/config": "^3.3.5", "@types/config": "^3.3.5",
"@types/connect-history-api-fallback": "^1.5.4", "@types/connect-history-api-fallback": "1.5.4",
"@types/express": "~4.17.21", "@types/express": "~5.0.3",
"@types/http-proxy": "^1.17.15", "@types/http-proxy": "^1.17.16",
"@types/node": "~20.17.6", "@types/node": "~22.17.2",
"fs-extra": "^11.2.0", "@yao-pkg/pkg": "^6.6.0",
"nodemon": "^3.1.7", "fs-extra": "^11.3.1",
"pkg": "^5.8.1", "nodemon": "^3.1.10",
"ts-node": "^10.9.2", "ts-node": "^10.9.2",
"typescript": "5.5.4" "typescript": "5.9.2"
}, },
"pkg": { "pkg": {
"assets": [ "assets": [

View File

@ -80,7 +80,7 @@
<goal>install-node-and-yarn</goal> <goal>install-node-and-yarn</goal>
</goals> </goals>
<configuration> <configuration>
<nodeVersion>v20.18.0</nodeVersion> <nodeVersion>v22.18.0</nodeVersion>
<yarnVersion>v1.22.22</yarnVersion> <yarnVersion>v1.22.22</yarnVersion>
</configuration> </configuration>
</execution> </execution>

File diff suppressed because it is too large Load Diff

View File

@ -56,7 +56,7 @@
<goal>install-node-and-yarn</goal> <goal>install-node-and-yarn</goal>
</goals> </goals>
<configuration> <configuration>
<nodeVersion>v20.18.0</nodeVersion> <nodeVersion>v22.18.0</nodeVersion>
<yarnVersion>v1.22.22</yarnVersion> <yarnVersion>v1.22.22</yarnVersion>
</configuration> </configuration>
</execution> </execution>

View File

@ -74,11 +74,12 @@ export class AiConfigComponent extends RuleNodeConfigurationComponent {
} }
} }
protected prepareOutputConfig(configuration: RuleNodeConfiguration): RuleNodeConfiguration { protected prepareOutputConfig(): RuleNodeConfiguration {
const config = this.configForm().getRawValue();
if (!this.aiConfigForm.get('systemPrompt').value) { if (!this.aiConfigForm.get('systemPrompt').value) {
delete configuration.systemPrompt; delete config.systemPrompt;
} }
return deepTrim(configuration); return deepTrim(config);
} }
onEntityChange($event: AiModel) { onEntityChange($event: AiModel) {

View File

@ -56,6 +56,9 @@ export const createTooltip = (map: TbMap<any>,
} }
} }
}); });
layer.on('mousemove', (e) => {
tooltip.setLatLng(e.latlng);
});
layer.on('mouseout', () => { layer.on('mouseout', () => {
tooltip.close(); tooltip.close();
}); });