mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 23:06:06 +08:00
修复定时任务详情页查看历史日志异常
This commit is contained in:
parent
c35cfba8b0
commit
5e73f0390f
|
@ -120,10 +120,11 @@ const CronDetailModal = ({
|
||||||
};
|
};
|
||||||
|
|
||||||
const onClickItem = (item: LogItem) => {
|
const onClickItem = (item: LogItem) => {
|
||||||
localStorage.setItem('logCron', currentCron.id);
|
const url = `${config.apiPrefix}logs/${item.filename}?path=${
|
||||||
setLogUrl(
|
item.directory || ''
|
||||||
`${config.apiPrefix}logs/${item.filename}?path=${item.directory || ''}`,
|
}`;
|
||||||
);
|
localStorage.setItem('logCron', url);
|
||||||
|
setLogUrl(url);
|
||||||
request
|
request
|
||||||
.get(
|
.get(
|
||||||
`${config.apiPrefix}logs/${item.filename}?path=${item.directory || ''}`,
|
`${config.apiPrefix}logs/${item.filename}?path=${item.directory || ''}`,
|
||||||
|
|
|
@ -40,6 +40,7 @@ const CronLogModal = ({
|
||||||
const [executing, setExecuting] = useState<any>(true);
|
const [executing, setExecuting] = useState<any>(true);
|
||||||
const [isPhone, setIsPhone] = useState(false);
|
const [isPhone, setIsPhone] = useState(false);
|
||||||
const scrollInfoRef = useRef({ value: 0, down: true });
|
const scrollInfoRef = useRef({ value: 0, down: true });
|
||||||
|
const uniqPath = logUrl ? logUrl : String(cron?.id);
|
||||||
|
|
||||||
const getCronLog = (isFirst?: boolean) => {
|
const getCronLog = (isFirst?: boolean) => {
|
||||||
if (isFirst) {
|
if (isFirst) {
|
||||||
|
@ -50,7 +51,7 @@ const CronLogModal = ({
|
||||||
.then(({ code, data }) => {
|
.then(({ code, data }) => {
|
||||||
if (
|
if (
|
||||||
code === 200 &&
|
code === 200 &&
|
||||||
localStorage.getItem('logCron') === String(cron.id) &&
|
localStorage.getItem('logCron') === uniqPath &&
|
||||||
data !== value
|
data !== value
|
||||||
) {
|
) {
|
||||||
const log = data as string;
|
const log = data as string;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user