- update UI based on figma

This commit is contained in:
Shemy Gan committed 2024-11-04 10:06:00 -05:00
1 parent c59af66be1
commit ba9bb505ed
1 file changed
+14 -7
@@ -26,6 +26,7 @@ const CreateInfrastructureMonitor = () => {
const idMap = { const idMap = {
"monitor-url": "url", "monitor-url": "url",
"monitor-name": "name", "monitor-name": "name",
"monitor-secret": "secret",
"monitor-checks-http": "type", "monitor-checks-http": "type",
"monitor-checks-ping": "type", "monitor-checks-ping": "type",
"notify-email-default": "notification-email", "notify-email-default": "notification-email",
@@ -142,7 +143,7 @@ const CreateInfrastructureMonitor = () => {
const action = await dispatch(createInfrastructureMonitor({ authToken, monitor: form })); const action = await dispatch(createInfrastructureMonitor({ authToken, monitor: form }));
if (action.meta.requestStatus === "fulfilled") { if (action.meta.requestStatus === "fulfilled") {
createToast({ body: "Infrastructure monitor created successfully!" }); createToast({ body: "Infrastructure monitor created successfully!" });
navigate("/infrastructure-monitors"); navigate("/infrastructure-monitors/create");
} else { } else {
createToast({ body: "Failed to create monitor." }); createToast({ body: "Failed to create monitor." });
} }
@@ -204,11 +205,10 @@ const CreateInfrastructureMonitor = () => {
</Box> </Box>
<Stack gap={theme.spacing(15)}> <Stack gap={theme.spacing(15)}>
<Field <Field
type={infrastructureMonitor.type === "http" ? "url" : "text"} type={"text"}
id="monitor-url" id="monitor-url"
label="URL to monitor" label="Server URL"
https={https} placeholder="https://"
placeholder="google.com"
value={infrastructureMonitor.url} value={infrastructureMonitor.url}
onChange={handleChange} onChange={handleChange}
error={errors["url"]} error={errors["url"]}
@@ -216,13 +216,20 @@ const CreateInfrastructureMonitor = () => {
<Field <Field
type="text" type="text"
id="monitor-name" id="monitor-name"
label="Display name" label="Friendly name(optional)"
isOptional={true} isOptional={true}
placeholder="Google"
value={infrastructureMonitor.name} value={infrastructureMonitor.name}
onChange={handleChange} onChange={handleChange}
error={errors["name"]} error={errors["name"]}
/> />
<Field
type="text"
id="monitor-secret"
label="Authorization secret"
value={infrastructureMonitor.secret}
onChange={handleChange}
error={errors["secret"]}
/>
</Stack> </Stack>
</ConfigBox> </ConfigBox>
<ConfigBox> <ConfigBox>