Merge branch 'develop/3.6' of github.com:thingsboard/thingsboard into develop/3.6

This commit is contained in:
Igor Kulikov 2023-09-19 18:04:45 +03:00
commit d479bca638
15 changed files with 34 additions and 17 deletions

View File

@ -23,6 +23,7 @@
} }
.tb-form-settings { .tb-form-settings {
display: flex;
flex-direction: column; flex-direction: column;
gap: 16px; gap: 16px;
padding-top: 0; padding-top: 0;

View File

@ -632,6 +632,10 @@
*ngIf="gatewayConfigGroup.get('thingsboard.checkingDeviceActivity.inactivityTimeoutSeconds').hasError('min')"> *ngIf="gatewayConfigGroup.get('thingsboard.checkingDeviceActivity.inactivityTimeoutSeconds').hasError('min')">
{{ 'gateway.inactivity-timeout-seconds-min' | translate }} {{ 'gateway.inactivity-timeout-seconds-min' | translate }}
</mat-error> </mat-error>
<mat-error
*ngIf="gatewayConfigGroup.get('thingsboard.checkingDeviceActivity.inactivityTimeoutSeconds').hasError('pattern')">
{{ 'gateway.inactivity-timeout-seconds-pattern' | translate }}
</mat-error>
<mat-icon matIconSuffix style="cursor:pointer;" <mat-icon matIconSuffix style="cursor:pointer;"
matTooltip="{{ 'gateway.hints.inactivity-timeout' | translate }}">info_outlined matTooltip="{{ 'gateway.hints.inactivity-timeout' | translate }}">info_outlined
</mat-icon> </mat-icon>
@ -647,6 +651,10 @@
*ngIf="gatewayConfigGroup.get('thingsboard.checkingDeviceActivity.inactivityCheckPeriodSeconds').hasError('min')"> *ngIf="gatewayConfigGroup.get('thingsboard.checkingDeviceActivity.inactivityCheckPeriodSeconds').hasError('min')">
{{ 'gateway.inactivity-check-period-seconds-min' | translate }} {{ 'gateway.inactivity-check-period-seconds-min' | translate }}
</mat-error> </mat-error>
<mat-error
*ngIf="gatewayConfigGroup.get('thingsboard.checkingDeviceActivity.inactivityCheckPeriodSeconds').hasError('pattern')">
{{ 'gateway.inactivity-check-period-seconds-pattern' | translate }}
</mat-error>
<mat-icon matIconSuffix style="cursor:pointer;" <mat-icon matIconSuffix style="cursor:pointer;"
matTooltip="{{ 'gateway.hints.inactivity-period' | translate }}">info_outlined matTooltip="{{ 'gateway.hints.inactivity-period' | translate }}">info_outlined
</mat-icon> </mat-icon>

View File

@ -70,6 +70,16 @@
justify-content: flex-end; justify-content: flex-end;
flex: 1; flex: 1;
} }
mat-form-field {
mat-error {
display: none !important;
}
mat-error:first-child {
display: block !important;
}
}
} }
:host ::ng-deep { :host ::ng-deep {

View File

@ -108,8 +108,8 @@ export class GatewayConfigurationComponent implements OnInit {
handleDeviceRenaming: [true, []], handleDeviceRenaming: [true, []],
checkingDeviceActivity: this.fb.group({ checkingDeviceActivity: this.fb.group({
checkDeviceInactivity: [false, []], checkDeviceInactivity: [false, []],
inactivityTimeoutSeconds: [200, [Validators.min(1), Validators.pattern(/^[^.\s]+$/)]], inactivityTimeoutSeconds: [200, [Validators.min(1), Validators.pattern(/^-?[0-9]+$/)]],
inactivityCheckPeriodSeconds: [500, [Validators.min(1), Validators.pattern(/^[^.\s]+$/)]] inactivityCheckPeriodSeconds: [500, [Validators.min(1), Validators.pattern(/^-?[0-9]+$/)]]
}), }),
security: this.fb.group({ security: this.fb.group({
type: [SecurityTypes.ACCESS_TOKEN, [Validators.required]], type: [SecurityTypes.ACCESS_TOKEN, [Validators.required]],
@ -187,8 +187,8 @@ export class GatewayConfigurationComponent implements OnInit {
checkingDeviceActivityGroup.get('checkDeviceInactivity').valueChanges.subscribe(enabled => { checkingDeviceActivityGroup.get('checkDeviceInactivity').valueChanges.subscribe(enabled => {
checkingDeviceActivityGroup.updateValueAndValidity(); checkingDeviceActivityGroup.updateValueAndValidity();
if (enabled) { if (enabled) {
checkingDeviceActivityGroup.get('inactivityTimeoutSeconds').setValidators([Validators.min(1), Validators.required]); checkingDeviceActivityGroup.get('inactivityTimeoutSeconds').setValidators([Validators.min(1), Validators.required, Validators.pattern(/^-?[0-9]+$/)]);
checkingDeviceActivityGroup.get('inactivityCheckPeriodSeconds').setValidators([Validators.min(1), Validators.required]); checkingDeviceActivityGroup.get('inactivityCheckPeriodSeconds').setValidators([Validators.min(1), Validators.required, Validators.pattern(/^-?[0-9]+$/)]);
} else { } else {
checkingDeviceActivityGroup.get('inactivityTimeoutSeconds').clearValidators(); checkingDeviceActivityGroup.get('inactivityTimeoutSeconds').clearValidators();
checkingDeviceActivityGroup.get('inactivityCheckPeriodSeconds').clearValidators(); checkingDeviceActivityGroup.get('inactivityCheckPeriodSeconds').clearValidators();

View File

@ -486,6 +486,6 @@ export class GatewayConnectorComponent extends PageComponent implements AfterVie
const connectorName = attribute.key; const connectorName = attribute.key;
const connector = this.subscription && this.subscription.data const connector = this.subscription && this.subscription.data
.find(data => data && data.dataKey.name === `${connectorName}_ERRORS_COUNT`); .find(data => data && data.dataKey.name === `${connectorName}_ERRORS_COUNT`);
return (connector && this.activeConnectors.includes(connectorName)) ? connector.data[0][1] : 'Inactive'; return (connector && this.activeConnectors.includes(connectorName)) ? (connector.data[0][1] || 0) : 'Inactive';
} }
} }

View File

@ -124,7 +124,7 @@ export const GatewayConnectorDefaultTypesTranslates = new Map<string, string>([
['ftp', 'FTP'], ['ftp', 'FTP'],
['socket', 'SOCKET'], ['socket', 'SOCKET'],
['xmpp', 'XMPP'], ['xmpp', 'XMPP'],
['ocpp', 'OCCP'], ['ocpp', 'OCPP'],
['custom', 'CUSTOM'] ['custom', 'CUSTOM']
]); ]);

View File

@ -29,7 +29,7 @@
</mat-progress-bar> </mat-progress-bar>
<div mat-dialog-content> <div mat-dialog-content>
<mat-horizontal-stepper linear #createNotification <mat-horizontal-stepper linear #createNotification
[labelPosition]="(stepperLabelPosition | async)" labelPosition="bottom"
[orientation]="(stepperOrientation | async)" [orientation]="(stepperOrientation | async)"
(selectionChange)="changeStep($event)"> (selectionChange)="changeStep($event)">
<ng-template matStepperIcon="edit"> <ng-template matStepperIcon="edit">

View File

@ -63,7 +63,6 @@ export class SentNotificationDialogComponent extends
@ViewChild('createNotification', {static: true}) createNotification: MatStepper; @ViewChild('createNotification', {static: true}) createNotification: MatStepper;
stepperOrientation: Observable<StepperOrientation>; stepperOrientation: Observable<StepperOrientation>;
stepperLabelPosition: Observable<'bottom' | 'end'>;
isAdd = true; isAdd = true;
entityType = EntityType; entityType = EntityType;
@ -102,9 +101,6 @@ export class SentNotificationDialogComponent extends
this.stepperOrientation = this.breakpointObserver.observe(MediaBreakpoints['gt-sm']) this.stepperOrientation = this.breakpointObserver.observe(MediaBreakpoints['gt-sm'])
.pipe(map(({matches}) => matches ? 'horizontal' : 'vertical')); .pipe(map(({matches}) => matches ? 'horizontal' : 'vertical'));
this.stepperLabelPosition = this.breakpointObserver.observe(MediaBreakpoints['gt-md'])
.pipe(map(({matches}) => matches ? 'end' : 'bottom'));
this.notificationRequestForm = this.fb.group({ this.notificationRequestForm = this.fb.group({
useTemplate: [false], useTemplate: [false],
templateId: [{value: null, disabled: true}, Validators.required], templateId: [{value: null, disabled: true}, Validators.required],

View File

@ -29,7 +29,7 @@
</mat-progress-bar> </mat-progress-bar>
<div mat-dialog-content> <div mat-dialog-content>
<mat-horizontal-stepper linear #notificationTemplateStepper <mat-horizontal-stepper linear #notificationTemplateStepper
[labelPosition]="(stepperLabelPosition | async)" labelPosition="bottom"
[orientation]="(stepperOrientation | async)" [orientation]="(stepperOrientation | async)"
(selectionChange)="changeStep($event)"> (selectionChange)="changeStep($event)">
<ng-template matStepperIcon="edit"> <ng-template matStepperIcon="edit">

View File

@ -54,7 +54,6 @@ export class TemplateNotificationDialogComponent
@ViewChild('notificationTemplateStepper', {static: true}) notificationTemplateStepper: MatStepper; @ViewChild('notificationTemplateStepper', {static: true}) notificationTemplateStepper: MatStepper;
stepperOrientation: Observable<StepperOrientation>; stepperOrientation: Observable<StepperOrientation>;
stepperLabelPosition: Observable<'bottom' | 'end'>;
dialogTitle = 'notification.edit-notification-template'; dialogTitle = 'notification.edit-notification-template';
@ -82,9 +81,6 @@ export class TemplateNotificationDialogComponent
this.stepperOrientation = this.breakpointObserver.observe(MediaBreakpoints['gt-sm']) this.stepperOrientation = this.breakpointObserver.observe(MediaBreakpoints['gt-sm'])
.pipe(map(({matches}) => matches ? 'horizontal' : 'vertical')); .pipe(map(({matches}) => matches ? 'horizontal' : 'vertical'));
this.stepperLabelPosition = this.breakpointObserver.observe(MediaBreakpoints['gt-md'])
.pipe(map(({matches}) => matches ? 'end' : 'bottom'));
if (isDefinedAndNotNull(this.data?.predefinedType)) { if (isDefinedAndNotNull(this.data?.predefinedType)) {
this.hideSelectType = true; this.hideSelectType = true;
this.templateNotificationForm.get('notificationType').setValue(this.data.predefinedType, {emitEvent: false}); this.templateNotificationForm.get('notificationType').setValue(this.data.predefinedType, {emitEvent: false});

View File

@ -173,6 +173,7 @@
} }
.mat-drawer-content.tb-rulechain-graph-content { .mat-drawer-content.tb-rulechain-graph-content {
overflow: hidden; overflow: hidden;
z-index: 0;
.tb-rulechain-graph { .tb-rulechain-graph {
z-index: 0; z-index: 0;
overflow: auto; overflow: auto;

View File

@ -172,6 +172,7 @@ export class WidgetsBundleWidgetsComponent extends PageComponent implements OnIn
this.widgetsService.updateWidgetsBundleWidgetTypes(this.widgetsBundle.id.id, widgetTypeIds).subscribe(() => { this.widgetsService.updateWidgetsBundleWidgetTypes(this.widgetsBundle.id.id, widgetTypeIds).subscribe(() => {
this.isDirty = false; this.isDirty = false;
this.editMode = false; this.editMode = false;
this.addMode = false;
}); });
} }

View File

@ -34,6 +34,7 @@
<div #toggleHelpTextButton <div #toggleHelpTextButton
(click)="toggleHelp()"> (click)="toggleHelp()">
<button mat-button <button mat-button
type="button"
color="primary" color="primary"
class="tb-help-popup-text-button" class="tb-help-popup-text-button"
[class]="{'mat-mdc-outlined-button mdc-button--outlined': popoverVisible && popoverReady, [class]="{'mat-mdc-outlined-button mdc-button--outlined': popoverVisible && popoverReady,

View File

@ -2703,9 +2703,11 @@
"inactivity-check-period-seconds": "Inactivity check period (in sec)", "inactivity-check-period-seconds": "Inactivity check period (in sec)",
"inactivity-check-period-seconds-required": "Inactivity check period is required", "inactivity-check-period-seconds-required": "Inactivity check period is required",
"inactivity-check-period-seconds-min": "Inactivity check period can not be less then 1", "inactivity-check-period-seconds-min": "Inactivity check period can not be less then 1",
"inactivity-check-period-seconds-pattern": "Inactivity check period is not valid",
"inactivity-timeout-seconds": "Inactivity timeout (in sec)", "inactivity-timeout-seconds": "Inactivity timeout (in sec)",
"inactivity-timeout-seconds-required": "Inactivity timeout is required", "inactivity-timeout-seconds-required": "Inactivity timeout is required",
"inactivity-timeout-seconds-min": "Inactivity timeout can not be less then 1", "inactivity-timeout-seconds-min": "Inactivity timeout can not be less then 1",
"inactivity-timeout-seconds-pattern": "Inactivity timeout is not valid",
"json-parse": "Not valid JSON.", "json-parse": "Not valid JSON.",
"json-required": "Field cannot be empty.", "json-required": "Field cannot be empty.",
"logs": { "logs": {
@ -2855,6 +2857,7 @@
"password": "MQTT password for the gateway form ThingsBoard server", "password": "MQTT password for the gateway form ThingsBoard server",
"ca-cert": "Path to CA certificate file", "ca-cert": "Path to CA certificate file",
"date-form": "Date format in log message", "date-form": "Date format in log message",
"data-folder": "Path to folder, that will contains data (Relative or Absolute)",
"log-format": "Log message format", "log-format": "Log message format",
"remote-log": "Enables remote logging and logs reading from the gateway", "remote-log": "Enables remote logging and logs reading from the gateway",
"backup-count": "If backup count is > 0, when a rollover is done, no more than backup count files are kept - the oldest ones are deleted", "backup-count": "If backup count is > 0, when a rollover is done, no more than backup count files are kept - the oldest ones are deleted",