Fix UX issues and improve Docker monitoring user experience
Critical fixes: 1. Monitor type detection on edit - When editing a Docker monitor, type is now correctly detected from monitor object - Previously defaulted to "hardware" causing incorrect form fields to show - Fix: Detect type from query params on create, from monitor.type on edit 2. Default interval for Docker monitors - Docker monitors now default to 30 seconds (0.5 minutes) on creation - Hardware monitors remain at 15 seconds (0.25 minutes) - Pass monitorType to initializeInfrastructureMonitorForCreate 3. Type-aware fallback links - Hardware tab empty state: links to /infrastructure/create?type=hardware - Docker tab empty state: links to /infrastructure/create?type=docker - Ensures correct form is shown when creating from empty state UX improvements: 4. Enhanced error messaging in Docker container table - Differentiate between "No containers" vs "Docker daemon unavailable" - Show error details when Capture API fails - Display critical errors (docker.client) with red background - Show partial error messages when some containers fail to inspect 5. Display Capture metadata - Show Capture version in container table header - Display error count when errors are present (⚠ N error(s) encountered) - Help users identify API issues vs legitimate empty states 6. Improved empty state handling - "Docker daemon unavailable" - when Docker socket unreachable on Capture server - "No containers found" - when Capture is working but no containers exist - "Partial data available" - when some containers failed to inspect - Show specific error messages from Capture API These changes improve the user experience when: - Editing existing Docker monitors (correct form fields shown) - Creating Docker monitors (proper default interval) - Troubleshooting Capture API issues (clear error messages) - Understanding container availability (version info, error details)
This commit is contained in:
5 files changed
+81
-17
No files matched your search
@@ -35,9 +35,6 @@ const CreateInfrastructureMonitor = () => {
|
||||
const theme = useTheme();
|
||||
const { t } = useTranslation();
|
||||
|
||||
// Get monitor type from query params (default to hardware for backwards compatibility)
|
||||
const monitorType = searchParams.get("type") || "hardware";
|
||||
|
||||
// State
|
||||
const [https, setHttps] = useState(false);
|
||||
const [updateTrigger, setUpdateTrigger] = useState(false);
|
||||
@@ -47,6 +44,11 @@ const CreateInfrastructureMonitor = () => {
|
||||
monitorId,
|
||||
updateTrigger,
|
||||
});
|
||||
|
||||
// Determine monitor type: from query params when creating, from monitor object when editing
|
||||
const monitorType = isCreate
|
||||
? (searchParams.get("type") || "hardware")
|
||||
: (monitor?.type || "hardware");
|
||||
const [deleteMonitor, isDeleting] = useDeleteMonitor();
|
||||
const [globalSettings, globalSettingsLoading] = useFetchGlobalSettings();
|
||||
const [notifications, notificationsAreLoading] = useGetNotificationsByTeamId();
|
||||
@@ -91,7 +93,8 @@ const CreateInfrastructureMonitor = () => {
|
||||
if (isCreate) {
|
||||
if (globalSettingsLoading) return;
|
||||
setHttps(false);
|
||||
initializeInfrastructureMonitorForCreate(globalSettings);
|
||||
const typeFromQuery = searchParams.get("type") || "hardware";
|
||||
initializeInfrastructureMonitorForCreate(globalSettings, typeFromQuery);
|
||||
} else if (monitor) {
|
||||
setHttps(monitor.url.startsWith("https"));
|
||||
initializeInfrastructureMonitorForUpdate(monitor);
|
||||
@@ -101,6 +104,7 @@ const CreateInfrastructureMonitor = () => {
|
||||
monitor,
|
||||
globalSettings,
|
||||
globalSettingsLoading,
|
||||
searchParams,
|
||||
initializeInfrastructureMonitorForCreate,
|
||||
initializeInfrastructureMonitorForUpdate,
|
||||
]);
|
||||
|
||||
Reference in new issue
Block a user