Skip to content

Commit

Permalink
feat(ui): show available models for air theme (#1595)
Browse files Browse the repository at this point in the history
* feat(ui): air 主题显示可用模型

* chore: 改为全角括号
  • Loading branch information
LeoQuote authored Jul 4, 2024
1 parent ec6ad24 commit 273be55
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions web/air/src/components/PersonalSetting.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const PersonalSetting = () => {
const [countdown, setCountdown] = useState(30);
const [affLink, setAffLink] = useState('');
const [systemToken, setSystemToken] = useState('');
// const [models, setModels] = useState([]);
const [models, setModels] = useState([]);
const [openTransfer, setOpenTransfer] = useState(false);
const [transferAmount, setTransferAmount] = useState(0);

Expand All @@ -72,7 +72,7 @@ const PersonalSetting = () => {
console.log(userState);
}
);
// loadModels().then();
loadModels().then();
getAffLink().then();
setTransferAmount(getQuotaPerUnit());
}, []);
Expand Down Expand Up @@ -127,16 +127,16 @@ const PersonalSetting = () => {
}
};

// const loadModels = async () => {
// let res = await API.get(`/api/user/models`);
// const { success, message, data } = res.data;
// if (success) {
// setModels(data);
// console.log(data);
// } else {
// showError(message);
// }
// };
const loadModels = async () => {
let res = await API.get(`/api/user/available_models`);
const { success, message, data } = res.data;
if (success) {
setModels(data);
console.log(data);
} else {
showError(message);
}
};

const handleAffLinkClick = async (e) => {
e.target.select();
Expand Down Expand Up @@ -344,7 +344,7 @@ const PersonalSetting = () => {
}
>
<Typography.Title heading={6}>调用信息</Typography.Title>
{/* <Typography.Title heading={6}>可用模型</Typography.Title>
<p>可用模型(可点击复制)</p>
<div style={{ marginTop: 10 }}>
<Space wrap>
{models.map((model) => (
Expand All @@ -355,7 +355,7 @@ const PersonalSetting = () => {
</Tag>
))}
</Space>
</div> */}
</div>
</Card>
{/* <Card
footer={
Expand Down

0 comments on commit 273be55

Please sign in to comment.