Skip to content

Commit

Permalink
fix: hide footer view error
Browse files Browse the repository at this point in the history
  • Loading branch information
scarqin committed Apr 26, 2022
1 parent f29eb10 commit 45dd602
Show file tree
Hide file tree
Showing 11 changed files with 67 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/shared/common/bounds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const getViewBounds = (zone: ViewZone, width: number, height: number, sid
export const calculateViewBounds = (width: number, height: number, sidePosition?: SidePosition, sideWidth?: number): Map<ViewZone, ViewBounds> => {
const position: SidePosition = sidePosition || SidePosition.left;
const _topHeight: number = 50;
const _bottomHeight: number = 30;
const _bottomHeight: number = 0;
const _sideWidth: number = sideWidth || 50;
const _mainHeight: number = height - _topHeight - _bottomHeight;
let topBounds: ViewBounds = {x: 0, y: 0, width: width, height: _topHeight};
Expand Down
4 changes: 2 additions & 2 deletions src/workbench/browser/src/app/pages/api/api.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ nz-sider {
eo-api {
router-outlet + * {
display: block;
height: calc(100vh - var(--NAVBAR_HEIGHT) - 45px);
height: calc(100vh - var(--NAVBAR_HEIGHT) - var(FOOTER_HEIGHT) - 45px);
overflow: auto;
}
.has_tab_page router-outlet + * {
height: calc(100vh - var(--NAVBAR_HEIGHT) - 45px - 46px);
height: calc(100vh - var(--NAVBAR_HEIGHT) - var(FOOTER_HEIGHT) - 45px - 46px);
}
}
.method_text_GET {
Expand Down
5 changes: 5 additions & 0 deletions src/workbench/browser/src/app/pages/pages-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { RouterModule, Routes } from '@angular/router';
import { NgModule } from '@angular/core';

import { PagesComponent } from './pages.component';
import { PageBlankComponent } from '../shared/components/page-blank/page-blank.component';
const routes: Routes = [
{
path: '',
Expand All @@ -12,6 +13,10 @@ const routes: Routes = [
redirectTo: 'api',
pathMatch: 'full',
},
{
path: 'blank',
component:PageBlankComponent
},
{
path: 'api',
loadChildren: () => import('./api/api.module').then((m) => m.ApiModule),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div class="p20">
<nz-spin nzSimple [nzSize]="'large'"></nz-spin>
</div>
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { PageBlankComponent } from './page-blank.component';

describe('PageBlankComponent', () => {
let component: PageBlankComponent;
let fixture: ComponentFixture<PageBlankComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ PageBlankComponent ]
})
.compileComponents();
});

beforeEach(() => {
fixture = TestBed.createComponent(PageBlankComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';

@Component({
selector: 'eo-page-blank',
templateUrl: './page-blank.component.html',
styleUrls: ['./page-blank.component.scss']
})
export class PageBlankComponent implements OnInit {

constructor() { }

ngOnInit(): void {
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { takeWhile } from 'rxjs/operators';
import { ElectronService } from '../../../core/services';
import { ModuleInfo } from '../../../../../../../platform/node/extension-manager';
import { SidebarService } from './sidebar.service';
import { Router } from '@angular/router';
@Component({
selector: 'eo-sidebar',
templateUrl: './sidebar.component.html',
Expand All @@ -14,7 +15,7 @@ export class SidebarComponent implements OnInit, OnDestroy {
isElectron: boolean = false;
moduleID: string = '@eo-core-apimanger';
modules: Array<ModuleInfo | any>;
constructor(private electron: ElectronService, private sidebar: SidebarService) {
constructor(private electron: ElectronService,private router: Router, private sidebar: SidebarService) {
this.isElectron = this.electron.isElectron;
this.isCollapsed = this.sidebar.getCollapsed();
this.sidebar
Expand Down Expand Up @@ -54,7 +55,15 @@ export class SidebarComponent implements OnInit, OnDestroy {
}

openApp(moduleID: string) {
let currentApp=this.modules.find(val=>val.moduleID===this.moduleID),nextApp=this.modules.find(val=>val.moduleID===moduleID);
if(currentApp.route){
//core app
this.router.navigate(['home/blank']);
}
this.moduleID = moduleID;
if(nextApp.route){
this.router.navigate([nextApp.route]);
}
window.eo.openApp({ moduleID: moduleID });
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,5 @@ export const eoFormatResponseData = ({type,report, history, id }) => {
value: val.value,
}));
}
console.log(JSON.stringify(result))
return result;
};
5 changes: 4 additions & 1 deletion src/workbench/browser/src/app/shared/shared.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ import { NzIconModule } from 'ng-zorro-antd/icon';
import { NzToolTipModule } from 'ng-zorro-antd/tooltip';
import { NzResultModule } from 'ng-zorro-antd/result';
import { NzDropDownModule } from 'ng-zorro-antd/dropdown';
import { NzSpinModule } from 'ng-zorro-antd/spin';

import { ApiParamsNumPipe } from './pipes/api-param-num.pipe';
import { ModalService } from './services/modal.service';
import { PageBlankComponent } from './components/page-blank/page-blank.component';

const COMPONENTS = [ToolbarComponent, SelectThemeComponent, SidebarComponent, NavbarComponent,PageNotFoundComponent];
@NgModule({
Expand All @@ -34,8 +36,9 @@ const COMPONENTS = [ToolbarComponent, SelectThemeComponent, SidebarComponent, Na
NzToolTipModule,
NzResultModule,
NzDropDownModule,
NzSpinModule
],
declarations: [WebviewDirective, ...COMPONENTS, ApiParamsNumPipe],
declarations: [WebviewDirective, ...COMPONENTS, ApiParamsNumPipe, PageBlankComponent],
providers: [ModalService],
exports: [WebviewDirective, ...COMPONENTS, ApiParamsNumPipe],
})
Expand Down
3 changes: 2 additions & 1 deletion src/workbench/browser/src/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ body {
}
:root {
--NAVBAR_HEIGHT: 50px;
--FOOTER_HEIGHT: 30px;
--FOOTER_HEIGHT: 0;
// --FOOTER_HEIGHT: 30px;
}
.api_test_history_list {
.method_label {
Expand Down

0 comments on commit 45dd602

Please sign in to comment.