mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-16 06:16:53 +08:00
Feat/add icons (#450)
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
.file-icon {
|
||||
background: url(../../../../assets/file.svg) center center no-repeat;
|
||||
background-size: contain;
|
||||
}
|
||||
|
||||
.sync-icon {
|
||||
background: url(../../../../assets/sync.svg) center center no-repeat;
|
||||
background-size: contain;
|
||||
}
|
||||
|
||||
.trash-icon {
|
||||
background: url(../../../../assets/trash.svg) center center no-repeat;
|
||||
background-size: contain;
|
||||
}
|
||||
@@ -5,12 +5,13 @@ import Link from 'next/link'
|
||||
import { useSWRConfig } from 'swr'
|
||||
import { EllipsisHorizontalIcon } from '@heroicons/react/24/solid'
|
||||
import { Menu, Transition } from '@headlessui/react'
|
||||
import cn from 'classnames'
|
||||
import s from './index.module.css'
|
||||
import { apiPrefix } from '@/config'
|
||||
import { syncDataSourceNotion, updateDataSourceNotionAction } from '@/service/common'
|
||||
import Toast from '@/app/components/base/toast'
|
||||
import type { DataSourceNotion } from '@/models/common'
|
||||
import { FilePlus02 } from '@/app/components/base/icons/src/vender/line/files'
|
||||
import { RefreshCw05 } from '@/app/components/base/icons/src/vender/line/arrows'
|
||||
import { Trash03 } from '@/app/components/base/icons/src/vender/line/general'
|
||||
|
||||
type OperateProps = {
|
||||
workspace: DataSourceNotion
|
||||
@@ -23,7 +24,7 @@ export default function Operate({
|
||||
cursor-pointer
|
||||
`
|
||||
const itemIconClassName = `
|
||||
mr-2 mt-[2px] w-4 h-4
|
||||
mr-2 mt-[2px] w-4 h-4 text-gray-500
|
||||
`
|
||||
const { t } = useTranslation()
|
||||
const { mutate } = useSWRConfig()
|
||||
@@ -73,7 +74,7 @@ export default function Operate({
|
||||
<Link
|
||||
className={itemClassName}
|
||||
href={`${apiPrefix}/oauth/data-source/notion`}>
|
||||
<div className={cn(s['file-icon'], itemIconClassName)}></div>
|
||||
<FilePlus02 className={itemIconClassName} />
|
||||
<div>
|
||||
<div className='leading-5'>{t('common.dataSource.notion.changeAuthorizedPages')}</div>
|
||||
<div className='leading-5 text-xs text-gray-500'>
|
||||
@@ -84,7 +85,7 @@ export default function Operate({
|
||||
</Menu.Item>
|
||||
<Menu.Item>
|
||||
<div className={itemClassName} onClick={handleSync}>
|
||||
<div className={cn(s['sync-icon'], itemIconClassName)} />
|
||||
<RefreshCw05 className={itemIconClassName} />
|
||||
<div className='leading-5'>{t('common.dataSource.notion.sync')}</div>
|
||||
</div>
|
||||
</Menu.Item>
|
||||
@@ -92,7 +93,7 @@ export default function Operate({
|
||||
<Menu.Item>
|
||||
<div className='p-1'>
|
||||
<div className={itemClassName} onClick={handleRemove}>
|
||||
<div className={cn(s['trash-icon'], itemIconClassName)} />
|
||||
<Trash03 className={itemIconClassName} />
|
||||
<div className='leading-5'>{t('common.dataSource.notion.remove')}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -2,14 +2,4 @@
|
||||
max-width: 720px !important;
|
||||
padding: 0 !important;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.data-source-icon {
|
||||
background: url(../assets/data-source.svg) center center no-repeat;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.data-source-solid-icon {
|
||||
background: url(../assets/data-source-blue.svg) center center no-repeat;
|
||||
background-size: cover;
|
||||
}
|
||||
@@ -3,7 +3,6 @@ import { useTranslation } from 'react-i18next'
|
||||
import { useState } from 'react'
|
||||
import { AtSymbolIcon, CubeTransparentIcon, GlobeAltIcon, UserIcon, UsersIcon, XMarkIcon } from '@heroicons/react/24/outline'
|
||||
import { GlobeAltIcon as GlobalAltIconSolid, UserIcon as UserIconSolid, UsersIcon as UsersIconSolid } from '@heroicons/react/24/solid'
|
||||
import cn from 'classnames'
|
||||
import AccountPage from './account-page'
|
||||
import MembersPage from './members-page'
|
||||
import IntegrationsPage from './Integrations-page'
|
||||
@@ -12,21 +11,13 @@ import ProviderPage from './provider-page'
|
||||
import DataSourcePage from './data-source-page'
|
||||
import s from './index.module.css'
|
||||
import Modal from '@/app/components/base/modal'
|
||||
import { Database03 } from '@/app/components/base/icons/src/vender/line/development'
|
||||
import { Database03 as Database03Solid } from '@/app/components/base/icons/src/vender/solid/development'
|
||||
|
||||
const iconClassName = `
|
||||
w-4 h-4 ml-3 mr-2
|
||||
`
|
||||
|
||||
type IconProps = {
|
||||
className?: string
|
||||
}
|
||||
const DataSourceIcon = ({ className }: IconProps) => (
|
||||
<div className={cn(s['data-source-icon'], className)} />
|
||||
)
|
||||
const DataSourceSolidIcon = ({ className }: IconProps) => (
|
||||
<div className={cn(s['data-source-solid-icon'], className)} />
|
||||
)
|
||||
|
||||
type IAccountSettingProps = {
|
||||
onCancel: () => void
|
||||
activeTab?: string
|
||||
@@ -81,8 +72,8 @@ export default function AccountSetting({
|
||||
{
|
||||
key: 'data-source',
|
||||
name: t('common.settings.dataSource'),
|
||||
icon: <DataSourceIcon className={iconClassName} />,
|
||||
activeIcon: <DataSourceSolidIcon className={iconClassName} />,
|
||||
icon: <Database03 className={iconClassName} />,
|
||||
activeIcon: <Database03Solid className={iconClassName} />,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.66659 9.98845C10.1231 9.93732 11.4455 9.71981 12.461 9.38077C13.0418 9.18687 13.5593 8.94109 13.9452 8.6353C14.3245 8.33478 14.6666 7.89967 14.6666 7.33341V3.33341C14.6666 2.76545 14.3207 2.33047 13.9411 2.03132C13.5539 1.72624 13.0351 1.48065 12.4534 1.28675C11.283 0.896612 9.70849 0.666748 7.99992 0.666748C6.29135 0.666748 4.71686 0.896612 3.54646 1.28675C2.96474 1.48065 2.44589 1.72624 2.05878 2.03132C1.67918 2.33047 1.33325 2.76545 1.33325 3.33341V7.33341C1.33325 7.89967 1.67538 8.33478 2.05463 8.6353C2.44053 8.94109 2.958 9.18687 3.53881 9.38077C4.55435 9.71981 5.87675 9.93732 7.33325 9.98845V11.4472C6.76498 11.6481 6.31458 12.0985 6.11372 12.6667H1.99992C1.63173 12.6667 1.33325 12.9652 1.33325 13.3334C1.33325 13.7016 1.63173 14.0001 1.99992 14.0001H6.11372C6.38828 14.7769 7.12911 15.3334 7.99992 15.3334C8.87073 15.3334 9.61156 14.7769 9.88612 14.0001H13.9999C14.3681 14.0001 14.6666 13.7016 14.6666 13.3334C14.6666 12.9652 14.3681 12.6667 13.9999 12.6667H9.88612C9.68526 12.0985 9.23486 11.6481 8.66659 11.4472V9.98845ZM2.66659 3.33337C2.66659 3.33337 2.66657 3.32994 2.66862 3.32322C2.67089 3.31579 2.67647 3.30111 2.68997 3.27913C2.71827 3.23303 2.77597 3.16373 2.88408 3.07853C3.1042 2.90506 3.46403 2.71968 3.9681 2.55166C4.96927 2.21793 6.39478 2.00008 7.99992 2.00008C9.60506 2.00008 11.0306 2.21793 12.0317 2.55166C12.5358 2.71968 12.8956 2.90506 13.1158 3.07853C13.2239 3.16373 13.2816 3.23303 13.3099 3.27913C13.3234 3.30111 13.329 3.31579 13.3312 3.32322C13.3333 3.32994 13.3333 3.33337 13.3333 3.33337C13.3333 3.33337 13.3332 3.33722 13.3312 3.34361C13.329 3.35104 13.3234 3.36572 13.3099 3.3877C13.2816 3.4338 13.2239 3.5031 13.1158 3.5883C12.8956 3.76177 12.5358 3.94715 12.0317 4.11517C11.0306 4.4489 9.60506 4.66675 7.99992 4.66675C6.39478 4.66675 4.96927 4.4489 3.9681 4.11517C3.46403 3.94715 3.1042 3.76177 2.88408 3.5883C2.77597 3.5031 2.71827 3.4338 2.68997 3.3877C2.67647 3.36572 2.67089 3.35104 2.66862 3.34361C2.6667 3.33731 2.66659 3.33337 2.66659 3.33337Z" fill="#155EEF"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 2.1 KiB |
@@ -1,3 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M9.33333 13.3333C9.33333 14.0696 8.73638 14.6666 8 14.6666C7.26362 14.6666 6.66667 14.0696 6.66667 13.3333M9.33333 13.3333C9.33333 12.5969 8.73638 11.9999 8 11.9999M9.33333 13.3333H14M6.66667 13.3333C6.66667 12.5969 7.26362 11.9999 8 11.9999M6.66667 13.3333H2M8 11.9999V9.33325M14 3.33325C14 4.43782 11.3137 5.33325 8 5.33325C4.68629 5.33325 2 4.43782 2 3.33325M14 3.33325C14 2.22868 11.3137 1.33325 8 1.33325C4.68629 1.33325 2 2.22868 2 3.33325M14 3.33325V7.33325C14 8.43992 11.3333 9.33325 8 9.33325M2 3.33325V7.33325C2 8.43992 4.66667 9.33325 8 9.33325" stroke="#344054" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 755 B |
Reference in New Issue
Block a user