Browse Source
Improvement OTA package (#4698)
* Add validation ota package Software hasURL
* Fixed show sort URL in OTA Package
pull/4705/head
Vladyslav
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
3 additions and
3 deletions
-
dao/src/main/java/org/thingsboard/server/dao/device/DeviceProfileServiceImpl.java
-
dao/src/main/java/org/thingsboard/server/dao/device/DeviceServiceImpl.java
-
ui-ngx/src/app/modules/home/pages/ota-update/ota-update-table-config.resolve.ts
|
|
|
@ -450,7 +450,7 @@ public class DeviceProfileServiceImpl extends AbstractEntityService implements D |
|
|
|
if (!software.getType().equals(OtaPackageType.SOFTWARE)) { |
|
|
|
throw new DataValidationException("Can't assign software with type: " + software.getType()); |
|
|
|
} |
|
|
|
if (software.getData() == null) { |
|
|
|
if (software.getData() == null && !software.hasUrl()) { |
|
|
|
throw new DataValidationException("Can't assign software with empty data!"); |
|
|
|
} |
|
|
|
if (!software.getDeviceProfileId().equals(deviceProfile.getId())) { |
|
|
|
|
|
|
|
@ -732,7 +732,7 @@ public class DeviceServiceImpl extends AbstractEntityService implements DeviceSe |
|
|
|
if (!software.getType().equals(OtaPackageType.SOFTWARE)) { |
|
|
|
throw new DataValidationException("Can't assign software with type: " + software.getType()); |
|
|
|
} |
|
|
|
if (software.getData() == null) { |
|
|
|
if (software.getData() == null && !software.hasUrl()) { |
|
|
|
throw new DataValidationException("Can't assign software with empty data!"); |
|
|
|
} |
|
|
|
if (!software.getDeviceProfileId().equals(device.getDeviceProfileId())) { |
|
|
|
|
|
|
|
@ -65,7 +65,7 @@ export class OtaUpdateTableConfigResolve implements Resolve<EntityTableConfig<Ot |
|
|
|
return this.translate.instant(OtaUpdateTypeTranslationMap.get(entity.type)); |
|
|
|
}), |
|
|
|
new EntityTableColumn<OtaPackageInfo>('url', 'ota-update.direct-url', '20%', entity => { |
|
|
|
return entity.url && entity.url.length > 20 ? `${entity.url.slice(0, 20)}…` : ''; |
|
|
|
return entity.url ? (entity.url.length > 20 ? `${entity.url.slice(0, 20)}…` : entity.url) : ''; |
|
|
|
}, () => ({}), true, () => ({}), () => undefined, false, |
|
|
|
{ |
|
|
|
name: this.translate.instant('ota-update.copy-direct-url'), |
|
|
|
|