Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zentaoatf
提交
cc75f102
Z
zentaoatf
项目概览
易企天创
/
zentaoatf
12 个月 前同步成功
通知
11
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
3
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Z
zentaoatf
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
3
Issue
3
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cc75f102
编写于
3月 04, 2022
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
kill ztf process by electron
上级
ff439191
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
34 addition
and
18 deletion
+34
-18
client/src/service.js
client/src/service.js
+13
-5
ui/package.json
ui/package.json
+0
-1
ui/src/views/script/index/main.vue
ui/src/views/script/index/main.vue
+12
-12
ui/vue.config.js
ui/vue.config.js
+9
-0
未找到文件。
client/src/service.js
浏览文件 @
cc75f102
...
...
@@ -17,15 +17,18 @@ let _ztfSubProcessIds = [];
export
function
checkZtfPort
()
{
let
cmd
=
''
if
(
!
isWin
)
{
cmd
=
'
lsof -i:${port} | grep ${port}
'
cmd
=
`lsof -i:
${
port
}
| grep :
${
port
}
`
}
else
{
cmd
=
'
netstat -aon | findstr ${port}
'
cmd
=
`netstat -aon`
}
const
stdout
=
execSync
(
cmd
).
toString
().
trim
()
console
.
log
(
'
exec ${cmd}, stdout: ${stdout}
'
);
const
cp
=
require
(
'
child_process
'
);
const
stdout
=
cp
.
execSync
(
cmd
).
toString
().
trim
()
const
msg
=
`exec
${
cmd
}
, stdout:
${
stdout
}
`
console
.
log
(
msg
);
logInfo
(
msg
)
if
(
stdout
.
indexOf
(
port
+
''
)
>
-
1
)
{
if
(
stdout
.
indexOf
(
'
:
'
+
port
)
>
-
1
)
{
if
(
stdout
.
indexOf
(
uuid
)
<
0
)
{
const
msg
=
'
Port ${port} is used by another process. exit.
'
console
.
log
(
msg
);
...
...
@@ -44,6 +47,11 @@ export function checkZtfPort() {
}
export
function
startZtfServer
()
{
const
pass
=
checkZtfPort
()
if
(
!
pass
)
{
return
}
if
(
process
.
env
.
SKIP_SERVER
)
{
logInfo
(
`>> Skip to start ZTF Server by env "SKIP_SERVER=
${
process
.
env
.
SKIP_SERVER
}
".`
);
return
Promise
.
resolve
();
...
...
ui/package.json
浏览文件 @
cc75f102
...
...
@@ -20,7 +20,6 @@
"localforage"
:
"^1.10.0"
,
"lodash.debounce"
:
"^4.0.8"
,
"lodash.throttle"
:
"^4.1.1"
,
"monaco-editor"
:
"^0.32.1"
,
"monaco-editor-webpack-plugin"
:
"^7.0.1"
,
"neffos.js"
:
"^0.1.25"
,
"nprogress"
:
"^0.2.0"
,
...
...
ui/src/views/script/index/main.vue
浏览文件 @
cc75f102
...
...
@@ -67,7 +67,7 @@ import {useI18n} from "vue-i18n";
// import hljsVuePlugin from "@highlightjs/vue-plugin";
// import 'highlight.js/styles/googlecode.css'
import
*
as
monaco
from
'
monaco-editor
'
;
//
import * as monaco from 'monaco-editor';
interface
ListScriptPageSetupData
{
t
:
(
key
:
string
|
number
)
=>
string
;
...
...
@@ -140,14 +140,14 @@ export default defineComponent({
console
.
log
(
'
expandNode
'
,
keys
[
0
],
e
)
}
let
monacoInstance
:
any
const
disposeEditor
=
()
=>
{
console
.
log
(
'
disposeEditor
'
)
if
(
monacoInstance
)
monacoInstance
.
dispose
();
}
//
let monacoInstance: any
//
const disposeEditor = () => {
//
console.log('disposeEditor')
//
if (monacoInstance) monacoInstance.dispose();
//
}
onUnmounted
(()
=>
{
console
.
log
(
'
onUnmounted
'
,
tree
)
disposeEditor
()
//
disposeEditor()
})
const
selectNode
=
(
selectedKeys
,
e
)
=>
{
console
.
log
(
'
selectNode
'
,
e
.
selectedNodes
)
...
...
@@ -159,11 +159,11 @@ export default defineComponent({
console
.
log
(
'
===
'
,
script
)
scriptCode
.
value
=
script
.
value
.
code
disposeEditor
()
monacoInstance
=
monaco
.
editor
.
create
(
document
.
getElementById
(
"
monaco
"
)
as
HTMLElement
,{
value
:
script
.
value
.
code
,
language
:
"
php
"
})
//
disposeEditor()
//
monacoInstance = monaco.editor.create(document.getElementById("monaco") as HTMLElement,{
//
value: script.value.code,
//
language:"php"
//
})
})
}
...
...
ui/vue.config.js
浏览文件 @
cc75f102
...
...
@@ -2,6 +2,8 @@
const
bodyParser
=
require
(
'
body-parser
'
)
const
{
NODE_ENV
,
VUE_APP_PORT
,
VUE_APP_MOCK
}
=
process
.
env
;
const
MonacoWebpackPlugin
=
require
(
'
monaco-editor-webpack-plugin
'
)
module
.
exports
=
{
publicPath
:
'
/
'
,
outputDir
:
'
dist
'
,
...
...
@@ -72,5 +74,12 @@ module.exports = {
});
config
.
resolve
.
alias
.
set
(
'
vue-i18n
'
,
'
vue-i18n/dist/vue-i18n.cjs.js
'
)
config
.
plugin
(
'
monaco-editor
'
).
use
(
MonacoWebpackPlugin
,
[
{
// Languages are loaded on demand at runtime
languages
:
[
'
json
'
,
'
javascript
'
,
'
html
'
,
'
xml
'
]
}
])
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录