Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
69ceb3ca
authored
Jun 16, 2024
by
1808837298@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: log channel status update time
parent
92549976
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletions
+18
-1
model/channel.go
+1
-0
web/src/components/ChannelsTable.js
+17
-1
No files found.
model/channel.go
View file @
69ceb3ca
...
@@ -255,6 +255,7 @@ func UpdateChannelStatusById(id int, status int, reason string) {
...
@@ -255,6 +255,7 @@ func UpdateChannelStatusById(id int, status int, reason string) {
// find channel by id success, update status and other info
// find channel by id success, update status and other info
info
:=
channel
.
GetOtherInfo
()
info
:=
channel
.
GetOtherInfo
()
info
[
"status_reason"
]
=
reason
info
[
"status_reason"
]
=
reason
info
[
"status_time"
]
=
common
.
GetTimestamp
()
channel
.
SetOtherInfo
(
info
)
channel
.
SetOtherInfo
(
info
)
channel
.
Status
=
status
channel
.
Status
=
status
err
=
channel
.
Save
()
err
=
channel
.
Save
()
...
...
web/src/components/ChannelsTable.js
View file @
69ceb3ca
...
@@ -96,7 +96,23 @@ const ChannelsTable = () => {
...
@@ -96,7 +96,23 @@ const ChannelsTable = () => {
title
:
'状态'
,
title
:
'状态'
,
dataIndex
:
'status'
,
dataIndex
:
'status'
,
render
:
(
text
,
record
,
index
)
=>
{
render
:
(
text
,
record
,
index
)
=>
{
return
<
div
>
{
renderStatus
(
text
)}
<
/div>
;
if
(
text
===
3
)
{
if
(
record
.
other_info
===
''
)
{
record
.
other_info
=
'{}'
}
let
otherInfo
=
JSON
.
parse
(
record
.
other_info
);
let
reason
=
otherInfo
[
'status_reason'
];
let
time
=
otherInfo
[
'status_time'
];
return
(
<
div
>
<
Tooltip
content
=
{
'原因:'
+
reason
+
',时间:'
+
timestamp2string
(
time
)}
>
{
renderStatus
(
text
)}
<
/Tooltip
>
<
/div
>
);
}
else
{
return
renderStatus
(
text
);
}
},
},
},
},
{
{
...
...
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