Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivManage
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivManage
Commits
d92e639f
Commit
d92e639f
authored
Aug 03, 2023
by
皮倩雯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: '定时任务优化'
parent
f4001def
Pipeline
#77037
passed with stages
Changes
5
Pipelines
1
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
236 additions
and
18 deletions
+236
-18
LookModal.jsx
...es/platformCenter/scheduledTasks/components/LookModal.jsx
+0
-0
LookModal.less
...s/platformCenter/scheduledTasks/components/LookModal.less
+51
-0
index.jsx
src/pages/platformCenter/scheduledTasks/index.jsx
+113
-14
index.less
src/pages/platformCenter/scheduledTasks/index.less
+63
-4
api.js
src/services/scheduledTasks/api.js
+9
-0
No files found.
src/pages/platformCenter/scheduledTasks/components/LookModal.jsx
0 → 100644
View file @
d92e639f
This diff is collapsed.
Click to expand it.
src/pages/platformCenter/scheduledTasks/components/LookModal.less
0 → 100644
View file @
d92e639f
.lookModal {
width: 100%;
height: 700px;
display: flex;
flex-direction: column;
overflow: hidden;
.header {
display: flex;
flex-wrap: wrap;
align-items: center;
width: 100%;
padding: 5px 10px;
.select {
margin: 0 10px;
}
.radioList {
margin: 0px 10px;
}
}
.table {
flex: 1;
overflow: hidden;
padding: 10px 10px 0px 10px;
:global {
.ant-table-wrapper {
height: 100%;
.ant-spin-nested-loading {
height: 100%;
.ant-spin-container {
height: 100%;
.ant-table.ant-table-small {
height: 100%;
.ant-table-container {
height: 100%;
}
}
}
}
}
}
}
.footer {
padding: 10px;
display: flex;
justify-content: flex-end;
}
}
src/pages/platformCenter/scheduledTasks/index.jsx
View file @
d92e639f
...
...
@@ -16,11 +16,11 @@ import {
Select
,
}
from
'antd'
;
import
{
SearchOutlined
,
FundViewOutlined
,
EditTwoTone
,
DeleteOutlined
,
PlusOutlined
,
CalendarOutlined
,
ZoomInOutlined
,
}
from
'@ant-design/icons'
;
import
'moment/dist/locale/zh-cn'
;
import
styles
from
'./index.less'
;
...
...
@@ -28,22 +28,28 @@ import {
GetIISAgentConfig
,
DeleteIISAgentConfig
,
AddIISAgentConfig
,
GetIISAgentLog
,
}
from
'@/services/scheduledTasks/api'
;
import
AddModal
from
'./components/AddModal'
;
import
LookModal
from
'./components/LookModal'
;
import
PushTest
from
'./components/PushTest/PushTest'
;
const
{
Option
}
=
Select
;
let
timer
=
null
;
const
ScheduledTasks
=
()
=>
{
const
[
loading
,
setLoading
]
=
useState
(
false
);
// 源数据
const
[
requestUrl
,
setRequestUrl
]
=
useState
(
''
);
// 接口名称筛选
const
[
showSearchStyle
,
setShowSearchStyle
]
=
useState
(
false
);
// 是否显示模糊查询样式
const
[
keepTableList
,
setKeepTableList
]
=
useState
([]);
const
[
addVisible
,
setAddVisible
]
=
useState
(
false
);
const
[
lookVisible
,
setLookVisible
]
=
useState
(
false
);
const
[
type
,
setType
]
=
useState
(
''
);
const
[
recordItem
,
setRecordItem
]
=
useState
();
const
[
pushTestVisible
,
setPushTestVisible
]
=
useState
(
false
);
const
typeValue
=
useRef
(
'重复执行'
);
const
[
columnsData
,
setColumnsData
]
=
useState
([]);
const
scroll
=
useRef
();
const
[
logList
,
setLogList
]
=
useState
([]);
const
columns
=
[
{
...
...
@@ -172,8 +178,83 @@ const ScheduledTasks = () => {
useEffect
(()
=>
{
getTableList
();
setColumnsData
(
columns
);
getIISAgentLog
();
return
()
=>
{
clearInterval
(
timer
);
timer
=
null
;
};
},
[]);
const
getIISAgentLog
=
()
=>
{
// const worker = new Worker('logWorker.js');
// GetIISAgentLog().then(res => {
// if (res.code === 0) {
// debugger;
// worker.postMessage(res.data);
// worker.onmessage = e => {
// setLogList(e.data);
// debugger;
// scroll.current.scrollTop = scroll.current.scrollHeight;
// timer = setTimeout(() => {
// getIISAgentLog();
// }, 2000);
// };
// } else {
// notification.error({
// message: '提示',
// duration: 3,
// description: res.msg,
// });
// clearInterval(timer);
// timer = null;
// }
// });
GetIISAgentLog
().
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
let
arr
=
[];
arr
.
push
(
res
.
data
.
split
(
/
(\r\n)
|
(\n)
/
).
map
((
item
,
index
)
=>
{
// eslint-disable-next-line react/no-danger
let
mes
=
item
?.
indexOf
(
'[信息]'
);
let
warn
=
item
?.
indexOf
(
'[警告]'
);
if
(
mes
!==
-
1
)
{
return
(
<
div
style=
{
{
color
:
'aqua'
}
}
key=
{
index
}
dangerouslySetInnerHTML=
{
{
__html
:
item
}
}
/>
);
}
else
if
(
warn
!==
-
1
)
{
return
(
<
div
style=
{
{
color
:
'yellow'
}
}
key=
{
index
}
dangerouslySetInnerHTML=
{
{
__html
:
item
}
}
/>
);
}
else
{
return
<
div
key=
{
index
}
dangerouslySetInnerHTML=
{
{
__html
:
item
}
}
/>;
}
}),
);
setLogList
(
arr
);
scroll
.
current
.
scrollTop
=
scroll
.
current
.
scrollHeight
;
timer
=
setTimeout
(()
=>
{
getIISAgentLog
();
},
2000
);
}
else
{
notification
.
error
({
message
:
'提示'
,
duration
:
3
,
description
:
res
.
msg
,
});
clearInterval
(
timer
);
timer
=
null
;
}
});
};
const
getTableList
=
(
search
,
planType
)
=>
{
let
newSearch
=
search
?
search
:
requestUrl
;
let
newType
=
planType
?
planType
:
typeValue
.
current
;
...
...
@@ -199,17 +280,6 @@ const ScheduledTasks = () => {
});
};
const
changeSwitch
=
(
e
,
record
)
=>
{
// AddIISAgentConfig({ ...record, Enabled: e }).then(res => {
// if (res.code === 0) {
// getTableList();
// message.success(e ? `开启成功!` : `关闭成功!`);
// } else {
// message.error(res.msg);
// }
// });
};
const
TestDesc
=
val
=>
{
setRecordItem
(
val
);
setPushTestVisible
(
true
);
...
...
@@ -256,6 +326,10 @@ const ScheduledTasks = () => {
setAddVisible
(
true
);
};
const
handleLook
=
()
=>
{
setLookVisible
(
true
);
};
const
onOk
=
val
=>
{
changeTable
(
val
);
typeValue
.
current
=
val
;
...
...
@@ -305,6 +379,17 @@ const ScheduledTasks = () => {
/>
</
div
>
<
div
className=
{
styles
.
headRight
}
>
<
Button
icon=
{
<
ZoomInOutlined
className=
{
styles
.
icon
}
/>
}
onClick=
{
handleLook
}
style=
{
{
marginLeft
:
'25px'
,
verticalAlign
:
'middle'
,
marginTop
:
'-3px'
,
}
}
>
调用日志
</
Button
>
<
Button
icon=
{
<
PlusOutlined
className=
{
styles
.
icon
}
/>
}
type=
"primary"
...
...
@@ -331,10 +416,19 @@ const ScheduledTasks = () => {
editData
(
record
);
},
// 双击
})
}
scroll=
{
{
y
:
'calc(100vh - 225px)'
}
}
scroll=
{
{
y
:
'calc(100% - 40px)'
}
}
pagination=
{
false
}
loading=
{
loading
}
/>
</
div
>
<
div
className=
{
styles
.
footer
}
>
<
CalendarOutlined
style=
{
{
color
:
'#1685ff'
}
}
/>
<
span
style=
{
{
marginLeft
:
'10px'
,
fontWeight
:
'bold'
}
}
>
运行日志
</
span
>
<
div
className=
{
styles
.
runLog
}
ref=
{
scroll
}
>
{
logList
}
<
div
className=
{
styles
.
blinkingCursor
}
>
|
</
div
>
</
div
>
</
div
>
<
AddModal
visible=
{
addVisible
}
onCancel=
{
()
=>
setAddVisible
(
false
)
}
...
...
@@ -342,6 +436,11 @@ const ScheduledTasks = () => {
type=
{
type
}
record=
{
recordItem
}
/>
<
LookModal
visible=
{
lookVisible
}
onCancel=
{
()
=>
setLookVisible
(
false
)
}
keepTableList=
{
keepTableList
}
/>
<
PushTest
visible=
{
pushTestVisible
}
onCancel=
{
()
=>
setPushTestVisible
(
false
)
}
...
...
src/pages/platformCenter/scheduledTasks/index.less
View file @
d92e639f
.scheduledTasks {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
.head {
padding: 10px;
background: white;
margin-bottom: 2px;
width: 100%;
height: 52px;
display: flex;
justify-content: space-between;
align-items: center;
.headLeft{
.headLeft
{
display: flex;
align-items: center;
}
}
.table {
height: calc(100% - 53px)
;
flex: 1
;
width: 100%;
background-color: white;
padding: 10px;
overflow: hidden;
margin-bottom: 3px;
:global {
.ant-table-wrapper {
height: 100%;
.ant-spin-nested-loading {
height: 100%;
.ant-spin-container {
height: 100%;
.ant-table.ant-table-small {
height: 100%;
.ant-table-container {
height: calc(100vh - 185px);
height: 100%;
}
}
}
}
}
}
}
.footer {
height: 350px;
width: 100%;
background-color: white;
padding: 10px;
:global {
::-webkit-scrollbar-thumb {
border-radius: 0;
}
::-webkit-scrollbar {
display: none;
}
}
.runLog {
margin-top: 5px;
width: 100%;
height: 305px;
background-color: #000040;
overflow-y: scroll;
color: #808080;
padding: 0 10px;
@keyframes blink {
0% {
opacity: 1;
}
50% {
opacity: 0;
}
100% {
opacity: 1;
}
}
.blinkingCursor {
color: #ffffff;
animation: blink 1s infinite;
}
}
}
.icon {
...
...
src/services/scheduledTasks/api.js
View file @
d92e639f
...
...
@@ -8,3 +8,12 @@ export const GetIISAgentConfig = param =>
export
const
DeleteIISAgentConfig
=
param
=>
get
(
`
${
PUBLISH_SERVICE
}
/MessageConfig/DeleteIISAgentConfig`
,
param
);
// 删除助理服务器配置
export
const
GetIISAgentLog
=
param
=>
get
(
`
${
PUBLISH_SERVICE
}
/MessageConfig/GetIISAgentLog`
,
param
);
// 删除助理服务器配置
export
const
GetIISAgentSite
=
param
=>
get
(
`
${
PUBLISH_SERVICE
}
/MessageConfig/GetIISAgentSite`
,
param
);
// 获取 siteName
export
const
QueryIISAgentCalllog
=
data
=>
post
(
`
${
PUBLISH_SERVICE
}
/MessageConfig/QueryIISAgentCalllog`
,
data
);
// 获取调用日志的接口
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment