Comprehensive credentials management and SSH host system fixes

Backend improvements:
- Fix SSH host update authentication system (use effectiveAuthType)
- Support both authType and authMethod field mapping
- Prevent empty password/key from overwriting existing credentials
- Add proper credentialId support for credential-based authentication

Frontend enhancements:
- Add dedicated "Add Credential" page similar to Add Host
- Refactor credentials management with consistent Host Manager styling
- Fix credential display bug (hide keyType for password credentials)
- Enhance CredentialSelector with improved API response handling

i18n internationalization:
- Fix Admin Settings i18n issues with comprehensive translation support
- Add missing credentials.* translation keys for both English and Chinese
- Fix hardcoded key type labels (RSA, ECDSA, Ed25519) with proper translations
- Add missing placeholders and form labels

UI/UX improvements:
- Update HostManager with 4-tab structure including credential management
- Improve visual consistency across credential components
- Better error handling and user feedback
- Enhanced form validation and submission logic

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
ZacharyZcR
2025-09-07 04:28:25 +08:00
parent 199a9f6e52
commit e5939dadbe
9 changed files with 918 additions and 1030 deletions
+33 -1
View File
@@ -10,7 +10,8 @@
"deleteCredential": "Delete Credential",
"updateCredential": "Update Credential",
"credentialName": "Credential Name",
"credentialDescription": "Description",
"credentialDescription": "Description",
"username": "Username",
"searchCredentials": "Search credentials...",
"selectFolder": "Select Folder",
"selectAuthType": "Select Auth Type",
@@ -33,6 +34,32 @@
"failedToSaveCredential": "Failed to save credential",
"failedToFetchCredentialDetails": "Failed to fetch credential details",
"failedToFetchHostsUsing": "Failed to fetch hosts using this credential",
"loadingCredentials": "Loading credentials...",
"retry": "Retry",
"noCredentials": "No Credentials",
"noCredentialsMessage": "Start by creating your first SSH credential",
"sshCredentials": "SSH Credentials",
"credentialsCount": "{{count}} credentials",
"refresh": "Refresh",
"passwordRequired": "Password is required",
"sshKeyRequired": "SSH key is required",
"credentialAddedSuccessfully": "Credential \"{{name}}\" added successfully",
"general": "General",
"description": "Description",
"folder": "Folder",
"tags": "Tags",
"addTagsSpaceToAdd": "Add tags (press space to add)",
"password": "Password",
"key": "Key",
"sshPrivateKey": "SSH Private Key",
"upload": "Upload",
"updateKey": "Update Key",
"keyPassword": "Key Password (optional)",
"keyType": "Key Type",
"keyTypeRSA": "RSA",
"keyTypeECDSA": "ECDSA",
"keyTypeEd25519": "Ed25519",
"updateCredential": "Update Credential",
"basicInfo": "Basic Info",
"authentication": "Authentication",
"organization": "Organization",
@@ -236,6 +263,7 @@
},
"admin": {
"title": "Admin Settings",
"oidc": "OIDC",
"users": "Users",
"userManagement": "User Management",
"makeAdmin": "Make Admin",
@@ -770,6 +798,9 @@
"folder": "folder",
"password": "password",
"keyPassword": "key password",
"credentialName": "My SSH Server",
"description": "SSH credential description",
"searchCredentials": "Search credentials by name, username, or tags...",
"sshConfig": "endpoint ssh configuration",
"homePath": "/home",
"clientId": "your-client-id",
@@ -780,6 +811,7 @@
"userIdField": "sub",
"usernameField": "name",
"scopes": "openid email profile",
"userinfoUrl": "https://your-provider.com/application/o/userinfo/",
"enterUsername": "Enter username to make admin",
"searchHosts": "Search hosts by name, username, IP, folder, tags...",
"enterPassword": "Enter your password",
+32
View File
@@ -11,6 +11,7 @@
"updateCredential": "更新凭据",
"credentialName": "凭据名称",
"credentialDescription": "描述",
"username": "用户名",
"searchCredentials": "搜索凭据...",
"selectFolder": "选择文件夹",
"selectAuthType": "选择认证类型",
@@ -33,6 +34,32 @@
"failedToSaveCredential": "保存凭据失败",
"failedToFetchCredentialDetails": "获取凭据详情失败",
"failedToFetchHostsUsing": "获取使用此凭据的主机失败",
"loadingCredentials": "正在加载凭据...",
"retry": "重试",
"noCredentials": "暂无凭据",
"noCredentialsMessage": "开始创建您的第一个SSH凭据",
"sshCredentials": "SSH凭据",
"credentialsCount": "{{count}} 个凭据",
"refresh": "刷新",
"passwordRequired": "密码为必填项",
"sshKeyRequired": "SSH密钥为必填项",
"credentialAddedSuccessfully": "凭据「{{name}}」添加成功",
"general": "常规",
"description": "描述",
"folder": "文件夹",
"tags": "标签",
"addTagsSpaceToAdd": "添加标签(按空格键添加)",
"password": "密码",
"key": "密钥",
"sshPrivateKey": "SSH私钥",
"upload": "上传",
"updateKey": "更新密钥",
"keyPassword": "密钥密码(可选)",
"keyType": "密钥类型",
"keyTypeRSA": "RSA",
"keyTypeECDSA": "ECDSA",
"keyTypeEd25519": "Ed25519",
"updateCredential": "更新凭据",
"basicInfo": "基本信息",
"authentication": "认证方式",
"organization": "组织管理",
@@ -236,6 +263,7 @@
},
"admin": {
"title": "管理员设置",
"oidc": "OIDC",
"users": "用户",
"userManagement": "用户管理",
"makeAdmin": "设为管理员",
@@ -807,6 +835,9 @@
"hostname": "主机名",
"folder": "文件夹",
"password": "密码",
"credentialName": "我的SSH服务器",
"description": "SSH凭据描述",
"searchCredentials": "按名称、用户名或标签搜索凭据...",
"keyPassword": "密钥密码",
"sshConfig": "端点 SSH 配置",
"homePath": "/home",
@@ -818,6 +849,7 @@
"userIdField": "sub",
"usernameField": "name",
"scopes": "openid email profile",
"userinfoUrl": "https://your-provider.com/application/o/userinfo/",
"enterUsername": "输入用户名以设为管理员",
"searchHosts": "按名称、用户名、IP、文件夹、标签搜索主机...",
"enterPassword": "输入您的密码",