简化界面:删除导入当前配置功能
- 移除 ImportConfigModal 组件及相关文件 - 删除头部的导入当前配置按钮 - 移除 importCurrentConfig 相关的 API 和 IPC 处理器 - 保留 importCurrentConfigAsDefault 功能用于首次启动 - 界面更简洁,专注核心功能:添加、编辑、切换、删除供应商 - 减少用户困惑,因为自动创建的默认供应商已经满足大部分需求
This commit is contained in:
@@ -1,67 +0,0 @@
|
||||
import React, { useState } from 'react'
|
||||
import './AddProviderModal.css'
|
||||
|
||||
interface ImportConfigModalProps {
|
||||
onImport: (name: string) => void
|
||||
onClose: () => void
|
||||
}
|
||||
|
||||
const ImportConfigModal: React.FC<ImportConfigModalProps> = ({ onImport, onClose }) => {
|
||||
const [name, setName] = useState('')
|
||||
const [error, setError] = useState('')
|
||||
|
||||
const handleSubmit = (e: React.FormEvent) => {
|
||||
e.preventDefault()
|
||||
setError('')
|
||||
|
||||
if (!name.trim()) {
|
||||
setError('请输入供应商名称')
|
||||
return
|
||||
}
|
||||
|
||||
onImport(name.trim())
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="modal-overlay">
|
||||
<div className="modal-content">
|
||||
<h2>导入当前配置</h2>
|
||||
|
||||
<p style={{marginBottom: '1.5rem', color: '#666', fontSize: '0.9rem'}}>
|
||||
将当前的 <code>~/.claude/settings.json</code> 配置文件导入为一个新的供应商。
|
||||
<br />
|
||||
<strong>注意:</strong>这不会修改您当前的配置文件。
|
||||
</p>
|
||||
|
||||
{error && <div className="error-message">{error}</div>}
|
||||
|
||||
<form onSubmit={handleSubmit}>
|
||||
<div className="form-group">
|
||||
<label htmlFor="name">供应商名称 *</label>
|
||||
<input
|
||||
type="text"
|
||||
id="name"
|
||||
name="name"
|
||||
value={name}
|
||||
onChange={(e) => setName(e.target.value)}
|
||||
placeholder="例如:我的当前配置"
|
||||
required
|
||||
autoFocus
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="form-actions">
|
||||
<button type="button" className="cancel-btn" onClick={onClose}>
|
||||
取消
|
||||
</button>
|
||||
<button type="submit" className="submit-btn">
|
||||
导入
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default ImportConfigModal
|
||||
Reference in New Issue
Block a user