mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-04 03:40:33 +08:00
feat: Enhance Notion settings with placeholders and help icon
This commit is contained in:
parent
914f83183e
commit
43375058af
@ -1,6 +1,7 @@
|
|||||||
/* eslint-disable react/no-unknown-property */
|
/* eslint-disable react/no-unknown-property */
|
||||||
import { CloseOutlined, ExportOutlined, PushpinOutlined, ReloadOutlined } from '@ant-design/icons'
|
import { CloseOutlined, ExportOutlined, PushpinOutlined, ReloadOutlined } from '@ant-design/icons'
|
||||||
import { isMac, isWindows } from '@renderer/config/constant'
|
import { isMac, isWindows } from '@renderer/config/constant'
|
||||||
|
import { AppLogo } from '@renderer/config/env'
|
||||||
import { DEFAULT_MIN_APPS } from '@renderer/config/minapps'
|
import { DEFAULT_MIN_APPS } from '@renderer/config/minapps'
|
||||||
import { useBridge } from '@renderer/hooks/useBridge'
|
import { useBridge } from '@renderer/hooks/useBridge'
|
||||||
import { useMinapps } from '@renderer/hooks/useMinapps'
|
import { useMinapps } from '@renderer/hooks/useMinapps'
|
||||||
@ -239,6 +240,10 @@ export default class MinApp {
|
|||||||
await delay(0)
|
await delay(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!app.logo) {
|
||||||
|
app.logo = AppLogo
|
||||||
|
}
|
||||||
|
|
||||||
MinApp.app = app
|
MinApp.app = app
|
||||||
store.dispatch(setMinappShow(true))
|
store.dispatch(setMinappShow(true))
|
||||||
|
|
||||||
|
|||||||
@ -560,7 +560,9 @@
|
|||||||
},
|
},
|
||||||
"data.title": "Data Directory",
|
"data.title": "Data Directory",
|
||||||
"notion.api_key": "Notion API Key",
|
"notion.api_key": "Notion API Key",
|
||||||
|
"notion.api_key_placeholder": "Enter Notion API Key",
|
||||||
"notion.database_id": "Notion Database ID",
|
"notion.database_id": "Notion Database ID",
|
||||||
|
"notion.database_id_placeholder": "Enter Notion Database ID",
|
||||||
"notion.title": "Notion Configuration",
|
"notion.title": "Notion Configuration",
|
||||||
"notion.check": {
|
"notion.check": {
|
||||||
"button": "Check",
|
"button": "Check",
|
||||||
|
|||||||
@ -560,7 +560,9 @@
|
|||||||
},
|
},
|
||||||
"data.title": "データディレクトリ",
|
"data.title": "データディレクトリ",
|
||||||
"notion.api_key": "Notion APIキー",
|
"notion.api_key": "Notion APIキー",
|
||||||
|
"notion.api_key_placeholder": "Notion APIキーを入力してください",
|
||||||
"notion.database_id": "Notion データベースID",
|
"notion.database_id": "Notion データベースID",
|
||||||
|
"notion.database_id_placeholder": "Notion データベースIDを入力してください",
|
||||||
"notion.title": "Notion 設定",
|
"notion.title": "Notion 設定",
|
||||||
"notion.check": {
|
"notion.check": {
|
||||||
"button": "確認",
|
"button": "確認",
|
||||||
|
|||||||
@ -560,7 +560,9 @@
|
|||||||
},
|
},
|
||||||
"data.title": "Каталог данных",
|
"data.title": "Каталог данных",
|
||||||
"notion.api_key": "Ключ API Notion",
|
"notion.api_key": "Ключ API Notion",
|
||||||
|
"notion.api_key_placeholder": "Введите ключ API Notion",
|
||||||
"notion.database_id": "ID базы данных Notion",
|
"notion.database_id": "ID базы данных Notion",
|
||||||
|
"notion.database_id_placeholder": "Введите ID базы данных Notion",
|
||||||
"notion.title": "Настройки Notion",
|
"notion.title": "Настройки Notion",
|
||||||
"notion.check": {
|
"notion.check": {
|
||||||
"button": "Проверить",
|
"button": "Проверить",
|
||||||
|
|||||||
@ -560,7 +560,9 @@
|
|||||||
},
|
},
|
||||||
"data.title": "数据目录",
|
"data.title": "数据目录",
|
||||||
"notion.api_key": "Notion 密钥",
|
"notion.api_key": "Notion 密钥",
|
||||||
"notion.database_id": "Notion 数据库ID",
|
"notion.api_key_placeholder": "请输入Notion 密钥",
|
||||||
|
"notion.database_id": "Notion 数据库 ID",
|
||||||
|
"notion.database_id_placeholder": "请输入Notion 数据库 ID",
|
||||||
"notion.title": "Notion 配置",
|
"notion.title": "Notion 配置",
|
||||||
"notion.check": {
|
"notion.check": {
|
||||||
"button": "检查",
|
"button": "检查",
|
||||||
|
|||||||
@ -558,7 +558,9 @@
|
|||||||
},
|
},
|
||||||
"data.title": "數據目錄",
|
"data.title": "數據目錄",
|
||||||
"notion.api_key": "Notion 金鑰",
|
"notion.api_key": "Notion 金鑰",
|
||||||
|
"notion.api_key_placeholder": "請輸入Notion 密鑰",
|
||||||
"notion.database_id": "Notion 資料庫 ID",
|
"notion.database_id": "Notion 資料庫 ID",
|
||||||
|
"notion.database_id_placeholder": "請輸入Notion 資料庫 ID",
|
||||||
"notion.title": "Notion 配置",
|
"notion.title": "Notion 配置",
|
||||||
"notion.check": {
|
"notion.check": {
|
||||||
"button": "檢查",
|
"button": "檢查",
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import { FileSearchOutlined, FolderOpenOutlined, SaveOutlined } from '@ant-design/icons'
|
import { FileSearchOutlined, FolderOpenOutlined, InfoCircleOutlined, SaveOutlined } from '@ant-design/icons'
|
||||||
import { Client } from '@notionhq/client'
|
import { Client } from '@notionhq/client'
|
||||||
import { HStack } from '@renderer/components/Layout'
|
import { HStack } from '@renderer/components/Layout'
|
||||||
|
import MinApp from '@renderer/components/MinApp'
|
||||||
import { useTheme } from '@renderer/context/ThemeProvider'
|
import { useTheme } from '@renderer/context/ThemeProvider'
|
||||||
import { backup, reset, restore } from '@renderer/services/BackupService'
|
import { backup, reset, restore } from '@renderer/services/BackupService'
|
||||||
import { RootState, useAppDispatch } from '@renderer/store'
|
import { RootState, useAppDispatch } from '@renderer/store'
|
||||||
@ -60,9 +61,23 @@ const NotionSettings: FC = () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const handleNotionTitleClick = () => {
|
||||||
|
MinApp.start({
|
||||||
|
id: 'notion-help',
|
||||||
|
name: 'Notion Help',
|
||||||
|
url: 'https://docs.cherry-ai.com/advanced-basic/notion'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SettingGroup theme={theme}>
|
<SettingGroup theme={theme}>
|
||||||
<SettingTitle>{t('settings.data.notion.title')}</SettingTitle>
|
<SettingTitle style={{ justifyContent: 'flex-start', gap: 10 }}>
|
||||||
|
{t('settings.data.notion.title')}
|
||||||
|
<InfoCircleOutlined
|
||||||
|
style={{ color: 'var(--color-text-2)', cursor: 'pointer' }}
|
||||||
|
onClick={handleNotionTitleClick}
|
||||||
|
/>
|
||||||
|
</SettingTitle>
|
||||||
<SettingDivider />
|
<SettingDivider />
|
||||||
<SettingRow>
|
<SettingRow>
|
||||||
<SettingRowTitle>{t('settings.data.notion.database_id')}</SettingRowTitle>
|
<SettingRowTitle>{t('settings.data.notion.database_id')}</SettingRowTitle>
|
||||||
@ -73,6 +88,7 @@ const NotionSettings: FC = () => {
|
|||||||
onChange={handleNotionDatabaseIdChange}
|
onChange={handleNotionDatabaseIdChange}
|
||||||
onBlur={handleNotionDatabaseIdChange}
|
onBlur={handleNotionDatabaseIdChange}
|
||||||
style={{ width: 315 }}
|
style={{ width: 315 }}
|
||||||
|
placeholder={t('settings.data.notion.database_id_placeholder')}
|
||||||
/>
|
/>
|
||||||
</HStack>
|
</HStack>
|
||||||
</SettingRow>
|
</SettingRow>
|
||||||
@ -86,6 +102,7 @@ const NotionSettings: FC = () => {
|
|||||||
onChange={handleNotionTokenChange}
|
onChange={handleNotionTokenChange}
|
||||||
onBlur={handleNotionTokenChange}
|
onBlur={handleNotionTokenChange}
|
||||||
style={{ width: 250 }}
|
style={{ width: 250 }}
|
||||||
|
placeholder={t('settings.data.notion.api_key_placeholder')}
|
||||||
/>
|
/>
|
||||||
<Button onClick={handleNotionConnectionCheck} style={{ width: 60 }}>
|
<Button onClick={handleNotionConnectionCheck} style={{ width: 60 }}>
|
||||||
{t('settings.data.notion.check.button')}
|
{t('settings.data.notion.check.button')}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user