Merge pull request #3694 from bluewave-labs/feat/fe/progress-indicator-infra
Feat: Progress indicator infra & pagespeed
This commit is contained in:
2 files changed
+15
-11
No files matched your search
@@ -264,10 +264,10 @@ const CreateMonitorPage = () => {
|
|||||||
reset(defaults);
|
reset(defaults);
|
||||||
}, [defaults, reset]);
|
}, [defaults, reset]);
|
||||||
|
|
||||||
// Multi-step wizard, uptime create only (showTypeSelector). Other flows
|
// Multi-step wizard on every create flow; edit mode keeps the flat form
|
||||||
// keep the flat form, where showStep() is always true.
|
// where showStep() is always true.
|
||||||
const [currentStep, setCurrentStep] = useState(0);
|
const [currentStep, setCurrentStep] = useState(0);
|
||||||
const showStep = (step: number) => !showTypeSelector || currentStep === step;
|
const showStep = (step: number) => isEditMode || currentStep === step;
|
||||||
|
|
||||||
const watchedType = watch("type") as MonitorType;
|
const watchedType = watch("type") as MonitorType;
|
||||||
const watchedUseAdvancedMatching = watch("useAdvancedMatching") as boolean;
|
const watchedUseAdvancedMatching = watch("useAdvancedMatching") as boolean;
|
||||||
@@ -362,7 +362,7 @@ const CreateMonitorPage = () => {
|
|||||||
refetch={refetchMonitor}
|
refetch={refetchMonitor}
|
||||||
onDelete={handleDeleteClick}
|
onDelete={handleDeleteClick}
|
||||||
/>
|
/>
|
||||||
{showTypeSelector && (
|
{!isEditMode && (
|
||||||
<StepProgress
|
<StepProgress
|
||||||
steps={totalSteps}
|
steps={totalSteps}
|
||||||
current={currentStep}
|
current={currentStep}
|
||||||
@@ -1335,9 +1335,9 @@ const CreateMonitorPage = () => {
|
|||||||
|
|
||||||
<Stack
|
<Stack
|
||||||
direction="row"
|
direction="row"
|
||||||
justifyContent={showTypeSelector ? "space-between" : "flex-end"}
|
justifyContent={!isEditMode ? "space-between" : "flex-end"}
|
||||||
>
|
>
|
||||||
{showTypeSelector && (
|
{!isEditMode && (
|
||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
@@ -1348,7 +1348,7 @@ const CreateMonitorPage = () => {
|
|||||||
{t("common.buttons.back")}
|
{t("common.buttons.back")}
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
{showTypeSelector && currentStep < totalSteps - 1 ? (
|
{!isEditMode && currentStep < totalSteps - 1 ? (
|
||||||
<Button
|
<Button
|
||||||
key="wizard-next"
|
key="wizard-next"
|
||||||
type="button"
|
type="button"
|
||||||
|
|||||||
@@ -128,19 +128,23 @@ const hardwareSchema = baseSchema.extend({
|
|||||||
cpuAlertThreshold: z
|
cpuAlertThreshold: z
|
||||||
.number()
|
.number()
|
||||||
.min(0, "CPU threshold must be at least 0")
|
.min(0, "CPU threshold must be at least 0")
|
||||||
.max(100, "CPU threshold must be at most 100"),
|
.max(100, "CPU threshold must be at most 100")
|
||||||
|
.register(monitorStepRegistry, { step: 1 }),
|
||||||
memoryAlertThreshold: z
|
memoryAlertThreshold: z
|
||||||
.number()
|
.number()
|
||||||
.min(0, "Memory threshold must be at least 0")
|
.min(0, "Memory threshold must be at least 0")
|
||||||
.max(100, "Memory threshold must be at most 100"),
|
.max(100, "Memory threshold must be at most 100")
|
||||||
|
.register(monitorStepRegistry, { step: 1 }),
|
||||||
diskAlertThreshold: z
|
diskAlertThreshold: z
|
||||||
.number()
|
.number()
|
||||||
.min(0, "Disk threshold must be at least 0")
|
.min(0, "Disk threshold must be at least 0")
|
||||||
.max(100, "Disk threshold must be at most 100"),
|
.max(100, "Disk threshold must be at most 100")
|
||||||
|
.register(monitorStepRegistry, { step: 1 }),
|
||||||
tempAlertThreshold: z
|
tempAlertThreshold: z
|
||||||
.number()
|
.number()
|
||||||
.min(0, "Temperature threshold must be at least 0")
|
.min(0, "Temperature threshold must be at least 0")
|
||||||
.max(150, "Temperature threshold must be at most 150"),
|
.max(150, "Temperature threshold must be at most 150")
|
||||||
|
.register(monitorStepRegistry, { step: 1 }),
|
||||||
selectedDisks: z.array(z.string()),
|
selectedDisks: z.array(z.string()),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user