Merge #8 into develop_web from feature/20251219_zy

feat(web): api method readonly

* feature/20251219_zy: (1 commits)
  feat(web): api method readonly

Signed-off-by: zhaoying <zhaoying@redbearai.com>
Merged-by: zhaoying <zhaoying@redbearai.com>

CR-link: https://codeup.aliyun.com/redbearai/python/redbear-mem-open/change/8
This commit is contained in:
赵莹
2025-12-18 13:35:11 +08:00

View File

@@ -15,7 +15,7 @@ import { maskApiKeys } from '@/utils/apiKeyReplacer'
const Api: FC<{ application: Application | null }> = ({ application }) => {
const { t } = useTranslation();
const [activeMethods, setActiveMethod] = useState(['GET']);
const activeMethods = ['GET'];
const { message, modal } = App.useApp()
const copyContent = window.location.origin + '/v1/chat'
const apiKeyModalRef = useRef<ApiKeyModalRef>(null);
@@ -86,7 +86,7 @@ const Api: FC<{ application: Application | null }> = ({ application }) => {
// 计算total_requests总数
const totalRequests = apiKeyList.reduce((total, item) => total + item.total_requests, 0);
return (
<div className="rb:w-[1000px] rb:mt-5 rb:pb-5 rb:mx-auto">
<div className="rb:w-250 rb:mt-5 rb:pb-5 rb:mx-auto">
<Space size={20} direction="vertical" style={{width: '100%'}}>
<Card
title={t('application.endpointConfiguration')}
@@ -95,7 +95,7 @@ const Api: FC<{ application: Application | null }> = ({ application }) => {
<div className="rb:p-[20px_20px_24px_20px] rb:bg-[#F0F3F8] rb:border rb:border-[#DFE4ED] rb:rounded-lg">
<Space size={8}>
{['GET', 'POST', 'PUT', 'DELETE'].map((method) => (
<Button key={method} type={activeMethods.includes(method) ? 'primary' : 'default'} onClick={() => setActiveMethod(prev => activeMethods.includes(method) ? prev.filter(m => m !== method) : [...prev, method])}>
<Button key={method} type={activeMethods.includes(method) ? 'primary' : 'default'}>
{method}
</Button>
))}