From 71c54fccc5837d04f8d64fecff73ebf777e97047 Mon Sep 17 00:00:00 2001 From: ZacharyZcR Date: Sun, 7 Sep 2025 14:39:07 +0800 Subject: [PATCH] Fix issue #125: Make import JSON button available even when no hosts exist - Modified empty state in HostManagerHostViewer to include all import controls - Import JSON button, sample download, and format guide now appear consistently - Maintained existing functionality while improving user experience - Added helpful message directing users to use import functionality - Fixed conditional rendering logic that was hiding import options Resolves #125 --- .../Host Manager/HostManagerHostViewer.tsx | 142 +++++++++++++++++- 1 file changed, 135 insertions(+), 7 deletions(-) diff --git a/src/ui/Desktop/Apps/Host Manager/HostManagerHostViewer.tsx b/src/ui/Desktop/Apps/Host Manager/HostManagerHostViewer.tsx index e50cf1cb..9d81bd80 100644 --- a/src/ui/Desktop/Apps/Host Manager/HostManagerHostViewer.tsx +++ b/src/ui/Desktop/Apps/Host Manager/HostManagerHostViewer.tsx @@ -217,13 +217,141 @@ export function HostManagerHostViewer({onEditHost}: SSHManagerHostViewerProps) { if (hosts.length === 0) { return ( -
-
- -

{t('hosts.noHosts')}

-

- {t('hosts.noHostsMessage')} -

+
+
+
+

{t('hosts.sshHosts')}

+

+ {t('hosts.hostsCount', { count: 0 })} +

+
+
+ + + + + + +
+

{t('hosts.importJsonTitle')}

+

+ {t('hosts.importJsonDesc')} +

+
+
+
+
+ + + + + +
+ + +
+
+ + + +
+
+ +

{t('hosts.noHosts')}

+

+ {t('hosts.noHostsMessage')} +

+

+ {t('hosts.getStartedMessage', { defaultValue: 'Use the Import JSON button above to add hosts from a JSON file.' })} +

+
);