-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(frontend): added button to toggle - wip
- Loading branch information
myst
committed
Aug 13, 2024
1 parent
0e41d46
commit bc693e4
Showing
4 changed files
with
118 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 53 additions & 32 deletions
85
frontend/src/app/core/mud/mud-client/mud-client.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,63 @@ | ||
<p-splitter | ||
layout="vertical" | ||
[style]="{ flex: '0 1 100%', overflow: 'hidden' }" | ||
[panelStyle]="{ overflow: 'hidden' }" | ||
> | ||
<ng-template pTemplate> | ||
<app-mud-output | ||
id="test" | ||
*ngIf="this.output$ | async as lines" | ||
[lines]="lines" | ||
[foregroundColor]="this.v.stdfg" | ||
[backgroundColor]="this.v.stdbg" | ||
[shallScroll]="true" | ||
></app-mud-output> | ||
</ng-template> | ||
<ng-template pTemplate> | ||
<ng-container *ngIf="this.mode$ | async as mode"> | ||
<p-splitter | ||
*ngIf="mode === 'split'; else singleMode" | ||
layout="vertical" | ||
[style]="{ flex: '0 1 100%', overflow: 'hidden' }" | ||
[panelStyle]="{ overflow: 'hidden' }" | ||
[panelSizes]="[85, 15]" | ||
> | ||
<ng-template pTemplate> | ||
<app-mud-output | ||
id="test" | ||
*ngIf="this.output$ | async as lines" | ||
[lines]="lines" | ||
[foregroundColor]="this.v.stdfg" | ||
[backgroundColor]="this.v.stdbg" | ||
[shallScroll]="true" | ||
></app-mud-output> | ||
</ng-template> | ||
<ng-template pTemplate> | ||
<app-mud-output | ||
#mainOutputSplit | ||
*ngIf="this.output$ | async as lines" | ||
[lines]="lines" | ||
[foregroundColor]="this.v.stdfg" | ||
[backgroundColor]="this.v.stdbg" | ||
[autoScroll]="true" | ||
></app-mud-output> | ||
</ng-template> | ||
</p-splitter> | ||
|
||
<ng-template #singleMode> | ||
<app-mud-output | ||
*ngIf="this.output$ | async as lines" | ||
[lines]="lines" | ||
[foregroundColor]="this.v.stdfg" | ||
[backgroundColor]="this.v.stdbg" | ||
[autoScroll]="true" | ||
[shallScroll]="true" | ||
></app-mud-output> | ||
</ng-template> | ||
</p-splitter> | ||
|
||
<ng-container *ngIf="this.isConnected$ | async; else disconnected"> | ||
<app-mud-input | ||
[mode]="(this.showEcho$ | async) ? 'text' : 'password'" | ||
(messageSent)="onInputReceived($event)" | ||
></app-mud-input> | ||
</ng-container> | ||
<ng-container *ngIf="this.isConnected$ | async; else disconnected"> | ||
<div style="display: flex; align-items: center"> | ||
<app-mud-input | ||
[mode]="(this.showEcho$ | async) ? 'text' : 'password'" | ||
(messageSent)="onInputReceived($event)" | ||
[style]="{ flex: '1 1 auto' }" | ||
></app-mud-input> | ||
<p-button | ||
[style]="{ flex: '0 1 auto' }" | ||
[label]="mode === 'normal' ? 'split' : 'unsplit'" | ||
(click)="this.onSplitToggle()" | ||
></p-button> | ||
</div> | ||
</ng-container> | ||
|
||
<ng-template #disconnected> | ||
<div id="disconnected-panel"> | ||
<p>Disconnected!</p> | ||
<p-button label="reconnect" (click)="this.onConnectClicked()"></p-button> | ||
</div> | ||
</ng-template> | ||
|
||
<!--<p-divider layout="vertical"></p-divider> | ||
<app-inventory [inv]="invlist" [vheight]="v.ref_height"></app-inventory>--> | ||
<ng-template #disconnected> | ||
<div id="disconnected-panel"> | ||
<p>Disconnected!</p> | ||
<p-button label="reconnect" (click)="this.onConnectClicked()"></p-button> | ||
</div> | ||
</ng-template> | ||
</ng-container> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,11 @@ | |
|
||
app-mud-output { | ||
flex: 1 1 100%; | ||
overflow: hidden; | ||
|
||
&#test { | ||
flex: 1 1 0%; | ||
} | ||
} | ||
|
||
app-mud-input { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters