Improvement OTA package (#4698)
* Add validation ota package Software hasURL * Fixed show sort URL in OTA Package
This commit is contained in:
parent
f96ea353f6
commit
08e517a6ee
@ -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'),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user