chore(web): new lint setup (#30020)

Co-authored-by: yyh <yuanyouhuilyz@gmail.com>
This commit is contained in:
Stephen Zhou
2025-12-23 16:58:55 +08:00
committed by GitHub
parent 9701a2994b
commit f2842da397
3356 changed files with 85046 additions and 81278 deletions

View File

@ -1,17 +1,17 @@
import React, { useState } from 'react'
import { useTranslation } from 'react-i18next'
import type { CreateExternalAPIReq } from '../declarations'
import type { ExternalAPIItem } from '@/models/datasets'
import {
RiDeleteBinLine,
RiEditLine,
} from '@remixicon/react'
import type { CreateExternalAPIReq } from '../declarations'
import type { ExternalAPIItem } from '@/models/datasets'
import { checkUsageExternalAPI, deleteExternalAPI, fetchExternalAPI, updateExternalAPI } from '@/service/datasets'
import React, { useState } from 'react'
import { useTranslation } from 'react-i18next'
import ActionButton from '@/app/components/base/action-button'
import Confirm from '@/app/components/base/confirm'
import { ApiConnectionMod } from '@/app/components/base/icons/src/vender/solid/development'
import { useExternalKnowledgeApi } from '@/context/external-knowledge-api-context'
import { useModalContext } from '@/context/modal-context'
import ActionButton from '@/app/components/base/action-button'
import Confirm from '@/app/components/base/confirm'
import { checkUsageExternalAPI, deleteExternalAPI, fetchExternalAPI, updateExternalAPI } from '@/service/datasets'
type ExternalKnowledgeAPICardProps = {
api: ExternalAPIItem
@ -109,24 +109,24 @@ const ExternalKnowledgeAPICard: React.FC<ExternalKnowledgeAPICardProps> = ({ api
bg-components-panel-on-panel-item-bg p-2
pl-3 ${isHovered ? 'border-state-destructive-border bg-state-destructive-hover' : ''}`}
>
<div className='flex grow flex-col items-start justify-center gap-1.5 py-1'>
<div className='flex items-center gap-1 self-stretch text-text-secondary'>
<ApiConnectionMod className='h-4 w-4' />
<div className='system-sm-medium'>{api.name}</div>
<div className="flex grow flex-col items-start justify-center gap-1.5 py-1">
<div className="flex items-center gap-1 self-stretch text-text-secondary">
<ApiConnectionMod className="h-4 w-4" />
<div className="system-sm-medium">{api.name}</div>
</div>
<div className='system-xs-regular self-stretch text-text-tertiary'>{api.settings.endpoint}</div>
<div className="system-xs-regular self-stretch text-text-tertiary">{api.settings.endpoint}</div>
</div>
<div className='flex items-start gap-1'>
<div className="flex items-start gap-1">
<ActionButton onClick={handleEditClick}>
<RiEditLine className='h-4 w-4 text-text-tertiary hover:text-text-secondary' />
<RiEditLine className="h-4 w-4 text-text-tertiary hover:text-text-secondary" />
</ActionButton>
<ActionButton
className='hover:bg-state-destructive-hover'
className="hover:bg-state-destructive-hover"
onClick={handleDeleteClick}
onMouseEnter={() => setIsHovered(true)}
onMouseLeave={() => setIsHovered(false)}
>
<RiDeleteBinLine className='h-4 w-4 text-text-tertiary hover:text-text-destructive' />
<RiDeleteBinLine className="h-4 w-4 text-text-tertiary hover:text-text-destructive" />
</ActionButton>
</div>
</div>
@ -139,7 +139,7 @@ const ExternalKnowledgeAPICard: React.FC<ExternalKnowledgeAPICardProps> = ({ api
? `${t('dataset.deleteExternalAPIConfirmWarningContent.content.front')} ${usageCount} ${t('dataset.deleteExternalAPIConfirmWarningContent.content.end')}`
: t('dataset.deleteExternalAPIConfirmWarningContent.noConnectionContent')
}
type='warning'
type="warning"
onConfirm={handleConfirmDelete}
onCancel={() => setShowConfirm(false)}
/>