Skip to content

Commit e86f2fc

Browse files
w940853815BaiJiangJie
authored andcommitted
perf: Add viewAssetOnlineSessionInfo conf
1 parent bbd1e3a commit e86f2fc

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

src/app/elements/connect/connect-dialog/connect-dialog.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ <h3>{{"Connect" | translate}} - {{ asset.name | truncatechars:30 }}</h3>
7373
type="submit"
7474
>
7575
{{"Connect"| translate}}
76-
<span *ngIf="protocol && protocol.name === 'rdp'" class="online-num">
76+
<span *ngIf="protocol && protocol.name === 'rdp' && viewAssetOnlineSessionInfo" class="online-num">
7777
({{ 'Current online' | translate}}: {{ onlineNum === null ? '- ' : onlineNum }})
7878
</span>
7979
</button>

src/app/elements/connect/connect-dialog/connect-dialog.component.ts

+5
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export class ElementConnectDialogComponent implements OnInit {
2424
public protocols: Array<Protocol>;
2525
public accountSelected: Account = null;
2626
public connectOption: Object;
27+
public viewAssetOnlineSessionInfo: boolean = true;
2728
public outputData: ConnectData = new ConnectData();
2829
public manualAuthInfo: AuthInfo = new AuthInfo();
2930
public connectMethod: ConnectMethod = new ConnectMethod('Null', '', 'null', 'null');
@@ -92,6 +93,7 @@ export class ElementConnectDialogComponent implements OnInit {
9293
this.connectMethod = connectMethods[0];
9394
}
9495
}
96+
this.viewAssetOnlineSessionInfo = this._settingSvc.globalSetting.VIEW_ASSET_ONLINE_SESSION_INFO
9597
}
9698

9799
onProtocolChange(protocol) {
@@ -100,6 +102,9 @@ export class ElementConnectDialogComponent implements OnInit {
100102
}
101103

102104
getOnlineNum() {
105+
if (!this.viewAssetOnlineSessionInfo) {
106+
return;
107+
}
103108
if (this.protocol.name !== 'rdp') {
104109
return;
105110
}

src/app/model.ts

+1
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ export class GlobalSetting {
273273
TERMINAL_GRAPHICAL_RESOLUTION: string;
274274
CONNECTION_TOKEN_REUSABLE: boolean;
275275
CHAT_AI_ENABLED: boolean;
276+
VIEW_ASSET_ONLINE_SESSION_INFO: boolean;
276277
}
277278

278279
export class Setting {

0 commit comments

Comments
 (0)