fix(ui): 完善控制台列表并优化企业中心与个人操作
This commit is contained in:
@@ -133,7 +133,7 @@ const originInputs = {
|
||||
model_mapping: '',
|
||||
status_code_mapping: '',
|
||||
models: [],
|
||||
auto_ban: 1,
|
||||
auto_ban: true,
|
||||
test_model: '',
|
||||
groups: ['default'],
|
||||
priority: 0,
|
||||
@@ -195,7 +195,6 @@ const EditChannelModal = (props) => {
|
||||
const [batch, setBatch] = useState(false);
|
||||
const [multiToSingle, setMultiToSingle] = useState(false);
|
||||
const [multiKeyMode, setMultiKeyMode] = useState('random');
|
||||
const [autoBan, setAutoBan] = useState(true);
|
||||
const [inputs, setInputs] = useState(originInputs);
|
||||
const [originModelOptions, setOriginModelOptions] = useState([]);
|
||||
const [modelOptions, setModelOptions] = useState([]);
|
||||
@@ -552,7 +551,6 @@ const EditChannelModal = (props) => {
|
||||
// 重置手动输入模式状态
|
||||
setUseManualInput(false);
|
||||
}
|
||||
//setAutoBan
|
||||
};
|
||||
|
||||
const loadChannel = async () => {
|
||||
@@ -757,6 +755,7 @@ const EditChannelModal = (props) => {
|
||||
if (!data.fallback_primary_attempts) data.fallback_primary_attempts = 1;
|
||||
if (!data.fallback_hop_attempts) data.fallback_hop_attempts = 1;
|
||||
|
||||
data.auto_ban = Boolean(data.auto_ban ?? originInputs.auto_ban);
|
||||
setInputs(data);
|
||||
if (formApiRef.current) {
|
||||
formApiRef.current.setValues(data);
|
||||
@@ -768,11 +767,6 @@ const EditChannelModal = (props) => {
|
||||
data.work_hours_timezone || 'Asia/Shanghai',
|
||||
);
|
||||
}
|
||||
if (data.auto_ban === 0) {
|
||||
setAutoBan(false);
|
||||
} else {
|
||||
setAutoBan(true);
|
||||
}
|
||||
// 同步企业账户状态
|
||||
setIsEnterpriseAccount(data.is_enterprise_account || false);
|
||||
setBasicModels(getChannelModels(data.type));
|
||||
@@ -3192,11 +3186,9 @@ const EditChannelModal = (props) => {
|
||||
label={t('是否自动禁用')}
|
||||
checkedText={t('开')}
|
||||
uncheckedText={t('关')}
|
||||
onChange={(value) => setAutoBan(value)}
|
||||
extraText={t(
|
||||
'仅当自动禁用开启时有效,关闭后不会自动禁用该渠道',
|
||||
)}
|
||||
initValue={autoBan}
|
||||
/>
|
||||
|
||||
<Form.TextArea
|
||||
|
||||
Reference in New Issue
Block a user