Browse Source

Configurable branch for gateways dashboard sync

pull/11829/head
ViacheslavKlimov 2 years ago
parent
commit
79db9ea5be
  1. 4
      application/src/main/java/org/thingsboard/server/service/entitiy/dashboard/DashboardSyncService.java
  2. 2
      application/src/main/resources/thingsboard.yml

4
application/src/main/java/org/thingsboard/server/service/entitiy/dashboard/DashboardSyncService.java

@ -50,6 +50,8 @@ public class DashboardSyncService {
private boolean enabled;
@Value("${transport.gateway.dashboard.sync.repository_url:}")
private String repoUrl;
@Value("${transport.gateway.dashboard.sync.branch:main}")
private String branch;
@Value("${transport.gateway.dashboard.sync.fetch_frequency:24}")
private int fetchFrequencyHours;
@ -61,7 +63,7 @@ public class DashboardSyncService {
if (!enabled) {
return;
}
gitSyncService.registerSync(REPO_KEY, repoUrl, "main", TimeUnit.HOURS.toMillis(fetchFrequencyHours), this::update);
gitSyncService.registerSync(REPO_KEY, repoUrl, branch, TimeUnit.HOURS.toMillis(fetchFrequencyHours), this::update);
}
private void update() {

2
application/src/main/resources/thingsboard.yml

@ -1251,6 +1251,8 @@ transport:
enabled: "${TB_GATEWAY_DASHBOARD_SYNC_ENABLED:true}"
# URL of gateways dashboard repository
repository_url: "${TB_GATEWAY_DASHBOARD_SYNC_REPOSITORY_URL:https://github.com/thingsboard/gateway-management-extensions-dist.git}"
# Branch of gateways dashboard repository to work with
branch: "${TB_GATEWAY_DASHBOARD_SYNC_BRANCH:main}"
# Fetch frequency in hours for gateways dashboard repository
fetch_frequency: "${TB_GATEWAY_DASHBOARD_SYNC_FETCH_FREQUENCY:24}"

Loading…
Cancel
Save