= ({ actionButton, activeTab }) => {
+ const [open, setOpen] = useState(false)
+
+ const onCancel = () => {
+ setOpen(false)
+ }
+
+ return (
+ <>
+ setOpen(true)}>{actionButton}
+
+
+
+
+ >
+ )
+}
+
+const GlobalStyle = createGlobalStyle`
+ .ant-modal-mask {
+ backdrop-filter: blur(10px);
+ background-color: transparent !important;
+ }
+`
+
+const StyledModal = styled(Modal)`
+ min-width: 900px;
+ max-width: 1300px;
+ padding-bottom: 0;
+
+ .ant-modal-content {
+ padding: 0;
+ overflow: hidden;
+ border-radius: 12px;
+ /* border: 0.5px solid var(--color-border); */
+ }
+ .ant-modal-close {
+ top: 4px;
+ right: 4px;
+ }
+`
+
+export default SettingsPopup
diff --git a/src/renderer/src/components/app/Sidebar.tsx b/src/renderer/src/components/app/Sidebar.tsx
index bc337098e0..beabd6ee7b 100644
--- a/src/renderer/src/components/app/Sidebar.tsx
+++ b/src/renderer/src/components/app/Sidebar.tsx
@@ -1,10 +1,10 @@
import { FileSearchOutlined, FolderOutlined, PictureOutlined, TranslationOutlined } from '@ant-design/icons'
import { isMac } from '@renderer/config/constant'
-import { isLocalAi, UserAvatar } from '@renderer/config/env'
+import { UserAvatar } from '@renderer/config/env'
import { useTheme } from '@renderer/context/ThemeProvider'
import useAvatar from '@renderer/hooks/useAvatar'
import { useMinapps } from '@renderer/hooks/useMinapps'
-import { modelGenerating, useRuntime } from '@renderer/hooks/useRuntime'
+import { useRuntime } from '@renderer/hooks/useRuntime'
import { useSettings } from '@renderer/hooks/useSettings'
import type { MenuProps } from 'antd'
import { Tooltip } from 'antd'
@@ -18,14 +18,13 @@ import styled from 'styled-components'
import DragableList from '../DragableList'
import MinAppIcon from '../Icons/MinAppIcon'
import MinApp from '../MinApp'
+import SettingsPopup from '../Popups/SettingsPopup'
import UserPopup from '../Popups/UserPopup'
const Sidebar: FC = () => {
- const { pathname } = useLocation()
const avatar = useAvatar()
const { minappShow } = useRuntime()
const { t } = useTranslation()
- const navigate = useNavigate()
const { windowStyle, sidebarIcons } = useSettings()
const { theme, toggleTheme } = useTheme()
const { pinned } = useMinapps()
@@ -37,11 +36,6 @@ const Sidebar: FC = () => {
const showPinnedApps = pinned.length > 0 && sidebarIcons.visible.includes('minapp')
- const to = async (path: string) => {
- await modelGenerating()
- navigate(path)
- }
-
return (
)
diff --git a/src/renderer/src/pages/settings/ProviderSettings/index.tsx b/src/renderer/src/pages/settings/ProviderSettings/index.tsx
index 6e6efef98c..88620ac024 100644
--- a/src/renderer/src/pages/settings/ProviderSettings/index.tsx
+++ b/src/renderer/src/pages/settings/ProviderSettings/index.tsx
@@ -164,7 +164,7 @@ const ProviderListContainer = styled.div`
display: flex;
flex-direction: column;
min-width: calc(var(--settings-width) + 10px);
- height: calc(100vh - var(--navbar-height));
+ height: calc(75vh - var(--navbar-height));
border-right: 0.5px solid var(--color-border);
`
@@ -180,19 +180,18 @@ const ProviderListItem = styled.div`
display: flex;
flex-direction: row;
align-items: center;
- padding: 5px 10px;
+ padding: 8px 8px;
width: 100%;
cursor: grab;
- border-radius: var(--list-item-border-radius);
+ border-radius: 8px;
font-size: 14px;
transition: all 0.2s ease-in-out;
- border: 0.5px solid transparent;
&:hover {
- background: var(--color-background-soft);
+ background: var(--color-primary-mute);
}
&.active {
- background: var(--color-background-soft);
- border: 0.5px solid var(--color-border);
+ background: var(--color-primary-mute);
+ color: var(--color-primary);
font-weight: bold !important;
}
`
diff --git a/src/renderer/src/pages/settings/SettingsPage.tsx b/src/renderer/src/pages/settings/SettingsPage.tsx
index a091ad707b..9e517250e6 100644
--- a/src/renderer/src/pages/settings/SettingsPage.tsx
+++ b/src/renderer/src/pages/settings/SettingsPage.tsx
@@ -7,11 +7,10 @@ import {
SaveOutlined,
SettingOutlined
} from '@ant-design/icons'
-import { Navbar, NavbarCenter } from '@renderer/components/app/Navbar'
import { isLocalAi } from '@renderer/config/env'
-import { FC } from 'react'
+import { Breadcrumb, Button, Menu } from 'antd'
+import { FC, useMemo, useState } from 'react'
import { useTranslation } from 'react-i18next'
-import { Link, Route, Routes, useLocation } from 'react-router-dom'
import styled from 'styled-components'
import AboutSettings from './AboutSettings'
@@ -23,94 +22,143 @@ import ProvidersList from './ProviderSettings'
import QuickAssistantSettings from './QuickAssistantSettings'
import ShortcutSettings from './ShortcutSettings'
-const SettingsPage: FC = () => {
- const { pathname } = useLocation()
- const { t } = useTranslation()
+export type SettingsTab =
+ | 'provider'
+ | 'model'
+ | 'general'
+ | 'display'
+ | 'data'
+ | 'quickAssistant'
+ | 'shortcut'
+ | 'about'
- const isRoute = (path: string): string => (pathname.startsWith(path) ? 'active' : '')
-
- return (
-
-
- {t('settings.title')}
-
-
-
- {!isLocalAi && (
- <>
-
-
-
-
-
-
- >
- )}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- } />
- } />
- } />
- } />
- } />
- } />
- } />
- } />
-
-
-
-
- )
+interface Props {
+ activeTab?: SettingsTab
+}
+interface MenuItem {
+ label: string
+ icon: React.ReactNode
+ key: string
+ enabled: boolean
}
-const Container = styled.div`
- display: flex;
- flex-direction: column;
- flex: 1;
-`
+const SettingsPage: FC = (props) => {
+ const { t } = useTranslation()
+ const [activeTab, setActiveTab] = useState(props.activeTab || 'provider')
+ const [collapsed, setCollapsed] = useState(false)
+
+ const settingMenus = useMemo