ota-update.warning-after-save-no-edit
- Upload binary file
- Use external URL
+ {{ "ota-update.upload-binary-file" | translate }}
+ {{ "ota-update.use-external-url" | translate }}
diff --git a/ui-ngx/src/app/modules/home/pages/ota-update/ota-update.component.ts b/ui-ngx/src/app/modules/home/pages/ota-update/ota-update.component.ts
index 9fd51302e1..7ea9ef2e3b 100644
--- a/ui-ngx/src/app/modules/home/pages/ota-update/ota-update.component.ts
+++ b/ui-ngx/src/app/modules/home/pages/ota-update/ota-update.component.ts
@@ -15,7 +15,7 @@
///
import { Component, Inject, OnDestroy, OnInit } from '@angular/core';
-import { Subject } from 'rxjs';
+import { combineLatest, Subject } from 'rxjs';
import { Store } from '@ngrx/store';
import { AppState } from '@core/core.state';
import { TranslateService } from '@ngx-translate/core';
@@ -30,7 +30,7 @@ import {
OtaUpdateTypeTranslationMap
} from '@shared/models/ota-package.models';
import { ActionNotificationShow } from '@core/notification/notification.actions';
-import { filter, takeUntil } from 'rxjs/operators';
+import { filter, startWith, takeUntil } from 'rxjs/operators';
import { isNotEmptyStr } from '@core/utils';
@Component({
@@ -56,22 +56,33 @@ export class OtaUpdateComponent extends EntityComponent implements O
ngOnInit() {
super.ngOnInit();
- this.entityForm.get('isURL').valueChanges.pipe(
- filter(() => this.isAdd),
- takeUntil(this.destroy$)
- ).subscribe((isURL) => {
- if (isURL === false) {
- this.entityForm.get('url').clearValidators();
- this.entityForm.get('file').setValidators(Validators.required);
- this.entityForm.get('url').updateValueAndValidity({emitEvent: false});
- this.entityForm.get('file').updateValueAndValidity({emitEvent: false});
- } else {
- this.entityForm.get('file').clearValidators();
- this.entityForm.get('url').setValidators([Validators.required, Validators.pattern('(.|\\s)*\\S(.|\\s)*')]);
- this.entityForm.get('file').updateValueAndValidity({emitEvent: false});
- this.entityForm.get('url').updateValueAndValidity({emitEvent: false});
- }
- });
+ if (this.isAdd) {
+ this.entityForm.get('isURL').valueChanges.pipe(
+ takeUntil(this.destroy$)
+ ).subscribe((isURL) => {
+ if (isURL === false) {
+ this.entityForm.get('url').clearValidators();
+ this.entityForm.get('file').setValidators(Validators.required);
+ this.entityForm.get('url').updateValueAndValidity({emitEvent: false});
+ this.entityForm.get('file').updateValueAndValidity({emitEvent: false});
+ } else {
+ this.entityForm.get('file').clearValidators();
+ this.entityForm.get('url').setValidators([Validators.required, Validators.pattern('(.|\\s)*\\S(.|\\s)*')]);
+ this.entityForm.get('file').updateValueAndValidity({emitEvent: false});
+ this.entityForm.get('url').updateValueAndValidity({emitEvent: false});
+ }
+ });
+ combineLatest([
+ this.entityForm.get('title').valueChanges.pipe(startWith('')),
+ this.entityForm.get('version').valueChanges.pipe(startWith(''))
+ ]).pipe(
+ filter(() => this.entityForm.get('tag').pristine),
+ takeUntil(this.destroy$)
+ ).subscribe(([title, version]) => {
+ const tag = (`${title} ${version}`).trim();
+ this.entityForm.get('tag').patchValue(tag);
+ });
+ }
}
ngOnDestroy() {
@@ -92,6 +103,7 @@ export class OtaUpdateComponent extends EntityComponent implements O
const form = this.fb.group({
title: [entity ? entity.title : '', [Validators.required, Validators.maxLength(255)]],
version: [entity ? entity.version : '', [Validators.required, Validators.maxLength(255)]],
+ tag: [entity ? entity.tag : '', [Validators.maxLength(255)]],
type: [entity?.type ? entity.type : OtaUpdateType.FIRMWARE, Validators.required],
deviceProfileId: [entity ? entity.deviceProfileId : null, Validators.required],
checksumAlgorithm: [entity && entity.checksumAlgorithm ? entity.checksumAlgorithm : ChecksumAlgorithm.SHA256],
@@ -119,6 +131,7 @@ export class OtaUpdateComponent extends EntityComponent implements O
this.entityForm.patchValue({
title: entity.title,
version: entity.version,
+ tag: entity.tag,
type: entity.type,
deviceProfileId: entity.deviceProfileId,
checksumAlgorithm: entity.checksumAlgorithm,
diff --git a/ui-ngx/src/app/shared/models/ota-package.models.ts b/ui-ngx/src/app/shared/models/ota-package.models.ts
index a27330235a..f91664612a 100644
--- a/ui-ngx/src/app/shared/models/ota-package.models.ts
+++ b/ui-ngx/src/app/shared/models/ota-package.models.ts
@@ -91,6 +91,7 @@ export interface OtaPackageInfo extends BaseData {
deviceProfileId?: DeviceProfileId;
title?: string;
version?: string;
+ tag?: string;
hasData?: boolean;
url?: string;
fileName: string;
diff --git a/ui-ngx/src/assets/locale/locale.constant-cs_CZ.json b/ui-ngx/src/assets/locale/locale.constant-cs_CZ.json
index 35892cfede..3b96068406 100644
--- a/ui-ngx/src/assets/locale/locale.constant-cs_CZ.json
+++ b/ui-ngx/src/assets/locale/locale.constant-cs_CZ.json
@@ -1236,14 +1236,12 @@
"object-list": "SEznam objektů",
"object-list-empty": "Žádné objekty nebyly vybrány.",
"no-objects-matching": "Žádné objekty odpovídající '{{object}}' nebyly nalezeny.",
- "valid-id-instance-no-min": "Instance číslo '{{instance}}' nebyla validována. Mininimální hodnota='{{min}}'",
- "valid-id-instance-no-max": "Instance číslo '{{instance}}' nebyla validována. Maximální hodnota='{{max}}'",
- "valid-id-instance": "Instance číslo '{{instance}}' nebyla validována. { count, plural, 1 {Maximální hodnota='{{max}}'} 2 {Minimální hodnota='{{min}}'} other {Musí být pouze číslo} }",
"model-tab": "LWM2M model",
"add-new-instances": "Přidat nové instance",
"instances-list": "Seznam instancí",
- "instances-input": "Vstupní hodnota Id instance",
- "instances-input-holder": "Vstupní číslo instance...",
+ "instances-list-required": "Seznam instancí je povinný",
+ "instance-id-pattern": "Instance číslo musí být kladné číslo.",
+ "instance-id-max": "Maximální instance číslo hodnota {{max}}.",
"instance": "Instance",
"resource-label": "Název zdroje #ID",
"observe-label": "Pozorování",
@@ -1266,7 +1264,6 @@
"view-attribute": "Zobrazit atribut",
"remove-attribute": "Odebrat atribut",
"mode": "Režim konfigurace bezpečnosti",
- "pattern_hex_dec": "{ count, plural, 0 {musí být v hexadecimálním formátu} other {musí být # znaků} }",
"servers": "Servery",
"short-id": "Krátké ID",
"short-id-required": "Krátké ID je povinné.",
@@ -1316,8 +1313,8 @@
"others-tab": "Ostatní nastavení",
"client-strategy": "Strategie klienta při připojování",
"client-strategy-label": "Strategie",
- "client-strategy-connect": "{ count, plural, 1 {1: Klientovi je odeslán pouze observe požadavek po úvodním spojení} other {2: Načti všechny zdroje a observer požadavky na klienta po registraci} }",
- "client-strategy-tip": "{ count, plural, 1 {Strategie 1: Po úvodním spojení LWM2M klienta, server odešle požadavek Observe zdrojů klientovi, přičemž tyto zdroje existující na straně LWM2M klienta jsou v profilu zařízení označeny jako pozorování.} other {Strategie 2: Po registraci, je klientovi odeslán požadavek na načtení hodnotu všech zdrojů všech objektů, které LWM2M klient má,\n poté: server odešle požadavek observe zdrojů klientovi, přičemž tyto zdroje existující na straně klienta, jsou v profilu zařízení označeny jako pozorování.} }",
+ "client-strategy-only-observe": "Klientovi je odeslán pouze observe požadavek po úvodním spojení",
+ "client-strategy-read-all": "Načti všechny zdroje a observer požadavky na klienta po registraci",
"fw-update": "Aktualizace firmware",
"fw-update-strategy": "Strategie aktualizace firmware",
"fw-update-strategy-data": "Odeslat (push) aktualizaci firmware jako binární soubor pomocí Object 19 a Resource 0 (Data)",
diff --git a/ui-ngx/src/assets/locale/locale.constant-en_US.json b/ui-ngx/src/assets/locale/locale.constant-en_US.json
index c7c9a8302e..5ba2d2c808 100644
--- a/ui-ngx/src/assets/locale/locale.constant-en_US.json
+++ b/ui-ngx/src/assets/locale/locale.constant-en_US.json
@@ -1273,7 +1273,6 @@
"view-attribute": "View attribute",
"remove-attribute": "Remove attribute",
"mode": "Security config mode",
- "pattern_hex_dec": "{ count, plural, 0 {must be hex decimal format} other {must be # characters} }",
"servers": "Servers",
"short-id": "Short ID",
"short-id-required": "Short ID is required.",
@@ -1323,8 +1322,8 @@
"others-tab": "Other settings",
"client-strategy": "Client strategy when connecting",
"client-strategy-label": "Strategy",
- "client-strategy-connect": "{ count, plural, 1 {1: Only Observe Request to the client after the initial connection} other {2: Read All Resources & Observe Request to the client after registration} }",
- "client-strategy-tip": "{ count, plural, 1 {Strategy 1: After the initial connection of the LWM2M Client, the server sends Observe resources Request to the client, those resources that are marked as observation in the Device profile and which exist on the LWM2M client.} other {Strategy 2: After the registration, request the client to read all the resource values for all objects that the LWM2M client has,\n then execute: the server sends Observe resources Request to the client, those resources that are marked as observation in the Device profile and which exist on the LWM2M client.} }",
+ "client-strategy-only-observe": "Only Observe Request to the client after the initial connection",
+ "client-strategy-read-all": "Read All Resources & Observe Request to the client after registration",
"fw-update": "Firmware update",
"fw-update-strategy": "Firmware update strategy",
"fw-update-strategy-data": "Push firmware update as binary file using Object 19 and Resource 0 (Data)",
@@ -2342,8 +2341,12 @@
"firmware": "Firmware",
"software": "Software"
},
+ "upload-binary-file": "Upload binary file",
+ "use-external-url": "Use external URL",
"version": "Version",
"version-required": "Version is required.",
+ "version-tag": "Version Tag",
+ "version-tag-hint": "Custom tag should match the package version reported by your device.",
"warning-after-save-no-edit": "Once the package is uploaded, you will not be able to modify title, version, device profile and package type."
},
"position": {
diff --git a/ui-ngx/yarn.lock b/ui-ngx/yarn.lock
index 1927f2e80b..3038f57bab 100644
--- a/ui-ngx/yarn.lock
+++ b/ui-ngx/yarn.lock
@@ -2774,7 +2774,25 @@ browserstack@^1.5.1:
dependencies:
https-proxy-agent "^2.2.1"
-buffer-from@^1.0.0:
+buffer-alloc-unsafe@^1.1.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0"
+ integrity sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==
+
+buffer-alloc@^1.2.0:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/buffer-alloc/-/buffer-alloc-1.2.0.tgz#890dd90d923a873e08e10e5fd51a57e5b7cce0ec"
+ integrity sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==
+ dependencies:
+ buffer-alloc-unsafe "^1.1.0"
+ buffer-fill "^1.0.0"
+
+buffer-fill@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c"
+ integrity sha1-+PeLdniYiO858gXNY39o5wISKyw=
+
+buffer-from@^1.0.0, buffer-from@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef"
integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==
@@ -2798,7 +2816,7 @@ buffer@^4.3.0:
ieee754 "^1.1.4"
isarray "^1.0.0"
-buffer@^5.5.0:
+buffer@^5.4.3, buffer@^5.5.0:
version "5.7.1"
resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0"
integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==
@@ -3953,6 +3971,11 @@ diffie-hellman@^5.0.0:
miller-rabin "^4.0.0"
randombytes "^2.0.0"
+dijkstrajs@^1.0.1:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/dijkstrajs/-/dijkstrajs-1.0.2.tgz#2e48c0d3b825462afe75ab4ad5e829c8ece36257"
+ integrity sha512-QV6PMaHTCNmKSeP6QoXhVTw9snc9VD8MulTT0Bd99Pacp4SS1cjcrYPgBPmibqKVtMJJfqC6XvOXgPMEEPH/fg==
+
dir-glob@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f"
@@ -5670,6 +5693,11 @@ isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0:
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=
+isarray@^2.0.1:
+ version "2.0.5"
+ resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723"
+ integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==
+
isbinaryfile@^4.0.6:
version "4.0.6"
resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-4.0.6.tgz#edcb62b224e2b4710830b67498c8e4e5a4d2610b"
@@ -7503,6 +7531,11 @@ pkg-dir@^4.1.0:
dependencies:
find-up "^4.0.0"
+pngjs@^3.3.0:
+ version "3.4.0"
+ resolved "https://registry.yarnpkg.com/pngjs/-/pngjs-3.4.0.tgz#99ca7d725965fb655814eaf65f38f12bbdbf555f"
+ integrity sha512-NCrCHhWmnQklfH4MtJMRjZ2a8c80qXeMlQMv2uVp9ISJMTt562SbGd6n2oq0PaPgKm7Z6pL9E2UlLIhC+SHL3w==
+
pnp-webpack-plugin@1.6.4:
version "1.6.4"
resolved "https://registry.yarnpkg.com/pnp-webpack-plugin/-/pnp-webpack-plugin-1.6.4.tgz#c9711ac4dc48a685dabafc86f8b6dd9f8df84149"
@@ -8007,6 +8040,19 @@ qjobs@^1.2.0:
resolved "https://registry.yarnpkg.com/qjobs/-/qjobs-1.2.0.tgz#c45e9c61800bd087ef88d7e256423bdd49e5d071"
integrity sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg==
+qrcode@^1.4.4:
+ version "1.4.4"
+ resolved "https://registry.yarnpkg.com/qrcode/-/qrcode-1.4.4.tgz#f0c43568a7e7510a55efc3b88d9602f71963ea83"
+ integrity sha512-oLzEC5+NKFou9P0bMj5+v6Z40evexeE29Z9cummZXZ9QXyMr3lphkURzxjXgPJC5azpxcshoDWV1xE46z+/c3Q==
+ dependencies:
+ buffer "^5.4.3"
+ buffer-alloc "^1.2.0"
+ buffer-from "^1.1.1"
+ dijkstrajs "^1.0.1"
+ isarray "^2.0.1"
+ pngjs "^3.3.0"
+ yargs "^13.2.4"
+
qs@6.7.0:
version "6.7.0"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc"
@@ -10389,7 +10435,7 @@ yargs-parser@^20.2.2:
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.7.tgz#61df85c113edfb5a7a4e36eb8aa60ef423cbc90a"
integrity sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw==
-yargs@^13.3.2:
+yargs@^13.2.4, yargs@^13.3.2:
version "13.3.2"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.2.tgz#ad7ffefec1aa59565ac915f82dccb38a9c31a2dd"
integrity sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==