添加供应商编辑功能和密码显示切换
- 为供应商列表添加启用和编辑按钮 - 创建EditProviderModal组件支持编辑供应商信息 - 实现updateProvider API接口 - 为API Key输入框添加密码显示/隐藏功能,使用SVG图标 - 更新预设供应商配置为YesCode和PackyCode - 移除model字段,简化供应商配置
This commit is contained in:
@@ -8,6 +8,7 @@ interface ProviderListProps {
|
||||
statuses: Record<string, ProviderStatus>
|
||||
onSwitch: (id: string) => void
|
||||
onDelete: (id: string) => void
|
||||
onEdit: (id: string) => void
|
||||
}
|
||||
|
||||
const ProviderList: React.FC<ProviderListProps> = ({
|
||||
@@ -15,7 +16,8 @@ const ProviderList: React.FC<ProviderListProps> = ({
|
||||
currentProviderId,
|
||||
statuses,
|
||||
onSwitch,
|
||||
onDelete
|
||||
onDelete,
|
||||
onEdit
|
||||
}) => {
|
||||
const formatResponseTime = (time: number) => {
|
||||
if (time < 0) return '-'
|
||||
@@ -77,6 +79,19 @@ const ProviderList: React.FC<ProviderListProps> = ({
|
||||
</div>
|
||||
|
||||
<div className="provider-actions">
|
||||
<button
|
||||
className="enable-btn"
|
||||
onClick={() => onSwitch(provider.id)}
|
||||
disabled={!status?.isOnline || isCurrent}
|
||||
>
|
||||
启用
|
||||
</button>
|
||||
<button
|
||||
className="edit-btn"
|
||||
onClick={() => onEdit(provider.id)}
|
||||
>
|
||||
编辑
|
||||
</button>
|
||||
<button
|
||||
className="delete-btn"
|
||||
onClick={() => onDelete(provider.id)}
|
||||
|
||||
Reference in New Issue
Block a user