From 175c042af0f747b2e832fd816a2c7e0632d7c086 Mon Sep 17 00:00:00 2001 From: dashuai Date: Wed, 15 Nov 2023 12:00:07 +0800 Subject: [PATCH] Feat/1.2.1/UI (#623) --- i18n/de_DE.yaml | 6 ++-- i18n/en_US.yaml | 28 ++++++++++++++---- ui/src/common/interface.ts | 7 ++++- ui/src/components/Comment/index.tsx | 20 ++++++++----- ui/src/components/Header/index.tsx | 2 +- ui/src/components/PluginRender/index.tsx | 5 ---- .../SchemaForm/components/Check.tsx | 1 - ui/src/components/Tag/index.tsx | 2 +- .../components/AnswerLinks/index.tsx | 29 +++++++++++++++++++ .../components/HealthStatus/index.tsx | 24 ++++++++------- .../Dashboard/components/Statistics/index.tsx | 2 +- .../Dashboard/components/SystemInfo/index.tsx | 12 ++++++++ ui/src/pages/Admin/Login/index.tsx | 13 +++++++++ ui/src/pages/Questions/Ask/index.tsx | 22 ++++++++++---- ui/src/pages/Tags/Create/index.tsx | 2 +- ui/src/pages/Tags/Edit/index.tsx | 2 +- ui/src/pages/Timeline/index.tsx | 7 +++-- ui/src/pages/Users/Login/index.tsx | 3 +- ui/src/router/pathFactory.ts | 4 +-- ui/src/services/common.ts | 7 ++--- ui/src/stores/loginSetting.ts | 1 + ui/src/utils/request.ts | 3 +- 22 files changed, 145 insertions(+), 57 deletions(-) diff --git a/i18n/de_DE.yaml b/i18n/de_DE.yaml index 92e613dae..a83b7dbc8 100644 --- a/i18n/de_DE.yaml +++ b/i18n/de_DE.yaml @@ -722,9 +722,9 @@ ui: btn_save_edits: Ă„nderungen speichern btn_cancel: Stornieren dates: - long_date: MMM D - long_date_with_year: "MMM D, JJJJ" - long_date_with_time: "MMM T, JJJJ [at] HH:mm" + long_date: DD. MMM + long_date_with_year: "DD. MMM YYYY" + long_date_with_time: "DD. MMM YYYY [at] HH:mm" now: jetzt x_seconds_ago: "vor {{count}}s" x_minutes_ago: "vor {{count}}m" diff --git a/i18n/en_US.yaml b/i18n/en_US.yaml index 2f32597c3..368c85cfc 100644 --- a/i18n/en_US.yaml +++ b/i18n/en_US.yaml @@ -1400,23 +1400,33 @@ ui: dashboard: title: Dashboard welcome: Welcome to Answer Admin! - site_statistics: Site Statistics + site_statistics: Site statistics questions: "Questions:" answers: "Answers:" comments: "Comments:" votes: "Votes:" - active_users: "Active users:" + users: "Users:" flags: "Flags:" - site_health_status: Site Health Status + site_health_status: Site health status version: "Version:" https: "HTTPS:" - uploading_files: "Uploading files:" + upload_folder: "Upload folder:" + run_mode: "Running mode:" + private: Private + public: Public smtp: "SMTP:" timezone: "Timezone:" - system_info: System Info + system_info: System info + go_version: "Go version:" + database: "Database:" + database_size: "Database size:" storage_used: "Storage used:" uptime: "Uptime:" - answer_links: Answer Links + answer_links: Answer links + plugins: Plugins + github: GitHub + blog: Blog + contact: Contact documents: Documents feedback: Feedback support: Support @@ -1431,6 +1441,8 @@ ui: allowed: Allowed enabled: Enabled disabled: Disabled + writable: Writable + not_writable: Not writable flags: title: Flags pending: Pending @@ -1704,6 +1716,10 @@ ui: title: Private label: Login required text: Only logged in users can access this community. + password_login: + title: Password login + label: Allow email and password login + text: "WARNING: If turn off, you may be unable to log in if you have not previously configured other login method." installed_plugins: title: Installed Plugins plugin_link: Plugins extend and expand the functionality of Answer. You may find plugins in the <1>Answer Plugin Repository. diff --git a/ui/src/common/interface.ts b/ui/src/common/interface.ts index 47987606f..a148d5ab0 100644 --- a/ui/src/common/interface.ts +++ b/ui/src/common/interface.ts @@ -454,6 +454,7 @@ export interface AdminSettingsLogin { login_required: boolean; allow_email_registrations: boolean; allow_email_domains: string[]; + allow_password_login: boolean; } /** @@ -507,11 +508,15 @@ export interface AdminDashboard { user_count: number; report_count: number; uploading_files: boolean; - smtp: boolean; + smtp: 'enabled' | 'disabled' | 'not_configured'; time_zone: string; occupying_storage_space: string; app_start_time: number; https: boolean; + login_required: boolean; + go_version: string; + database_version: string; + database_size: string; version_info: { remote_version: string; version: string; diff --git a/ui/src/components/Comment/index.tsx b/ui/src/components/Comment/index.tsx index e91183563..cf84be883 100644 --- a/ui/src/components/Comment/index.tsx +++ b/ui/src/components/Comment/index.tsx @@ -328,16 +328,17 @@ const Comment = ({ objectId, mode, commentId }) => { ); }; return ( -
- {comments.map((item, index) => { +
0 && 'bg-light px-3 py-2 rounded', + )}> + {comments.map((item) => { return (
+ className="border-bottom py-2 comment-item"> {item.showEdit ? (
{ ); })} -
+
0 && 'py-2')}>