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 all commits
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,711 changes: 1,729 additions & 1,982 deletions webapp/package-lock.json

Large diffs are not rendered by default.

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