diff --git a/src/layouts/index.tsx b/src/layouts/index.tsx index 85911186..116cea28 100644 --- a/src/layouts/index.tsx +++ b/src/layouts/index.tsx @@ -61,6 +61,11 @@ export default function (props: any) { if (props.location.pathname === '/login') { return props.children; } + + const isFirefox = navigator.userAgent.includes('Firefox'); + const isSafari = + navigator.userAgent.includes('Safari') && + !navigator.userAgent.includes('Chrome'); return ( {version} diff --git a/src/pages/crontab/index.tsx b/src/pages/crontab/index.tsx index 18da79dc..90203d18 100644 --- a/src/pages/crontab/index.tsx +++ b/src/pages/crontab/index.tsx @@ -431,7 +431,7 @@ const Crontab = () => { if (index === -1) { result.push(cron); } else { - result.splice(index + pageSize * (currentPage - 1), 1, { + result.splice(index, 1, { ...cron, }); } @@ -442,9 +442,11 @@ const Crontab = () => { request .get(`${config.apiPrefix}crons/${cron._id}`) .then((data: any) => { + console.log(value); const index = value.findIndex((x) => x._id === cron._id); + console.log(index); const result = [...value]; - result.splice(index + pageSize * (currentPage - 1), 1, { + result.splice(index, 1, { ...cron, ...data.data, });