diff --git a/frontend/.prettierrc b/frontend/.prettierrc new file mode 100644 index 0000000..dffb6f2 --- /dev/null +++ b/frontend/.prettierrc @@ -0,0 +1,3 @@ +{ + "quoteProps": "consistent" +} diff --git a/frontend/eslint.config.js b/frontend/eslint.config.js index 2425cba..037f340 100644 --- a/frontend/eslint.config.js +++ b/frontend/eslint.config.js @@ -22,7 +22,7 @@ export default tseslint.config( plugins: { "react-hooks": reactHooks, "react-refresh": reactRefresh, - prettier: eslintPluginPrettier, + "prettier": eslintPluginPrettier, }, rules: { ...reactHooks.configs.recommended.rules, diff --git a/frontend/prettierrc.yml b/frontend/prettierrc.yml deleted file mode 100644 index 2a77ec8..0000000 --- a/frontend/prettierrc.yml +++ /dev/null @@ -1,12 +0,0 @@ -printWidth: 120 -tabWidth: 2 -useTabs: false -semi: false -singleQuote: false -quoteProps: "as-needed" -jsxSingleQuote: true -trailingComma: "none" -bracketSameLine: false -arrowParens: "avoid" -endOfLine: "lf" -bracketSpacing: false diff --git a/frontend/src/i18n.ts b/frontend/src/i18n.ts index 55352db..d29119e 100644 --- a/frontend/src/i18n.ts +++ b/frontend/src/i18n.ts @@ -1,55 +1,55 @@ export const i18nData = { - en: { + "en": { translation: { "My Profile": "My Profile", - Publish: "Publish", + "Publish": "Publish", "Log out": "Log out", "Are you sure you want to log out?": "Are you sure you want to log out?", - Cancel: "Cancel", - Confirm: "Confirm", - Search: "Search", - Login: "Login", - Register: "Register", - Username: "Username", - Password: "Password", + "Cancel": "Cancel", + "Confirm": "Confirm", + "Search": "Search", + "Login": "Login", + "Register": "Register", + "Username": "Username", + "Password": "Password", "Confirm Password": "Confirm Password", "Username and password cannot be empty": "Username and password cannot be empty", "Passwords do not match": "Passwords do not match", - Continue: "Continue", + "Continue": "Continue", "Don't have an account? Register": "Don't have an account? Register", "Already have an account? Login": "Already have an account? Login", "Publish Resource": "Publish Resource", "All information can be modified after publishing": "All information can be modified after publishing", - Title: "Title", + "Title": "Title", "Alternative Titles": "Alternative Titles", "Add Alternative Title": "Add Alternative Title", - Tags: "Tags", - Description: "Description", + "Tags": "Tags", + "Description": "Description", "Use Markdown format": "Use Markdown format", - Images: "Images", + "Images": "Images", "Images will not be displayed automatically, you need to reference them in the description": "Images will not be displayed automatically, you need to reference them in the description", - Preview: "Preview", - Link: "Link", - Action: "Action", + "Preview": "Preview", + "Link": "Link", + "Action": "Action", "Upload Image": "Upload Image", - Error: "Error", + "Error": "Error", "Title cannot be empty": "Title cannot be empty", "Alternative title cannot be empty": "Alternative title cannot be empty", "At least one tag required": "At least one tag required", "Description cannot be empty": "Description cannot be empty", - Loading: "Loading", + "Loading": "Loading", "Enter a search keyword to continue": "Enter a search keyword to continue", "My Info": "My Info", - Server: "Server", + "Server": "Server", // Management page translations - Manage: "Manage", - Storage: "Storage", - Users: "Users", + "Manage": "Manage", + "Storage": "Storage", + "Users": "Users", "You are not logged in. Please log in to access this page.": "You are not logged in. Please log in to access this page.", "You are not authorized to access this page.": @@ -58,34 +58,34 @@ export const i18nData = { // Storage management "No storage found. Please create a new storage.": "No storage found. Please create a new storage.", - Name: "Name", + "Name": "Name", "Created At": "Created At", - Actions: "Actions", + "Actions": "Actions", "Delete Storage": "Delete Storage", "Are you sure you want to delete this storage? This action cannot be undone.": "Are you sure you want to delete this storage? This action cannot be undone.", - Delete: "Delete", + "Delete": "Delete", "Storage deleted successfully": "Storage deleted successfully", "New Storage": "New Storage", - Type: "Type", - Local: "Local", - S3: "S3", - Path: "Path", + "Type": "Type", + "Local": "Local", + "S3": "S3", + "Path": "Path", "Max Size (MB)": "Max Size (MB)", - Endpoint: "Endpoint", + "Endpoint": "Endpoint", "Access Key ID": "Access Key ID", "Secret Access Key": "Secret Access Key", "Bucket Name": "Bucket Name", "All fields are required": "All fields are required", "Storage created successfully": "Storage created successfully", - Close: "Close", - Submit: "Submit", + "Close": "Close", + "Submit": "Submit", // User management - Admin: "Admin", + "Admin": "Admin", "Can Upload": "Can Upload", - Yes: "Yes", - No: "No", + "Yes": "Yes", + "No": "No", "Delete User": "Delete User", "Are you sure you want to delete user": "Are you sure you want to delete user", @@ -104,9 +104,9 @@ export const i18nData = { // Resource details page "Resource ID is required": "Resource ID is required", - Files: "Files", - Comments: "Comments", - Upload: "Upload", + "Files": "Files", + "Comments": "Comments", + "Upload": "Upload", "Create File": "Create File", "Please select a file type": "Please select a file type", "Please fill in all fields": "Please fill in all fields", @@ -114,11 +114,11 @@ export const i18nData = { "Successfully create uploading task.": "Successfully create uploading task.", "Please select a file and storage": "Please select a file and storage", - Redirect: "Redirect", + "Redirect": "Redirect", "User who click the file will be redirected to the URL": "User who click the file will be redirected to the URL", "File Name": "File Name", - URL: "URL", + "URL": "URL", "Upload a file to server, then the file will be moved to the selected storage.": "Upload a file to server, then the file will be moved to the selected storage.", "Select Storage": "Select Storage", @@ -136,7 +136,7 @@ export const i18nData = { "Change Password": "Change Password", "New Username": "New Username", "Enter new username": "Enter new username", - Save: "Save", + "Save": "Save", "Current Password": "Current Password", "Enter current password": "Enter current password", "New Password": "New Password", @@ -172,7 +172,7 @@ export const i18nData = { "Tag not found": "Tag not found", "Description is too long": "Description is too long", "Unknown error": "Unknown error", - Edit: "Edit", + "Edit": "Edit", "Edit Tag": "Edit Tag", "Set the description of the tag.": "Set the description of the tag.", "Use markdown format.": "Use markdown format.", @@ -190,9 +190,9 @@ export const i18nData = { "Verifying your request": "Verifying your request", "Please check your network if the verification takes too long or the captcha does not appear.": "Please check your network if the verification takes too long or the captcha does not appear.", - About: "About", - Home: "Home", - Other: "Other", + "About": "About", + "Home": "Home", + "Other": "Other", "Quick Add": "Quick Add", "Add Tags": "Add Tags", "Input tags separated by separator.": @@ -204,57 +204,58 @@ export const i18nData = { "Upload Clipboard Image": "Upload Clipboard Image", "Show more": "Show more", "Show less": "Show less", + "You need to log in to comment": "You need to log in to comment", }, }, "zh-CN": { translation: { "My Profile": "我的资料", - Publish: "发布", + "Publish": "发布", "Log out": "退出登录", "Are you sure you want to log out?": "您确定要退出登录吗?", - Cancel: "取消", - Confirm: "确认", - Search: "搜索", - Login: "登录", - Register: "注册", - Username: "用户名", - Password: "密码", + "Cancel": "取消", + "Confirm": "确认", + "Search": "搜索", + "Login": "登录", + "Register": "注册", + "Username": "用户名", + "Password": "密码", "Confirm Password": "确认密码", "Username and password cannot be empty": "用户名和密码不能为空", "Passwords do not match": "两次输入的密码不匹配", - Continue: "继续", + "Continue": "继续", "Don't have an account? Register": "没有账号?注册", "Already have an account? Login": "已有账号?登录", "Publish Resource": "发布资源", "All information can be modified after publishing": "所有的信息均可在发布后修改", - Title: "标题", + "Title": "标题", "Alternative Titles": "其他标题", "Add Alternative Title": "新增标题", - Tags: "标签", - Description: "介绍", + "Tags": "标签", + "Description": "介绍", "Use Markdown format": "使用Markdown格式", - Images: "图片", + "Images": "图片", "Images will not be displayed automatically, you need to reference them in the description": "图片不会被自动显示, 你需要在介绍中引用它们", - Preview: "预览", - Link: "链接", - Action: "操作", + "Preview": "预览", + "Link": "链接", + "Action": "操作", "Upload Image": "上传图片", - Error: "错误", + "Error": "错误", "Title cannot be empty": "标题不能为空", "Alternative title cannot be empty": "不能存在空标题", "At least one tag required": "至少选择一个标签", "Description cannot be empty": "介绍不能为空", - Loading: "加载中", + "Loading": "加载中", "Enter a search keyword to continue": "输入搜索关键词以继续", "My Info": "个人信息", - Server: "服务器", + "Server": "服务器", // Management page translations - Manage: "管理", - Storage: "存储", - Users: "用户", + "Manage": "管理", + "Storage": "存储", + "Users": "用户", "You are not logged in. Please log in to access this page.": "您尚未登录。请登录以访问此页面。", "You are not authorized to access this page.": "您无权访问此页面。", @@ -262,34 +263,34 @@ export const i18nData = { // Storage management "No storage found. Please create a new storage.": "未找到存储。请创建新的存储。", - Name: "名称", + "Name": "名称", "Created At": "创建于", - Actions: "操作", + "Actions": "操作", "Delete Storage": "删除存储", "Are you sure you want to delete this storage? This action cannot be undone.": "您确定要删除此存储吗?此操作不可撤销。", - Delete: "删除", + "Delete": "删除", "Storage deleted successfully": "存储已成功删除", "New Storage": "新建存储", - Type: "类型", - Local: "本地", - S3: "S3", - Path: "路径", + "Type": "类型", + "Local": "本地", + "S3": "S3", + "Path": "路径", "Max Size (MB)": "最大大小 (MB)", - Endpoint: "终端节点", + "Endpoint": "终端节点", "Access Key ID": "访问密钥 ID", "Secret Access Key": "私有访问密钥", "Bucket Name": "桶名称", "All fields are required": "所有字段都是必填的", "Storage created successfully": "存储创建成功", - Close: "关闭", - Submit: "提交", + "Close": "关闭", + "Submit": "提交", // User management - Admin: "管理员", + "Admin": "管理员", "Can Upload": "可上传", - Yes: "是", - No: "否", + "Yes": "是", + "No": "否", "Delete User": "删除用户", "Are you sure you want to delete user": "您确定要删除用户", "This action cannot be undone.": "此操作不可撤销。", @@ -305,20 +306,20 @@ export const i18nData = { // Resource details page "Resource ID is required": "资源ID是必需的", - Files: "文件", - Comments: "评论", - Upload: "上传", + "Files": "文件", + "Comments": "评论", + "Upload": "上传", "Create File": "创建文件", "Please select a file type": "请选择文件类型", "Please fill in all fields": "请填写所有字段", "File created successfully": "文件创建成功", "Successfully create uploading task.": "成功创建上传任务。", "Please select a file and storage": "请选择文件和存储", - Redirect: "重定向", + "Redirect": "重定向", "User who click the file will be redirected to the URL": "点击文件的用户将被重定向到URL", "File Name": "文件名", - URL: "URL", + "URL": "URL", "Upload a file to server, then the file will be moved to the selected storage.": "将文件上传到服务器,然后文件将被移动到选定的存储中。", "Select Storage": "选择存储", @@ -334,7 +335,7 @@ export const i18nData = { "Change Password": "更改密码", "New Username": "新用户名", "Enter new username": "输入新用户名", - Save: "保存", + "Save": "保存", "Current Password": "当前密码", "Enter current password": "输入当前密码", "New Password": "新密码", @@ -369,7 +370,7 @@ export const i18nData = { "Tag not found": "标签未找到", "Description is too long": "描述太长", "Unknown error": "未知错误", - Edit: "编辑", + "Edit": "编辑", "Edit Tag": "编辑标签", "Set the description of the tag.": "设置标签的描述。", "Use markdown format.": "使用Markdown格式。", @@ -387,9 +388,9 @@ export const i18nData = { "Verifying your request": "正在验证您的请求", "Please check your network if the verification takes too long or the captcha does not appear.": "如果验证时间过长或验证码未出现, 请检查您的网络连接", - About: "关于", - Home: "首页", - Other: "其他", + "About": "关于", + "Home": "首页", + "Other": "其他", "Quick Add": "快速添加", "Add Tags": "添加标签", "Input tags separated by separator.": "输入标签, 用分隔符分隔。", @@ -400,57 +401,58 @@ export const i18nData = { "Upload Clipboard Image": "上传剪贴板图片", "Show more": "显示更多", "Show less": "显示更少", + "You need to log in to comment": "您需要登录才能评论", }, }, "zh-TW": { translation: { "My Profile": "我的資料", - Publish: "發布", + "Publish": "發布", "Log out": "登出", "Are you sure you want to log out?": "您確定要登出嗎?", - Cancel: "取消", - Confirm: "確認", - Search: "搜尋", - Login: "登入", - Register: "註冊", - Username: "用戶名", - Password: "密碼", + "Cancel": "取消", + "Confirm": "確認", + "Search": "搜尋", + "Login": "登入", + "Register": "註冊", + "Username": "用戶名", + "Password": "密碼", "Confirm Password": "確認密碼", "Username and password cannot be empty": "用戶名和密碼不能為空", "Passwords do not match": "兩次輸入的密碼不匹配", - Continue: "繼續", + "Continue": "繼續", "Don't have an account? Register": "沒有賬號?註冊", "Already have an account? Login": "已有賬號?登入", "Publish Resource": "發布資源", "All information can be modified after publishing": "所有資訊均可於發布後修改", - Title: "標題", + "Title": "標題", "Alternative Titles": "其他標題", "Add Alternative Title": "新增標題", - Tags: "標籤", - Description: "介紹", + "Tags": "標籤", + "Description": "介紹", "Use Markdown format": "使用Markdown格式", - Images: "圖片", + "Images": "圖片", "Images will not be displayed automatically, you need to reference them in the description": "圖片不會自動顯示,需在介紹中引用", - Preview: "預覽", - Link: "連結", - Action: "操作", + "Preview": "預覽", + "Link": "連結", + "Action": "操作", "Upload Image": "上傳圖片", - Error: "錯誤", + "Error": "錯誤", "Title cannot be empty": "標題不能為空", "Alternative title cannot be empty": "不能有空的標題", "At least one tag required": "至少選擇一個標籤", "Description cannot be empty": "介紹不能為空", - Loading: "載入中", + "Loading": "載入中", "Enter a search keyword to continue": "輸入搜尋關鍵字以繼續", "My Info": "個人信息", - Server: "伺服器", + "Server": "伺服器", // Management page translations - Manage: "管理", - Storage: "儲存", - Users: "用戶", + "Manage": "管理", + "Storage": "儲存", + "Users": "用戶", "You are not logged in. Please log in to access this page.": "您尚未登入。請登入以訪問此頁面。", "You are not authorized to access this page.": "您無權訪問此頁面。", @@ -458,34 +460,34 @@ export const i18nData = { // Storage management "No storage found. Please create a new storage.": "未找到儲存。請創建新的儲存。", - Name: "名稱", + "Name": "名稱", "Created At": "建立於", - Actions: "操作", + "Actions": "操作", "Delete Storage": "刪除儲存", "Are you sure you want to delete this storage? This action cannot be undone.": "您確定要刪除此儲存嗎?此操作不可撤銷。", - Delete: "刪除", + "Delete": "刪除", "Storage deleted successfully": "儲存已成功刪除", "New Storage": "新建儲存", - Type: "類型", - Local: "本地", - S3: "S3", - Path: "路徑", + "Type": "類型", + "Local": "本地", + "S3": "S3", + "Path": "路徑", "Max Size (MB)": "最大大小 (MB)", - Endpoint: "端點", + "Endpoint": "端點", "Access Key ID": "訪問密鑰 ID", "Secret Access Key": "私有訪問密鑰", "Bucket Name": "儲存桶名稱", "All fields are required": "所有欄位都是必填的", "Storage created successfully": "儲存創建成功", - Close: "關閉", - Submit: "提交", + "Close": "關閉", + "Submit": "提交", // User management - Admin: "管理員", + "Admin": "管理員", "Can Upload": "可上傳", - Yes: "是", - No: "否", + "Yes": "是", + "No": "否", "Delete User": "刪除用戶", "Are you sure you want to delete user": "您確定要刪除用戶", "This action cannot be undone.": "此操作不可撤銷。", @@ -501,20 +503,20 @@ export const i18nData = { // Resource details page "Resource ID is required": "資源ID是必需的", - Files: "檔案", - Comments: "評論", - Upload: "上傳", + "Files": "檔案", + "Comments": "評論", + "Upload": "上傳", "Create File": "創建檔案", "Please select a file type": "請選擇檔案類型", "Please fill in all fields": "請填寫所有欄位", "File created successfully": "檔案創建成功", "Successfully create uploading task.": "成功創建上傳任務。", "Please select a file and storage": "請選擇檔案和儲存", - Redirect: "重定向", + "Redirect": "重定向", "User who click the file will be redirected to the URL": "點擊檔案的用戶將被重定向到URL", "File Name": "檔案名", - URL: "URL", + "URL": "URL", "Upload a file to server, then the file will be moved to the selected storage.": "將檔案上傳到伺服器,然後檔案將被移動到選定的儲存中。", "Select Storage": "選擇儲存", @@ -530,7 +532,7 @@ export const i18nData = { "Change Password": "更改密碼", "New Username": "新用戶名", "Enter new username": "輸入新用戶名", - Save: "儲存", + "Save": "儲存", "Current Password": "當前密碼", "Enter current password": "輸入當前密碼", "New Password": "新密碼", @@ -565,7 +567,7 @@ export const i18nData = { "Tag not found": "標籤未找到", "Description is too long": "描述太長", "Unknown error": "未知錯誤", - Edit: "編輯", + "Edit": "編輯", "Edit Tag": "編輯標籤", "Set the description of the tag.": "設置標籤的描述。", "Use markdown format.": "使用Markdown格式。", @@ -583,9 +585,9 @@ export const i18nData = { "Verifying your request": "正在驗證您的請求", "Please check your network if the verification takes too long or the captcha does not appear.": "如果驗證時間過長或驗證碼未出現,請檢查您的網絡連接。", - About: "關於", - Home: "首頁", - Other: "其他", + "About": "關於", + "Home": "首頁", + "Other": "其他", "Quick Add": "快速添加", "Add Tags": "添加標籤", "Input tags separated by separator.": "輸入標籤, 用分隔符分隔。", @@ -596,6 +598,7 @@ export const i18nData = { "Upload Clipboard Image": "上傳剪貼板圖片", "Show more": "顯示更多", "Show less": "顯示更少", + "You need to log in to comment": "您需要登入才能評論", }, }, }; diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index eec0fc3..7667f2a 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -8,7 +8,7 @@ export default defineConfig({ server: { proxy: { "/api": { - target: 'http://localhost:3000', + target: "http://localhost:3000", changeOrigin: true, }, },