26 changed files with 370 additions and 18 deletions
@ -0,0 +1,24 @@ |
|||||
|
<!-- |
||||
|
|
||||
|
Copyright © 2016-2019 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. |
||||
|
|
||||
|
--> |
||||
|
<h2 mat-dialog-title>Coming soon!</h2> |
||||
|
<div mat-dialog-content> |
||||
|
<img [src]="comingSoon"/> |
||||
|
</div> |
||||
|
<div mat-dialog-actions fxLayout="row" fxLayoutAlign="end center"> |
||||
|
<button mat-button color="primary" [mat-dialog-close]="true" cdkFocusInitial>Ok</button> |
||||
|
</div> |
||||
@ -0,0 +1,23 @@ |
|||||
|
/** |
||||
|
* Copyright © 2016-2019 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 { |
||||
|
.mat-dialog-content { |
||||
|
padding: 0 24px 24px; |
||||
|
img { |
||||
|
max-width: 500px; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,31 @@ |
|||||
|
///
|
||||
|
/// Copyright © 2016-2019 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'; |
||||
|
|
||||
|
@Component({ |
||||
|
selector: 'tb-todo-dialog', |
||||
|
templateUrl: './todo-dialog.component.html', |
||||
|
styleUrls: ['./todo-dialog.component.scss'] |
||||
|
}) |
||||
|
export class TodoDialogComponent { |
||||
|
|
||||
|
comingSoon = require('../../../../assets/coming-soon.jpg'); |
||||
|
|
||||
|
constructor(public dialogRef: MatDialogRef<TodoDialogComponent>) { |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,64 @@ |
|||||
|
<!-- |
||||
|
|
||||
|
Copyright © 2016-2019 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 style="min-width: 400px;"> |
||||
|
<mat-toolbar fxLayout="row" color="primary"> |
||||
|
<h2>{{ 'dashboard.public-dashboard-title' | translate }}</h2> |
||||
|
<span fxFlex></span> |
||||
|
<button mat-button mat-icon-button |
||||
|
(click)="close()" |
||||
|
type="button"> |
||||
|
<mat-icon class="material-icons">close</mat-icon> |
||||
|
</button> |
||||
|
</mat-toolbar> |
||||
|
<mat-progress-bar color="warn" mode="indeterminate" *ngIf="isLoading$ | async"> |
||||
|
</mat-progress-bar> |
||||
|
<div style="height: 4px;" *ngIf="!(isLoading$ | async)"></div> |
||||
|
<div mat-dialog-content tb-toast toastTarget="makeDashboardPublicDialogContent"> |
||||
|
<span |
||||
|
innerHTML="{{ translate.get('dashboard.public-dashboard-text', {dashboardTitle: dashboard.title, publicLink: publicLink}) | async }}"> |
||||
|
</span> |
||||
|
<div fxLayout="row" fxLayoutAlign="start center"> |
||||
|
<pre class="tb-highlight" fxFlex><code>{{ publicLink }}</code></pre> |
||||
|
<button mat-button mat-icon-button |
||||
|
ngxClipboard |
||||
|
(cbOnSuccess)="onPublicLinkCopied($event)" |
||||
|
cbContent="{{publicLink}}" |
||||
|
matTooltipPosition="above" |
||||
|
matTooltip="{{ 'dashboard.copy-public-link' | translate }}"> |
||||
|
<mat-icon svgIcon="mdi:clipboard-arrow-left"></mat-icon> |
||||
|
</button> |
||||
|
</div> |
||||
|
<div class="tb-notice" innerHTML="{{'dashboard.public-dashboard-notice' | translate}}"></div> |
||||
|
<tb-social-share-panel style="padding-top: 15px;" |
||||
|
shareTitle="{{ 'dashboard.socialshare-title' | translate:{dashboardTitle: dashboard.title} }}" |
||||
|
shareText="{{ 'dashboard.socialshare-text' | translate:{dashboardTitle: dashboard.title} }}" |
||||
|
shareLink="{{ publicLink }}" |
||||
|
shareHashTags="thingsboard, iot"> |
||||
|
</tb-social-share-panel> |
||||
|
</div> |
||||
|
<div mat-dialog-actions fxLayout="row"> |
||||
|
<span fxFlex></span> |
||||
|
<button mat-button color="primary" |
||||
|
style="margin-right: 20px;" |
||||
|
type="button" |
||||
|
[disabled]="(isLoading$ | async)" |
||||
|
(click)="close()" cdkFocusInitial> |
||||
|
{{ 'action.ok' | translate }} |
||||
|
</button> |
||||
|
</div> |
||||
|
</div> |
||||
@ -0,0 +1,77 @@ |
|||||
|
///
|
||||
|
/// Copyright © 2016-2019 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, OnInit, SkipSelf} from '@angular/core'; |
||||
|
import {ErrorStateMatcher, MAT_DIALOG_DATA, MatDialogRef} from '@angular/material'; |
||||
|
import {PageComponent} from '@shared/components/page.component'; |
||||
|
import {Store} from '@ngrx/store'; |
||||
|
import {AppState} from '@core/core.state'; |
||||
|
import {FormBuilder, FormControl, FormGroup, FormGroupDirective, NgForm} from '@angular/forms'; |
||||
|
import {EntityType} from '@shared/models/entity-type.models'; |
||||
|
import {DashboardService} from '@core/http/dashboard.service'; |
||||
|
import {forkJoin, Observable} from 'rxjs'; |
||||
|
import {DashboardInfo} from '@app/shared/models/dashboard.models'; |
||||
|
import {ActionNotificationShow} from '@core/notification/notification.actions'; |
||||
|
import {TranslateService} from '@ngx-translate/core'; |
||||
|
|
||||
|
export interface MakeDashboardPublicDialogData { |
||||
|
dashboard: DashboardInfo; |
||||
|
} |
||||
|
|
||||
|
@Component({ |
||||
|
selector: 'tb-make-dashboard-public-dialog', |
||||
|
templateUrl: './make-dashboard-public-dialog.component.html', |
||||
|
styleUrls: [] |
||||
|
}) |
||||
|
export class MakeDashboardPublicDialogComponent extends PageComponent implements OnInit { |
||||
|
|
||||
|
dashboard: DashboardInfo; |
||||
|
|
||||
|
publicLink: string; |
||||
|
|
||||
|
constructor(protected store: Store<AppState>, |
||||
|
@Inject(MAT_DIALOG_DATA) public data: MakeDashboardPublicDialogData, |
||||
|
public translate: TranslateService, |
||||
|
private dashboardService: DashboardService, |
||||
|
public dialogRef: MatDialogRef<MakeDashboardPublicDialogComponent>, |
||||
|
public fb: FormBuilder) { |
||||
|
super(store); |
||||
|
|
||||
|
this.dashboard = data.dashboard; |
||||
|
this.publicLink = dashboardService.getPublicDashboardLink(this.dashboard); |
||||
|
} |
||||
|
|
||||
|
ngOnInit(): void { |
||||
|
} |
||||
|
|
||||
|
close(): void { |
||||
|
this.dialogRef.close(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
onPublicLinkCopied($event) { |
||||
|
this.store.dispatch(new ActionNotificationShow( |
||||
|
{ |
||||
|
message: this.translate.instant('dashboard.public-link-copied-message'), |
||||
|
type: 'success', |
||||
|
target: 'makeDashboardPublicDialogContent', |
||||
|
duration: 750, |
||||
|
verticalPosition: 'bottom', |
||||
|
horizontalPosition: 'left' |
||||
|
})); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,27 @@ |
|||||
|
/** |
||||
|
* Copyright © 2016-2019 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 { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
:host ::ng-deep { |
||||
|
.mat-form-field-flex { |
||||
|
padding-top: 0; |
||||
|
.mat-form-field-infix { |
||||
|
border-top: 0; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,18 @@ |
|||||
|
/** |
||||
|
* Copyright © 2016-2019 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 { |
||||
|
display: block; |
||||
|
} |
||||
|
After Width: | Height: | Size: 277 KiB |
Loading…
Reference in new issue