mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-07 05:39:05 +08:00
wip
This commit is contained in:
parent
14acd45927
commit
563472f3a9
@ -1,6 +1,6 @@
|
|||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'iconfont'; /* Project id 4563475 */
|
font-family: 'iconfont'; /* Project id 4563475 */
|
||||||
src: url('iconfont.woff2?t=1724204739157') format('woff2');
|
src: url('iconfont.woff2?t=1725424338696') format('woff2');
|
||||||
}
|
}
|
||||||
|
|
||||||
.iconfont {
|
.iconfont {
|
||||||
@ -11,6 +11,10 @@
|
|||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon-inbox:before {
|
||||||
|
content: '\e869';
|
||||||
|
}
|
||||||
|
|
||||||
.icon-business-smart-assistant:before {
|
.icon-business-smart-assistant:before {
|
||||||
content: '\e601';
|
content: '\e601';
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
@ -68,6 +68,7 @@ const resources = {
|
|||||||
'topics.edit.placeholder': 'Enter new name',
|
'topics.edit.placeholder': 'Enter new name',
|
||||||
'topics.delete.all.title': 'Delete all topics',
|
'topics.delete.all.title': 'Delete all topics',
|
||||||
'topics.delete.all.content': 'Are you sure you want to delete all topics?',
|
'topics.delete.all.content': 'Are you sure you want to delete all topics?',
|
||||||
|
'topics.list': 'Topic List',
|
||||||
'input.new_topic': 'New Topic',
|
'input.new_topic': 'New Topic',
|
||||||
'input.clear': 'Clear',
|
'input.clear': 'Clear',
|
||||||
'input.expand': 'Expand',
|
'input.expand': 'Expand',
|
||||||
@ -312,6 +313,7 @@ const resources = {
|
|||||||
'topics.edit.placeholder': '输入新名称',
|
'topics.edit.placeholder': '输入新名称',
|
||||||
'topics.delete.all.title': '删除所有话题',
|
'topics.delete.all.title': '删除所有话题',
|
||||||
'topics.delete.all.content': '确定要删除所有话题吗?',
|
'topics.delete.all.content': '确定要删除所有话题吗?',
|
||||||
|
'topics.list': '话题列表',
|
||||||
'input.new_topic': '新话题',
|
'input.new_topic': '新话题',
|
||||||
'input.clear': '清除',
|
'input.clear': '清除',
|
||||||
'input.expand': '展开',
|
'input.expand': '展开',
|
||||||
|
|||||||
@ -121,7 +121,7 @@ const Assistants: FC<Props> = ({
|
|||||||
onClick={() => onSwitchAssistant(assistant)}
|
onClick={() => onSwitchAssistant(assistant)}
|
||||||
className={assistant.id === activeAssistant?.id ? 'active' : ''}>
|
className={assistant.id === activeAssistant?.id ? 'active' : ''}>
|
||||||
<AssistantName className="name">{assistant.name || t('chat.default.name')}</AssistantName>
|
<AssistantName className="name">{assistant.name || t('chat.default.name')}</AssistantName>
|
||||||
<Tooltip arrow title="话题列表" placement="bottom" mouseEnterDelay={0.5}>
|
<Tooltip arrow title={t('chat.topics.list')} placement="bottom" mouseEnterDelay={0.5}>
|
||||||
<ArrowRightButton className="arrow-button" onClick={() => setShowTopics(true)}>
|
<ArrowRightButton className="arrow-button" onClick={() => setShowTopics(true)}>
|
||||||
<ArrowRightOutlined />
|
<ArrowRightOutlined />
|
||||||
</ArrowRightButton>
|
</ArrowRightButton>
|
||||||
@ -180,9 +180,6 @@ const AssistantItem = styled.div`
|
|||||||
opacity: 1;
|
opacity: 1;
|
||||||
color: var(--color-text-2);
|
color: var(--color-text-2);
|
||||||
}
|
}
|
||||||
.name {
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
@ -192,6 +189,7 @@ const AssistantName = styled.div`
|
|||||||
-webkit-line-clamp: 1;
|
-webkit-line-clamp: 1;
|
||||||
-webkit-box-orient: vertical;
|
-webkit-box-orient: vertical;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
font-size: 13px;
|
||||||
`
|
`
|
||||||
|
|
||||||
const ArrowRightButton = styled.div`
|
const ArrowRightButton = styled.div`
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { ArrowLeftOutlined } from '@ant-design/icons'
|
import { ArrowLeftOutlined, UnorderedListOutlined } from '@ant-design/icons'
|
||||||
import { Navbar, NavbarCenter, NavbarLeft } from '@renderer/components/app/Navbar'
|
import { Navbar, NavbarCenter, NavbarLeft } from '@renderer/components/app/Navbar'
|
||||||
import { HStack } from '@renderer/components/Layout'
|
import { HStack } from '@renderer/components/Layout'
|
||||||
import { isMac, isWindows } from '@renderer/config/constant'
|
import { isMac, isWindows } from '@renderer/config/constant'
|
||||||
@ -64,17 +64,17 @@ const HomePage: FC = () => {
|
|||||||
{showAssistants && (
|
{showAssistants && (
|
||||||
<NavbarLeft
|
<NavbarLeft
|
||||||
style={{ justifyContent: 'space-between', alignItems: 'center', borderRight: 'none', padding: '0 8px' }}>
|
style={{ justifyContent: 'space-between', alignItems: 'center', borderRight: 'none', padding: '0 8px' }}>
|
||||||
<NavigtaionBack className={showTopics ? 'back' : ''} onClick={() => setShowTopics(false)}>
|
<NewButton onClick={() => setShowTopics(!showTopics)} className="back-button">
|
||||||
{showTopics && <ArrowLeftOutlined />}
|
{showTopics ? <ArrowLeftOutlined /> : <UnorderedListOutlined />}
|
||||||
<NavigationBackTitle>{showTopics ? t('common.back') : t('common.chat')}</NavigationBackTitle>
|
<BackText>{showTopics ? t('common.assistant') : t('chat.topics.title')}</BackText>
|
||||||
</NavigtaionBack>
|
</NewButton>
|
||||||
<NewButton onClick={onCreate}>
|
<NewButton onClick={onCreate}>
|
||||||
<i className="iconfont icon-a-addchat"></i>
|
<i className="iconfont icon-a-addchat"></i>
|
||||||
</NewButton>
|
</NewButton>
|
||||||
</NavbarLeft>
|
</NavbarLeft>
|
||||||
)}
|
)}
|
||||||
<NavbarCenter
|
<NavbarCenter
|
||||||
style={{ paddingLeft: isMac ? 16 : 8, justifyContent: 'space-between', paddingRight: isWindows ? 140 : 12 }}>
|
style={{ justifyContent: 'space-between', paddingLeft: isMac ? 16 : 8, paddingRight: isWindows ? 135 : 12 }}>
|
||||||
<HStack alignItems="center">
|
<HStack alignItems="center">
|
||||||
<AssistantName>{activeAssistant?.name || t('chat.default.name')}</AssistantName>
|
<AssistantName>{activeAssistant?.name || t('chat.default.name')}</AssistantName>
|
||||||
<SelectModelButton assistant={activeAssistant} />
|
<SelectModelButton assistant={activeAssistant} />
|
||||||
@ -118,45 +118,20 @@ const ContentContainer = styled.div`
|
|||||||
background-color: var(--color-background);
|
background-color: var(--color-background);
|
||||||
`
|
`
|
||||||
|
|
||||||
const NavigtaionBack = styled.div`
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: flex-start;
|
|
||||||
gap: 10px;
|
|
||||||
margin-left: ${isMac ? '10px' : 0};
|
|
||||||
-webkit-app-region: none;
|
|
||||||
transition: all 0.2s ease-in-out;
|
|
||||||
transition: opacity 0.2s ease-in-out;
|
|
||||||
padding: 3px 8px;
|
|
||||||
border-radius: 6px;
|
|
||||||
&.back {
|
|
||||||
cursor: pointer;
|
|
||||||
&:hover {
|
|
||||||
background-color: var(--color-background-mute);
|
|
||||||
color: var(--color-text-1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`
|
|
||||||
|
|
||||||
const NavigationBackTitle = styled.div`
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: 800;
|
|
||||||
font-family: Ubuntu;
|
|
||||||
`
|
|
||||||
|
|
||||||
const AssistantName = styled.span`
|
const AssistantName = styled.span`
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
font-family: Ubuntu;
|
font-family: Ubuntu;
|
||||||
font-weight: 800;
|
font-size: 13px;
|
||||||
|
font-weight: 500;
|
||||||
`
|
`
|
||||||
|
|
||||||
export const NewButton = styled.div`
|
export const NewButton = styled.div`
|
||||||
-webkit-app-region: none;
|
-webkit-app-region: none;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
width: 30px;
|
padding: 0 5px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
|
gap: 5px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
@ -173,6 +148,19 @@ export const NewButton = styled.div`
|
|||||||
.icon-hidesidebarhoriz {
|
.icon-hidesidebarhoriz {
|
||||||
font-size: 17px;
|
font-size: 17px;
|
||||||
}
|
}
|
||||||
|
&.back-button {
|
||||||
|
margin-left: ${isMac ? '8px' : 0};
|
||||||
|
.anticon {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
.anticon-arrow-left {
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
&:hover {
|
||||||
|
background-color: var(--color-background-mute);
|
||||||
|
color: var(--color-icon-white);
|
||||||
|
}
|
||||||
|
}
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: var(--color-background-mute);
|
background-color: var(--color-background-mute);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
@ -180,6 +168,11 @@ export const NewButton = styled.div`
|
|||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
|
const BackText = styled.span`
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 400;
|
||||||
|
`
|
||||||
|
|
||||||
const ThemeSwitch = styled(Switch)`
|
const ThemeSwitch = styled(Switch)`
|
||||||
-webkit-app-region: none;
|
-webkit-app-region: none;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
|
|||||||
@ -109,7 +109,7 @@ const Topics: FC<Props> = ({ assistant: _assistant, activeTopic, setActiveTopic
|
|||||||
</Dropdown>
|
</Dropdown>
|
||||||
)}
|
)}
|
||||||
</DragableList>
|
</DragableList>
|
||||||
{assistant.topics.length > 20 && (
|
{assistant.topics.length > 10 && (
|
||||||
<Footer>
|
<Footer>
|
||||||
<Button style={{ width: '100%' }} onClick={onDeleteAll}>
|
<Button style={{ width: '100%' }} onClick={onDeleteAll}>
|
||||||
{t('chat.topics.delete.all.title')}
|
{t('chat.topics.delete.all.title')}
|
||||||
@ -128,7 +128,7 @@ const Container = styled.div`
|
|||||||
`
|
`
|
||||||
|
|
||||||
const TopicListItem = styled.div`
|
const TopicListItem = styled.div`
|
||||||
padding: 6px 10px;
|
padding: 5px 10px;
|
||||||
margin: 0 10px;
|
margin: 0 10px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
@ -142,7 +142,6 @@ const TopicListItem = styled.div`
|
|||||||
}
|
}
|
||||||
&.active {
|
&.active {
|
||||||
background-color: var(--color-background-mute);
|
background-color: var(--color-background-mute);
|
||||||
font-weight: 500;
|
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
|
|||||||
@ -7,10 +7,9 @@ import { useAppDispatch } from '@renderer/store'
|
|||||||
import { setLanguage, setUserName, ThemeMode } from '@renderer/store/settings'
|
import { setLanguage, setUserName, ThemeMode } from '@renderer/store/settings'
|
||||||
import { setProxyUrl as _setProxyUrl } from '@renderer/store/settings'
|
import { setProxyUrl as _setProxyUrl } from '@renderer/store/settings'
|
||||||
import { isValidProxyUrl } from '@renderer/utils'
|
import { isValidProxyUrl } from '@renderer/utils'
|
||||||
import { Avatar, Button, Input, Select } from 'antd'
|
import { Button, Input, Select } from 'antd'
|
||||||
import { FC, useState } from 'react'
|
import { FC, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import styled from 'styled-components'
|
|
||||||
|
|
||||||
import { SettingContainer, SettingDivider, SettingRow, SettingRowTitle, SettingTitle } from '.'
|
import { SettingContainer, SettingDivider, SettingRow, SettingRowTitle, SettingTitle } from '.'
|
||||||
|
|
||||||
@ -128,8 +127,4 @@ const GeneralSettings: FC = () => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const UserAvatar = styled(Avatar)`
|
|
||||||
cursor: pointer;
|
|
||||||
`
|
|
||||||
|
|
||||||
export default GeneralSettings
|
export default GeneralSettings
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user