Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(webapp): session toolbar loading issues #1106

Merged
merged 4 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,717 changes: 1,731 additions & 1,986 deletions webapp/package-lock.json

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"@angular/cli": "18.2.1",
"@angular/compiler-cli": "18.2.1",
"@biomejs/biome": "1.9.3",
"@biomejs/cli-linux-x64": "1.9.3",

"@types/jasmine": "~4.3.0",
"@types/uuid": "^9.0.8",
"jasmine-core": "~4.6.0",
Expand All @@ -60,6 +60,7 @@
"typescript": "^5.5.4"
},
"optionalDependencies": {
"@rollup/rollup-linux-x64-gnu": "^4.21.2"
"@rollup/rollup-linux-x64-gnu": "^4.21.2",
"@biomejs/cli-linux-x64": "1.9.3"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,47 +7,11 @@
[isFormExists]="true"></web-client-form>
</div>

<div #sessionToolbar
id="sessionToolbar"
*ngIf="!isFullScreenMode || (isFullScreenMode && showToolbarDiv)"
[ngClass]="isFullScreenMode?'session-toolbar-layer':''"
class="session-toolbar">

<div class="session-toolbar-left-group">

</div>

<div class="session-toolbar-middle-group">
<p-button
(onClick)="scaleTo(screenScale.Full)"
label="Full Screen"
icon="dvl-icon dvl-icon-fullscreen"
iconPos="left"></p-button>

<div class="separator"></div>

<p-button
(onClick)="scaleTo(screenScale.Fit)"
label="Fit to Screen"
icon="dvl-icon dvl-icon-minimize"
iconPos="left"></p-button>

<div class="separator"></div>
<p-button
(onClick)="scaleTo(screenScale.Real)"
label="Actual Size"
icon="dvl-icon dvl-icon-screen"
iconPos="left"></p-button>
</div>

<div class="session-toolbar-right-group">
<p-button (onClick)="startTerminationProcess()"
styleClass="other"
label="Close Session"
icon="dvl-icon dvl-icon-close"
iconPos="left"></p-button>
</div>
</div>
<session-toolbar
[sessionContainerParent]="sessionContainerElement"
[middleButtons]="middleToolbarButtons"
[rightButtons]="rightToolbarButtons">
</session-toolbar>

<div class="loading-info-container" *ngIf="loading">
<div class="loading-info">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,27 @@ export class WebClientArdComponent extends WebClientBaseComponent implements OnI
showToolbarDiv = true;
loading = true;

middleToolbarButtons = [
{
label: 'Fit to Screen',
icon: 'dvl-icon dvl-icon-minimize',
action: () => this.scaleTo(this.screenScale.Fit)
},
{
label: 'Actual Size',
icon: 'dvl-icon dvl-icon-screen',
action: () => this.scaleTo(this.screenScale.Real)
}
];

rightToolbarButtons = [
{
label: 'Close Session',
icon: 'dvl-icon dvl-icon-close',
action: () => this.startTerminationProcess()
},
];

protected removeElement = new Subject();
private remoteClientEventListener: (event: Event) => void;
private remoteClient: UserInteraction;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,59 +7,12 @@
[isFormExists]="true"></web-client-form>
</div>

<div #sessionToolbar
id="sessionToolbar"
*ngIf="!isFullScreenMode || (isFullScreenMode && showToolbarDiv)"
[ngClass]="isFullScreenMode?'session-toolbar-layer':''"
class="session-toolbar">

<div class="session-toolbar-left-group">
<p-button
(onClick)="sendWindowsKey()"
label="Start"
icon="dvl-icon dvl-icon-windows"
iconPos="left"></p-button>

<div class="separator"></div>

<p-button
(onClick)="sendCtrlAltDel()"
label="Ctrl+Alt+Del"
icon="dvl-icon dvl-icon-admin"
iconPos="left"></p-button>
</div>

<div class="session-toolbar-middle-group">
<p-button
(onClick)="scaleTo(screenScale.Full)"
label="Full Screen"
icon="dvl-icon dvl-icon-fullscreen"
iconPos="left"></p-button>

<div class="separator"></div>

<p-button
(onClick)="scaleTo(screenScale.Fit)"
label="Fit to Screen"
icon="dvl-icon dvl-icon-minimize"
iconPos="left"></p-button>

<div class="separator"></div>
<p-button
(onClick)="scaleTo(screenScale.Real)"
label="Actual Size"
icon="dvl-icon dvl-icon-screen"
iconPos="left"></p-button>
</div>

<div class="session-toolbar-right-group">
<p-button (onClick)="startTerminationProcess()"
styleClass="other"
label="Close Session"
icon="dvl-icon dvl-icon-close"
iconPos="left"></p-button>
</div>
</div>
<session-toolbar
[sessionContainerParent]="sessionContainerElement"
[leftButtons]="leftToolbarButtons"
[middleButtons]="middleToolbarButtons"
[rightButtons]="rightToolbarButtons">
</session-toolbar>

<div class="loading-info-container" *ngIf="loading">
<div class="loading-info">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,40 @@ export class WebClientRdpComponent extends WebClientBaseComponent implements OnI
showToolbarDiv = true;
loading = true;

leftToolbarButtons = [
{
label: 'Start',
icon: 'dvl-icon dvl-icon-windows',
action: () => this.sendWindowsKey()
},
{
label: 'Ctrl+Alt+Del',
icon: 'dvl-icon dvl-icon-admin',
action: () => this.sendCtrlAltDel()
}
];

middleToolbarButtons = [
{
label: 'Fit to Screen',
icon: 'dvl-icon dvl-icon-minimize',
action: () => this.scaleTo(this.screenScale.Fit)
},
{
label: 'Actual Size',
icon: 'dvl-icon dvl-icon-screen',
action: () => this.scaleTo(this.screenScale.Real)
}
];

rightToolbarButtons = [
{
label: 'Close Session',
icon: 'dvl-icon dvl-icon-close',
action: () => this.startTerminationProcess()
},
];

protected removeElement = new Subject();
private remoteClientEventListener: (event: Event) => void;
private remoteClient: UserInteraction;
Expand Down Expand Up @@ -331,7 +365,6 @@ export class WebClientRdpComponent extends WebClientBaseComponent implements OnI
private initSessionEventHandler(): void {
this.remoteClient.sessionListener.subscribe({
next: (event: SessionEvent): void => {
console.log('event', event);
switch (event.type) {
case SessionEventType.STARTED:
this.handleSessionStarted(event);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,59 +7,12 @@
[isFormExists]="true"></web-client-form>
</div>

<div #sessionToolbar
id="sessionToolbar"
*ngIf="!isFullScreenMode || (isFullScreenMode && showToolbarDiv)"
[ngClass]="isFullScreenMode?'session-toolbar-layer':''"
class="session-toolbar">

<div class="session-toolbar-left-group">
<p-button
(onClick)="sendWindowsKey()"
label="Start"
icon="dvl-icon dvl-icon-windows"
iconPos="left"></p-button>

<div class="separator"></div>

<p-button
(onClick)="sendCtrlAltDel()"
label="Ctrl+Alt+Del"
icon="dvl-icon dvl-icon-admin"
iconPos="left"></p-button>
</div>

<div class="session-toolbar-middle-group">
<p-button
(onClick)="scaleTo(screenScale.Full)"
label="Full Screen"
icon="dvl-icon dvl-icon-fullscreen"
iconPos="left"></p-button>

<div class="separator"></div>

<p-button
(onClick)="scaleTo(screenScale.Fit)"
label="Fit to Screen"
icon="dvl-icon dvl-icon-minimize"
iconPos="left"></p-button>

<div class="separator"></div>
<p-button
(onClick)="scaleTo(screenScale.Real)"
label="Actual Size"
icon="dvl-icon dvl-icon-screen"
iconPos="left"></p-button>
</div>

<div class="session-toolbar-right-group">
<p-button (onClick)="startTerminationProcess()"
styleClass="other"
label="Close Session"
icon="dvl-icon dvl-icon-close"
iconPos="left"></p-button>
</div>
</div>
<session-toolbar
[sessionContainerParent]="sessionContainerElement"
[leftButtons]="leftToolbarButtons"
[middleButtons]="middleToolbarButtons"
[rightButtons]="rightToolbarButtons">
</session-toolbar>

<div class="loading-info-container" *ngIf="loading">
<div class="loading-info">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,40 @@ export class WebClientVncComponent extends WebClientBaseComponent implements OnI
showToolbarDiv = true;
loading = true;

leftToolbarButtons = [
{
label: 'Start',
icon: 'dvl-icon dvl-icon-windows',
action: () => this.sendWindowsKey()
},
{
label: 'Ctrl+Alt+Del',
icon: 'dvl-icon dvl-icon-admin',
action: () => this.sendCtrlAltDel()
}
];

middleToolbarButtons = [
{
label: 'Fit to Screen',
icon: 'dvl-icon dvl-icon-minimize',
action: () => this.scaleTo(this.screenScale.Fit)
},
{
label: 'Actual Size',
icon: 'dvl-icon dvl-icon-screen',
action: () => this.scaleTo(this.screenScale.Real)
}
];

rightToolbarButtons = [
{
label: 'Close Session',
icon: 'dvl-icon dvl-icon-close',
action: () => this.startTerminationProcess()
},
];

protected removeElement: Subject<unknown> = new Subject();
private remoteClient: UserInteraction;
private remoteClientEventListener: (event: Event) => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[icon]="button.icon"
iconPos="left"></p-button>

<div class="separator"></div>
<div class="separator" *ngIf="!last"></div>

</ng-container>
</div>
Expand All @@ -31,7 +31,7 @@
[icon]="button.icon"
iconPos="left"></p-button>

<div class="separator"></div>
<div class="separator" *ngIf="!last"></div>

</ng-container>
</div>
Expand All @@ -43,7 +43,7 @@
[icon]="button.icon"
iconPos="left"></p-button>

<div class="separator" *ngIf="rightButtons.length > 1"></div>
<div class="separator" *ngIf="rightButtons.length > 1 && !last"></div>

</ng-container>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
flex: 1;
}

.session-toolbar-right-group {
.session-toolbar-right-group, .session-toolbar-left-group {
display: flex;
align-items: center;
}
Expand Down
Loading