v1.6.0 #221

Merged
LukeGus merged 74 commits from dev-1.6.0 into main 2025-09-12 19:42:00 +00:00
5 changed files with 33 additions and 37 deletions
Showing only changes of commit 7fe49d82f3 - Show all commits

View File

@@ -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}` });
}

View File

@@ -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}`,
});
}
});
});

View File

@@ -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",

View File

@@ -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": "创建中...",

View File

@@ -209,7 +209,7 @@ export const Terminal = forwardRef<any, SSHTerminalProps>(function SSHTerminal(
const wsUrl = isDev
? "ws://localhost:8082"
: isElectron
: isElectron()
? (() => {
const baseUrl =
(window as any).configuredServerUrl || "http://127.0.0.1:8081";