From 4f5540f75678c22a85ffdad70211caaa9e3165fd Mon Sep 17 00:00:00 2001 From: hanhh <18330117883@163.com> Date: Thu, 17 Jun 2021 20:56:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=89=88=E6=9C=AC=E5=8F=B7?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E5=92=8C=E6=9F=A5=E7=9C=8Bcron=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E5=88=97=E8=A1=A8=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layouts/index.tsx | 12 +++++++++++- src/pages/crontab/index.tsx | 6 ++++-- 2 files changed, 15 insertions(+), 3 deletions(-) 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, });