reuse of existing components
This commit is contained in:
parent
7912871849
commit
e1f18f16af
@ -1907,7 +1907,7 @@
|
|||||||
"dialogTitle": "Launch command",
|
"dialogTitle": "Launch command",
|
||||||
"dialogHideDashboardToolbar": true,
|
"dialogHideDashboardToolbar": true,
|
||||||
"dialogWidth": null,
|
"dialogWidth": null,
|
||||||
"dialogHeight": 35,
|
"dialogHeight": 40,
|
||||||
"openInSeparateDialog": true,
|
"openInSeparateDialog": true,
|
||||||
"openInPopover": false,
|
"openInPopover": false,
|
||||||
"id": "337c767b-3217-d3d3-b955-7b0bd0858a1d"
|
"id": "337c767b-3217-d3d3-b955-7b0bd0858a1d"
|
||||||
@ -5087,14 +5087,14 @@
|
|||||||
"useMarkdownTextFunction": true,
|
"useMarkdownTextFunction": true,
|
||||||
"markdownTextFunction": "return `<div class=\"action-container\">\n<tb-gateway-command deviceId=\"${data[0].entityId}\"></tb-gateway-command>\n </div>`;",
|
"markdownTextFunction": "return `<div class=\"action-container\">\n<tb-gateway-command deviceId=\"${data[0].entityId}\"></tb-gateway-command>\n </div>`;",
|
||||||
"applyDefaultMarkdownStyle": false,
|
"applyDefaultMarkdownStyle": false,
|
||||||
"markdownCss": ".action-container {\r\n display: flex;\r\n flex-wrap: wrap;\r\n flex-direction: row;\r\n height: 100%;\r\n width: 100%;\r\n align-content: center;\r\n}\r\n\r\nbutton {\r\n flex-grow: 1;\r\n margin: 10px;\r\n min-width: 150px;\r\n height: auto;\r\n}"
|
"markdownCss": ".action-container {\r\n display: flex;\r\n flex-wrap: wrap;\r\n flex-direction: row;\r\n height: 100%;\r\n width: 100%;\r\n}\r\n\r\nbutton {\r\n flex-grow: 1;\r\n margin: 10px;\r\n min-width: 150px;\r\n height: auto;\r\n}"
|
||||||
},
|
},
|
||||||
"title": "New Markdown/HTML Card",
|
"title": "New Markdown/HTML Card",
|
||||||
"showTitleIcon": false,
|
"showTitleIcon": false,
|
||||||
"iconColor": "rgba(0, 0, 0, 0.87)",
|
"iconColor": "rgba(0, 0, 0, 0.87)",
|
||||||
"iconSize": "24px",
|
"iconSize": "24px",
|
||||||
"titleTooltip": "",
|
"titleTooltip": "",
|
||||||
"dropShadow": true,
|
"dropShadow": false,
|
||||||
"enableFullscreen": false,
|
"enableFullscreen": false,
|
||||||
"widgetStyle": {},
|
"widgetStyle": {},
|
||||||
"titleStyle": {
|
"titleStyle": {
|
||||||
|
|||||||
@ -17,39 +17,57 @@
|
|||||||
-->
|
-->
|
||||||
<div mat-dialog-content tb-toast fxLayout="column" toastTarget="dockerCommandDialogContent">
|
<div mat-dialog-content tb-toast fxLayout="column" toastTarget="dockerCommandDialogContent">
|
||||||
<span style="padding-bottom: 15px;">{{ 'gateway.docker-label' | translate }}</span>
|
<span style="padding-bottom: 15px;">{{ 'gateway.docker-label' | translate }}</span>
|
||||||
<div fxFlex fxLayout="row" style="justify-content: space-between; flex-grow: 0">
|
<div fxFlex fxLayout="row" style="justify-content: space-between; flex-grow: 0; align-items: center">
|
||||||
<mat-button-toggle-group [formControl]="selectedOSCControl" aria-label="Favorite Color" style="width: max-content; flex-grow: 0">
|
<tb-toggle-select [formControl]="selectedOSCControl" appearance="stroked" style="width: max-content; flex-grow: 0">
|
||||||
<mat-button-toggle [value]="osTypes.windows"><span translate>gateway.windows </span></mat-button-toggle>
|
<tb-toggle-option [value]="osTypes.windows"><span>Windows </span></tb-toggle-option>
|
||||||
<mat-button-toggle [value]="osTypes.linux"><span translate>gateway.linux-macos </span></mat-button-toggle>
|
<tb-toggle-option [value]="osTypes.linux"><span>Linux/MacOS </span></tb-toggle-option>
|
||||||
</mat-button-toggle-group>
|
</tb-toggle-select>
|
||||||
<div class="tb-help" [tb-help]="helpLink"></div>
|
<div class="tb-help" [tb-help]="helpLink"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="mat-content" fxLayout="column" *ngIf="selectedOSCControl.value !== osTypes.windows">
|
<ng-container [ngSwitch]="selectedOSCControl.value">
|
||||||
<div fxLayout="row" fxLayoutAlign="start center">
|
<ng-template [ngSwitchCase]="osTypes.windows">
|
||||||
<pre class="tb-highlight" fxFlex><code style="white-space: pre-wrap;">{{ linuxCode }}</code></pre>
|
<tb-markdown usePlainMarkdown containerClass="start-code" data="
|
||||||
<button mat-icon-button
|
```bash
|
||||||
color="primary"
|
{{windowsCode}}
|
||||||
ngxClipboard
|
{:copy-code}
|
||||||
cbContent="{{ linuxCode }}"
|
```
|
||||||
(cbOnSuccess)="onDockerCodeCopied()"
|
"></tb-markdown>
|
||||||
matTooltip="{{ 'gateway.copy-command' | translate }}"
|
</ng-template>
|
||||||
matTooltipPosition="above">
|
<ng-template [ngSwitchCase]="osTypes.linux">
|
||||||
<mat-icon svgIcon="mdi:clipboard-arrow-left"></mat-icon>
|
<tb-markdown usePlainMarkdown containerClass="start-code" data="
|
||||||
</button>
|
```bash
|
||||||
</div>
|
{{linuxCode}}
|
||||||
</div>
|
{:copy-code}
|
||||||
<div class="mat-content" fxLayout="column" *ngIf="selectedOSCControl.value === osTypes.windows">
|
```
|
||||||
<div fxLayout="row" fxLayoutAlign="start center">
|
"></tb-markdown>
|
||||||
<pre class="tb-highlight" fxFlex><code style="white-space: pre-wrap;">{{ windowsCode }}</code></pre>
|
</ng-template>
|
||||||
<button mat-icon-button
|
</ng-container>
|
||||||
color="primary"
|
<!-- <div class="mat-content" fxLayout="column" *ngIf="selectedOSCControl.value !== osTypes.windows">-->
|
||||||
ngxClipboard
|
<!-- <div fxLayout="row" fxLayoutAlign="start center">-->
|
||||||
cbContent="{{ windowsCode }}"
|
<!-- <pre class="tb-highlight" fxFlex><code style="white-space: pre-wrap;">{{ linuxCode }}</code></pre>-->
|
||||||
(cbOnSuccess)="onDockerCodeCopied()"
|
<!-- <button mat-icon-button-->
|
||||||
matTooltip="{{ 'gateway.copy-command' | translate }}"
|
<!-- color="primary"-->
|
||||||
matTooltipPosition="above">
|
<!-- ngxClipboard-->
|
||||||
<mat-icon svgIcon="mdi:clipboard-arrow-left"></mat-icon>
|
<!-- cbContent="{{ linuxCode }}"-->
|
||||||
</button>
|
<!-- (cbOnSuccess)="onDockerCodeCopied()"-->
|
||||||
</div>
|
<!-- matTooltip="{{ 'gateway.copy-command' | translate }}"-->
|
||||||
</div>
|
<!-- matTooltipPosition="above">-->
|
||||||
|
<!-- <mat-icon svgIcon="mdi:clipboard-arrow-left"></mat-icon>-->
|
||||||
|
<!-- </button>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- <div class="mat-content" fxLayout="column" *ngIf="selectedOSCControl.value === osTypes.windows">-->
|
||||||
|
<!-- <div fxLayout="row" fxLayoutAlign="start center">-->
|
||||||
|
<!-- <pre class="tb-highlight" fxFlex><code style="white-space: pre-wrap;">{{ windowsCode }}</code></pre>-->
|
||||||
|
<!-- <button mat-icon-button-->
|
||||||
|
<!-- color="primary"-->
|
||||||
|
<!-- ngxClipboard-->
|
||||||
|
<!-- cbContent="{{ windowsCode }}"-->
|
||||||
|
<!-- (cbOnSuccess)="onDockerCodeCopied()"-->
|
||||||
|
<!-- matTooltip="{{ 'gateway.copy-command' | translate }}"-->
|
||||||
|
<!-- matTooltipPosition="above">-->
|
||||||
|
<!-- <mat-icon svgIcon="mdi:clipboard-arrow-left"></mat-icon>-->
|
||||||
|
<!-- </button>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- </div>-->
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -0,0 +1,95 @@
|
|||||||
|
/**
|
||||||
|
* Copyright © 2016-2023 The Thingsboard Authors
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
:host {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display: block;
|
||||||
|
|
||||||
|
::ng-deep.tb-markdown-view {
|
||||||
|
.start-code {
|
||||||
|
.code-wrapper {
|
||||||
|
padding: 0;
|
||||||
|
|
||||||
|
pre[class*=language-] {
|
||||||
|
margin: 0;
|
||||||
|
padding: 9px 38px 9px 16px;
|
||||||
|
background: rgba(0, 0, 0, 0.03);
|
||||||
|
border-radius: 6px;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
code[class*="language-"], pre[class*="language-"] {
|
||||||
|
font-family: 'Roboto';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 16px;
|
||||||
|
letter-spacing: 0.25px;
|
||||||
|
color: rgba(0, 0, 0, 0.38);
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: break-spaces;
|
||||||
|
word-break: break-all;
|
||||||
|
|
||||||
|
& * {
|
||||||
|
color: rgba(0, 0, 0, 0.38);
|
||||||
|
cursor: inherit;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
button.clipboard-btn {
|
||||||
|
right: 0;
|
||||||
|
height: 34px;
|
||||||
|
|
||||||
|
p, div {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin: 0;
|
||||||
|
padding: 7px;
|
||||||
|
color: #305680;
|
||||||
|
}
|
||||||
|
|
||||||
|
div {
|
||||||
|
top: 0;
|
||||||
|
padding: 8px;
|
||||||
|
height: 34px;
|
||||||
|
width: 34px;
|
||||||
|
|
||||||
|
img {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:after {
|
||||||
|
content: "";
|
||||||
|
position: initial;
|
||||||
|
display: block;
|
||||||
|
width: 18px;
|
||||||
|
height: 18px;
|
||||||
|
background: #305680;
|
||||||
|
-webkit-mask-image: url(/assets/copy-code-icon.svg);
|
||||||
|
-webkit-mask-repeat: no-repeat;
|
||||||
|
mask-image: url(/assets/copy-code-icon.svg);
|
||||||
|
mask-repeat: no-repeat;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ enum OsType {
|
|||||||
@Component({
|
@Component({
|
||||||
selector: 'tb-gateway-command',
|
selector: 'tb-gateway-command',
|
||||||
templateUrl: './device-gateway-command.component.html',
|
templateUrl: './device-gateway-command.component.html',
|
||||||
styleUrls: []
|
styleUrls: ['./device-gateway-command.component.scss']
|
||||||
})
|
})
|
||||||
|
|
||||||
export class DeviceGatewayCommandComponent implements OnInit {
|
export class DeviceGatewayCommandComponent implements OnInit {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -22,6 +22,10 @@
|
|||||||
color: rgba(0, 0, 0, .12);
|
color: rgba(0, 0, 0, .12);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tb-form-panel {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
.mat-toolbar {
|
.mat-toolbar {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
color: rgba(0, 0, 0, .87) !important;
|
color: rgba(0, 0, 0, .87) !important;
|
||||||
@ -41,6 +45,11 @@
|
|||||||
margin-right: 15px;
|
margin-right: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.slider-icon {
|
||||||
|
position: absolute;
|
||||||
|
transform: translateY(-3px);
|
||||||
|
}
|
||||||
|
|
||||||
.block-title {
|
.block-title {
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
@ -53,41 +62,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.security-toggle-group {
|
.security-toggle-group {
|
||||||
padding-bottom: 0;
|
|
||||||
background: transparent !important;
|
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
border: none;
|
margin-right: auto;
|
||||||
overflow: auto;
|
|
||||||
|
|
||||||
.mat-button-toggle {
|
|
||||||
border-radius: 15px;
|
|
||||||
border: 1px solid rgba(0, 0, 0, 0);
|
|
||||||
background: rgba(0, 0, 0, .05);
|
|
||||||
margin: 5px;
|
|
||||||
color: rgba(0, 0, 0, .2);
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mat-button-toggle-checked {
|
|
||||||
border-radius: 15px;
|
|
||||||
border: 1px solid #305680;
|
|
||||||
background: white;
|
|
||||||
color: #305680;
|
|
||||||
}
|
|
||||||
|
|
||||||
::ng-deep span {
|
::ng-deep span {
|
||||||
text-transform: capitalize;
|
padding: 0 25px;
|
||||||
line-height: 20px;
|
|
||||||
font-size: 13px;
|
|
||||||
padding: 5px 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
::ng-deep .mat-button-toggle-ripple {
|
|
||||||
border-radius: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
::ng-deep .mat-button-toggle-appearance-standard:not(.mat-button-toggle-disabled):hover .mat-button-toggle-focus-overlay {
|
|
||||||
opacity: 0 !important;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,41 +75,6 @@
|
|||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logs-toggle-group {
|
|
||||||
border: none;
|
|
||||||
border-radius: 15px;
|
|
||||||
background: rgba(0, 0, 0, .05);
|
|
||||||
color: rgba(0, 0, 0, .2);
|
|
||||||
font-weight: 500;
|
|
||||||
|
|
||||||
.mat-button-toggle {
|
|
||||||
border: none;
|
|
||||||
background: rgba(0, 0, 0, .0);
|
|
||||||
color: rgba(0, 0, 0, .2);
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mat-button-toggle-checked {
|
|
||||||
border-radius: 15px;
|
|
||||||
color: white;
|
|
||||||
background: #305680;
|
|
||||||
}
|
|
||||||
|
|
||||||
::ng-deep span {
|
|
||||||
line-height: 20px;
|
|
||||||
font-size: 13px;
|
|
||||||
padding: 5px 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
::ng-deep .mat-button-toggle-ripple {
|
|
||||||
border-radius: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
::ng-deep .mat-button-toggle-appearance-standard:not(.mat-button-toggle-disabled):hover .mat-button-toggle-focus-overlay {
|
|
||||||
opacity: 0 !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.statistics-block {
|
.statistics-block {
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
padding-left: 15px;
|
padding-left: 15px;
|
||||||
@ -167,10 +111,6 @@
|
|||||||
z-index: 100;
|
z-index: 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
.suffix-icon {
|
|
||||||
position: absolute;
|
|
||||||
transform: translateY(-3px);
|
|
||||||
}
|
|
||||||
|
|
||||||
mat-panel-title {
|
mat-panel-title {
|
||||||
display: block;
|
display: block;
|
||||||
|
|||||||
@ -133,6 +133,8 @@ export class GatewayConfigurationComponent implements OnInit {
|
|||||||
|
|
||||||
logSelector: FormControl;
|
logSelector: FormControl;
|
||||||
|
|
||||||
|
securityType: SecurityTypes;
|
||||||
|
|
||||||
|
|
||||||
constructor(protected router: Router,
|
constructor(protected router: Router,
|
||||||
protected store: Store<AppState>,
|
protected store: Store<AppState>,
|
||||||
@ -259,6 +261,7 @@ export class GatewayConfigurationComponent implements OnInit {
|
|||||||
const securityGroup = this.gatewayConfigGroup.get('thingsboard.security') as FormGroup;
|
const securityGroup = this.gatewayConfigGroup.get('thingsboard.security') as FormGroup;
|
||||||
securityGroup.get('type').valueChanges.subscribe(type => {
|
securityGroup.get('type').valueChanges.subscribe(type => {
|
||||||
this.removeAllSecurityValidators();
|
this.removeAllSecurityValidators();
|
||||||
|
console.log(type);
|
||||||
if (type === SecurityTypes.ACCESS_TOKEN) {
|
if (type === SecurityTypes.ACCESS_TOKEN) {
|
||||||
securityGroup.get('accessToken').addValidators([Validators.required]);
|
securityGroup.get('accessToken').addValidators([Validators.required]);
|
||||||
securityGroup.get('accessToken').updateValueAndValidity();
|
securityGroup.get('accessToken').updateValueAndValidity();
|
||||||
@ -317,6 +320,18 @@ export class GatewayConfigurationComponent implements OnInit {
|
|||||||
this.fetchConfigAttribute(this.device);
|
this.fetchConfigAttribute(this.device);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateSecurityValidators(value: SecurityTypes) {
|
||||||
|
this.gatewayConfigGroup.get('thingsboard.security.type').setValue(value, {emitEvent: true});
|
||||||
|
}
|
||||||
|
|
||||||
|
updateLogType(value: LocalLogsConfigs) {
|
||||||
|
this.logSelector.setValue(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
updateStorageType(value: StorageTypes) {
|
||||||
|
this.gatewayConfigGroup.get('storage.type').setValue(value, {emitEvent: true})
|
||||||
|
}
|
||||||
|
|
||||||
fetchConfigAttribute(entityId: EntityId) {
|
fetchConfigAttribute(entityId: EntityId) {
|
||||||
if (entityId.id === NULL_UUID) return;
|
if (entityId.id === NULL_UUID) return;
|
||||||
this.attributeService.getEntityAttributes(entityId, AttributeScope.CLIENT_SCOPE,
|
this.attributeService.getEntityAttributes(entityId, AttributeScope.CLIENT_SCOPE,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user