Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 优化导出到Notion的相关提示、添加Notion配置文档按钮提示 #1939

Merged
merged 2 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/renderer/src/i18n/locales/en-us.json
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@
"error.invalid.enter.model": "Please select a model",
"error.invalid.proxy.url": "Invalid proxy URL",
"error.invalid.webdav": "Invalid WebDAV settings",
"error.notion.export": "Notion import failed",
"error.notion.export": "Failed to export to Notion. Please check connection status and configuration according to documentation",
"error.notion.no_api_key": "Notion ApiKey or Notion DatabaseID is not configured",
"group.delete.content": "Deleting a group message will delete the user's question and all assistant's answers",
"group.delete.title": "Delete Group Message",
Expand All @@ -377,13 +377,13 @@
"reset.double.confirm.title": "DATA LOST !!!",
"restore.success": "Restored successfully",
"save.success.title": "Saved successfully",
"success.notion.export": "Notion import successful",
"success.notion.export": "Successfully exported to Notion",
"switch.disabled": "Please wait for the current reply to complete",
"topic.added": "New topic added",
"upgrade.success.button": "Restart",
"upgrade.success.content": "Please restart the application to complete the upgrade",
"upgrade.success.title": "Upgrade successfully",
"warn.notion.exporting": "Notion is importing, please do not import repeatedly",
"warn.notion.exporting": "Exporting to Notion, please do not request export repeatedly!",
"error.invalid.api.host": "Invalid API Host",
"error.invalid.api.key": "Invalid API Key"
},
Expand Down Expand Up @@ -567,11 +567,12 @@
"notion.database_id": "Notion Database ID",
"notion.database_id_placeholder": "Enter Notion Database ID",
"notion.title": "Notion Configuration",
"notion.help": "Notion Configuration Documentation",
"notion.check": {
"button": "Check",
"fail": "Connection failed, please check the configuration",
"fail": "Connection failed, please check network and Api_key and Database_id",
"success": "Connection successful",
"error": "Connection error, please check the network",
"error": "Connection error, please check network configuration and Api_key and Database_id",
"empty_api_key": "Api_key is not configured",
"empty_database_id": "Database_id is not configured"
},
Expand Down
11 changes: 6 additions & 5 deletions src/renderer/src/i18n/locales/ja-jp.json
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@
"error.invalid.enter.model": "モデルを選択してください",
"error.invalid.proxy.url": "無効なプロキシURL",
"error.invalid.webdav": "無効なWebDAV設定",
"error.notion.export": "Notion インポートに失敗",
"error.notion.export": "Notionへのエクスポートに失敗しました。接続状態と設定を確認してください",
"error.notion.no_api_key": "Notion ApiKey または Notion DatabaseID が設定されていません",
"group.delete.content": "分組メッセージを削除するとユーザーの質問と助け手の回答がすべて削除されます",
"group.delete.title": "分組メッセージを削除",
Expand All @@ -376,13 +376,13 @@
"reset.double.confirm.title": "データが失われます!!!",
"restore.success": "復元に成功しました",
"save.success.title": "保存に成功しました",
"success.notion.export": "Notion へのインポートに成功",
"success.notion.export": "Notionへのエクスポートに成功しました",
"switch.disabled": "現在の応答が完了するまで切り替えを無効にします",
"topic.added": "新しいトピックが追加されました",
"upgrade.success.button": "再起動",
"upgrade.success.content": "アップグレードを完了するためにアプリケーションを再起動してください",
"upgrade.success.title": "アップグレードに成功しました",
"warn.notion.exporting": "Notion 正在インポート中です。重複インポートしないでください。",
"warn.notion.exporting": "Notionにエクスポート中です。重複してエクスポートしないでください! ",
"error.enter.name": "ナレッジベース名を入力してください",
"error.invalid.api.host": "無効なAPIアドレスです",
"error.invalid.api.key": "無効なAPIキーです"
Expand Down Expand Up @@ -567,11 +567,12 @@
"notion.database_id": "Notion データベースID",
"notion.database_id_placeholder": "Notion データベースIDを入力してください",
"notion.title": "Notion 設定",
"notion.help": "Notion 設定ドキュメント",
"notion.check": {
"button": "確認",
"fail": "接続に失敗しました。設定を確認してください。",
"fail": "接続エラー、ネットワーク設定とApi_keyとDatabase_idを確認してください",
"success": "接続に成功しました。",
"error": "接続エラーが発生しました。ネットワークを確認してください。",
"error": "接続エラー、ネットワーク設定とApi_keyとDatabase_idを確認してください",
"empty_api_key": "Api_keyが設定されていません",
"empty_database_id": "Database_idが設定されていません"
},
Expand Down
11 changes: 6 additions & 5 deletions src/renderer/src/i18n/locales/ru-ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@
"error.invalid.enter.model": "Пожалуйста, выберите модель",
"error.invalid.proxy.url": "Неверный URL прокси",
"error.invalid.webdav": "Неверные настройки WebDAV",
"error.notion.export": "Импорт в Notion не удался",
"error.notion.export": "Ошибка экспорта в Notion, пожалуйста, проверьте состояние подключения и настройки в документации",
"error.notion.no_api_key": "Notion ApiKey или Notion DatabaseID не настроен",
"group.delete.content": "Удаление группы сообщений удалит пользовательский вопрос и все ответы помощника",
"group.delete.title": "Удалить группу сообщений",
Expand All @@ -377,13 +377,13 @@
"reset.double.confirm.title": "ДАННЫЕ БУДУТ УТЕРЯНЫ !!!",
"restore.success": "Успешно восстановлено",
"save.success.title": "Успешно сохранено",
"success.notion.export": "Импорт в Notion выполнен успешно",
"success.notion.export": "Успешный экспорт в Notion",
"switch.disabled": "Пожалуйста, дождитесь завершения текущего ответа",
"topic.added": "Новый топик добавлен",
"upgrade.success.button": "Перезапустить",
"upgrade.success.content": "Пожалуйста, перезапустите приложение для завершения обновления",
"upgrade.success.title": "Обновление успешно",
"warn.notion.exporting": "Идет импорт в Notion, пожалуйста, не повторяйте импорт",
"warn.notion.exporting": "Экспортируется в Notion, пожалуйста, не отправляйте повторные запросы!",
"error.invalid.api.host": "Неверный API адрес",
"error.invalid.api.key": "Неверный API ключ"
},
Expand Down Expand Up @@ -567,11 +567,12 @@
"notion.database_id": "ID базы данных Notion",
"notion.database_id_placeholder": "Введите ID базы данных Notion",
"notion.title": "Настройки Notion",
"notion.help": "Документация по настройке Notion",
"notion.check": {
"button": "Проверить",
"fail": "Ошибка подключения, проверьте настройки",
"fail": "Не удалось подключиться, пожалуйста, проверьте сеть и правильность Api_key и Database_id",
"success": "Подключение успешно",
"error": "Ошибка подключения, проверьте сеть",
"error": "Аномалия в подключении, пожалуйста, проверьте настройки сети, а также правильность Api_key и Database_id",
"empty_api_key": "Не настроен Api_key",
"empty_database_id": "Не настроен Database_id"
},
Expand Down
11 changes: 6 additions & 5 deletions src/renderer/src/i18n/locales/zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@
"error.invalid.enter.model": "请选择一个模型",
"error.invalid.proxy.url": "无效的代理地址",
"error.invalid.webdav": "无效的 WebDAV 设置",
"error.notion.export": "Notion 导入失败",
"error.notion.export": "导出Notion错误,请检查连接状态并对照文档检查配置",
"error.notion.no_api_key": "未配置Notion ApiKey或Notion DatabaseID",
"group.delete.content": "删除分组消息会删除用户提问和所有助手的回答",
"group.delete.title": "删除分组消息",
Expand All @@ -379,13 +379,13 @@
"reset.double.confirm.title": "数据丢失!!!",
"restore.success": "恢复成功",
"save.success.title": "保存成功",
"success.notion.export": "导入Notion成功",
"success.notion.export": "成功导出到Notion",
"switch.disabled": "请等待当前回复完成后操作",
"topic.added": "话题添加成功",
"upgrade.success.button": "重启",
"upgrade.success.content": "重启用以完成升级",
"upgrade.success.title": "升级成功",
"warn.notion.exporting": "Notion正在导入,请勿重复导入"
"warn.notion.exporting": "正在导出到Notion, 请勿重复请求导出!"
},
"minapp": {
"sidebar.add.title": "添加到侧边栏",
Expand Down Expand Up @@ -567,11 +567,12 @@
"notion.database_id": "Notion 数据库 ID",
"notion.database_id_placeholder": "请输入Notion 数据库 ID",
"notion.title": "Notion 配置",
"notion.help" : "Notion 配置文档",
"notion.check": {
"button": "检查",
"fail": "连接失败,请检查配置",
"fail": "连接失败,请检查网络及Api_key和Database_id是否正确",
"success": "连接成功",
"error": "连接异常,请检查网络",
"error": "连接异常,请检查网络及Api_key和Database_id是否正确",
"empty_api_key": "未配置Api_key",
"empty_database_id": "未配置Database_id"
},
Expand Down
13 changes: 7 additions & 6 deletions src/renderer/src/i18n/locales/zh-tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@
"error.invalid.enter.model": "請選擇一個模型",
"error.invalid.proxy.url": "無效的代理 URL",
"error.invalid.webdav": "無效的 WebDAV 設定",
"error.notion.export": "Notion 匯入失敗",
"error.notion.export": "導出Notion錯誤,請檢查連接狀態並對照文檔檢查配置",
"error.notion.no_api_key": "未配置 Notion ApiKey 或 Notion DatabaseID",
"group.delete.content": "刪除分組消息會刪除用戶提問和所有助手的回答",
"group.delete.title": "刪除分組消息",
Expand All @@ -377,13 +377,13 @@
"reset.double.confirm.title": "資料將會丟失!!!",
"restore.success": "恢復成功",
"save.success.title": "保存成功",
"success.notion.export": "匯入 Notion 成功",
"success.notion.export": "成功導出到Notion",
"switch.disabled": "請等待當前回覆完成",
"topic.added": "新話題已添加",
"upgrade.success.button": "重新啟動",
"upgrade.success.content": "請重新啟動應用以完成升級",
"upgrade.success.title": "升級成功",
"warn.notion.exporting": "Notion 正在匯入,請勿重複匯入",
"warn.notion.exporting": "正在導出到Notion,請勿重複請求導出!",
"error.invalid.api.host": "無效的 API 位址",
"error.invalid.api.key": "無效的 API 密鑰"
},
Expand Down Expand Up @@ -560,16 +560,17 @@
"title": "清除緩存"
},
"data.title": "數據目錄",
"notion.api_key": "Notion 金鑰",
"notion.api_key": "Notion 密鑰",
"notion.api_key_placeholder": "請輸入Notion 密鑰",
"notion.database_id": "Notion 資料庫 ID",
"notion.database_id_placeholder": "請輸入Notion 資料庫 ID",
"notion.title": "Notion 配置",
"notion.help": "Notion 配置文檔",
"notion.check": {
"button": "檢查",
"fail": "連線失敗,請檢查配置",
"fail": "連接失敗,請檢查網絡及Api_key和Database_id是否正確",
"success": "連線成功",
"error": "連線異常,請檢查網路",
"error": "連接異常,請檢查網絡及Api_key和Database_id是否正確",
"empty_api_key": "未配置Api_key",
"empty_database_id": "未配置Database_id"
},
Expand Down
16 changes: 8 additions & 8 deletions src/renderer/src/pages/settings/DataSettings/DataSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { backup, reset, restore } from '@renderer/services/BackupService'
import { RootState, useAppDispatch } from '@renderer/store'
import { setNotionApiKey, setNotionDatabaseID } from '@renderer/store/settings'
import { AppInfo } from '@renderer/types'
import { Button, Modal, Typography } from 'antd'
import { Button, Modal, Tooltip, Typography } from 'antd'
import Input from 'antd/es/input/Input'
import { FC, useEffect, useState } from 'react'
import { useTranslation } from 'react-i18next'
Expand Down Expand Up @@ -73,10 +73,12 @@ const NotionSettings: FC = () => {
<SettingGroup theme={theme}>
<SettingTitle style={{ justifyContent: 'flex-start', gap: 10 }}>
{t('settings.data.notion.title')}
<InfoCircleOutlined
style={{ color: 'var(--color-text-2)', cursor: 'pointer' }}
onClick={handleNotionTitleClick}
/>
<Tooltip title={t('settings.data.notion.help')} placement="right">
<InfoCircleOutlined
style={{ color: 'var(--color-text-2)', cursor: 'pointer' }}
onClick={handleNotionTitleClick}
/>
</Tooltip>
</SettingTitle>
<SettingDivider />
<SettingRow>
Expand Down Expand Up @@ -104,9 +106,7 @@ const NotionSettings: FC = () => {
style={{ width: 250 }}
placeholder={t('settings.data.notion.api_key_placeholder')}
/>
<Button onClick={handleNotionConnectionCheck}>
{t('settings.data.notion.check.button')}
</Button>
<Button onClick={handleNotionConnectionCheck}>{t('settings.data.notion.check.button')}</Button>
</HStack>
</SettingRow>
<SettingDivider /> {/* 添加分割线 */}
Expand Down