提交 979218ee 编写于 作者: aaronchen2k2k's avatar aaronchen2k2k

fix issues

上级 27bcf57a
......@@ -25,7 +25,7 @@ npm run start
在调试模式下可以通过制定环境变量来设置 ZD UI 服务访问地址和 ZD 可执行程序位置。
* `UI_SERVER_URL`:ZD UI 服务访问地址或静态资源文件目录,如果不指定会自动进入 `../ui/` 目录执行 `npm run serve` 获取开发服务器地址;
* `UI_SERVER_PORT`:ZD UI 服务端口,如果不指定则使用 `8000`
* `UI_SERVER_PORT`:ZD UI 服务端口,如果不指定则使用 `8080`
* `SERVER_EXE_PATH`:ZD 服务可执行文件位置(相对于 `/client` 目录),如果不指定则会自动进入 `../cmd/server/` 目录下执行 `go run main.go -p 8085` 启动 ZD 服务器。
* `SERVER_CWD_PATH`:ZD 服务运行目录;
* `SKIP_SERVER`:跳过启动 ZD 服务,适用于 ZD 服务已经在外部启动的情况。
......@@ -35,13 +35,13 @@ npm run start
**模式一:使用外部 UI 服务**
```
SKIP_SERVER=1 UI_SERVER_URL=http://localhost:8000 npm run start
SKIP_SERVER=1 UI_SERVER_URL=http://localhost:8080 npm run start
```
**模式二:使用本地 UI 静态文件目录**
```
UI_SERVER_URL=../ui/dist UI_SERVER_PORT=8000 npm run start
UI_SERVER_URL=../ui/dist UI_SERVER_PORT=8080 npm run start
```
**模式三:自定义 ZD 服务执行文件路径**
......@@ -59,7 +59,7 @@ SKIP_SERVER=1 npm run start
**模式五:综合使用外部 UI 服务和外部 ZD 服务**
```
UI_SERVER_URL=http://localhost:8000 SKIP_SERVER=1 npm run start
UI_SERVER_URL=http://localhost:8080 SKIP_SERVER=1 npm run start
```
## 代码检查
......
......@@ -52,14 +52,22 @@ export class ZdApp {
async createWindow() {
process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = 'true';
const frame = IS_MAC_OSX ? true: false;
const mainWin = new BrowserWindow({
show: false,
frame: false,
frame: frame,
// titleBarStyle: "hidden",
webPreferences: {
nodeIntegration: true,
contextIsolation: false,
}
})
// if (IS_MAC_OSX) {
// mainWin.setTrafficLightPosition && mainWin.setTrafficLightPosition({
// x: 10,
// y: 125
// })
// }
require('@electron/remote/main').initialize()
require('@electron/remote/main').enable(mainWin.webContents)
......@@ -233,7 +241,6 @@ export class ZdApp {
}
get windows() {
return this._windows;
}
......
......@@ -143,7 +143,7 @@ export function killZdServer() {
logInfo(`<${line}>`)
const cols = line.split(/\s/)
if (line.indexOf('zd') > -1 && cols.length > 3) {
if (line.indexOf('server') > -1 && cols.length > 3) {
const col3 = cols[3].trim()
console.log(`col3=${col3}`);
logInfo(`col3=${col3}`)
......
......@@ -113,14 +113,25 @@ export function getVersionUrl() {
return url
}
export function getAppUrl(version) {
const platform = os.platform(); // 'darwin', 'linux', 'win32'
const platform = getPlatform(); // 'darwin', 'linux', 'win32', 'win64'
logInfo(`platform=${platform}`)
const url = new URL(`${App}/${version}/${platform}/${App}-upgrade.zip`, downloadUrl) + '?ts=' + Date.now();
logInfo(`appUrl=${url}`)
return url
}
export function getPlatform() {
let platform = os.platform(); // 'darwin', 'linux', 'win32'
if (platform === 'win32' && ['arm64', 'ppc64', 'x64', 's390x'].includes(os.arch())) {
platform = 'win64'
}
return platform
}
export async function checkMd5(version, file) {
const platform = os.platform(); // 'darwin', 'linux', 'win32'
const platform = getPlatform(); // 'darwin', 'linux', 'win32'
const url = new URL(`${App}/${version}/${platform}/${App}-upgrade.zip.md5`, downloadUrl) + '?ts=' + Date.now();
logInfo(`md5Url=${url}, file=${file}`)
......
......@@ -97,4 +97,8 @@ a.common {
.clear-both {
clear: both;
}
.link {
cursor: pointer;
}
\ No newline at end of file
<template>
<div>
<a-menu
:default-selected-keys="['mine']"
:open-keys.sync="openKeys"
mode="inline"
@click="handleClick"
>
<a-menu-item key="mine/list">
{{ $t('msg.mine') }}
</a-menu-item>
<a-sub-menu key="buildin" @titleClick="titleClick">
<span slot="title"><span>{{ $t('msg.buildin') }}</span></span>
<a-menu-item key="buildin/config/list">
{{ $t('msg.config') }}
</a-menu-item>
<a-menu-item key="buildin/ranges/list">
{{ $t('msg.ranges') }}
</a-menu-item>
<a-menu-item key="buildin/instances/list">
{{ $t('msg.instances') }}
</a-menu-item>
<a-menu-item key="buildin/text/list">
{{ $t('msg.text') }}
</a-menu-item>
<a-menu-item key="buildin/excel/list">
{{ $t('msg.excel') }}
</a-menu-item>
</a-sub-menu>
</a-menu>
</div>
</template>
<script>
export default {
name: 'Menu',
components: {
},
data () {
return {
current: [],
openKeys: [],
};
},
watch: {
openKeys(val) {
console.log('openKeys', val);
},
},
computed: {
},
created () {
},
mounted () {
},
methods: {
handleClick (e) {
console.log('handleClick', e, this.$route.path, e.key)
if (e.key.indexOf('buildin') > -1) this.openKeys = ['buildin']
const path = '/data/' + e.key
if (this.$route.path != path) this.$router.push(path);
},
titleClick (e) {
console.log('titleClick', e)
},
}
}
</script>
<style lang="less" scoped>
</style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册