diff --git a/src/backend/database/routes/users.ts b/src/backend/database/routes/users.ts index d945f2b0..fe4a7a10 100644 --- a/src/backend/database/routes/users.ts +++ b/src/backend/database/routes/users.ts @@ -640,11 +640,9 @@ router.get("/oidc/callback", async (req, res) => { `Identifier not found at path: ${config.identifier_path}`, ); authLogger.error(`Available fields: ${Object.keys(userInfo).join(", ")}`); - return res - .status(400) - .json({ - error: `User identifier not found at path: ${config.identifier_path}. Available fields: ${Object.keys(userInfo).join(", ")}`, - }); + return res.status(400).json({ + error: `User identifier not found at path: ${config.identifier_path}. Available fields: ${Object.keys(userInfo).join(", ")}`, + }); } let user = await db @@ -916,12 +914,10 @@ router.delete("/delete-account", authenticateJWT, async (req, res) => { const userRecord = user[0]; if (userRecord.is_oidc) { - return res - .status(403) - .json({ - error: - "Cannot delete external authentication accounts through this endpoint", - }); + return res.status(403).json({ + error: + "Cannot delete external authentication accounts through this endpoint", + }); } const isMatch = await bcrypt.compare(password, userRecord.password_hash); @@ -976,12 +972,9 @@ router.post("/initiate-reset", async (req, res) => { } if (user[0].is_oidc) { - return res - .status(403) - .json({ - error: - "Password reset not available for external authentication users", - }); + return res.status(403).json({ + error: "Password reset not available for external authentication users", + }); } const resetCode = Math.floor(100000 + Math.random() * 900000).toString(); @@ -1074,11 +1067,9 @@ router.post("/complete-reset", async (req, res) => { !isNonEmptyString(tempToken) || !isNonEmptyString(newPassword) ) { - return res - .status(400) - .json({ - error: "Username, temporary token, and new password are required", - }); + return res.status(400).json({ + error: "Username, temporary token, and new password are required", + }); } try { @@ -1602,12 +1593,10 @@ router.delete("/delete-user", authenticateJWT, async (req, res) => { if (err && typeof err === "object" && "code" in err) { if (err.code === "SQLITE_CONSTRAINT_FOREIGNKEY") { - res - .status(400) - .json({ - error: - "Cannot delete user: User has associated data that cannot be removed", - }); + res.status(400).json({ + error: + "Cannot delete user: User has associated data that cannot be removed", + }); } else { res.status(500).json({ error: `Database error: ${err.code}` }); } diff --git a/src/backend/ssh/file-manager.ts b/src/backend/ssh/file-manager.ts index b32a3fbd..200081bd 100644 --- a/src/backend/ssh/file-manager.ts +++ b/src/backend/ssh/file-manager.ts @@ -825,11 +825,9 @@ app.post("/ssh/file_manager/ssh/uploadFile", async (req, res) => { streamErr, ); if (!res.headersSent) { - res - .status(500) - .json({ - error: `Chunked upload stream error: ${streamErr.message}`, - }); + res.status(500).json({ + error: `Chunked upload stream error: ${streamErr.message}`, + }); } }); }); diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index e62f8e87..f40340c4 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -340,9 +340,7 @@ "oidcConfigurationUpdated": "OIDC configuration updated successfully!", "failedToFetchOidcConfig": "Failed to fetch OIDC configuration", "failedToFetchRegistrationStatus": "Failed to fetch registration status", - "user": { - "failedToLoadVersionInfo": "Failed to load version information" - }, + "failedToFetchUsers": "Failed to fetch users", "oidcConfigurationDisabled": "OIDC configuration disabled successfully!", "failedToUpdateOidcConfig": "Failed to update OIDC configuration", "failedToDisableOidcConfig": "Failed to disable OIDC configuration", @@ -864,6 +862,9 @@ "external": "External (OIDC)", "selectPreferredLanguage": "Select your preferred language for the interface" }, + "user": { + "failedToLoadVersionInfo": "Failed to load version information" + }, "placeholders": { "enterCode": "000000", "ipAddress": "127.0.0.1", diff --git a/src/locales/zh/translation.json b/src/locales/zh/translation.json index 32973261..370d906f 100644 --- a/src/locales/zh/translation.json +++ b/src/locales/zh/translation.json @@ -325,6 +325,9 @@ "allowNewAccountRegistration": "允许新账户注册", "missingRequiredFields": "缺少必填字段:{{fields}}", "oidcConfigurationUpdated": "OIDC 配置更新成功!", + "failedToFetchOidcConfig": "获取 OIDC 配置失败", + "failedToFetchRegistrationStatus": "获取注册状态失败", + "failedToFetchUsers": "获取用户列表失败", "oidcConfigurationDisabled": "OIDC 配置禁用成功!", "failedToUpdateOidcConfig": "更新 OIDC 配置失败", "failedToDisableOidcConfig": "禁用 OIDC 配置失败", @@ -542,6 +545,11 @@ "clickToSelectFile": "点击选择文件", "chooseFile": "选择文件", "uploading": "上传中...", + "uploadingFile": "正在上传 {{name}}...", + "creatingFile": "正在创建 {{name}}...", + "creatingFolder": "正在创建 {{name}}...", + "deletingItem": "正在删除 {{type}} {{name}}...", + "renamingItem": "正在重命名 {{type}} {{oldName}} 为 {{newName}}...", "createNewFile": "创建新文件", "fileName": "文件名", "creating": "创建中...", diff --git a/src/ui/Desktop/Apps/Terminal/Terminal.tsx b/src/ui/Desktop/Apps/Terminal/Terminal.tsx index 6f80d42c..e5aa03b2 100644 --- a/src/ui/Desktop/Apps/Terminal/Terminal.tsx +++ b/src/ui/Desktop/Apps/Terminal/Terminal.tsx @@ -209,7 +209,7 @@ export const Terminal = forwardRef(function SSHTerminal( const wsUrl = isDev ? "ws://localhost:8082" - : isElectron + : isElectron() ? (() => { const baseUrl = (window as any).configuredServerUrl || "http://127.0.0.1:8081";