-
Notifications
You must be signed in to change notification settings - Fork 771
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
56 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
...red/components/navbar/navbar.component.ts → .../src/app/pages/navbar/navbar.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/workbench/browser/src/app/pages/navbar/navbar.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; | ||
import { NzDropDownModule } from 'ng-zorro-antd/dropdown'; | ||
import { NzToolTipModule } from 'ng-zorro-antd/tooltip'; | ||
import { NavbarComponent } from 'eo/workbench/browser/src/app/pages/navbar/navbar.component'; | ||
import { SettingModule } from 'eo/workbench/browser/src/app/shared/components/setting/setting.module'; | ||
import { CommonModule } from '@angular/common'; | ||
|
||
@NgModule({ | ||
imports: [CommonModule,NzDropDownModule,NzToolTipModule, SettingModule], | ||
schemas: [CUSTOM_ELEMENTS_SCHEMA], | ||
declarations: [NavbarComponent], | ||
exports: [NavbarComponent], | ||
}) | ||
export class NavbarModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
export * from './toolbar/toolbar.component'; | ||
export * from './toolbar/select-theme/select-theme.component'; | ||
export * from './sidebar/sidebar.component'; | ||
export * from './navbar/navbar.component'; | ||
export * from './page-not-found/page-not-found.component'; | ||
export * from './about/about.component'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/workbench/browser/src/app/shared/services/storage/http/lib/baseUrl.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest, HttpResponse } from "@angular/common/http"; | ||
import { Injectable } from "@angular/core"; | ||
import { filter, map, Observable } from "rxjs"; | ||
const protocolReg = new RegExp('^(http|https)://'); | ||
|
||
// implements StorageInterface | ||
@Injectable() | ||
export class BaseUrlInterceptor implements HttpInterceptor { | ||
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { | ||
const { url = '', token = '' } = window.eo?.getModuleSettings?.('eoapi-common.remoteServer') || {}; | ||
req = req.clone({ | ||
url: protocolReg.test(req.url) ? req.url : url + req.url, | ||
headers: req.headers.append('x-api-key', token), | ||
}); | ||
|
||
return next.handle(req).pipe( | ||
filter((event) => event instanceof HttpResponse && [200, 201].includes(event.status)), | ||
map((event: HttpResponse<any>) => event.clone({ body: { status: 200, data: event.body.data } })) | ||
); | ||
} | ||
} |
24 changes: 2 additions & 22 deletions
24
src/workbench/browser/src/app/shared/services/storage/http/lib/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters