Compare commits

...

39 Commits

Author SHA1 Message Date
Joel
7608eb1049 Merge branch 'main' into feat/plugin-auto-upgrade-fe 2025-07-10 14:20:34 +08:00
Joel
95ce7b6f47 feat: add time zone 2025-07-10 11:34:05 +08:00
Joel
784a236280 Merge branch 'main' into feat/plugin-auto-upgrade-fe 2025-07-08 17:20:37 +08:00
Joel
1e0426ca6f chore: peroid not auto scroll 2025-07-08 17:15:00 +08:00
Joel
fd7396d8f9 chore: icon fixed 2025-07-03 17:48:22 +08:00
Joel
a0af33e945 Merge branch 'main' into feat/plugin-auto-upgrade-fe 2025-07-03 17:34:06 +08:00
Joel
8d8220b06c fix: utc time show 2025-06-30 18:28:09 +08:00
Joel
0625d6a361 fix: not use local time 2025-06-30 18:22:40 +08:00
Joel
63a1a1077e Merge branch 'main' into feat/plugin-auto-upgrade-fe 2025-06-30 14:01:29 +08:00
Joel
0af646d947 fix: fetch installed plugin instead of all plugins 2025-06-27 19:35:18 +08:00
Joel
07c99745fa feat: handle downgrade install 2025-06-27 19:05:12 +08:00
Joel
afd0d31354 fix: not the same as 2025-06-27 12:01:32 +08:00
Joel
18bbf1165d feat: exculde call api 2025-06-27 11:53:14 +08:00
Joel
5f17edc77f feat: downgrade detect 2025-06-27 11:42:28 +08:00
Joel
836027cb33 chore: add auto update show config 2025-06-27 11:36:08 +08:00
Joel
f3cbfe2223 feat: config can save 2025-06-27 10:49:22 +08:00
Joel
bc1e4c88e0 feat: no data placeholder 2025-06-27 10:36:54 +08:00
Joel
d114485abd feat: pluging loading 2025-06-27 10:10:02 +08:00
Joel
3e8a4a66fe feat: api to refernce settings 2025-06-27 09:55:25 +08:00
Joel
4c583f3d9a feat: can select plugins 2025-06-26 15:31:50 +08:00
Joel
52b845a5bb feat: select box setting 2025-06-26 10:48:11 +08:00
Joel
38d1c85c57 main 2025-06-26 10:15:41 +08:00
Joel
c43d992f2b feat: fetch plugin list 2025-06-25 18:40:12 +08:00
Joel
1ff5969b92 feat: select tool template 2025-06-25 17:41:33 +08:00
Joel
93a560ee54 chore: ui and clear 2025-06-25 16:45:21 +08:00
Joel
2f241d932c chore: temp i18n 2025-06-24 16:29:54 +08:00
Joel
a0804786fd feat: downgrade modal i18n 2025-06-24 16:15:26 +08:00
Joel
c6fa8102eb feat: downgrade modal 2025-06-24 15:36:10 +08:00
Joel
7ec5816513 feat: show downgrade warning logic 2025-06-24 11:21:57 +08:00
Joel
825fbcc6f8 feat: auto update button 2025-06-24 11:04:04 +08:00
Joel
ccef71626d feat: show list and select 2025-06-23 18:31:21 +08:00
Joel
29cac85b12 feat: plugin no data 2025-06-23 18:09:32 +08:00
Joel
8b290ac7a1 feat: only choose 15 time 2025-06-23 16:45:48 +08:00
Joel
01cdffaa08 feat: plugins picker holder 2025-06-19 18:13:56 +08:00
Joel
3061280f7a fat: auto update mode 2025-06-19 17:56:53 +08:00
Joel
bc75d810c4 feat: choose time 2025-06-19 17:47:31 +08:00
Joel
dc5e974a78 feat: choose auto update description and i18n 2025-06-19 16:27:17 +08:00
Joel
baff25c160 feat: auto update strategy picker 2025-06-19 16:11:02 +08:00
Joel
42b6524954 feat: type config 2025-06-18 15:04:40 +08:00
158 changed files with 1492 additions and 260 deletions

View File

@@ -4,18 +4,21 @@ import cn from '@/utils/classnames'
type OptionListItemProps = {
isSelected: boolean
onClick: () => void
noAutoScroll?: boolean
} & React.LiHTMLAttributes<HTMLLIElement>
const OptionListItem: FC<OptionListItemProps> = ({
isSelected,
onClick,
noAutoScroll,
children,
}) => {
const listItemRef = useRef<HTMLLIElement>(null)
useEffect(() => {
if (isSelected)
if (isSelected && !noAutoScroll)
listItemRef.current?.scrollIntoView({ behavior: 'instant' })
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])
return (

View File

@@ -1,13 +1,18 @@
import React from 'react'
import { useTranslation } from 'react-i18next'
const Header = () => {
type Props = {
title?: string
}
const Header = ({
title,
}: Props) => {
const { t } = useTranslation()
return (
<div className='flex flex-col border-b-[0.5px] border-divider-regular'>
<div className='system-md-semibold flex items-center px-2 py-1.5 text-text-primary'>
{t('time.title.pickTime')}
{title || t('time.title.pickTime')}
</div>
</div>
)

View File

@@ -20,6 +20,9 @@ const TimePicker = ({
onChange,
onClear,
renderTrigger,
title,
minuteFilter,
popupClassName,
}: TimePickerProps) => {
const { t } = useTranslation()
const [isOpen, setIsOpen] = useState(false)
@@ -108,6 +111,15 @@ const TimePicker = ({
const displayValue = value?.format(timeFormat) || ''
const placeholderDate = isOpen && selectedTime ? selectedTime.format(timeFormat) : (placeholder || t('time.defaultPlaceholder'))
const inputElem = (
<input
className='system-xs-regular flex-1 cursor-pointer appearance-none truncate bg-transparent p-1
text-components-input-text-filled outline-none placeholder:text-components-input-text-placeholder'
readOnly
value={isOpen ? '' : displayValue}
placeholder={placeholderDate}
/>
)
return (
<PortalToFollowElem
open={isOpen}
@@ -115,18 +127,16 @@ const TimePicker = ({
placement='bottom-end'
>
<PortalToFollowElemTrigger>
{renderTrigger ? (renderTrigger()) : (
{renderTrigger ? (renderTrigger({
inputElem,
onClick: handleClickTrigger,
isOpen,
})) : (
<div
className='group flex w-[252px] cursor-pointer items-center gap-x-0.5 rounded-lg bg-components-input-bg-normal px-2 py-1 hover:bg-state-base-hover-alt'
onClick={handleClickTrigger}
>
<input
className='system-xs-regular flex-1 cursor-pointer appearance-none truncate bg-transparent p-1
text-components-input-text-filled outline-none placeholder:text-components-input-text-placeholder'
readOnly
value={isOpen ? '' : displayValue}
placeholder={placeholderDate}
/>
{inputElem}
<RiTimeLine className={cn(
'h-4 w-4 shrink-0 text-text-quaternary',
isOpen ? 'text-text-secondary' : 'group-hover:text-text-secondary',
@@ -142,14 +152,15 @@ const TimePicker = ({
</div>
)}
</PortalToFollowElemTrigger>
<PortalToFollowElemContent className='z-50'>
<PortalToFollowElemContent className={cn('z-50', popupClassName)}>
<div className='mt-1 w-[252px] rounded-xl border-[0.5px] border-components-panel-border bg-components-panel-bg shadow-lg shadow-shadow-shadow-5'>
{/* Header */}
<Header />
<Header title={title} />
{/* Time Options */}
<Options
selectedTime={selectedTime}
minuteFilter={minuteFilter}
handleSelectHour={handleSelectHour}
handleSelectMinute={handleSelectMinute}
handleSelectPeriod={handleSelectPeriod}

View File

@@ -5,6 +5,7 @@ import OptionListItem from '../common/option-list-item'
const Options: FC<TimeOptionsProps> = ({
selectedTime,
minuteFilter,
handleSelectHour,
handleSelectMinute,
handleSelectPeriod,
@@ -33,7 +34,7 @@ const Options: FC<TimeOptionsProps> = ({
{/* Minute */}
<ul className='no-scrollbar flex h-[208px] flex-col gap-y-0.5 overflow-y-auto pb-[184px]'>
{
minuteOptions.map((minute) => {
(minuteFilter ? minuteFilter(minuteOptions) : minuteOptions).map((minute) => {
const isSelected = selectedTime?.format('mm') === minute
return (
<OptionListItem
@@ -57,6 +58,7 @@ const Options: FC<TimeOptionsProps> = ({
key={period}
isSelected={isSelected}
onClick={handleSelectPeriod.bind(null, period)}
noAutoScroll // if choose PM which would hide(scrolled) AM that may make user confused that there's no am.
>
{period}
</OptionListItem>

View File

@@ -28,6 +28,7 @@ export type DatePickerProps = {
onClear: () => void
triggerWrapClassName?: string
renderTrigger?: (props: TriggerProps) => React.ReactNode
minuteFilter?: (minutes: string[]) => string[]
popupZIndexClassname?: string
}
@@ -47,13 +48,21 @@ export type DatePickerFooterProps = {
handleConfirmDate: () => void
}
export type TriggerParams = {
isOpen: boolean
inputElem: React.ReactNode
onClick: (e: React.MouseEvent) => void
}
export type TimePickerProps = {
value: Dayjs | undefined
timezone?: string
placeholder?: string
onChange: (date: Dayjs | undefined) => void
onClear: () => void
renderTrigger?: () => React.ReactNode
renderTrigger?: (props: TriggerParams) => React.ReactNode
title?: string
minuteFilter?: (minutes: string[]) => string[]
popupClassName?: string
}
export type TimePickerFooterProps = {
@@ -81,6 +90,7 @@ export type CalendarItemProps = {
export type TimeOptionsProps = {
selectedTime: Dayjs | undefined
minuteFilter?: (minutes: string[]) => string[]
handleSelectHour: (hour: string) => void
handleSelectMinute: (minute: string) => void
handleSelectPeriod: (period: Period) => void

View File

@@ -2,6 +2,7 @@ import dayjs, { type Dayjs } from 'dayjs'
import type { Day } from '../types'
import utc from 'dayjs/plugin/utc'
import timezone from 'dayjs/plugin/timezone'
import tz from '@/utils/timezone.json'
dayjs.extend(utc)
dayjs.extend(timezone)
@@ -78,3 +79,14 @@ export const getHourIn12Hour = (date: Dayjs) => {
export const getDateWithTimezone = (props: { date?: Dayjs, timezone?: string }) => {
return props.date ? dayjs.tz(props.date, props.timezone) : dayjs().tz(props.timezone)
}
// Asia/Shanghai -> UTC+8
const DEFAULT_OFFSET_STR = 'UTC+0'
export const convertTimezoneToOffsetStr = (timezone?: string) => {
if(!timezone)
return DEFAULT_OFFSET_STR
const tzItem = tz.find(item => item.value === timezone)
if(!tzItem)
return DEFAULT_OFFSET_STR
return `UTC${tzItem.name.charAt(0)}${tzItem.name.charAt(2)}`
}

View File

@@ -0,0 +1,7 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M28.0049 16C28.0049 20.4183 24.4231 24 20.0049 24C15.5866 24 12.0049 20.4183 12.0049 16C12.0049 11.5817 15.5866 8 20.0049 8C24.4231 8 28.0049 11.5817 28.0049 16Z" stroke="#676F83" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M4.00488 16H6.67155" stroke="#676F83" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M4.00488 9.33334H8.00488" stroke="#676F83" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M4.00488 22.6667H8.00488" stroke="#676F83" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M26 22L29.3333 25.3333" stroke="#676F83" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 823 B

View File

@@ -0,0 +1,4 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M5.46257 4.43262C7.21556 2.91688 9.5007 2 12 2C17.5228 2 22 6.47715 22 12C22 14.1361 21.3302 16.1158 20.1892 17.7406L17 12H20C20 7.58172 16.4183 4 12 4C9.84982 4 7.89777 4.84827 6.46023 6.22842L5.46257 4.43262ZM18.5374 19.5674C16.7844 21.0831 14.4993 22 12 22C6.47715 22 2 17.5228 2 12C2 9.86386 2.66979 7.88416 3.8108 6.25944L7 12H4C4 16.4183 7.58172 20 12 20C14.1502 20 16.1022 19.1517 17.5398 17.7716L18.5374 19.5674Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M16.3308 16H14.2915L13.6249 13.9476H10.3761L9.70846 16H7.66918L10.7759 7H13.2281L16.3308 16ZM10.8595 12.4622H13.1435L12.0378 9.05639H11.9673L10.8595 12.4622Z" fill="black"/>
</svg>

After

Width:  |  Height:  |  Size: 772 B

View File

@@ -89,4 +89,4 @@
]
},
"name": "Robot"
}
}

View File

@@ -86,4 +86,4 @@
]
},
"name": "User"
}
}

View File

@@ -26,4 +26,4 @@
]
},
"name": "ArCube1"
}
}

View File

@@ -35,4 +35,4 @@
]
},
"name": "Asterisk"
}
}

View File

@@ -176,4 +176,4 @@
]
},
"name": "AwsMarketplace"
}
}

View File

@@ -190,4 +190,4 @@
]
},
"name": "Azure"
}
}

View File

@@ -36,4 +36,4 @@
]
},
"name": "Buildings"
}
}

View File

@@ -36,4 +36,4 @@
]
},
"name": "Diamond"
}
}

View File

@@ -63,4 +63,4 @@
]
},
"name": "GoogleCloud"
}
}

View File

@@ -26,4 +26,4 @@
]
},
"name": "Group2"
}
}

View File

@@ -25,4 +25,4 @@
]
},
"name": "Keyframe"
}
}

View File

@@ -92,4 +92,4 @@
]
},
"name": "Sparkles"
}
}

View File

@@ -33,4 +33,4 @@
]
},
"name": "SparklesSoft"
}
}

View File

@@ -122,4 +122,4 @@
]
},
"name": "D"
}
}

View File

@@ -25,4 +25,4 @@
]
},
"name": "DiagonalDividingLine"
}
}

View File

@@ -59,4 +59,4 @@
]
},
"name": "Dify"
}
}

View File

@@ -337,4 +337,4 @@
]
},
"name": "Gdpr"
}
}

View File

@@ -33,4 +33,4 @@
]
},
"name": "Github"
}
}

View File

@@ -64,4 +64,4 @@
]
},
"name": "Highlight"
}
}

View File

@@ -118,4 +118,4 @@
]
},
"name": "Iso"
}
}

View File

@@ -25,4 +25,4 @@
]
},
"name": "Line3"
}
}

View File

@@ -35,4 +35,4 @@
]
},
"name": "Lock"
}
}

View File

@@ -34,4 +34,4 @@
]
},
"name": "MessageChatSquare"
}
}

View File

@@ -150,4 +150,4 @@
]
},
"name": "MultiPathRetrieval"
}
}

View File

@@ -143,4 +143,4 @@
]
},
"name": "NTo1Retrieval"
}
}

View File

@@ -80,4 +80,4 @@
]
},
"name": "Notion"
}
}

View File

@@ -935,4 +935,4 @@
]
},
"name": "Soc2"
}
}

View File

@@ -44,4 +44,4 @@
]
},
"name": "SparklesSoft"
}
}

View File

@@ -24,4 +24,4 @@
]
},
"name": "Triangle"
}
}

View File

@@ -178,4 +178,4 @@
]
},
"name": "Csv"
}
}

View File

@@ -166,4 +166,4 @@
]
},
"name": "Doc"
}
}

View File

@@ -175,4 +175,4 @@
]
},
"name": "Docx"
}
}

View File

@@ -175,4 +175,4 @@
]
},
"name": "Html"
}
}

View File

@@ -175,4 +175,4 @@
]
},
"name": "Json"
}
}

View File

@@ -141,4 +141,4 @@
]
},
"name": "Md"
}
}

View File

@@ -166,4 +166,4 @@
]
},
"name": "Pdf"
}
}

View File

@@ -177,4 +177,4 @@
]
},
"name": "Txt"
}
}

View File

@@ -196,4 +196,4 @@
]
},
"name": "Unknown"
}
}

View File

@@ -142,4 +142,4 @@
]
},
"name": "Xlsx"
}
}

View File

@@ -178,4 +178,4 @@
]
},
"name": "Yaml"
}
}

View File

@@ -113,4 +113,4 @@
]
},
"name": "Chunk"
}
}

View File

@@ -59,4 +59,4 @@
]
},
"name": "Collapse"
}
}

View File

@@ -35,4 +35,4 @@
]
},
"name": "GeneralType"
}
}

View File

@@ -33,4 +33,4 @@
]
},
"name": "LayoutRight2LineMod"
}
}

View File

@@ -53,4 +53,4 @@
]
},
"name": "ParentChildType"
}
}

View File

@@ -113,4 +113,4 @@
]
},
"name": "SelectionMod"
}
}

View File

@@ -34,4 +34,4 @@
]
},
"name": "Anthropic"
}
}

View File

@@ -1043,4 +1043,4 @@
]
},
"name": "AnthropicDark"
}
}

View File

@@ -1043,4 +1043,4 @@
]
},
"name": "AnthropicLight"
}
}

View File

@@ -536,4 +536,4 @@
]
},
"name": "AnthropicText"
}
}

View File

@@ -71,4 +71,4 @@
]
},
"name": "AzureOpenaiService"
}
}

View File

@@ -233,4 +233,4 @@
]
},
"name": "AzureOpenaiServiceText"
}
}

View File

@@ -177,4 +177,4 @@
]
},
"name": "Azureai"
}
}

View File

@@ -240,4 +240,4 @@
]
},
"name": "AzureaiText"
}
}

View File

@@ -73,4 +73,4 @@
]
},
"name": "Baichuan"
}
}

View File

@@ -153,4 +153,4 @@
]
},
"name": "BaichuanText"
}
}

View File

@@ -69,4 +69,4 @@
]
},
"name": "Chatglm"
}
}

View File

@@ -132,4 +132,4 @@
]
},
"name": "ChatglmText"
}
}

View File

@@ -109,4 +109,4 @@
]
},
"name": "Cohere"
}
}

View File

@@ -87,4 +87,4 @@
]
},
"name": "CohereText"
}
}

View File

@@ -48,4 +48,4 @@
]
},
"name": "Gpt3"
}
}

View File

@@ -48,4 +48,4 @@
]
},
"name": "Gpt4"
}
}

View File

@@ -155,4 +155,4 @@
]
},
"name": "Huggingface"
}
}

View File

@@ -319,4 +319,4 @@
]
},
"name": "HuggingfaceText"
}
}

View File

@@ -347,4 +347,4 @@
]
},
"name": "HuggingfaceTextHub"
}
}

View File

@@ -41,4 +41,4 @@
]
},
"name": "IflytekSpark"
}
}

View File

@@ -184,4 +184,4 @@
]
},
"name": "IflytekSparkText"
}
}

View File

@@ -95,4 +95,4 @@
]
},
"name": "IflytekSparkTextCn"
}
}

View File

@@ -32,4 +32,4 @@
]
},
"name": "Jina"
}
}

View File

@@ -79,4 +79,4 @@
]
},
"name": "JinaText"
}
}

View File

@@ -104,4 +104,4 @@
]
},
"name": "Localai"
}
}

View File

@@ -167,4 +167,4 @@
]
},
"name": "LocalaiText"
}
}

View File

@@ -73,4 +73,4 @@
]
},
"name": "Microsoft"
}
}

View File

@@ -34,4 +34,4 @@
]
},
"name": "OpenaiBlack"
}
}

View File

@@ -34,4 +34,4 @@
]
},
"name": "OpenaiBlue"
}
}

View File

@@ -34,4 +34,4 @@
]
},
"name": "OpenaiGreen"
}
}

View File

@@ -34,4 +34,4 @@
]
},
"name": "OpenaiTeal"
}
}

View File

@@ -74,4 +74,4 @@
]
},
"name": "OpenaiText"
}
}

View File

@@ -23,4 +23,4 @@
]
},
"name": "OpenaiTransparent"
}
}

View File

@@ -34,4 +34,4 @@
]
},
"name": "OpenaiViolet"
}
}

File diff suppressed because one or more lines are too long

View File

@@ -80,4 +80,4 @@
]
},
"name": "Openllm"
}
}

View File

@@ -140,4 +140,4 @@
]
},
"name": "OpenllmText"
}
}

View File

@@ -36,4 +36,4 @@
]
},
"name": "Replicate"
}
}

View File

@@ -113,4 +113,4 @@
]
},
"name": "ReplicateText"
}
}

View File

@@ -173,4 +173,4 @@
]
},
"name": "XorbitsInference"
}
}

View File

@@ -326,4 +326,4 @@
]
},
"name": "XorbitsInferenceText"
}
}

View File

@@ -50,4 +50,4 @@
]
},
"name": "Zhipuai"
}
}

View File

@@ -41,4 +41,4 @@
]
},
"name": "ZhipuaiText"
}
}

View File

@@ -59,4 +59,4 @@
]
},
"name": "ZhipuaiTextCn"
}
}

View File

@@ -26,4 +26,4 @@
]
},
"name": "Checked"
}
}

View File

@@ -78,4 +78,4 @@
]
},
"name": "DefaultToolIcon"
}
}

Some files were not shown because too many files have changed in this diff Show More