@@ -11,7 +11,7 @@ import {
1111 I18nService ,
1212 HttpService ,
1313 DrawerStateService ,
14- IframeCommunicationService ,
14+ IframeCommunicationService
1515} from '@app/services' ;
1616
1717@Component ( {
@@ -50,7 +50,7 @@ export class PagesConnectComponent implements OnInit, OnDestroy {
5050 private connectData : any ;
5151 private account : Account ;
5252 private connectToken : ConnectionToken ;
53- private connectMethod : ConnectMethod ;
53+ private connectMethod : ConnectMethod | string ;
5454 private asset : any ;
5555 private method : string ;
5656
@@ -63,7 +63,7 @@ export class PagesConnectComponent implements OnInit, OnDestroy {
6363 private _route : ActivatedRoute ,
6464 private _dialog : NzModalService ,
6565 private _drawerStateService : DrawerStateService ,
66- private _iframeCommunicationService : IframeCommunicationService ,
66+ private _iframeCommunicationService : IframeCommunicationService
6767 ) {
6868 this . startTime = new Date ( ) ;
6969 }
@@ -72,21 +72,18 @@ export class PagesConnectComponent implements OnInit, OnDestroy {
7272 this . view = null ;
7373 this . isTimerStopped = false ;
7474
75- // 检查是否为直连模式
7675 this . checkDirectMode ( ) ;
7776
78- // 监听 iframe 通信消息
7977 this . subscription = this . _iframeCommunicationService . message$ . subscribe ( message => {
8078 if ( message . name === 'CLOSE' ) {
8179 this . stopTimer ( ) ;
8280 }
8381 } ) ;
8482
8583 if ( this . isDirect ) {
86- // 直连模式初始化:需要获取资产数据和创建连接令牌
8784 await this . initDirectMode ( ) ;
85+
8886 } else {
89- // 普通连接模式初始化:等待 elements-connect 组件触发连接
9087 this . handleEventChangeTime ( ) ;
9188 }
9289 }
@@ -263,8 +260,6 @@ export class PagesConnectComponent implements OnInit, OnDestroy {
263260 case 'mongodb' :
264261 case 'clickhouse' :
265262 case 'k8s' :
266- case 'http' :
267- case 'https' :
268263 this . connectMethod = {
269264 component : 'koko' ,
270265 type : 'web' ,
@@ -274,6 +269,17 @@ export class PagesConnectComponent implements OnInit, OnDestroy {
274269 disabled : false
275270 } ;
276271 return 'web_cli' ;
272+ case 'http' :
273+ case 'https' :
274+ this . connectMethod = {
275+ component : 'lion' ,
276+ type : 'web' ,
277+ value : 'chrome' ,
278+ label : 'Chrome' ,
279+ endpoint_protocol : endpointProtocol ,
280+ disabled : false
281+ } ;
282+ return 'chrome' ;
277283 case 'rdp' :
278284 case 'vnc' :
279285 this . connectMethod = {
0 commit comments