remove pages/monitors/index.js
This commit is contained in:
1 parent
2b425a27cf
commit
20868135c1
2 files changed
+6
-8
No files matched your search
+1
-5
@@ -56,11 +56,7 @@ function App() {
|
|||||||
element={<ProtectedRoute Component={MonitorsWithAdminProp} />}
|
element={<ProtectedRoute Component={MonitorsWithAdminProp} />}
|
||||||
/>
|
/>
|
||||||
<Route
|
<Route
|
||||||
path="/monitors/create"
|
path="/monitors/create/:monitorId?"
|
||||||
element={<ProtectedRoute Component={CreateMonitor} />}
|
|
||||||
/>
|
|
||||||
<Route
|
|
||||||
path="/monitors/clone/:monitorId"
|
|
||||||
element={<ProtectedRoute Component={CreateMonitor} />}
|
element={<ProtectedRoute Component={CreateMonitor} />}
|
||||||
/>
|
/>
|
||||||
<Route
|
<Route
|
||||||
|
|||||||
@@ -48,10 +48,12 @@ const CreateMonitor = () => {
|
|||||||
const data = monitors.find((monitor) => monitor._id === monitorId);
|
const data = monitors.find((monitor) => monitor._id === monitorId);
|
||||||
if (!data) {
|
if (!data) {
|
||||||
console.error("Error fetching monitor of id: " + monitorId);
|
console.error("Error fetching monitor of id: " + monitorId);
|
||||||
navigate("/not-found");
|
navigate("/not-found", {replace: true});
|
||||||
}
|
}
|
||||||
const {url, name, ...rest} = data;
|
const {name, ...rest} = data; //data.name is read-only
|
||||||
rest.interval = rest.interval/60000;
|
if(rest.type == 'http') rest.url = rest.url.substring(8, rest.url.length)
|
||||||
|
rest.name = `${name} (Clone)`;
|
||||||
|
rest.interval /= 60000;
|
||||||
setMonitor({
|
setMonitor({
|
||||||
...rest,
|
...rest,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in new issue
Block a user