From bf3a88752c3905603fe3b61ebb5eaa0015b4065e Mon Sep 17 00:00:00 2001 From: YevhenBondarenko Date: Fri, 10 Sep 2021 19:41:52 +0300 Subject: [PATCH 1/6] LwM2M X509 credentials improvements --- .../server/dao/device/DeviceCredentialsServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dao/src/main/java/org/thingsboard/server/dao/device/DeviceCredentialsServiceImpl.java b/dao/src/main/java/org/thingsboard/server/dao/device/DeviceCredentialsServiceImpl.java index f62d25dcec..47af5df8fe 100644 --- a/dao/src/main/java/org/thingsboard/server/dao/device/DeviceCredentialsServiceImpl.java +++ b/dao/src/main/java/org/thingsboard/server/dao/device/DeviceCredentialsServiceImpl.java @@ -272,7 +272,7 @@ public class DeviceCredentialsServiceImpl extends AbstractEntityService implemen break; case X509: X509ClientCredentials x509CCredentials = (X509ClientCredentials) clientCredentials; - if (x509CCredentials.getCert() != null) { + if (StringUtils.isNotEmpty(x509CCredentials.getCert())) { try { SecurityUtil.certificate.decode(Base64.decodeBase64(x509CCredentials.getCert())); } catch (Exception e) { From 6b7c95c0405d33a72eeebcb4bdde756d548b683e Mon Sep 17 00:00:00 2001 From: Vladyslav Prykhodko Date: Mon, 13 Sep 2021 08:54:31 +0300 Subject: [PATCH 2/6] UI: Fixed - widgets showed two errors at the same time. --- .../widget/lib/multiple-input-widget.component.html | 2 +- .../widget/lib/multiple-input-widget.component.ts | 4 +++- .../home/components/widget/lib/qrcode-widget.component.html | 6 ++++-- .../home/components/widget/lib/qrcode-widget.component.ts | 4 ++++ .../home/components/widget/lib/rpc/switch.component.scss | 3 +++ 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/multiple-input-widget.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/multiple-input-widget.component.html index 5dc5bc4be2..65db045157 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/multiple-input-widget.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/lib/multiple-input-widget.component.html @@ -122,7 +122,7 @@
+ *ngIf="(!entityDetected || !isAllParametersValid) && datasourceDetected">
{{ 'widgets.input-widgets.no-entity-selected' | translate }}
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/multiple-input-widget.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/multiple-input-widget.component.ts index 5ba5651511..def6404ffc 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/multiple-input-widget.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/multiple-input-widget.component.ts @@ -117,6 +117,7 @@ export class MultipleInputWidgetComponent extends PageComponent implements OnIni resetButtonLabel: string; entityDetected = false; + datasourceDetected = false; isAllParametersValid = true; multipleInputFormGroup: FormGroup; @@ -203,7 +204,8 @@ export class MultipleInputWidgetComponent extends PageComponent implements OnIni } private updateDatasources() { - if (this.datasources && this.datasources.length) { + this.datasourceDetected = this.datasources?.length !== 0; + if (this.datasourceDetected) { this.entityDetected = true; let keyIndex = 0; this.datasources.forEach((datasource) => { diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/qrcode-widget.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/qrcode-widget.component.html index 6423bf33ce..48f888340a 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/qrcode-widget.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/lib/qrcode-widget.component.html @@ -17,6 +17,8 @@ -->
-
entity.no-data
-
widgets.invalid-qr-code-text
+
+
entity.no-data
+
widgets.invalid-qr-code-text
+
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/qrcode-widget.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/qrcode-widget.component.ts index dff51a1378..a7c2c46911 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/qrcode-widget.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/qrcode-widget.component.ts @@ -54,6 +54,7 @@ export class QrCodeWidgetComponent extends PageComponent implements OnInit, Afte qrCodeText: string; invalidQrCodeText = false; + datasourceDetected = false; private viewInited: boolean; private scheduleUpdateCanvas: boolean; @@ -95,6 +96,8 @@ export class QrCodeWidgetComponent extends PageComponent implements OnInit, Afte data: [] } ]; + } else { + this.datasourceDetected = false; } if (initialData) { const data = parseData(initialData); @@ -103,6 +106,7 @@ export class QrCodeWidgetComponent extends PageComponent implements OnInit, Afte safeExecute(this.qrCodeTextFunction, [dataSourceData]) : this.settings.qrCodeTextPattern; const replaceInfo = processPattern(pattern, dataSourceData); qrCodeText = fillPattern(pattern, replaceInfo, dataSourceData); + this.datasourceDetected = true; } this.updateQrCodeText(qrCodeText); } diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/rpc/switch.component.scss b/ui-ngx/src/app/modules/home/components/widget/lib/rpc/switch.component.scss index d5f5e2be56..293246c79e 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/rpc/switch.component.scss +++ b/ui-ngx/src/app/modules/home/components/widget/lib/rpc/switch.component.scss @@ -45,6 +45,7 @@ $error-height: 14px !default; font-weight: 500; color: #757575; white-space: nowrap; + z-index: 1; .off-label { color: #b7b5b5; @@ -86,6 +87,8 @@ $error-height: 14px !default; :host ::ng-deep { .tb-switch { .switch { + z-index: 1; + mat-slide-toggle { position: absolute; top: 0; From cb03cf7450bdba191fc7d6c1a70c890f59b0cb19 Mon Sep 17 00:00:00 2001 From: Andrii Shvaika Date: Mon, 13 Sep 2021 14:39:44 +0300 Subject: [PATCH 3/6] DNS cache TTL set to 60 seconds --- msa/tb-node/docker/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/msa/tb-node/docker/Dockerfile b/msa/tb-node/docker/Dockerfile index 21babfdfbf..51618675bb 100644 --- a/msa/tb-node/docker/Dockerfile +++ b/msa/tb-node/docker/Dockerfile @@ -16,6 +16,8 @@ FROM thingsboard/openjdk11 +RUN echo 'networkaddress.cache.ttl=60' >> /etc/java-11-openjdk/security/java.security + COPY start-tb-node.sh ${pkg.name}.deb /tmp/ RUN chmod a+x /tmp/*.sh \ From 24446376bcd5e96b98906d58c2ac30980ba183b6 Mon Sep 17 00:00:00 2001 From: Vladyslav_Prykhodko Date: Wed, 15 Sep 2021 11:07:51 +0300 Subject: [PATCH 4/6] UI: Fixed not updating data in Timeseries table in full screen mode --- .../lib/timeseries-table-widget.component.ts | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/timeseries-table-widget.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/timeseries-table-widget.component.ts index 3f36769baf..94efa03663 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/timeseries-table-widget.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/timeseries-table-widget.component.ts @@ -19,7 +19,6 @@ import { Component, ElementRef, Input, - NgZone, OnInit, QueryList, ViewChild, @@ -59,7 +58,8 @@ import { getCellStyleInfo, getRowStyleInfo, RowStyleInfo, - TableWidgetDataKeySettings, TableWidgetSettings + TableWidgetDataKeySettings, + TableWidgetSettings } from '@home/components/widget/lib/table-widget.models'; import { Overlay } from '@angular/cdk/overlay'; import { SubscriptionEntityInfo } from '@core/api/widget-api.models'; @@ -151,7 +151,6 @@ export class TimeseriesTableWidgetComponent extends PageComponent implements OnI constructor(protected store: Store, private elementRef: ElementRef, - private ngZone: NgZone, private overlay: Overlay, private viewContainerRef: ViewContainerRef, private utils: UtilsService, @@ -199,6 +198,7 @@ export class TimeseriesTableWidgetComponent extends PageComponent implements OnI public onDataUpdated() { this.updateCurrentSourceData(); this.clearCache(); + this.ctx.detectChanges(); } private initialize() { @@ -291,7 +291,7 @@ export class TimeseriesTableWidgetComponent extends PageComponent implements OnI if (this.actionCellDescriptors.length) { source.displayedColumns.push('actions'); } - const tsDatasource = new TimeseriesDatasource(source, this.hideEmptyLines, this.dateFormatFilter, this.datePipe, this.ngZone); + const tsDatasource = new TimeseriesDatasource(source, this.hideEmptyLines, this.dateFormatFilter, this.datePipe); tsDatasource.dataUpdated(this.data); this.sources.push(source); } @@ -574,8 +574,7 @@ class TimeseriesDatasource implements DataSource { private source: TimeseriesTableSource, private hideEmptyLines: boolean, private dateFormatFilter: string, - private datePipe: DatePipe, - private ngZone: NgZone + private datePipe: DatePipe ) { this.source.timeseriesDatasource = this; } @@ -598,10 +597,8 @@ class TimeseriesDatasource implements DataSource { catchError(() => of(emptyPageData())), ).subscribe( (pageData) => { - this.ngZone.run(() => { - this.rowsSubject.next(pageData.data); - this.pageDataSubject.next(pageData); - }); + this.rowsSubject.next(pageData.data); + this.pageDataSubject.next(pageData); } ); } From eb2065a5539a95e82e5defa6616e1e4d4825cb23 Mon Sep 17 00:00:00 2001 From: Igor Kulikov Date: Wed, 15 Sep 2021 14:11:06 +0300 Subject: [PATCH 5/6] Fix markdown widget height --- .../home/components/widget/lib/markdown-widget.component.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/markdown-widget.component.scss b/ui-ngx/src/app/modules/home/components/widget/lib/markdown-widget.component.scss index bea3ee1509..4ac6bf9095 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/markdown-widget.component.scss +++ b/ui-ngx/src/app/modules/home/components/widget/lib/markdown-widget.component.scss @@ -16,6 +16,7 @@ .tb-markdown-view { display: block; + height: 100%; ::ng-deep { h1 { font-size: 32px; From 547055bb4e38cd8d5a33db300da3cc6c9e716d87 Mon Sep 17 00:00:00 2001 From: Vladyslav_Prykhodko Date: Thu, 16 Sep 2021 11:47:00 +0300 Subject: [PATCH 6/6] UI: Fixed not updated data for timeseries widget in NONE aggregation type --- ui-ngx/src/app/core/api/data-aggregator.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui-ngx/src/app/core/api/data-aggregator.ts b/ui-ngx/src/app/core/api/data-aggregator.ts index 971f037282..300998548c 100644 --- a/ui-ngx/src/app/core/api/data-aggregator.ts +++ b/ui-ngx/src/app/core/api/data-aggregator.ts @@ -308,7 +308,7 @@ export class DataAggregator { } aggKeyData.delete(aggTimestamp); this.updatedData = true; - } else if (aggTimestamp < this.endTs) { + } else if (aggTimestamp < this.endTs || this.noAggregation) { const kvPair: [number, any] = [aggTimestamp, aggData.aggValue]; keyData.push(kvPair); }