mirror of
https://github.com/langgenius/dify.git
synced 2026-04-26 10:16:40 +08:00
fix: Update button styles and improve file size validation in breadcrumb and item components
This commit is contained in:
parent
5e2b60664f
commit
e911a4e719
@ -34,7 +34,7 @@ const Bucket = ({
|
|||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
type='button'
|
type='button'
|
||||||
className='flex size-6 cursor-pointer items-center justify-center rounded-md hover:bg-state-base-hover'
|
className='flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-md hover:bg-state-base-hover'
|
||||||
onClick={handleBackToBucketList}
|
onClick={handleBackToBucketList}
|
||||||
>
|
>
|
||||||
<BucketsGray />
|
<BucketsGray />
|
||||||
@ -44,16 +44,17 @@ const Bucket = ({
|
|||||||
<button
|
<button
|
||||||
type='button'
|
type='button'
|
||||||
className={cn(
|
className={cn(
|
||||||
'rounded-md px-[5px] py-1',
|
'max-w-full shrink truncate rounded-md px-[5px] py-1',
|
||||||
isActive ? 'system-sm-medium text-text-secondary' : 'system-sm-regular text-text-tertiary',
|
isActive ? 'system-sm-medium text-text-secondary' : 'system-sm-regular text-text-tertiary',
|
||||||
!disabled && 'hover:bg-state-base-hover',
|
!disabled && 'hover:bg-state-base-hover',
|
||||||
)}
|
)}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
onClick={handleClickItem}
|
onClick={handleClickItem}
|
||||||
|
title={bucketName}
|
||||||
>
|
>
|
||||||
{bucketName}
|
{bucketName}
|
||||||
</button>
|
</button>
|
||||||
{showSeparator && <span className='system-xs-regular text-divider-deep'>/</span>}
|
{showSeparator && <span className='system-xs-regular shrink-0 text-divider-deep'>/</span>}
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -66,7 +66,7 @@ const Breadcrumbs = ({
|
|||||||
}, [dataSourceStore, prefix])
|
}, [dataSourceStore, prefix])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='flex grow items-center py-1'>
|
<div className='flex grow items-center overflow-hidden py-1'>
|
||||||
{showSearchResult && (
|
{showSearchResult && (
|
||||||
<div className='system-sm-medium text-test-secondary px-[5px] py-1'>
|
<div className='system-sm-medium text-test-secondary px-[5px] py-1'>
|
||||||
{t('datasetPipeline.onlineDrive.breadcrumbs.searchResult', {
|
{t('datasetPipeline.onlineDrive.breadcrumbs.searchResult', {
|
||||||
@ -81,7 +81,7 @@ const Breadcrumbs = ({
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{!showSearchResult && !isRoot && (
|
{!showSearchResult && !isRoot && (
|
||||||
<div className='flex items-center gap-x-0.5'>
|
<div className='flex w-full items-center gap-x-0.5 overflow-hidden'>
|
||||||
{bucket && (
|
{bucket && (
|
||||||
<Bucket
|
<Bucket
|
||||||
bucketName={bucket}
|
bucketName={bucket}
|
||||||
|
|||||||
@ -28,16 +28,17 @@ const BreadcrumbItem = ({
|
|||||||
<button
|
<button
|
||||||
type='button'
|
type='button'
|
||||||
className={cn(
|
className={cn(
|
||||||
'rounded-md px-[5px] py-1',
|
'max-w-full shrink truncate rounded-md px-[5px] py-1',
|
||||||
isActive ? 'system-sm-medium text-text-secondary' : 'system-sm-regular text-text-tertiary',
|
isActive ? 'system-sm-medium text-text-secondary' : 'system-sm-regular text-text-tertiary',
|
||||||
!disabled && 'hover:bg-state-base-hover',
|
!disabled && 'hover:bg-state-base-hover',
|
||||||
)}
|
)}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
onClick={handleClickItem}
|
onClick={handleClickItem}
|
||||||
|
title={name}
|
||||||
>
|
>
|
||||||
{name}
|
{name}
|
||||||
</button>
|
</button>
|
||||||
{showSeparator && <span className='system-xs-regular text-divider-deep'>/</span>}
|
{showSeparator && <span className='system-xs-regular shrink-0 text-divider-deep'>/</span>}
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -85,7 +85,7 @@ const Item = ({
|
|||||||
>
|
>
|
||||||
{file.displayName}
|
{file.displayName}
|
||||||
</span>
|
</span>
|
||||||
{!isFolder && file.size && (
|
{!isFolder && typeof file.size === 'number' && (
|
||||||
<span className='system-xs-regular shrink-0 text-text-tertiary'>{formatFileSize(file.size)}</span>
|
<span className='system-xs-regular shrink-0 text-text-tertiary'>{formatFileSize(file.size)}</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -14,16 +14,16 @@ const CreateAppCard = () => {
|
|||||||
return (
|
return (
|
||||||
<div className='flex h-[166px] flex-col gap-y-0.5 rounded-xl bg-background-default-dimmed'>
|
<div className='flex h-[166px] flex-col gap-y-0.5 rounded-xl bg-background-default-dimmed'>
|
||||||
<div className='flex grow flex-col items-center justify-center p-2'>
|
<div className='flex grow flex-col items-center justify-center p-2'>
|
||||||
<Option
|
|
||||||
href={'/datasets/create-from-pipeline'}
|
|
||||||
Icon={RiFunctionAddLine}
|
|
||||||
text={t('dataset.createFromPipeline')}
|
|
||||||
/>
|
|
||||||
<Option
|
<Option
|
||||||
href={'/datasets/create'}
|
href={'/datasets/create'}
|
||||||
Icon={RiAddLine}
|
Icon={RiAddLine}
|
||||||
text={t('dataset.createDataset')}
|
text={t('dataset.createDataset')}
|
||||||
/>
|
/>
|
||||||
|
<Option
|
||||||
|
href={'/datasets/create-from-pipeline'}
|
||||||
|
Icon={RiFunctionAddLine}
|
||||||
|
text={t('dataset.createFromPipeline')}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className='border-t-[0.5px] border-divider-subtle p-2'>
|
<div className='border-t-[0.5px] border-divider-subtle p-2'>
|
||||||
<Option
|
<Option
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user