mirror of
https://github.com/linux-do/new-api.git
synced 2025-11-12 00:53:41 +08:00
feat: log channel status update time
This commit is contained in:
@@ -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()
|
||||||
|
|||||||
@@ -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);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user