Skip to content

Commit

Permalink
perf: Add viewAssetOnlineSessionInfo conf
Browse files Browse the repository at this point in the history
  • Loading branch information
w940853815 authored and BaiJiangJie committed Nov 25, 2024
1 parent bbd1e3a commit e86f2fc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ <h3>{{"Connect" | translate}} - {{ asset.name | truncatechars:30 }}</h3>
type="submit"
>
{{"Connect"| translate}}
<span *ngIf="protocol && protocol.name === 'rdp'" class="online-num">
<span *ngIf="protocol && protocol.name === 'rdp' && viewAssetOnlineSessionInfo" class="online-num">
({{ 'Current online' | translate}}: {{ onlineNum === null ? '- ' : onlineNum }})
</span>
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export class ElementConnectDialogComponent implements OnInit {
public protocols: Array<Protocol>;
public accountSelected: Account = null;
public connectOption: Object;
public viewAssetOnlineSessionInfo: boolean = true;
public outputData: ConnectData = new ConnectData();
public manualAuthInfo: AuthInfo = new AuthInfo();
public connectMethod: ConnectMethod = new ConnectMethod('Null', '', 'null', 'null');
Expand Down Expand Up @@ -92,6 +93,7 @@ export class ElementConnectDialogComponent implements OnInit {
this.connectMethod = connectMethods[0];
}
}
this.viewAssetOnlineSessionInfo = this._settingSvc.globalSetting.VIEW_ASSET_ONLINE_SESSION_INFO
}

onProtocolChange(protocol) {
Expand All @@ -100,6 +102,9 @@ export class ElementConnectDialogComponent implements OnInit {
}

getOnlineNum() {
if (!this.viewAssetOnlineSessionInfo) {
return;
}
if (this.protocol.name !== 'rdp') {
return;
}
Expand Down
1 change: 1 addition & 0 deletions src/app/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ export class GlobalSetting {
TERMINAL_GRAPHICAL_RESOLUTION: string;
CONNECTION_TOKEN_REUSABLE: boolean;
CHAT_AI_ENABLED: boolean;
VIEW_ASSET_ONLINE_SESSION_INFO: boolean;
}

export class Setting {
Expand Down

0 comments on commit e86f2fc

Please sign in to comment.