Unverified Commit 6098b0a2 authored by liuzheng712's avatar liuzheng712

Merge branch 'github_dev' into dev

parents c0d5504a 889c877e
...@@ -24,7 +24,7 @@ import {DialogService, ElementDialogAlertComponent} from './elements/dialog/dial ...@@ -24,7 +24,7 @@ import {DialogService, ElementDialogAlertComponent} from './elements/dialog/dial
import {ElementFooterComponent} from './elements/footer/footer.component'; import {ElementFooterComponent} from './elements/footer/footer.component';
import {ElementTermComponent} from './elements/term/term.component'; import {ElementTermComponent} from './elements/term/term.component';
import {ElementInteractiveComponent} from './elements/interactive/interactive.component'; import {ElementInteractiveComponent} from './elements/interactive/interactive.component';
import {ElementNavComponent} from './elements/nav/nav.component'; import {ChangLanWarningDialogComponent, ElementNavComponent} from './elements/nav/nav.component';
import {ElementPopupComponent} from './elements/popup/popup.component'; import {ElementPopupComponent} from './elements/popup/popup.component';
import {ElementRdpComponent} from './elements/rdp/rdp.component'; import {ElementRdpComponent} from './elements/rdp/rdp.component';
import {ElementServerMenuComponent} from './elements/server-menu/server-menu.component'; import {ElementServerMenuComponent} from './elements/server-menu/server-menu.component';
...@@ -83,7 +83,7 @@ import {ConnectPageComponent} from './connect-page/connect-page.component'; ...@@ -83,7 +83,7 @@ import {ConnectPageComponent} from './connect-page/connect-page.component';
], ],
declarations: [ declarations: [
AppComponent, AppComponent,
ElementNavComponent, ElementNavComponent, ChangLanWarningDialogComponent,
ElementFooterComponent, ElementFooterComponent,
ElementPopupComponent, ElementPopupComponent,
ElementTermComponent, ElementTermComponent,
...@@ -128,6 +128,7 @@ import {ConnectPageComponent} from './connect-page/connect-page.component'; ...@@ -128,6 +128,7 @@ import {ConnectPageComponent} from './connect-page/connect-page.component';
entryComponents: [ entryComponents: [
CleftbarDialogComponent, CleftbarDialogComponent,
ElementDialogAlertComponent, ElementDialogAlertComponent,
ChangLanWarningDialogComponent,
], ],
bootstrap: [AppComponent], bootstrap: [AppComponent],
providers: [ providers: [
......
<h1 mat-dialog-title>{{"Warning"|trans}}</h1>
<h2>
{{"The page will be reload, can you acceptable?"|trans}}
</h2>
<div style="float: right">
<button mat-raised-button (click)="onNoClick()">{{"Cancel"|trans}}</button>
<button mat-raised-button color="primary" [mat-dialog-close]="selected" cdkFocusInitial>{{"Confirm"|trans}}</button>
</div>
...@@ -5,12 +5,14 @@ ...@@ -5,12 +5,14 @@
* @date 2017-11-07 * @date 2017-11-07
* @author liuzheng <liuzheng712@gmail.com> * @author liuzheng <liuzheng712@gmail.com>
*/ */
import {Component, OnInit} from '@angular/core'; import {Component, Inject, OnInit} from '@angular/core';
import {AppService, HttpService, LocalStorageService, LogService} from '../../app.service'; import {AppService, HttpService, LocalStorageService, LogService} from '../../app.service';
import {CleftbarComponent} from '../../ControlPage/cleftbar/cleftbar.component'; import {CleftbarComponent} from '../../ControlPage/cleftbar/cleftbar.component';
import {ControlComponent, NavList} from '../../ControlPage/control/control.component'; import {ControlComponent, NavList} from '../../ControlPage/control/control.component';
import {DataStore, i18n} from '../../globals'; import {DataStore, i18n} from '../../globals';
import * as jQuery from 'jquery/dist/jquery.min.js'; import * as jQuery from 'jquery/dist/jquery.min.js';
import {MAT_DIALOG_DATA, MatDialog, MatDialogRef} from '@angular/material';
import {FormControl, Validators} from '@angular/forms';
// import * as layer from 'layui-layer/src/layer.js'; // import * as layer from 'layui-layer/src/layer.js';
declare let layer: any; declare let layer: any;
...@@ -21,6 +23,7 @@ declare let layer: any; ...@@ -21,6 +23,7 @@ declare let layer: any;
}) })
export class ElementNavComponent implements OnInit { export class ElementNavComponent implements OnInit {
DataStore = DataStore; DataStore = DataStore;
ChangeLanWarningDialog: any;
static Hide() { static Hide() {
jQuery('app-element-nav').hide(); jQuery('app-element-nav').hide();
...@@ -29,12 +32,19 @@ export class ElementNavComponent implements OnInit { ...@@ -29,12 +32,19 @@ export class ElementNavComponent implements OnInit {
constructor(private _appService: AppService, constructor(private _appService: AppService,
private _http: HttpService, private _http: HttpService,
private _logger: LogService, private _logger: LogService,
public _dialog: MatDialog,
private _localStorage: LocalStorageService) { private _localStorage: LocalStorageService) {
this._logger.log('nav.ts:NavComponent'); this._logger.log('nav.ts:NavComponent');
this.getnav(); this.getnav();
} }
ngOnInit() { ngOnInit() {
this.ChangeLanWarningDialog = this._dialog.open(
ChangLanWarningDialogComponent,
{
height: '200px',
width: '300px',
});
} }
click(event) { click(event) {
...@@ -95,11 +105,21 @@ export class ElementNavComponent implements OnInit { ...@@ -95,11 +105,21 @@ export class ElementNavComponent implements OnInit {
break; break;
} }
case 'English': { case 'English': {
this.English(); this.ChangeLanWarningDialog.afterClosed().subscribe(
result => {
if (result) {
this.English();
}
});
break; break;
} }
case 'Chinese': { case 'Chinese': {
this.Language('cn'); this.ChangeLanWarningDialog.afterClosed().subscribe(
result => {
if (result) {
this.Language('cn');
}
});
break; break;
} }
default: { default: {
...@@ -304,3 +324,21 @@ export class ElementNavComponent implements OnInit { ...@@ -304,3 +324,21 @@ export class ElementNavComponent implements OnInit {
location.reload(); location.reload();
} }
} }
@Component({
selector: 'app-element-nav-dialog',
templateUrl: 'changeLanWarning.html',
})
export class ChangLanWarningDialogComponent implements OnInit {
constructor(public dialogRef: MatDialogRef<ChangLanWarningDialogComponent>) {
}
ngOnInit() {
}
onNoClick(): void {
this.dialogRef.close();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment