提交 5fcf70d9 编写于 作者: aaronchen2k2k's avatar aaronchen2k2k

fix issues

上级 27363bae
......@@ -1092,7 +1092,6 @@
"version": "4.3.0",
"resolved": "https://registry.nlark.com/ansi-styles/download/ansi-styles-4.3.0.tgz",
"integrity": "sha1-7dgDYornHATIWuegkG7a00tkiTc=",
"dev": true,
"requires": {
"color-convert": "^2.0.1"
}
......@@ -1547,7 +1546,6 @@
"version": "4.1.2",
"resolved": "https://registry.npmmirror.com/chalk/download/chalk-4.1.2.tgz",
"integrity": "sha1-qsTit3NKdAhnrrFr8CqtVWoeegE=",
"dev": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
......@@ -1676,7 +1674,6 @@
"version": "2.0.1",
"resolved": "https://registry.npmmirror.com/color-convert/download/color-convert-2.0.1.tgz",
"integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=",
"dev": true,
"requires": {
"color-name": "~1.1.4"
}
......@@ -1684,8 +1681,7 @@
"color-name": {
"version": "1.1.4",
"resolved": "http://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz",
"integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=",
"dev": true
"integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI="
},
"color-support": {
"version": "1.1.3",
......@@ -1717,8 +1713,7 @@
"commander": {
"version": "5.1.0",
"resolved": "https://registry.npmmirror.com/commander/download/commander-5.1.0.tgz",
"integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==",
"dev": true
"integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg=="
},
"compare-version": {
"version": "0.1.2",
......@@ -1983,7 +1978,6 @@
"version": "4.3.3",
"resolved": "https://registry.npmmirror.com/debug/download/debug-4.3.3.tgz",
"integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==",
"dev": true,
"requires": {
"ms": "2.1.2"
}
......@@ -2212,6 +2206,11 @@
"tslib": "^2.0.3"
}
},
"duplexer": {
"version": "0.1.2",
"resolved": "https://registry.npmmirror.com/duplexer/-/duplexer-0.1.2.tgz",
"integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg=="
},
"duplexer3": {
"version": "0.1.4",
"resolved": "https://registry.npmmirror.com/duplexer3/download/duplexer3-0.1.4.tgz",
......@@ -3133,6 +3132,20 @@
"integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=",
"dev": true
},
"event-stream": {
"version": "3.3.4",
"resolved": "https://registry.npmmirror.com/event-stream/-/event-stream-3.3.4.tgz",
"integrity": "sha512-QHpkERcGsR0T7Qm3HNJSyXKEEj8AHNxkY3PK8TS2KJvQ7NiSHe3DDpwVKKtoYprL/AreyzFBeIkBIWChAqn60g==",
"requires": {
"duplexer": "~0.1.1",
"from": "~0",
"map-stream": "~0.1.0",
"pause-stream": "0.0.11",
"split": "0.3",
"stream-combiner": "~0.0.4",
"through": "~2.3.1"
}
},
"eventemitter3": {
"version": "4.0.7",
"resolved": "https://registry.npm.taobao.org/eventemitter3/download/eventemitter3-4.0.7.tgz?cache=0&sync_timestamp=1598517790184&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feventemitter3%2Fdownload%2Feventemitter3-4.0.7.tgz",
......@@ -3427,6 +3440,16 @@
}
}
},
"find-process": {
"version": "1.4.7",
"resolved": "https://registry.npmmirror.com/find-process/-/find-process-1.4.7.tgz",
"integrity": "sha512-/U4CYp1214Xrp3u3Fqr9yNynUrr5Le4y0SsJh2lMDDSbpwYSz3M2SMWQC+wqcx79cN8PQtHQIL8KnuY9M66fdg==",
"requires": {
"chalk": "^4.0.0",
"commander": "^5.1.0",
"debug": "^4.1.1"
}
},
"find-up": {
"version": "2.1.0",
"resolved": "https://registry.npmmirror.com/find-up/-/find-up-2.1.0.tgz",
......@@ -3494,6 +3517,11 @@
"integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=",
"dev": true
},
"from": {
"version": "0.1.7",
"resolved": "https://registry.npmmirror.com/from/-/from-0.1.7.tgz",
"integrity": "sha512-twe20eF1OxVxp/ML/kq2p1uc6KvFK/+vs8WjEbeKmV2He22MKm7YF2ANIt+EOqhJ5L3K/SuuPhk0hWQDjOM23g=="
},
"fs-extra": {
"version": "10.0.0",
"resolved": "https://registry.nlark.com/fs-extra/download/fs-extra-10.0.0.tgz",
......@@ -3889,8 +3917,7 @@
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.nlark.com/has-flag/download/has-flag-4.0.0.tgz",
"integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=",
"dev": true
"integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s="
},
"has-symbols": {
"version": "1.0.2",
......@@ -4739,6 +4766,11 @@
"integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=",
"dev": true
},
"map-stream": {
"version": "0.1.0",
"resolved": "https://registry.npmmirror.com/map-stream/-/map-stream-0.1.0.tgz",
"integrity": "sha512-CkYQrPYZfWnu/DAmVCpTSX/xHpKZ80eKh2lAkyA6AJTef6bW+6JpbQZN5rofum7da+SyN1bi5ctTm+lTfcCW3g=="
},
"matcher": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/matcher/download/matcher-3.0.0.tgz?cache=0&sync_timestamp=1633253783507&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fmatcher%2Fdownload%2Fmatcher-3.0.0.tgz",
......@@ -5047,8 +5079,7 @@
"ms": {
"version": "2.1.2",
"resolved": "https://registry.npmmirror.com/ms/download/ms-2.1.2.tgz",
"integrity": "sha1-0J0fNXtEP0kzgqjrPM0YOHKuYAk=",
"dev": true
"integrity": "sha1-0J0fNXtEP0kzgqjrPM0YOHKuYAk="
},
"multicast-dns": {
"version": "6.2.3",
......@@ -5583,6 +5614,14 @@
}
}
},
"pause-stream": {
"version": "0.0.11",
"resolved": "https://registry.npmmirror.com/pause-stream/-/pause-stream-0.0.11.tgz",
"integrity": "sha512-e3FBlXLmN/D1S+zHzanP4E/4Z60oFAa3O051qt1pxa7DEJWKAyil6upYVXCWadEnuoqa4Pkc9oUx9zsxYeRv8A==",
"requires": {
"through": "~2.3"
}
},
"pend": {
"version": "1.2.0",
"resolved": "http://registry.npm.taobao.org/pend/download/pend-1.2.0.tgz",
......@@ -5888,6 +5927,14 @@
"ipaddr.js": "1.9.1"
}
},
"ps-tree": {
"version": "1.2.0",
"resolved": "https://registry.npmmirror.com/ps-tree/-/ps-tree-1.2.0.tgz",
"integrity": "sha512-0VnamPPYHl4uaU/nSFeZZpR21QAWRz+sRv4iW9+v/GS/J5U5iZB5BNN6J0RMoOvdx2gWM2+ZFMIm58q24e4UYA==",
"requires": {
"event-stream": "=3.3.4"
}
},
"psl": {
"version": "1.8.0",
"resolved": "https://registry.npm.taobao.org/psl/download/psl-1.8.0.tgz?cache=0&sync_timestamp=1585142991033&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fpsl%2Fdownload%2Fpsl-1.8.0.tgz",
......@@ -6663,6 +6710,14 @@
"integrity": "sha1-mHbb0qFp0xFUAtSObqYynIgWpQ0=",
"dev": true
},
"split": {
"version": "0.3.3",
"resolved": "https://registry.npmmirror.com/split/-/split-0.3.3.tgz",
"integrity": "sha512-wD2AeVmxXRBoX44wAycgjVpMhvbwdI2aZjCkvfNcH1YqHQvJVa1duWc73OyVGJUc05fhFaTZeQ/PYsrmyH0JVA==",
"requires": {
"through": "2"
}
},
"sprintf-js": {
"version": "1.1.2",
"resolved": "http://registry.npm.taobao.org/sprintf-js/download/sprintf-js-1.1.2.tgz",
......@@ -6702,6 +6757,14 @@
"integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=",
"dev": true
},
"stream-combiner": {
"version": "0.0.4",
"resolved": "https://registry.npmmirror.com/stream-combiner/-/stream-combiner-0.0.4.tgz",
"integrity": "sha512-rT00SPnTVyRsaSz5zgSPma/aHSOic5U1prhYdRy5HS2kTZviFpmDgzilbtsJsxiroqACmayynDN/9VzIbX5DOw==",
"requires": {
"duplexer": "~0.1.1"
}
},
"string-width": {
"version": "4.2.3",
"resolved": "https://registry.npmmirror.com/string-width/download/string-width-4.2.3.tgz",
......@@ -6800,7 +6863,6 @@
"version": "7.2.0",
"resolved": "https://registry.npmmirror.com/supports-color/download/supports-color-7.2.0.tgz",
"integrity": "sha1-G33NyzK4E4gBs+R4umpRyqiWSNo=",
"dev": true,
"requires": {
"has-flag": "^4.0.0"
}
......@@ -6911,8 +6973,7 @@
"through": {
"version": "2.3.8",
"resolved": "http://registry.npm.taobao.org/through/download/through-2.3.8.tgz",
"integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=",
"dev": true
"integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU="
},
"through2": {
"version": "0.2.3",
......
......@@ -40,6 +40,8 @@
},
"dependencies": {
"electron-log": "^4.4.6",
"electron-squirrel-startup": "^1.0.0"
"electron-squirrel-startup": "^1.0.0",
"find-process": "^1.4.7",
"ps-tree": "^1.2.0"
}
}
......@@ -60,13 +60,29 @@ app.on('ready', startApp);
// for applications and their menu bar to stay active until the user quits
// explicitly with Cmd + Q.
app.on('window-all-closed', () => {
logInfo(`>> Event window-all-closed`)
// if (process.platform !== 'darwin') {
app.quit();
killZtfServer();
// }
});
app.on('before-quit',function(){
logInfo(`>> Event before-quit`)
killZtfServer();
})
app.on('will-quit',function(){
logInfo(`>> Event will-quit`)
})
app.on('quit',function(){
logInfo(`>> Event quit`)
})
app.on('activate', () => {
logInfo(`>> Event activate`)
// On OS X it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (BrowserWindow.getAllWindows().length === 0) {
......
......@@ -6,7 +6,7 @@ import express from 'express';
import {logInfo, logErr} from './log';
const DEBUG = process.env.NODE_ENV === 'development';
const isWin = /^win/.test(process.platform);
let _ztfServerProcess;
export function startZtfServer() {
......@@ -115,7 +115,19 @@ export function startZtfServer() {
}
export function killZtfServer() {
_ztfServerProcess.kill('SIGINT');
if(!isWin) {
_ztfServerProcess.kill('SIGINT');
kill(_ztfServerProcess.pid);
} else {
const cp = require('child_process');
cp.exec('taskkill /PID ' + _ztfServerProcess.pid + ' /T /F', function (error, stdout, stderr) {
// console.log('stdout: ' + stdout);
// console.log('stderr: ' + stderr);
// if(error !== null) {
// console.log('exec error: ' + error);
// }
});
}
}
let _uiServerApp;
......@@ -212,3 +224,28 @@ export function getUIServerUrl() {
_uiServerApp = cmd;
});
}
const psTree = require('ps-tree');
function kill (pid, signal, callback) {
signal = signal || 'SIGKILL';
callback = callback || function () {};
const killTree = true;
if(killTree) {
psTree(pid, function (err, children) {
[pid].concat(
children.map(function (p) {
return p.PID;
})
).forEach(function (tpid) {
try { process.kill(tpid, signal) }
catch (ex) { }
});
callback();
});
} else {
try { process.kill(pid, signal) }
catch (ex) { }
callback();
}
};
......@@ -10,9 +10,9 @@ var (
Failure = ResponseCode{100, "request_failure"}
ParamErr = ResponseCode{200, "parm_error"}
NeedInitErr = ResponseCode{1000, "data_not_init"}
BizErrProjectNotInit = ResponseCode{2000, "project_not_init"}
BizErrNameNotExist = ResponseCode{3000, "record_not_found_by_name"}
NeedInitErr = ResponseCode{1000, "data_not_init"}
BizErrProjectConfig = ResponseCode{2000, "project_config_err"}
BizErrNameNotExist = ResponseCode{3000, "record_not_found_by_name"}
)
type ResultStatus string
......
......@@ -25,7 +25,7 @@ func (c *ZentaoCtrl) ListProduct(ctx iris.Context) {
data, err := zentaoUtils.ListProduct(projectPath)
if err != nil {
ctx.JSON(c.ErrResp(commConsts.BizErrProjectNotInit, err.Error()))
ctx.JSON(c.ErrResp(commConsts.BizErrProjectConfig, err.Error()))
return
}
......
......@@ -18,8 +18,8 @@
"translation": "Data not init"
},
{
"id": "project_not_init",
"translation": "Project not init"
"id": "project_config_err",
"translation": "Project config error"
},
{
"id": "record_not_found_by_name",
......
......@@ -18,8 +18,8 @@
"translation": "数据为初始化"
},
{
"id": "project_not_init",
"translation": "项目未初始化"
"id": "project_config_err",
"translation": "项目配置错误"
},
{
"id": "record_not_found_by_name",
......
select t1.id,t1.parent_id,t2.*,
if(find_in_set(parent_id, @pids) > 0, @pids := concat(@pids, ',', id), 0) as ischild
from (
select id,parent_id from biz_product t where t.deleted = '0' order by parent_id, id
) t1,
(select @pids := 1) t2
cd internal/comm/grpc/proto
protoc --go_out=. \
--go_opt=paths=source_relative \
--go-grpc_out=. \
--go-grpc_opt=paths=source_relative \
greater/greater.proto
安装打包工具
npm install --save-dev electron-packager
打包
cd ui && yarn build --dest ../client/ui && cd ..
go-bindata -o=res/res.go -pkg=res res/...
make compile_win64
cd client && npm run package-win64 && cd ..
make compile_linux
cd client && npm run package-linux && cd ..
make compile_mac
cd client && npm run package-mac && cd ..
client/out/ztf-darwin-x64/ztf.app/Contents/MacOS/ztf
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册