|
|
|
@ -18,6 +18,7 @@ package org.thingsboard.server.service.entitiy.dashboard; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.thingsboard.server.common.data.ResourceType; |
|
|
|
import org.thingsboard.server.common.data.id.TenantId; |
|
|
|
@ -39,6 +40,7 @@ import java.util.stream.Stream; |
|
|
|
@TbCoreComponent |
|
|
|
@RequiredArgsConstructor |
|
|
|
@Slf4j |
|
|
|
@ConditionalOnProperty(value = "transport.gateway.dashboard.sync.enabled", havingValue = "true") |
|
|
|
public class DashboardSyncService { |
|
|
|
|
|
|
|
private final GitSyncService gitSyncService; |
|
|
|
@ -46,8 +48,6 @@ public class DashboardSyncService { |
|
|
|
private final WidgetsBundleService widgetsBundleService; |
|
|
|
private final PartitionService partitionService; |
|
|
|
|
|
|
|
@Value("${transport.gateway.dashboard.sync.enabled:true}") |
|
|
|
private boolean enabled; |
|
|
|
@Value("${transport.gateway.dashboard.sync.repository_url:}") |
|
|
|
private String repoUrl; |
|
|
|
@Value("${transport.gateway.dashboard.sync.branch:main}") |
|
|
|
@ -60,9 +60,6 @@ public class DashboardSyncService { |
|
|
|
|
|
|
|
@AfterStartUp(order = AfterStartUp.REGULAR_SERVICE) |
|
|
|
public void init() throws Exception { |
|
|
|
if (!enabled) { |
|
|
|
return; |
|
|
|
} |
|
|
|
gitSyncService.registerSync(REPO_KEY, repoUrl, branch, TimeUnit.HOURS.toMillis(fetchFrequencyHours), this::update); |
|
|
|
} |
|
|
|
|
|
|
|
|