Skip to content

Commit d1b5673

Browse files
committed
feat: 支持配置资产连接默认打开方式
1 parent 1da4565 commit d1b5673

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

src/app/elements/asset-tree/asset-tree.component.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ export class ElementAssetTreeComponent implements OnInit {
102102
isShowRMenu = false;
103103
rightClickSelectNode: any;
104104
isLoadTreeAsync: boolean;
105+
isOpenNewWindow: boolean;
105106
filterAssetCancel$: Subject<boolean> = new Subject();
106107
favoriteAssets = [];
107108
searchValue = '';
@@ -221,6 +222,8 @@ export class ElementAssetTreeComponent implements OnInit {
221222
this.currentOrgID = this._cookie.get('X-JMS-LUNA-ORG') || this._cookie.get('X-JMS-ORG');
222223
this._settingSvc.afterInited().then((state) => {
223224
this.isLoadTreeAsync = this._settingSvc.isLoadTreeAsync();
225+
this.isOpenNewWindow = this._settingSvc.isOpenNewWindow();
226+
224227
if (state) {
225228
if (!this._settingSvc.hasXPack() && this.currentOrgID === SYSTEM_ORG_ID) {
226229
this.currentOrgID = DEFAULT_ORG_ID;
@@ -255,7 +258,11 @@ export class ElementAssetTreeComponent implements OnInit {
255258
this._dialog.open(DisabledAssetsDialogComponent, config);
256259
return;
257260
}
258-
this.connectAsset(treeNode).then();
261+
if (this.isOpenNewWindow) {
262+
connectOnNewPage(treeNode, 'auto');
263+
} else {
264+
this.connectAsset(treeNode).then();
265+
}
259266
}
260267

261268
onAssetTreeCheck(event, treeId) {

src/app/model.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,8 @@ export class Setting {
281281
sqlClient = '1';
282282

283283
basic = {
284-
is_async_asset_tree: false
284+
is_async_asset_tree: false,
285+
connect_default_open_method: 'new'
285286
};
286287
graphics = {
287288
rdp_resolution: 'Auto',

src/app/services/setting.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export class SettingService {
1313
settingKey = 'LunaSetting';
1414
public initialized$ = new BehaviorSubject<boolean>(false);
1515
public isLoadTreeAsync$ = new BehaviorSubject<boolean>(true);
16+
public isOpenNewWindow$ = new BehaviorSubject<boolean>(false);
1617
public appletConnectMethod$ = new BehaviorSubject<string>('');
1718
public keyboardLayout$ = new BehaviorSubject<string>('');
1819
public isDirectNavigation$ = new BehaviorSubject<boolean>(false);
@@ -127,6 +128,11 @@ export class SettingService {
127128
return this.setting.basic.is_async_asset_tree;
128129
}
129130

131+
isOpenNewWindow() {
132+
return this.setting.basic.connect_default_open_method === 'new';
133+
}
134+
135+
130136
setAppletConnectMethod() {
131137
this.appletConnectMethod$.next(this.setting.graphics.applet_connection_method);
132138
}

0 commit comments

Comments
 (0)