fix: various UI/UX improvements for infrastructure pages
## Changes - Fix infrastructure monitor configure page loading error by adding required dateRange parameter - Fix URL validation error when editing existing infrastructure monitors - Fix monitor update using correct 'id' property instead of '_id' - Fix gauge box labels: "Device" (capitalized) and "Mounted on" instead of "mountpoint" - Show full device path instead of truncated ".../" prefix - Implement CSS Grid layout for gauge boxes ensuring consistent widths across all rows - Gauge boxes expand to fill space only when 4+ boxes exist ## Files Modified - client/src/Pages/Infrastructure/Create/index.jsx - client/src/Pages/Infrastructure/Create/hooks/useInfrastructureSubmit.jsx - client/src/Pages/Infrastructure/Details/Components/GaugeBoxes/index.jsx - client/src/Pages/Infrastructure/Details/Components/GaugeBoxes/Gauge.jsx - client/src/Pages/Infrastructure/Details/Components/BaseContainer/index.jsx - client/src/Pages/Infrastructure/Details/Hooks/useHardwareUtils.jsx - client/src/locales/en.json
This commit is contained in:
1 parent
b5caabed20
commit
bf15018173
7 files changed
+39
-33
No files matched your search
@@ -61,7 +61,7 @@ const useInfrastructureSubmit = () => {
|
||||
};
|
||||
|
||||
const finalForm = {
|
||||
...(isCreate ? {} : { _id: monitorId }),
|
||||
...(isCreate ? {} : { id: monitorId }),
|
||||
...rest,
|
||||
description: form.name,
|
||||
type: "hardware",
|
||||
|
||||
@@ -44,6 +44,7 @@ const CreateInfrastructureMonitor = () => {
|
||||
// Fetch monitor details if editing
|
||||
const [monitor, isLoading] = useFetchHardwareMonitorById({
|
||||
monitorId,
|
||||
dateRange: "day",
|
||||
updateTrigger,
|
||||
});
|
||||
const [deleteMonitor, isDeleting] = useDeleteMonitor();
|
||||
@@ -127,7 +128,9 @@ const CreateInfrastructureMonitor = () => {
|
||||
const onSubmit = async (event) => {
|
||||
event.preventDefault();
|
||||
const form = buildForm(infrastructureMonitor, https);
|
||||
const error = validateForm(form);
|
||||
// When editing, exclude URL from validation since it's disabled and can't be changed
|
||||
const formToValidate = isCreate ? form : { ...form, url: monitor.url };
|
||||
const error = validateForm(formToValidate);
|
||||
if (error) {
|
||||
return;
|
||||
}
|
||||
@@ -204,14 +207,14 @@ const CreateInfrastructureMonitor = () => {
|
||||
<></>
|
||||
)}
|
||||
</Typography>
|
||||
{!isCreate && (
|
||||
{!isCreate && monitor && (
|
||||
<MonitorStatusHeader
|
||||
monitor={monitor}
|
||||
infrastructureMonitor={infrastructureMonitor}
|
||||
/>
|
||||
)}
|
||||
</Box>
|
||||
{!isCreate && (
|
||||
{!isCreate && monitor && (
|
||||
<MonitorActionButtons
|
||||
monitor={monitor}
|
||||
isBusy={isBusy}
|
||||
|
||||
Reference in new issue
Block a user