Skip to content

Commit 7cb4e4f

Browse files
committed
added spinner when connecting
1 parent f5c3e6a commit 7cb4e4f

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

src/client/src/app/app.component.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,8 @@
33
width:200px;
44
margin:auto;
55
z-index:50;
6-
}
6+
}
7+
.connect-spinner {
8+
width:320px;
9+
margin:auto;
10+
}

src/client/src/app/app.component.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,8 @@
88
<monitor-canvas *ngFor="let mon of ClientSettings_.MonitorsToWatch" [Monitor]="mon" #HTMLCanvasScreenImage_></monitor-canvas>
99
<canvas #HTMLCanvasMouseImage_ style="position:absolute;"></canvas>
1010
</div>
11+
<div *ngIf="Socket_ && this.Socket_.readyState === this.Socket_.CONNECTING">
12+
<h1 style="text-align:center;">Connecting to {{ConnectedTo}}</h1>
13+
<mat-progress-spinner class="connect-spinner" mode="indeterminate" diameter="32" [value]="50"> </mat-progress-spinner>
14+
</div>
15+

src/client/src/app/app.component.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ export class AppComponent implements OnInit {
7171
public OpenDialog(): void
7272
{
7373
this.dialog.open(ConnectDialog, {disableClose : true}).afterClosed().subscribe((a: ConnectModel) => {
74-
if (a) {
75-
this.Socket_ = new WebSocket(a.Protocol + "://" + a.Host + ":" + a.Port);
74+
if (a) {
75+
this.Socket_ = new WebSocket(a.Protocol + "://" + a.Host + ":" + a.Port);
7676
this.Socket_.binaryType = 'arraybuffer';
7777
this.ConnectedTo = a.Protocol + "://" + a.Host + ":" + a.Port;
7878
this.ClientDriver_ =
@@ -87,6 +87,7 @@ export class AppComponent implements OnInit {
8787
.onMessage((ws: WebSocket, message: WSMessage) => { console.log('onMessage length:' + message.data.byteLength); })
8888
.onDisconnection((ws: WebSocket, code: number, message: string) => {
8989
console.log('onDisconnection ' + code + " "+ message);
90+
this.ConnectedTo ='';
9091
this.Cursor_ = null;
9192
this.ScaleImage_ = false;
9293
this.Monitors = new Array<Monitor>();

src/client/src/app/material.module.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {MatButtonModule, MatCheckboxModule, MatDialogModule, MatInputModule, MatSelectModule, MatSidenavModule, MatListModule} from '@angular/material';
1+
import {MatButtonModule, MatCheckboxModule, MatDialogModule, MatInputModule, MatSelectModule, MatSidenavModule, MatListModule, MatProgressSpinnerModule} from '@angular/material';
22
import { NgModule } from '@angular/core';
33

44
@NgModule({
@@ -9,7 +9,8 @@ import { NgModule } from '@angular/core';
99
MatInputModule,
1010
MatSelectModule,
1111
MatSidenavModule,
12-
MatListModule
12+
MatListModule,
13+
MatProgressSpinnerModule
1314
],
1415
exports: [
1516
MatButtonModule,
@@ -18,7 +19,8 @@ import { NgModule } from '@angular/core';
1819
MatInputModule,
1920
MatSelectModule,
2021
MatSidenavModule,
21-
MatListModule
22+
MatListModule,
23+
MatProgressSpinnerModule
2224
],
2325
})
2426
export class MaterialModule { }

0 commit comments

Comments
 (0)