mirror of
https://gitee.com/eolink_admin/postcat.git
synced 2024-12-02 03:38:03 +08:00
fix: new websocket tab jump to mock
This commit is contained in:
parent
860ffce8f9
commit
174b38f9b8
@ -87,9 +87,8 @@ export class ApiTabOperateService {
|
|||||||
*
|
*
|
||||||
* @returns tabItem
|
* @returns tabItem
|
||||||
*/
|
*/
|
||||||
newDefaultTab(key = 'http-test') {
|
newDefaultTab(path?) {
|
||||||
const pathHash = ['http-test', 'http-edit', 'http-detail', 'overview', 'ws-test', 'http-mock'];
|
const tabItem = Object.assign({}, eoDeepCopy(this.BASIC_TABS.find(val=>val.pathname===path)||this.BASIC_TABS[0]));
|
||||||
const tabItem = Object.assign({}, eoDeepCopy(this.BASIC_TABS[pathHash.findIndex((it) => it === key)]));
|
|
||||||
tabItem.params = {};
|
tabItem.params = {};
|
||||||
tabItem.uuid = tabItem.params.pageID = Date.now();
|
tabItem.uuid = tabItem.params.pageID = Date.now();
|
||||||
Object.assign(tabItem, { isLoading: false });
|
Object.assign(tabItem, { isLoading: false });
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
<nz-dropdown-menu #addMenu="nzDropdownMenu">
|
<nz-dropdown-menu #addMenu="nzDropdownMenu">
|
||||||
<ul nz-menu>
|
<ul nz-menu>
|
||||||
<li nz-menu-item (click)="newTab()">HTTP</li>
|
<li nz-menu-item (click)="newTab()">HTTP</li>
|
||||||
<li nz-menu-item (click)="newTab('ws-test')">Websocket</li>
|
<li nz-menu-item (click)="newTab('/home/api/ws/test')">Websocket</li>
|
||||||
</ul>
|
</ul>
|
||||||
</nz-dropdown-menu>
|
</nz-dropdown-menu>
|
||||||
<a nz-dropdown [nzDropdownMenu]="menu">
|
<a nz-dropdown [nzDropdownMenu]="menu">
|
||||||
|
Loading…
Reference in New Issue
Block a user