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