Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
duckula
duckula-ops
提交
9fb47cff
duckula-ops
项目概览
duckula
/
duckula-ops
通知
6
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
duckula-ops
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
9fb47cff
编写于
12月 28, 2020
作者:
偏锋书生
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
界面支持初步
上级
8f217a66
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
47 addition
and
31 deletion
+47
-31
src/main/java/net/wicp/tams/duckula/ops/pages/runing/TaskManager.java
...a/net/wicp/tams/duckula/ops/pages/runing/TaskManager.java
+36
-27
src/main/resources/net/wicp/tams/duckula/ops/pages/runing/TaskManager.tml
...es/net/wicp/tams/duckula/ops/pages/runing/TaskManager.tml
+11
-4
未找到文件。
src/main/java/net/wicp/tams/duckula/ops/pages/runing/TaskManager.java
浏览文件 @
9fb47cff
...
...
@@ -15,6 +15,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
lombok.extern.slf4j.Slf4j
;
import
net.wicp.tams.app.duckula.controller.BusiTools
;
import
net.wicp.tams.app.duckula.controller.bean.models.CommonCheckpoint
;
import
net.wicp.tams.app.duckula.controller.bean.models.CommonTask
;
...
...
@@ -40,6 +41,7 @@ import net.wicp.tams.component.services.IReq;
import
net.wicp.tams.component.tools.TapestryAssist
;
import
net.wicp.tams.duckula.ops.WebTools
;
@Slf4j
@HtmlJs
(
easyuiadd
=
{
EasyUIAdd
.
edatagrid
})
public
class
TaskManager
{
@Inject
...
...
@@ -135,31 +137,33 @@ public class TaskManager {
@Override
public
String
getStr
(
Object
object
)
{
CommonTask
commonTask
=
(
CommonTask
)
object
;
return
deployService
.
queryStatus
(
CommandType
.
task
,
commonTask
.
getId
(),
commonTask
.
getDeployId
());
return
deployService
.
queryStatus
(
CommandType
.
task
,
commonTask
.
getId
(),
commonTask
.
getDeployId
());
}
};
// 位点
IConvertValue
<
Object
>
posConvert
=
new
IConvertValue
<
Object
>()
{
@Override
public
String
getStr
(
Object
object
)
{
CommonTask
commonTask
=(
CommonTask
)
object
;
CommonTask
commonTask
=
(
CommonTask
)
object
;
CommonCheckpoint
checkpoint
=
mapCheckpoint
.
get
(
commonTask
.
getCheckpointId
());
Position
position
=
posService
.
selectPosition
(
checkpoint
,
commonTask
.
getName
(),
commonTask
.
getClientId
());
return
position
==
null
?
""
:
position
.
getTimeStr
();
Position
position
=
posService
.
selectPosition
(
checkpoint
,
commonTask
.
getName
(),
commonTask
.
getClientId
());
return
position
==
null
?
""
:
position
.
getTimeStr
();
}
};
IConvertValue
<
String
>
configNameConvert
=
new
IConvertValue
<
String
>()
{
@Override
public
String
getStr
(
String
keyObj
)
{
return
CommandType
.
task
.
formateTaskName
(
keyObj
);
return
CommandType
.
task
.
formateTaskName
(
keyObj
);
}
};
String
retstr
=
EasyUiAssist
.
getJsonForGridAlias2
(
selectPage
.
getRecords
(),
new
String
[]
{
"versionId,version1"
,
"deployId,deployId1"
,
"middlewareId,middlewareId1"
,
"instanceId,instanceId1"
,
"checkpointId,checkpoint1"
,
",taskStatus"
,
",pos"
,
"name,configName"
},
"instanceId,instanceId1"
,
"checkpointId,checkpoint1"
,
",taskStatus"
,
",pos"
,
"name,configName"
},
CollectionUtil
.
newMap
(
"version1"
,
versionConvert
,
"deployId1"
,
deployConvert
,
"middlewareId1"
,
middlewareConvert
,
"instanceId1"
,
instanceConvert
,
"checkpoint1"
,
checkpointConvert
,
"taskStatus"
,
statusConvert
,
"pos"
,
posConvert
,
"configName"
,
configNameConvert
),
"taskStatus"
,
statusConvert
,
"pos"
,
posConvert
,
"configName"
,
configNameConvert
),
selectPage
.
getTotal
());
return
TapestryAssist
.
getTextStreamResponse
(
retstr
);
}
...
...
@@ -190,11 +194,16 @@ public class TaskManager {
public
TextStreamResponse
onRuleData
()
{
String
commandtypeStr
=
request
.
getParameter
(
"ruleData"
);
RuleManager
ruleManager
=
new
RuleManager
(
commandtypeStr
);
JSONArray
retAry
=
ruleManager
.
toJsonAry
();
return
TapestryAssist
.
getTextStreamResponse
(
retAry
.
toJSONString
());
try
{
RuleManager
ruleManager
=
new
RuleManager
(
commandtypeStr
);
JSONArray
retAry
=
ruleManager
.
toJsonAry
();
return
TapestryAssist
.
getTextStreamResponse
(
retAry
.
toJSONString
());
}
catch
(
Exception
e
)
{
// 异常需要清楚grid
log
.
error
(
"rule转换出错"
,
e
);
return
TapestryAssist
.
getTextStreamResponse
(
new
JSONArray
().
toJSONString
());
}
}
public
TextStreamResponse
onViewlog
()
{
final
CommonTask
commonTask
=
TapestryAssist
.
getBeanFromPage
(
CommonTask
.
class
,
requestGlobals
);
deployService
.
viewLog
(
CommandType
.
task
,
commonTask
.
getId
(),
commonTask
.
getDeployId
());
...
...
@@ -208,42 +217,42 @@ public class TaskManager {
*/
public
TextStreamResponse
onStartTask
()
{
final
CommonTask
commonTask
=
TapestryAssist
.
getBeanFromPage
(
CommonTask
.
class
,
requestGlobals
);
Result
startTask
=
deployService
.
startTask
(
CommandType
.
task
,
commonTask
.
getId
(),
commonTask
.
getDeployId
(),
false
);
Result
startTask
=
deployService
.
startTask
(
CommandType
.
task
,
commonTask
.
getId
(),
commonTask
.
getDeployId
(),
false
);
return
TapestryAssist
.
getTextStreamResponse
(
startTask
);
}
//布署配置文件
// 布署配置文件
public
TextStreamResponse
onAddConfig
()
{
final
CommonTask
commonTask
=
TapestryAssist
.
getBeanFromPage
(
CommonTask
.
class
,
requestGlobals
);
Result
startTask
=
deployService
.
addConfig
(
CommandType
.
task
,
commonTask
.
getId
(),
commonTask
.
getDeployId
());
Result
startTask
=
deployService
.
addConfig
(
CommandType
.
task
,
commonTask
.
getId
(),
commonTask
.
getDeployId
());
return
TapestryAssist
.
getTextStreamResponse
(
startTask
);
}
///停止任务,会等3分钟。
/// 停止任务,会等3分钟。
public
TextStreamResponse
onStopTask
()
{
final
CommonTask
commonTask
=
TapestryAssist
.
getBeanFromPage
(
CommonTask
.
class
,
requestGlobals
);
Result
stopTask
=
deployService
.
stopTask
(
CommandType
.
task
,
commonTask
.
getId
(),
commonTask
.
getDeployId
());
long
maxWaitTime
=
180000
;
//
最长等10S
long
curTime
=
System
.
currentTimeMillis
();
Result
stopTask
=
deployService
.
stopTask
(
CommandType
.
task
,
commonTask
.
getId
(),
commonTask
.
getDeployId
());
long
maxWaitTime
=
180000
;
//
最长等10S
long
curTime
=
System
.
currentTimeMillis
();
while
(
true
)
{
if
(
System
.
currentTimeMillis
()-
curTime
>
maxWaitTime
)
{
if
(
System
.
currentTimeMillis
()
-
curTime
>
maxWaitTime
)
{
break
;
}
try
{
Thread
.
sleep
(
3000
);
}
catch
(
InterruptedException
e
)
{
}
String
queryStatus
=
deployService
.
queryStatus
(
CommandType
.
task
,
commonTask
.
getId
(),
commonTask
.
getDeployId
());
System
.
out
.
println
(
"=========stoptasking============"
+
queryStatus
);
if
(
queryStatus
.
contains
(
"未布署"
))
{
String
queryStatus
=
deployService
.
queryStatus
(
CommandType
.
task
,
commonTask
.
getId
(),
commonTask
.
getDeployId
());
System
.
out
.
println
(
"=========stoptasking============"
+
queryStatus
);
if
(
queryStatus
.
contains
(
"未布署"
))
{
break
;
}
else
{
}
else
{
continue
;
}
}
return
TapestryAssist
.
getTextStreamResponse
(
stopTask
);
}
}
\ No newline at end of file
src/main/resources/net/wicp/tams/duckula/ops/pages/runing/TaskManager.tml
浏览文件 @
9fb47cff
...
...
@@ -103,8 +103,7 @@
<th
field=
"colName"
width=
"12%"
editor=
"{type:'validatebox',options:{required:false}}"
>
附加列
</th>
<th
field=
"addProp"
width=
"12%"
editor=
"{type:'validatebox',options:{required:false}}"
>
静态属性
</th>
<th
field=
"filter"
width=
"30%"
editor=
"{type:'validatebox',options:{required:false}}"
>
过滤器配置
</th>
<th
field=
"other"
width=
"12%"
editor=
"{type:'validatebox',options:{required:false}}"
>
其它配置
</th>
</tr>
</thead>
...
...
@@ -114,8 +113,9 @@
<a
href=
"javascript:void(0)"
class=
"easyui-linkbutton"
iconCls=
"icon-remove"
plain=
"true"
onclick=
"javascript:$('#dg').edatagrid('destroyRow')"
>
删除
</a>
<a
href=
"javascript:void(0)"
class=
"easyui-linkbutton"
iconCls=
"icon-undo"
plain=
"true"
onclick=
"javascript:$('#dg').edatagrid('cancelRow')"
>
取消
</a>
<a
href=
"javascript:void(0)"
class=
"easyui-linkbutton"
iconCls=
"icon-save"
plain=
"true"
onclick=
"javascript:$('#dg').edatagrid('saveRow')"
>
保存
</a>
<a
href=
"javascript:void(0)"
class=
"easyui-linkbutton"
iconCls=
"icon-save"
plain=
"true"
onclick=
"javascript:openFilter()"
>
过滤器
</a>
<font
color=
"red"
style=
"font-weight:bold;"
>
 &msp;   
请选择接收者,编辑完成后请“保存”,配置以输入框内容为准,界面只是辅助输入
</font>
<r:validatebox
id=
"ruleEdit"
name=
"rule"
style=
"width:
735px
;"
required=
"true"
/>
<r:validatebox
id=
"ruleEdit"
name=
"rule"
style=
"width:
100%
;"
required=
"true"
/>
</div>
</td>
</tr>
...
...
@@ -360,7 +360,14 @@
}
}
function
openFilter
(){
var
row
=
$
(
'
#dg
'
).
datagrid
(
'
getSelected
'
);
if
(
!
row
){
alert
(
'
请选择规则!
'
);
}
else
{
alert
(
row
.
filter
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录