feat(setting_page): 添加供应商后清空输入框
- 修改 add_provider 函数,返回清空后的输入框值 - 更新 add_button.click 事件处理,添加清空输入框的输出
This commit is contained in:
parent
74ae5e1426
commit
374b124cf8
@ -30,7 +30,7 @@ def setting_page():
|
||||
session.add(new_provider)
|
||||
session.commit()
|
||||
session.refresh(new_provider)
|
||||
return get_providers()
|
||||
return get_providers(), "", "", "" # 返回清空后的输入框值
|
||||
except Exception as e:
|
||||
raise gr.Error(f"添加失败: {str(e)}")
|
||||
|
||||
@ -108,7 +108,7 @@ def setting_page():
|
||||
add_button.click(
|
||||
fn=add_provider,
|
||||
inputs=[model_id_input, base_url_input, api_key_input],
|
||||
outputs=[provider_table]
|
||||
outputs=[provider_table, model_id_input, base_url_input, api_key_input] # 添加清空输入框的输出
|
||||
)
|
||||
|
||||
provider_table.select(select_record, [], [], show_progress="hidden")
|
||||
|
Loading…
x
Reference in New Issue
Block a user