|
@@ -16,10 +16,7 @@ import Doc from './Doc'
|
|
|
import TabSliderNew from '@/app/components/base/tab-slider-new'
|
|
|
import TagManagementModal from '@/app/components/base/tag-management'
|
|
|
import TagFilter from '@/app/components/base/tag-management/filter'
|
|
|
-import Button from '@/app/components/base/button'
|
|
|
import Input from '@/app/components/base/input'
|
|
|
-import { ApiConnectionMod } from '@/app/components/base/icons/src/vender/solid/development'
|
|
|
-import CheckboxWithLabel from '@/app/components/datasets/create/website/base/checkbox-with-label'
|
|
|
|
|
|
// Services
|
|
|
import { fetchDatasetApiBaseUrl } from '@/service/datasets'
|
|
@@ -108,15 +105,18 @@ const Container = () => {
|
|
|
const [optionsDept, setOptionsDept] = useState<any>([])
|
|
|
useEffect(() => {
|
|
|
fetchDepts({
|
|
|
- url: '/xxx',
|
|
|
- params: {
|
|
|
- page: 1,
|
|
|
- limit: 99999,
|
|
|
- },
|
|
|
+ url: '/depts',
|
|
|
}).then((res: any) => {
|
|
|
setOptionsDept(res.data || [])
|
|
|
})
|
|
|
}, [])
|
|
|
+ const [authType, setAuthType] = useState<any>('')
|
|
|
+ const optionsAuthType = [
|
|
|
+ { name: '创建', value: '1' },
|
|
|
+ { name: '编辑', value: '2' },
|
|
|
+ { name: '授权编辑', value: '3' },
|
|
|
+ { name: '授权可见', value: '4' },
|
|
|
+ ]
|
|
|
return (
|
|
|
<div ref={containerRef} className='scroll-container relative flex grow flex-col overflow-y-auto bg-background-body'>
|
|
|
<div className='sticky top-0 z-10 flex flex-wrap justify-between gap-y-2 bg-background-body px-12 pb-2 pt-4 leading-[56px]'>
|
|
@@ -127,6 +127,16 @@ const Container = () => {
|
|
|
/>
|
|
|
{activeTab === 'dataset' && (
|
|
|
<div className='flex items-center justify-center gap-2'>
|
|
|
+ <SimpleSelect
|
|
|
+ wrapperClassName="h-[32px] w-[200px]"
|
|
|
+ defaultValue={authType}
|
|
|
+ onSelect={(i) => {
|
|
|
+ setAuthType(i.value)
|
|
|
+ }}
|
|
|
+ items={optionsAuthType}
|
|
|
+ allowSearch={false}
|
|
|
+ placeholder="请选择权限类型"
|
|
|
+ />
|
|
|
<AntdTreeSelect
|
|
|
showSearch
|
|
|
style={{ width: '200px' }}
|
|
@@ -137,7 +147,7 @@ const Container = () => {
|
|
|
treeDefaultExpandAll
|
|
|
onChange={v => setDept(v || '')}
|
|
|
treeData={optionsDept}
|
|
|
- fieldNames={{ label: 'name', value: 'id' }}
|
|
|
+ fieldNames={{ label: 'dept_name', value: 'dept_id' }}
|
|
|
/>
|
|
|
<SimpleSelect
|
|
|
wrapperClassName="h-[32px] w-[200px]"
|
|
@@ -148,15 +158,16 @@ const Container = () => {
|
|
|
}}
|
|
|
items={optionsType}
|
|
|
allowSearch={false}
|
|
|
+ placeholder="请选择类型"
|
|
|
/>
|
|
|
- {isCurrentWorkspaceOwner && <CheckboxWithLabel
|
|
|
- isChecked={includeAll}
|
|
|
- onChange={toggleIncludeAll}
|
|
|
- label={t('dataset.allKnowledge')}
|
|
|
- labelClassName='system-md-regular text-text-secondary'
|
|
|
- className='mr-2'
|
|
|
- tooltip={t('dataset.allKnowledgeDescription') as string}
|
|
|
- />}
|
|
|
+ {/* {isCurrentWorkspaceOwner && <CheckboxWithLabel */}
|
|
|
+ {/* isChecked={includeAll} */}
|
|
|
+ {/* onChange={toggleIncludeAll} */}
|
|
|
+ {/* label={t('dataset.allKnowledge')} */}
|
|
|
+ {/* labelClassName='system-md-regular text-text-secondary' */}
|
|
|
+ {/* className='mr-2' */}
|
|
|
+ {/* tooltip={t('dataset.allKnowledgeDescription') as string} */}
|
|
|
+ {/* />} */}
|
|
|
<TagFilter type='knowledge' value={tagFilterValue} onChange={handleTagsChange} />
|
|
|
<Input
|
|
|
showLeftIcon
|
|
@@ -166,21 +177,21 @@ const Container = () => {
|
|
|
onChange={e => handleKeywordsChange(e.target.value)}
|
|
|
onClear={() => handleKeywordsChange('')}
|
|
|
/>
|
|
|
- <div className="h-4 w-[1px] bg-divider-regular" />
|
|
|
- <Button
|
|
|
- className='shadows-shadow-xs gap-0.5'
|
|
|
- onClick={() => setShowExternalApiPanel(true)}
|
|
|
- >
|
|
|
- <ApiConnectionMod className='h-4 w-4 text-components-button-secondary-text' />
|
|
|
- <div className='system-sm-medium flex items-center justify-center gap-1 px-0.5 text-components-button-secondary-text'>{t('dataset.externalAPIPanelTitle')}</div>
|
|
|
- </Button>
|
|
|
+ {/* <div className="h-4 w-[1px] bg-divider-regular" /> */}
|
|
|
+ {/* <Button */}
|
|
|
+ {/* className='shadows-shadow-xs gap-0.5' */}
|
|
|
+ {/* onClick={() => setShowExternalApiPanel(true)} */}
|
|
|
+ {/* > */}
|
|
|
+ {/* <ApiConnectionMod className='h-4 w-4 text-components-button-secondary-text' /> */}
|
|
|
+ {/* <div className='system-sm-medium flex items-center justify-center gap-1 px-0.5 text-components-button-secondary-text'>{t('dataset.externalAPIPanelTitle')}</div> */}
|
|
|
+ {/* </Button> */}
|
|
|
</div>
|
|
|
)}
|
|
|
{activeTab === 'api' && data && <ApiServer apiBaseUrl={data.api_base_url || ''} />}
|
|
|
</div>
|
|
|
{activeTab === 'dataset' && (
|
|
|
<>
|
|
|
- <Datasets containerRef={containerRef} tags={tagIDs} keywords={searchKeywords} includeAll={includeAll} type={searchType} dept={dept} />
|
|
|
+ <Datasets containerRef={containerRef} tags={tagIDs} keywords={searchKeywords} includeAll={includeAll} type={searchType} dept={dept} authType={authType} />
|
|
|
<DatasetFooter />
|
|
|
{showTagManagementModal && (
|
|
|
<TagManagementModal type='knowledge' show={showTagManagementModal} />
|