Skip to content

Commit

Permalink
docs: build script
Browse files Browse the repository at this point in the history
  • Loading branch information
scarqin committed May 21, 2022
1 parent 69492cb commit 8f10fae
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ npm install -g @angular/cli

| 命令 | 描述 |
| ------------------------ | ------------------------ |
| `npm run electron:build` | 各系统打包 Electron 应用 |
| `npm run build` | 各系统打包 Electron 应用 |

### 运行测试

Expand Down
11 changes: 3 additions & 8 deletions src/app/electron-main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,19 @@ function createWindow(): BrowserWindow {
webSecurity: false,
preload: path.join(__dirname, '../../', 'platform', 'electron-browser', 'preload.js'),
nodeIntegration: true,
allowRunningInsecureContent: processEnv === 'serve' ? true : false,
allowRunningInsecureContent: processEnv === 'development' ? true : false,
contextIsolation: false, // false if you want to run e2e test with Spectron
},
});
// main
if (['serve'].includes(processEnv)) {
require('electron-reload')(__dirname, {
electron: require(path.join(__dirname, '../node_modules/electron')),
});
}
proxyOpenExternal(win);
let loadPage = () => {
const file: string =
processEnv === 'development'
? 'http://localhost:4200'
: `file://${path.join(__dirname, '../../workbench/browser/dist/index.html')}`;
win.loadURL(file);
if (['serve'].includes(processEnv)) {
console.log('processEnv', processEnv);
if (['development'].includes(processEnv)) {
win.webContents.openDevTools({
mode: 'undocked',
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class ApiGroupTreeComponent implements OnInit, OnDestroy {
isFixed: true,
},
];
nzSelectedKeys: string[] = [];
nzSelectedKeys: number[] = [];
private destroy$: Subject<void> = new Subject<void>();
constructor(
private router: Router,
Expand Down Expand Up @@ -137,6 +137,7 @@ export class ApiGroupTreeComponent implements OnInit, OnDestroy {
});
this.apiDataItems = apiItems;
this.messageService.send({ type: 'loadApi', data: this.apiDataItems });
this.setSelectedKeys();
this.generateGroupTreeData();
this.restoreExpandStatus();
}
Expand Down Expand Up @@ -337,6 +338,7 @@ export class ApiGroupTreeComponent implements OnInit, OnDestroy {
}

private setSelectedKeys() {
console.log('setSelectedKeys',this.route.snapshot.queryParams.uuid,this.nzSelectedKeys)
if (this.route.snapshot.queryParams.uuid) {
this.nzSelectedKeys = [this.route.snapshot.queryParams.uuid];
} else {
Expand Down
2 changes: 1 addition & 1 deletion wiki/README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ npm install -g @angular/cli

| Command | Description |
| ------------------------ | ------------------------------------------------- |
| `npm run electron:build` | Packaging Electron applications for each platform |
| `npm run build` | Packaging Electron applications for each platform |

### Running the tests

Expand Down

0 comments on commit 8f10fae

Please sign in to comment.