14 changed files with 486 additions and 14 deletions
@ -0,0 +1,40 @@ |
|||
<!-- |
|||
|
|||
Copyright © 2016-2026 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. |
|||
|
|||
--> |
|||
<div class="tb-iot-hub-pe-required"> |
|||
<button mat-icon-button class="tb-iot-hub-pe-required-close" (click)="close()" tabindex="-1"> |
|||
<mat-icon>close</mat-icon> |
|||
</button> |
|||
|
|||
<span class="tb-iot-hub-pe-required-icon" aria-hidden="true"></span> |
|||
|
|||
<h2 class="tb-iot-hub-pe-required-title"> |
|||
{{ 'iot-hub.pe-required-title' | translate }} |
|||
</h2> |
|||
|
|||
<p class="tb-iot-hub-pe-required-message" |
|||
[innerHTML]="'iot-hub.pe-required-message' | translate"></p> |
|||
|
|||
<div class="tb-iot-hub-pe-required-actions"> |
|||
<button mat-button (click)="close()"> |
|||
{{ 'action.close' | translate }} |
|||
</button> |
|||
<button mat-flat-button color="primary" (click)="upgradeInstance()"> |
|||
{{ 'iot-hub.upgrade-instance' | translate }} |
|||
</button> |
|||
</div> |
|||
</div> |
|||
@ -0,0 +1,77 @@ |
|||
/** |
|||
* Copyright © 2016-2026 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. |
|||
*/ |
|||
|
|||
@import "../../../../../scss/constants"; |
|||
|
|||
:host { |
|||
display: block; |
|||
width: 500px; |
|||
max-width: 100%; |
|||
} |
|||
|
|||
.tb-iot-hub-pe-required { |
|||
position: relative; |
|||
display: flex; |
|||
flex-direction: column; |
|||
align-items: center; |
|||
text-align: center; |
|||
gap: 20px; |
|||
padding: 40px; |
|||
background: white; |
|||
border-radius: 8px; |
|||
} |
|||
|
|||
.tb-iot-hub-pe-required-close { |
|||
position: absolute; |
|||
top: 8px; |
|||
right: 8px; |
|||
} |
|||
|
|||
// SVG illustration applied as a mask so the silhouette is filled |
|||
// with $tb-primary-color. PE builds inherit their own primary value |
|||
// without re-exporting the asset. |
|||
.tb-iot-hub-pe-required-icon { |
|||
display: block; |
|||
width: 100px; |
|||
height: 100px; |
|||
background-color: $tb-primary-color; |
|||
-webkit-mask: url('/assets/iot-hub/upgrade-required.svg') no-repeat center / contain; |
|||
mask: url('/assets/iot-hub/upgrade-required.svg') no-repeat center / contain; |
|||
} |
|||
|
|||
.tb-iot-hub-pe-required-title { |
|||
font-size: 24px; |
|||
font-weight: 500; |
|||
line-height: 32px; |
|||
letter-spacing: 0.15px; |
|||
color: rgba(0, 0, 0, 0.87); |
|||
margin: 0; |
|||
} |
|||
|
|||
.tb-iot-hub-pe-required-message { |
|||
font-size: 14px; |
|||
font-weight: 400; |
|||
line-height: 24px; |
|||
letter-spacing: 0.25px; |
|||
color: rgba(0, 0, 0, 0.76); |
|||
margin: 0; |
|||
} |
|||
|
|||
.tb-iot-hub-pe-required-actions { |
|||
display: flex; |
|||
align-items: center; |
|||
gap: 8px; |
|||
} |
|||
@ -0,0 +1,47 @@ |
|||
///
|
|||
/// Copyright © 2016-2026 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.
|
|||
///
|
|||
|
|||
import { Component } from '@angular/core'; |
|||
import { MatDialogRef } from '@angular/material/dialog'; |
|||
import { Router } from '@angular/router'; |
|||
import { Store } from '@ngrx/store'; |
|||
import { AppState } from '@core/core.state'; |
|||
import { DialogComponent } from '@shared/components/dialog.component'; |
|||
|
|||
@Component({ |
|||
selector: 'tb-iot-hub-pe-required-dialog', |
|||
standalone: false, |
|||
templateUrl: './iot-hub-pe-required-dialog.component.html', |
|||
styleUrls: ['./iot-hub-pe-required-dialog.component.scss'] |
|||
}) |
|||
export class TbIotHubPeRequiredDialogComponent extends DialogComponent<TbIotHubPeRequiredDialogComponent> { |
|||
|
|||
constructor( |
|||
protected store: Store<AppState>, |
|||
protected router: Router, |
|||
protected dialogRef: MatDialogRef<TbIotHubPeRequiredDialogComponent> |
|||
) { |
|||
super(store, router, dialogRef); |
|||
} |
|||
|
|||
close(): void { |
|||
this.dialogRef.close(); |
|||
} |
|||
|
|||
upgradeInstance(): void { |
|||
window.open('https://thingsboard.io/docs/pe/installation/upgrade-from-ce/', '_blank'); |
|||
} |
|||
} |
|||
@ -0,0 +1,43 @@ |
|||
<!-- |
|||
|
|||
Copyright © 2016-2026 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. |
|||
|
|||
--> |
|||
<div class="tb-iot-hub-upgrade-required"> |
|||
<button mat-icon-button class="tb-iot-hub-upgrade-required-close" (click)="close()" tabindex="-1"> |
|||
<mat-icon>close</mat-icon> |
|||
</button> |
|||
|
|||
<span class="tb-iot-hub-upgrade-required-icon" aria-hidden="true"></span> |
|||
|
|||
<h2 class="tb-iot-hub-upgrade-required-title"> |
|||
{{ 'iot-hub.upgrade-required-title' | translate }} |
|||
</h2> |
|||
|
|||
<p class="tb-iot-hub-upgrade-required-message" |
|||
[innerHTML]="'iot-hub.upgrade-required-message' | translate:{ |
|||
minVersion: minVersion, |
|||
currentVersion: currentVersion |
|||
}"></p> |
|||
|
|||
<div class="tb-iot-hub-upgrade-required-actions"> |
|||
<button mat-button (click)="close()"> |
|||
{{ 'action.close' | translate }} |
|||
</button> |
|||
<button mat-flat-button color="primary" (click)="upgradeInstance()"> |
|||
{{ 'iot-hub.upgrade-instance' | translate }} |
|||
</button> |
|||
</div> |
|||
</div> |
|||
@ -0,0 +1,76 @@ |
|||
/** |
|||
* Copyright © 2016-2026 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. |
|||
*/ |
|||
|
|||
@import "../../../../../scss/constants"; |
|||
|
|||
:host { |
|||
display: block; |
|||
width: 500px; |
|||
max-width: 100%; |
|||
} |
|||
|
|||
.tb-iot-hub-upgrade-required { |
|||
position: relative; |
|||
display: flex; |
|||
flex-direction: column; |
|||
align-items: center; |
|||
text-align: center; |
|||
gap: 20px; |
|||
padding: 40px; |
|||
background: white; |
|||
border-radius: 8px; |
|||
} |
|||
|
|||
.tb-iot-hub-upgrade-required-close { |
|||
position: absolute; |
|||
top: 8px; |
|||
right: 8px; |
|||
} |
|||
|
|||
// Re-use the upgrade-required.svg silhouette as a CSS mask so the icon |
|||
// tints with $tb-primary-color (PE overrides apply automatically). |
|||
.tb-iot-hub-upgrade-required-icon { |
|||
display: block; |
|||
width: 100px; |
|||
height: 100px; |
|||
background-color: $tb-primary-color; |
|||
-webkit-mask: url('/assets/iot-hub/upgrade-required.svg') no-repeat center / contain; |
|||
mask: url('/assets/iot-hub/upgrade-required.svg') no-repeat center / contain; |
|||
} |
|||
|
|||
.tb-iot-hub-upgrade-required-title { |
|||
font-size: 24px; |
|||
font-weight: 500; |
|||
line-height: 32px; |
|||
letter-spacing: 0.15px; |
|||
color: rgba(0, 0, 0, 0.87); |
|||
margin: 0; |
|||
} |
|||
|
|||
.tb-iot-hub-upgrade-required-message { |
|||
font-size: 14px; |
|||
font-weight: 400; |
|||
line-height: 24px; |
|||
letter-spacing: 0.25px; |
|||
color: rgba(0, 0, 0, 0.76); |
|||
margin: 0; |
|||
} |
|||
|
|||
.tb-iot-hub-upgrade-required-actions { |
|||
display: flex; |
|||
align-items: center; |
|||
gap: 8px; |
|||
} |
|||
@ -0,0 +1,59 @@ |
|||
///
|
|||
/// Copyright © 2016-2026 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.
|
|||
///
|
|||
|
|||
import { Component, Inject } from '@angular/core'; |
|||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; |
|||
import { Router } from '@angular/router'; |
|||
import { Store } from '@ngrx/store'; |
|||
import { AppState } from '@core/core.state'; |
|||
import { DialogComponent } from '@shared/components/dialog.component'; |
|||
import { tbVersionIntToString } from '@core/http/iot-hub-api.service'; |
|||
import { environment as env } from '@env/environment'; |
|||
|
|||
export interface IotHubUpgradeRequiredDialogData { |
|||
minTbVersion: number; |
|||
} |
|||
|
|||
@Component({ |
|||
selector: 'tb-iot-hub-upgrade-required-dialog', |
|||
standalone: false, |
|||
templateUrl: './iot-hub-upgrade-required-dialog.component.html', |
|||
styleUrls: ['./iot-hub-upgrade-required-dialog.component.scss'] |
|||
}) |
|||
export class TbIotHubUpgradeRequiredDialogComponent extends DialogComponent<TbIotHubUpgradeRequiredDialogComponent> { |
|||
|
|||
readonly minVersion: string; |
|||
readonly currentVersion: string; |
|||
|
|||
constructor( |
|||
protected store: Store<AppState>, |
|||
protected router: Router, |
|||
protected dialogRef: MatDialogRef<TbIotHubUpgradeRequiredDialogComponent>, |
|||
@Inject(MAT_DIALOG_DATA) public data: IotHubUpgradeRequiredDialogData |
|||
) { |
|||
super(store, router, dialogRef); |
|||
this.minVersion = `v${tbVersionIntToString(data.minTbVersion)}`; |
|||
this.currentVersion = `v${env.tbVersion}`; |
|||
} |
|||
|
|||
close(): void { |
|||
this.dialogRef.close(); |
|||
} |
|||
|
|||
upgradeInstance(): void { |
|||
window.open('https://thingsboard.io/docs/installation/upgrade-instructions/', '_blank'); |
|||
} |
|||
} |
|||
|
After Width: | Height: | Size: 827 B |
Loading…
Reference in new issue