diff --git a/public/locales/en/setting.json b/public/locales/en/setting.json index 42638fb9..7f958af3 100644 --- a/public/locales/en/setting.json +++ b/public/locales/en/setting.json @@ -20,7 +20,7 @@ "widget": "Widget", "license": "License", "about": "About", - "api_doc": "API Document", + "api_doc": "API Documentation", "version": "Version" }, "channel": { @@ -47,7 +47,7 @@ "upload_desc": "Minimum size is 128x128, We recommend at least 512x512 for the server. Max size limited to 5M.", "sign_up": { "title": "Default Sign Up", - "desc": "Who can sign up this server.", + "desc": "Who can sign up to this server.", "everyone": "Everyone", "invite": "Invitation Link Only" }, @@ -62,8 +62,8 @@ "desc": "Update the frontend url" }, "lang": { - "title": "Language", - "desc": "Setting the language", + "title": "Languages", + "desc": "Set the system language", "en": "English", "tr": "Türkçe", "zh": "中文", @@ -71,14 +71,14 @@ }, "theme": { "title": "Theme", - "desc": "Setting the theme", + "desc": "Choose your theme", "auto": "Auto", "dark": "Dark", "light": "Light" }, "online_status": { "title": "Online Status", - "desc": "Toggle users' online status visible", + "desc": "If enabled, members will see the online/offline status of each other.", "enable": "Enable", "disable": "Disable" }, @@ -90,7 +90,7 @@ }, "contact_verify": { "title": "Contact Verification", - "desc": "Toggle contact verification", + "desc": "By default all server members can see each other. If you want server members to add and manage their own contacts, please enable the contact feature (admin will be in the contacts list by default).", "enable": "Enable", "disable": "Disable" } @@ -170,7 +170,7 @@ "use_official": "Use Official Configuration", "custom": "Custom", "enable": "Enable", - "token_url": "Token Url", + "token_url": "Token URL", "project_id": "Project ID", "private_key": "Private Key", "client_email": "Client Email" @@ -185,6 +185,10 @@ "how_to": "How to setup SMTP?", "send_test_email": "Send Test Email" }, + "agora": { + "enable": "Enable", + "how_to": "How to setup Agora?" + }, "third_app": { "key": "API Secure Key", "update": "Update Secret", diff --git a/public/locales/tr/setting.json b/public/locales/tr/setting.json index 2dfeab02..8f4bc8b2 100644 --- a/public/locales/tr/setting.json +++ b/public/locales/tr/setting.json @@ -20,7 +20,7 @@ "widget": "Araçlar", "license": "Lisans", "about": "Hakkında", - "api_doc": "API Document", + "api_doc": "API Documentation", "version": "Sürüm", "faq": "SSS", "feedback": "Geri Bildirim" @@ -150,7 +150,7 @@ "use_official": "Resmi Yapılandırmayı Kullanın", "custom": "Özel", "enable": "Etkin", - "token_url": "Jeton Url", + "token_url": "Jeton URL", "project_id": "Tasarı Kimliği", "private_key": "Gizli Anahtar", "client_email": "İstemci E-Posta'sı" diff --git a/public/locales/zh/setting.json b/public/locales/zh/setting.json index 08d595d4..5ca96ce4 100644 --- a/public/locales/zh/setting.json +++ b/public/locales/zh/setting.json @@ -84,7 +84,7 @@ }, "contact_verify": { "title": "联系人验证", - "desc": "是否开启联系人验证", + "desc": "关闭:服务器内的所有成员能够互相看见;开启:通过搜索添加好友(管理员默认是所有人好友)", "enable": "开启", "disable": "关闭" } @@ -180,6 +180,10 @@ "how_to": "如何设置SMTP?", "send_test_email": "发送测试邮件" }, + "agora": { + "enable": "开启", + "how_to": "如何配置Agora?" + }, "third_app": { "key": "API 安全密钥", "update": "更新安全密钥", diff --git a/src/components/AutoDeleteMessages.tsx b/src/components/AutoDeleteMessages.tsx index cd196345..c9c90324 100644 --- a/src/components/AutoDeleteMessages.tsx +++ b/src/components/AutoDeleteMessages.tsx @@ -69,7 +69,7 @@ const AutoDeleteMessages = ({ id, type = "channel" }: Props) => {

{t("title")}

-

{t("desc")}

+

{t("desc")}

{ {showClear && <>

{t("clear_title")}

-

{t("clear_desc")}

+

{t("clear_desc")}

{t("clear")} diff --git a/src/components/ManageMembers/index.tsx b/src/components/ManageMembers/index.tsx index b9e50f2e..f35d77af 100644 --- a/src/components/ManageMembers/index.tsx +++ b/src/components/ManageMembers/index.tsx @@ -19,8 +19,8 @@ const ManageMembers: FC = ({ cid }) => {
{loginUser?.is_admin && }
-

{t("manage_members")}

-

+

{t("manage_members")}

+

{t("manage_tip")}

diff --git a/src/components/Message/URLPreview.tsx b/src/components/Message/URLPreview.tsx index 27ede94e..119dcab9 100644 --- a/src/components/Message/URLPreview.tsx +++ b/src/components/Message/URLPreview.tsx @@ -65,7 +65,7 @@ export default function URLPreview({ url = "" }) { )}

{title}

-

{description}

+

{description}

{url}
diff --git a/src/components/Voice/Operations.tsx b/src/components/Voice/Operations.tsx index 014aa84b..73e6b7dc 100644 --- a/src/components/Voice/Operations.tsx +++ b/src/components/Voice/Operations.tsx @@ -95,7 +95,7 @@ const DeviceList = ({ type, visible, setVisible, devices }: { console.log("device selected", title, selected); if (list.length == 0) return null; return
-

{title}

+

{title}

    {list.map(({ deviceId, kind, label }) => { return ( diff --git a/src/components/styled/Input.tsx b/src/components/styled/Input.tsx index 2216ef69..a18a103a 100644 --- a/src/components/styled/Input.tsx +++ b/src/components/styled/Input.tsx @@ -38,31 +38,59 @@ const Input: FC = ({ type = "text", prefix = "", className = "", ...rest const isNone = className.includes("none"); // const noInner=!className.includes("inner"); const isPwd = type == "password"; - const inputClass = clsx(`w-full bg-white dark:bg-gray-800 text-sm text-gray-800 dark:text-gray-200 p-2 outline-none + const inputClass = clsx( + `w-full text-sm text-gray-800 dark:text-gray-200 p-2 outline-none + bg-inherit disabled:text-gray-500 disabled:bg-gray-100 dark:disabled:text-gray-500 dark:disabled:bg-gray-800/50 dark:disabled:border-gray-600 placeholder:text-gray-400`, // noInner && 'rounded border border-solid border-gray-200 shadow', - isLarge && 'py-3', + isLarge && "py-3", isNone && "!border-none bg-transparent shadow-none", isPwd && "pr-[30px]" ); return type == "password" ? ( -
    - -
    - {inputType == "password" ? : } +
    + +
    + {inputType == "password" ? ( + + ) : ( + + )}
    ) : prefix ? ( -
    - {typeof prefix === "string" ? {prefix} : {prefix}} +
    + {typeof prefix === "string" ? ( + + {prefix} + + ) : ( + {prefix} + )}
    ) : ( - + ); }; diff --git a/src/components/styled/Label.tsx b/src/components/styled/Label.tsx index 44404fc9..638768ba 100644 --- a/src/components/styled/Label.tsx +++ b/src/components/styled/Label.tsx @@ -1,9 +1,14 @@ import { LabelHTMLAttributes, ReactNode } from "react"; -type Props = LabelHTMLAttributes & { children?: ReactNode } -const StyledLabel = ({ children, className = '', ...rest }: Props) => { - return ; +type Props = LabelHTMLAttributes & { children?: ReactNode }; +const StyledLabel = ({ children, className = "", ...rest }: Props) => { + return ( + + ); }; export default StyledLabel; diff --git a/src/routes/chat/SessionList/Session.tsx b/src/routes/chat/SessionList/Session.tsx index 8dc62412..9ca5f0ea 100644 --- a/src/routes/chat/SessionList/Session.tsx +++ b/src/routes/chat/SessionList/Session.tsx @@ -152,12 +152,12 @@ const Session: FC = ({ {!is_public && } - + {fromNowTime(previewMsg.created_at)}
    - 0 ? `w-36` : ``)}>{renderPreviewMessage(previewMsg)} + 0 ? `w-36` : ``)}>{renderPreviewMessage(previewMsg)} {(unreads > 0 && !isCurrentPath) ? {unreads > 99 ? "99+" : unreads} : (muted && )} diff --git a/src/routes/setting/APIDocument.tsx b/src/routes/setting/APIDocument.tsx index 3992dc08..65080e1e 100644 --- a/src/routes/setting/APIDocument.tsx +++ b/src/routes/setting/APIDocument.tsx @@ -14,33 +14,33 @@ const APIDocument = () => { }; return (
    -
    +
    {t("api_doc.desc")}
    -

    +

    {t("api_doc.access")} + + {APIUrl} +

    - - {APIUrl} -
    -

    +

    {t("api_doc.use_method")}

    -

    - 👉 {t("api_doc.step_1")} +

    + {t("api_doc.step_1")}

    {/*
    */} - step 1 + step 1 {/*
    */}
    -

    - 👉 {t("api_doc.step_2")} +

    + {t("api_doc.step_2")} ({t("api_doc.step_2_desc")})

    @@ -53,8 +53,8 @@ const APIDocument = () => { step 2

    -

    - 👉 {t("api_doc.last")} +

    + {t("api_doc.last")}

    step 3
    diff --git a/src/routes/setting/BotConfig/WebhookEdit.tsx b/src/routes/setting/BotConfig/WebhookEdit.tsx index 9d0240ec..a8a364d3 100644 --- a/src/routes/setting/BotConfig/WebhookEdit.tsx +++ b/src/routes/setting/BotConfig/WebhookEdit.tsx @@ -72,7 +72,7 @@ const WebhookEdit = ({ uid }: Props) => { evt.preventDefault(); handleEdit(); }}> - +
    -

    +

    {t("manage")} - + 🔗 {t("how_to_use")}

    -

    {t("manage_desc")}

    +

    {t("manage_desc")}

    - {[t("col_avatar"), t('col_name'), t('col_api_key'), t('col_webhook'), t('col_opt')].map(title => )} + {[ + t("col_avatar"), + t("col_name"), + t("col_api_key"), + t("col_webhook"), + t("col_opt") + ].map((title) => ( + + ))} - {bots.map(bot => { + {bots.map((bot) => { const { uid, name, avatar } = bot; - return - - - - - - ; + return ( + + + + + + + + ); })}
    - {title} - + {title} +
    - - -
    - {name} -
    -
    - #{uid} -
    -
    - - - - - - {/* */} -
    + + +
    {name}
    +
    #{uid}
    +
    + + + + + + {/* */} +
    {/* */}
    - + {/* {bots.length > 0 && } */}
    -
    {createModalVisible && } - {currWebhookParams && } - {currDeleteParams && } + {currWebhookParams && ( + + )} + {currDeleteParams && ( + + )} {/* {testAPIKeyModalVisible && } */} ); diff --git a/src/routes/setting/License/LicensePriceListModal.tsx b/src/routes/setting/License/LicensePriceListModal.tsx index aa934083..c8916e04 100644 --- a/src/routes/setting/License/LicensePriceListModal.tsx +++ b/src/routes/setting/License/LicensePriceListModal.tsx @@ -126,7 +126,7 @@ const LicensePriceListModal: FC = ({ closeModal }) => { {ct("action.cancel")}
    diff --git a/src/routes/setting/Overview/Server.tsx b/src/routes/setting/Overview/Server.tsx index b9203827..a6bb353b 100644 --- a/src/routes/setting/Overview/Server.tsx +++ b/src/routes/setting/Overview/Server.tsx @@ -1,113 +1,113 @@ -import { ChangeEvent, useEffect, useState } from 'react'; -import { useTranslation } from 'react-i18next'; +import { ChangeEvent, useEffect, useState } from "react"; +import { useTranslation } from "react-i18next"; import toast from "react-hot-toast"; -import { useUpdateLogoMutation, useUpdateServerMutation } from '../../../app/services/server'; +import { useUpdateLogoMutation, useUpdateServerMutation } from "@/app/services/server"; import LogoUploader from "@/components/AvatarUploader"; import Input from "@/components/styled/Input"; import Label from "@/components/styled/Label"; import Textarea from "@/components/styled/Textarea"; -import SaveTip from '../../../components/SaveTip'; -import { useAppSelector } from '../../../app/store'; +import SaveTip from "@/components/SaveTip"; +import { useAppSelector } from "@/app/store"; const Index = () => { - const { t } = useTranslation("setting"); - const { t: ct } = useTranslation(); - const { loginUser, server } = useAppSelector((store) => { - return { loginUser: store.authData.user, server: store.server }; + const { t } = useTranslation("setting"); + const { t: ct } = useTranslation(); + const { loginUser, server } = useAppSelector((store) => { + return { loginUser: store.authData.user, server: store.server }; + }); + + const [uploadLogo, { isSuccess: uploadSuccess }] = useUpdateLogoMutation(); + const [updateServer] = useUpdateServerMutation(); + const [changed, setChanged] = useState(false); + const [serverValues, setServerValues] = useState(server); + const handleChange = (evt: ChangeEvent) => { + const newValue = evt.target.value; + const { type = "" } = evt.target.dataset; + setServerValues((prev) => { + return { ...prev, [type]: newValue }; }); + }; + const handleUpdateServer = () => { + const { name, description } = serverValues; + updateServer({ name, description }); + }; - const [uploadLogo, { isSuccess: uploadSuccess }] = useUpdateLogoMutation(); - const [updateServer] = useUpdateServerMutation(); - const [changed, setChanged] = useState(false); - const [serverValues, setServerValues] = useState(server); - const handleChange = (evt: ChangeEvent) => { - const newValue = evt.target.value; - const { type = "" } = evt.target.dataset; - setServerValues((prev) => { - return { ...prev, [type]: newValue }; - }); - }; - const handleUpdateServer = () => { - const { name, description } = serverValues; - updateServer({ name, description }); - }; - - const handleReset = () => { - setServerValues(server); - }; - useEffect(() => { - if (server) { - setServerValues(server); - } - }, [server]); - useEffect(() => { - if (uploadSuccess) { - toast.success(ct("tip.update")); - } - }, [uploadSuccess]); - useEffect(() => { - if (server && serverValues) { - const { name, description } = serverValues; - const { name: oName, description: oDescription } = server; - if (oName !== name || oDescription !== description) { - setChanged(true); - } else { - setChanged(false); - } - } - }, [server, serverValues]); - const { name, description, logo } = serverValues; - const isAdmin = loginUser?.is_admin; - if (!loginUser || !serverValues) return null; - return ( - <> -
    -
    - -
    - {isAdmin && ( -
    -
    - {t("overview.upload_desc")} -
    -
    - )} + const handleReset = () => { + setServerValues(server); + }; + useEffect(() => { + if (server) { + setServerValues(server); + } + }, [server]); + useEffect(() => { + if (uploadSuccess) { + toast.success(ct("tip.update")); + } + }, [uploadSuccess]); + useEffect(() => { + if (server && serverValues) { + const { name, description } = serverValues; + const { name: oName, description: oDescription } = server; + if (oName !== name || oDescription !== description) { + setChanged(true); + } else { + setChanged(false); + } + } + }, [server, serverValues]); + const { name, description, logo } = serverValues; + const isAdmin = loginUser?.is_admin; + if (!loginUser || !serverValues) return null; + return ( + <> +
    +
    + +
    + {isAdmin && ( +
    +
    + {t("overview.upload_desc")}
    -
    -
    - - -
    -
    - -