Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
so-operation-api
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
smart-operation
so-operation-api
Commits
7ede4b8a
Commit
7ede4b8a
authored
Jul 10, 2023
by
陈子龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
任务历史 fix
parent
d83da738
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
2 deletions
+3
-2
src/bean/vo/response/task_history.go
src/bean/vo/response/task_history.go
+1
-0
src/service/task_history.go
src/service/task_history.go
+1
-1
src/service/task_manage.go
src/service/task_manage.go
+1
-1
No files found.
src/bean/vo/response/task_history.go
View file @
7ede4b8a
...
...
@@ -25,6 +25,7 @@ type TaskInfoListRes struct {
type
TaskExecLogRes
struct
{
Id
int
`json:"id"`
// 主键id
TaskId
int
`json:"task_id"`
// 任务id
ExecDesc
string
`json:"exec_desc"`
// 执行说明
TaskName
string
`json:"task_name"`
// 任务名称
ExecStartTime
time
.
Time
`json:"exec_start_time" `
// 执行开始时间
...
...
src/service/task_history.go
View file @
7ede4b8a
...
...
@@ -123,7 +123,7 @@ func (t *TaskHistorySvc) TaskExecLog(id int) (taskExecLogRes response.TaskExecLo
//查询
_
,
err
=
db
.
Table
(
"task_history"
)
.
Alias
(
"th"
)
.
Where
(
"id = ?"
,
id
)
.
Select
(
"th.id,th.exec_desc,(select tm.task_name from task_manage tm where th.task_id = tm.id and tm.is_delete = 0) as task_name,"
+
Select
(
"th.id,th.
task_id,th.
exec_desc,(select tm.task_name from task_manage tm where th.task_id = tm.id and tm.is_delete = 0) as task_name,"
+
"th.exec_start_time,th.exec_end_time,th.state,th.exec_log"
)
.
Get
(
&
taskExecLogRes
)
if
err
!=
nil
{
err
=
resp
.
DbSelectError
.
WithError
(
err
)
...
...
src/service/task_manage.go
View file @
7ede4b8a
...
...
@@ -250,7 +250,7 @@ func (t *TaskManageSvc) ExecScript(req request.ExecScriptReq, script string) (id
if
req
.
Value
!=
""
{
cmd
=
exec
.
Command
(
"ansible-playbook"
,
"/etc/ansible/ansible.yml"
,
"--extra-vars"
,
req
.
Value
)
}
else
{
cmd
=
exec
.
Command
(
"ansible-playbook"
,
"/etc/ansible/ansible.yml"
)
cmd
=
exec
.
Command
(
"ansible-playbook"
,
"/etc/ansible/ansible.yml"
,
"--extra-vars"
,
"{
\"
hosts
\"
:
\"
"
+
"cc"
+
"
\"
}"
)
}
//捕获正常日志
stdout
,
err
:=
cmd
.
StdoutPipe
()
...
...
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