Browse Source

Call loadSystemImages on each upgrade

pull/9753/head
ViacheslavKlimov 3 years ago
parent
commit
1db101a9c3
  1. 3
      application/src/main/java/org/thingsboard/server/install/ThingsboardInstallService.java
  2. 4
      application/src/main/java/org/thingsboard/server/service/install/InstallScripts.java

3
application/src/main/java/org/thingsboard/server/install/ThingsboardInstallService.java

@ -282,6 +282,7 @@ public class ThingsboardInstallService {
dataUpdateService.upgradeRuleNodes(); dataUpdateService.upgradeRuleNodes();
systemDataLoaderService.loadSystemWidgets(); systemDataLoaderService.loadSystemWidgets();
installScripts.loadSystemLwm2mResources(); installScripts.loadSystemLwm2mResources();
installScripts.loadSystemImages();
} }
log.info("Upgrade finished successfully!"); log.info("Upgrade finished successfully!");
@ -324,7 +325,7 @@ public class ThingsboardInstallService {
// systemDataLoaderService.loadSystemPlugins(); // systemDataLoaderService.loadSystemPlugins();
// systemDataLoaderService.loadSystemRules(); // systemDataLoaderService.loadSystemRules();
installScripts.loadSystemLwm2mResources(); installScripts.loadSystemLwm2mResources();
installScripts.createSystemImages(); installScripts.loadSystemImages();
if (loadDemo) { if (loadDemo) {
log.info("Loading demo data..."); log.info("Loading demo data...");

4
application/src/main/java/org/thingsboard/server/service/install/InstallScripts.java

@ -304,15 +304,13 @@ public class InstallScripts {
public void updateImages() { public void updateImages() {
imagesUpdater.updateWidgetsBundlesImages(); imagesUpdater.updateWidgetsBundlesImages();
imagesUpdater.updateWidgetTypesImages(); imagesUpdater.updateWidgetTypesImages();
createSystemImages();
imagesUpdater.updateDashboardsImages(); imagesUpdater.updateDashboardsImages();
imagesUpdater.updateDeviceProfilesImages(); imagesUpdater.updateDeviceProfilesImages();
imagesUpdater.updateAssetProfilesImages(); imagesUpdater.updateAssetProfilesImages();
} }
@SneakyThrows @SneakyThrows
public void createSystemImages() { public void loadSystemImages() {
Stream<Path> dashboardsFiles = Files.list(Paths.get(getDataDir(), JSON_DIR, DEMO_DIR, DASHBOARDS_DIR)); Stream<Path> dashboardsFiles = Files.list(Paths.get(getDataDir(), JSON_DIR, DEMO_DIR, DASHBOARDS_DIR));
try (dashboardsFiles) { try (dashboardsFiles) {
dashboardsFiles.forEach(file -> { dashboardsFiles.forEach(file -> {

Loading…
Cancel
Save