From 2330fc8684718bae5ffde4dbc76e91303a54d7e9 Mon Sep 17 00:00:00 2001 From: dongfang <1136005348@qq.com> Date: Thu, 13 Feb 2025 00:54:24 +0000 Subject: [PATCH] support create uptime with json validation --- Client/src/Pages/Uptime/Create/index.jsx | 69 ++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/Client/src/Pages/Uptime/Create/index.jsx b/Client/src/Pages/Uptime/Create/index.jsx index a0fcce43b..354dfef29 100644 --- a/Client/src/Pages/Uptime/Create/index.jsx +++ b/Client/src/Pages/Uptime/Create/index.jsx @@ -93,6 +93,12 @@ const CreateMonitor = () => { interval: monitor.interval * MS_PER_MINUTE, }; + if (monitor.type === "http") { + form.expectedValue = monitor.expectedValue; + form.jsonPath = monitor.jsonPath; + form.matchMethod = monitor.matchMethod; + } + const { error } = monitorValidation.validate(form, { abortEarly: false, }); @@ -399,6 +405,69 @@ const CreateMonitor = () => { onChange={(event) => handleChange(event, "interval")} items={SELECT_VALUES} /> + { + monitor.type === "http" && <> +