日志增加时间显示

This commit is contained in:
“xxq250” 2022-08-11 15:46:25 +08:00
parent 2f4ac49b3b
commit 76a1c8aeba
3 changed files with 5 additions and 3 deletions

2
web/dist/umi.js vendored

File diff suppressed because one or more lines are too long

View File

@ -2,6 +2,7 @@ import { useEffect } from 'react';
import { Modal, Button, Spin } from 'antd';
import { getJobLog } from '@/services/Jobs';
import useRequest from '@/utils/useRequest';
import moment from 'moment';
interface Props {
visible: boolean;
@ -17,7 +18,7 @@ export default (props: Props) => {
useEffect(() => {
fetchJobLog({ name, id });
}, [])
return (
<Modal
title="查看日志"
@ -31,7 +32,7 @@ export default (props: Props) => {
{
logsData?.data?.list?.map((item: API.Log, index: number) => (
<>
<div>{item.log}</div>
<div>{moment(item.create_time).format('YYYY-MM-DD HH:mm:ss')} {item.log_type} {item.log}</div>
{index === logsData?.data?.list?.length ? <br/> : null }
</>
))

View File

@ -242,6 +242,7 @@ declare namespace API {
log_type: string;
/** log */
log: string;
create_time: string;
}
interface UserInfoDto {