Skip to content

Commit

Permalink
fix: icon load error
Browse files Browse the repository at this point in the history
  • Loading branch information
scarqin committed Apr 20, 2022
2 parents facde98 + 9df818f commit cc823d1
Show file tree
Hide file tree
Showing 17 changed files with 34 additions and 18 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@

# 功能

📃 API 文档

- HTTP 协议
- 各种格式请求体:FormData、XML、JSON、Raw

⚡ API 测试

- 快速对 API 发起测试
- 支持本地测试

📃 API 管理

- HTTP 协议
- 各种格式请求体:FormData、XML、JSON、Raw

📶 可离线使用

🌐 测试环境管理
Expand Down
1 change: 1 addition & 0 deletions src/app/browser/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<script type="application/javascript" src="./dist/index.js"></script>
</head>
<body>
Expand Down
1 change: 1 addition & 0 deletions src/app/electron-main/coreView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export class CoreViews {
? 'http://localhost:4201'
: `file://${path.join(__dirname, '../../', 'workbench', 'browser', 'dist', 'index.html')}`,
}).init(this.win);
this.view.webContents.openDevTools();
this.view.webContents.once('dom-ready', () => {
require('@electron/remote/main').enable(this.view.webContents);
});
Expand Down
2 changes: 1 addition & 1 deletion src/core/api-manager/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"moduleID": "default",
"moduleName": "API Manager",
"moduleType": "app",
"logo": "dist/assets/images/icon.png",
"logo": "icon-link",
"main": "dist/index.html",
"main_node": "../node/unitWorker.js",
"main_debug": "http://localhost:4200",
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion src/core/market/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"belongs": [
"default"
],
"logo": "dist/icon.png",
"logo": "icon-apps",
"main_debug": "http://localhost:8080",
"moduleID": "market",
"moduleName": "Market",
Expand Down
Binary file removed src/core/market/browser/public/icon.png
Binary file not shown.
2 changes: 2 additions & 0 deletions src/core/market/browser/public/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/platform/node/extension-manager/lib/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class CoreHandler {
if (moduleInfo.main_node && moduleInfo.main_node.length > 0) {
moduleInfo.main_node = path.join(moduleInfo.baseDir, moduleInfo.main_node);
}
if (moduleInfo.logo && moduleInfo.logo.length > 0 && !moduleInfo.logo.startsWith('http')) {
if (moduleInfo.logo && moduleInfo.logo.length > 0 && !moduleInfo.logo.startsWith('http')&&!moduleInfo.logo.includes("icon-")) {
moduleInfo.logo = 'file://' + path.join(moduleInfo.baseDir, moduleInfo.logo);
}
if (!moduleInfo.belongs || !isNotEmpty(moduleInfo.belongs)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<div class="eo_sidebar" [ngClass]="{ eo_sidebar_shrink: isCollapsed }">
<a (click)="openApp(item.moduleID)" *ngFor="let item of getModules()">
<div nz-tooltip (nzTooltipVisibleChange)="tooltipVisibleChange($event)" [nzTooltipTitle]="isCollapsed ? item.moduleName : ''" class="sidebar_item sidebar_item_active">
<img [src]="item.logo" />
<div nz-tooltip (nzTooltipVisibleChange)="tooltipVisibleChange($event)" [nzTooltipTitle]="isCollapsed ? item.moduleName : ''" class="sidebar_item" [ngClass]="{sidebar_item_active:item.moduleID===this.moduleID}">
<span *ngIf="item.logo.includes('icon-')" class="iconfont fs28" [ngClass]="item.logo" ></span>
<img *ngIf="!item.logo.includes('icon-')"[src]="item.logo" />
<span *ngIf="!isCollapsed">{{ item.moduleName }}</span>
</div>
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export class SidebarComponent implements OnInit, OnDestroy {
isCollapsed: boolean;
destroy = false;
isElectron: boolean = false;
moduleID:string='default';
modules: Map<string, ModuleInfo>;
constructor(private electron: ElectronService, private sidebar: SidebarService) {
this.isElectron = this.electron.isElectron;
Expand Down Expand Up @@ -41,6 +42,7 @@ export class SidebarComponent implements OnInit, OnDestroy {
ngOnInit(): void {
if (this.isElectron) {
this.modules = window.eo.getSideModuleList();
console.log(this.modules)
this.electron.ipcRenderer.on('moduleUpdate', (event, args) => {
console.log('get moduleUpdate');
this.modules = window.eo.getSideModuleList();
Expand All @@ -55,6 +57,7 @@ export class SidebarComponent implements OnInit, OnDestroy {
}

openApp(moduleID: string) {
this.moduleID=moduleID;
window.eo.openApp({ moduleID: moduleID });
}

Expand Down
14 changes: 11 additions & 3 deletions src/workbench/browser/src/assets/font/iconfont.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@font-face {
font-family: "iconfont"; /* Project id 2855448 */
src: url('iconfont.woff2?t=1638375349218') format('woff2'),
url('iconfont.woff?t=1638375349218') format('woff'),
url('iconfont.ttf?t=1638375349218') format('truetype');
src: url('iconfont.woff2?t=1650440880888') format('woff2'),
url('iconfont.woff?t=1650440880888') format('woff'),
url('iconfont.ttf?t=1650440880888') format('truetype');
}

.iconfont {
Expand All @@ -13,6 +13,14 @@
-moz-osx-font-smoothing: grayscale;
}

.icon-wangyuanjing:before {
content: "\e6b6";
}

.icon-apispace:before {
content: "\e62c";
}

.icon-linux:before {
content: "\e60a";
}
Expand Down
Binary file modified src/workbench/browser/src/assets/font/iconfont.ttf
Binary file not shown.
Binary file modified src/workbench/browser/src/assets/font/iconfont.woff
Binary file not shown.
Binary file modified src/workbench/browser/src/assets/font/iconfont.woff2
Binary file not shown.
Binary file removed src/workbench/browser/src/assets/images/icon.png
Binary file not shown.
10 changes: 5 additions & 5 deletions wiki/README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ English | [简体中文](README.md)

# Featue

⚡ API Test
📃 API Documentation

- HTTP protocol
- Various formats of request body: FormData, XML, JSON, Raw

⚡ API Test
- Quickly test the API
- Test local API

📃 API management

- HTTP protocol
- Various formats of request body: FormData, XML, JSON, Raw

🌐 Test environment management

Expand Down

0 comments on commit cc823d1

Please sign in to comment.