replace monitor type map for lables and placeholders
This commit is contained in:
1 parent
d08ede519a
commit
dd9ed553dd
1 file changed
+18
-2
@@ -35,6 +35,24 @@ const CreateMonitor = () => {
|
|||||||
{ _id: 5, name: "5 minutes" },
|
{ _id: 5, name: "5 minutes" },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const monitorTypeMaps = {
|
||||||
|
http: {
|
||||||
|
label: "URL to monitor",
|
||||||
|
placeholder: "google.com",
|
||||||
|
namePlaceholder: "Google",
|
||||||
|
},
|
||||||
|
ping: {
|
||||||
|
label: "IP address to monitor",
|
||||||
|
placeholder: "1.1.1.1",
|
||||||
|
namePlaceholder: "Google",
|
||||||
|
},
|
||||||
|
docker: {
|
||||||
|
label: "Container ID",
|
||||||
|
placeholder: "abc123",
|
||||||
|
namePlaceholder: "My Container",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
const { user, authToken } = useSelector((state) => state.auth);
|
const { user, authToken } = useSelector((state) => state.auth);
|
||||||
const { monitors, isLoading } = useSelector((state) => state.uptimeMonitors);
|
const { monitors, isLoading } = useSelector((state) => state.uptimeMonitors);
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
@@ -156,8 +174,6 @@ const CreateMonitor = () => {
|
|||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const fetchMonitor = async () => {
|
const fetchMonitor = async () => {
|
||||||
if (monitorId) {
|
if (monitorId) {
|
||||||
|
|||||||
Reference in new issue
Block a user