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

Perf: Optimize code structure #1218

Merged
merged 1 commit into from
Dec 30, 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
2 changes: 1 addition & 1 deletion src/app/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ export class ConnectOption {
export class AdminConnectData {
asset: Asset;
account: Account;
protocol: Protocol;
protocol: string;
input_username: string;
method: string;
}
Expand Down
6 changes: 2 additions & 4 deletions src/app/pages/pages.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import { PagesBlankComponent } from "./blank/blank.component";
import { PagesReplayComponent } from "./replay/replay.component";
import { PagesConnectComponent } from "./connect/connect.component";
import { PagesMonitorComponent } from "./monitor/monitor.component";
import { PagePamGUIComponent } from "./pam/gui.component/gui.component";
import { PagesNotFoundComponent } from "./not-found/not-found.component";
import { PagePamTerminalComponent } from "./pam/terminal.component/terminal.component";
import { PagePamComponent } from "./pam/pam.component";

export const PagesComponents = [
PageMainComponent,
Expand All @@ -16,6 +15,5 @@ export const PagesComponents = [
PagesNotFoundComponent,
PageSftpComponent,
PagesMonitorComponent,
PagePamTerminalComponent,
PagePamGUIComponent,
PagePamComponent
];
20 changes: 0 additions & 20 deletions src/app/pages/pam/gui.component/gui.component.html

This file was deleted.

102 changes: 0 additions & 102 deletions src/app/pages/pam/gui.component/gui.component.scss

This file was deleted.

140 changes: 140 additions & 0 deletions src/app/pages/pam/pam.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
<div>
<div class="terminal-connect" *ngIf="iframeTerminalURL">
<mat-sidenav-container (backdropClick)="closeDrawer()">
<mat-sidenav
#sidenav
position="end"
mode="over"
class="file-manage-drawer"
>
<div class="drawer-header">
<mat-icon style="cursor: pointer" (click)="closeDrawer()"
>close</mat-icon
>

<p>文件管理</p>
</div>

<mat-divider></mat-divider>

<div class="drawer-manage">
<div class="path">
<mat-icon>home</mat-icon>
<div class="delimiter">/</div>
</div>
</div>
</mat-sidenav>

<mat-sidenav-content>
<mat-card>
<mat-card-header style="height: 55px; align-items: center">
<mat-card-title> SSH 会话 </mat-card-title>

<mat-divider [vertical]="true"> </mat-divider>

<div class="info-section">
<div class="top-part">
<mat-icon matTooltip="资产信息">dvr</mat-icon>
<div class="desc">
<div style="font-weight: 700; margin-right: 5px">
资产信息:
</div>
{{ assetName }}
</div>
</div>

<div class="bottom-part">
<mat-icon matTooltip="连接时间">date_range</mat-icon>

<div class="desc">
<div style="font-weight: 700; margin-right: 5px">
连接时间:
</div>
{{ startTime.toLocaleString() }}
</div>
</div>
</div>

<div class="action-section">
<div class="timer-container">
<div class="timer">
<div [class.active]="isActive" class="status-dot"></div>
<span>{{ totalConnectTime }}</span>
</div>
</div>

<mat-divider [vertical]="true"> </mat-divider>

<div class="actions">
<div class="file-manage action-icon">
<mat-icon
matTooltip="文件管理"
(click)="handleOpenFileManage()"
>folder</mat-icon
>
</div>

<div class="exit action-icon">
<mat-icon matTooltip="退出" (click)="handleCloseConnect()"
>close</mat-icon
>
</div>
</div>
</div>
</mat-card-header>
</mat-card>

<mat-card
style="
margin: 20px;
height: calc(100% - 130px);
background-color: #f7f8f9;
"
>
<mat-card-content style="height: 100%">
<elements-iframe #iFrame [src]="iframeTerminalURL" [origin]="'pam'">
</elements-iframe>
</mat-card-content>
</mat-card>
</mat-sidenav-content>
</mat-sidenav-container>
</div>

<div class="sftp-connect" *ngIf="iframeSFTPURL">
<div class="timer-container">
<div class="timer">
<div [class.active]="isActive" class="status-dot"></div>
<span>{{ totalConnectTime }}</span>
</div>
</div>

<div class="action-icons" [class.show]="showActionIcons">
<div class="close-icon" (click)="handleCloseConnect()">
<mat-icon matTooltip="退出">close</mat-icon>
</div>
</div>

<pages-sftp></pages-sftp>
</div>

<div class="pam-gui" *ngIf="iframeRDPURL">
<div class="timer-container">
<div class="timer">
<div [class.active]="isActive" class="status-dot"></div>
<span>{{ totalConnectTime }}</span>
</div>
</div>

<div class="action-icons" [class.show]="showActionIcons">
<div class="close-icon" (click)="handleCloseConnect()">
<mat-icon matTooltip="退出">close</mat-icon>
</div>
</div>

<elements-iframe
*ngIf="iframeRDPURL"
[src]="iframeRDPURL"
[origin]="'pam'"
></elements-iframe>
</div>
</div>
Loading
Loading