feat: now able to limit ip range for token now (close #1275)

This commit is contained in:
JustSong
2024-04-05 10:09:16 +08:00
parent f02c7138ea
commit c49778c254
10 changed files with 78 additions and 6 deletions

View File

@@ -2,6 +2,9 @@
> 每个文件夹代表一个主题,欢迎提交你的主题
> [!WARNING]
> 不是每一个主题都及时同步了所有功能,由于精力有限,优先更新默认主题,其他主题欢迎 & 期待 PR
## 提交新的主题
> 欢迎在页面底部保留你和 One API 的版权信息以及指向链接

View File

@@ -15,7 +15,8 @@ const EditToken = () => {
remain_quota: isEdit ? 0 : 500000,
expired_time: -1,
unlimited_quota: false,
models: []
models: [],
subnet: "",
};
const [inputs, setInputs] = useState(originInputs);
const { name, remain_quota, expired_time, unlimited_quota } = inputs;
@@ -153,6 +154,16 @@ const EditToken = () => {
options={modelOptions}
/>
</Form.Field>
<Form.Field>
<Form.Input
label='IP 限制'
name='subnet'
placeholder={'请输入允许访问的网段例如192.168.0.0/24'}
onChange={handleInputChange}
value={inputs.subnet}
autoComplete='new-password'
/>
</Form.Field>
<Form.Field>
<Form.Input
label='过期时间'