🔖 chore: add chat image request proxy address

This commit is contained in:
MartialBE
2024-05-29 04:01:28 +08:00
parent 3d8a51e139
commit b5a4283b28
11 changed files with 76 additions and 53 deletions

View File

@@ -35,7 +35,8 @@ const OperationSetting = () => {
RetryCooldownSeconds: 0,
MjNotifyEnabled: '',
ChatCacheEnabled: '',
ChatCacheExpireMinute: 5
ChatCacheExpireMinute: 5,
ChatImageRequestProxy: ''
});
const [originInputs, setOriginInputs] = useState({});
let [loading, setLoading] = useState(false);
@@ -173,6 +174,9 @@ const OperationSetting = () => {
if (originInputs['ChatCacheExpireMinute'] !== inputs.ChatCacheExpireMinute) {
await updateOption('ChatCacheExpireMinute', inputs.ChatCacheExpireMinute);
}
if (originInputs['ChatImageRequestProxy'] !== inputs.ChatImageRequestProxy) {
await updateOption('ChatImageRequestProxy', inputs.ChatImageRequestProxy);
}
break;
}
@@ -334,6 +338,26 @@ const OperationSetting = () => {
/>
</FormControl>
</Stack>
<Stack spacing={2}>
<Alert severity="info">
当用户使用vision模型并提供了图片链接时我们的服务器需要下载这些图片并计算 tokens为了在下载图片时保护服务器的 IP
地址不被泄露可以在下方配置一个代理这个代理配置使用的是 HTTP SOCKS5
代理如果你是个人用户这个配置可以不用理会代理格式为 http://127.0.0.1:1080 或 socks5://127.0.0.1:1080
</Alert>
<FormControl>
<InputLabel htmlFor="ChatImageRequestProxy">图片检测代理</InputLabel>
<OutlinedInput
id="ChatImageRequestProxy"
name="ChatImageRequestProxy"
value={inputs.ChatImageRequestProxy}
onChange={handleInputChange}
label="图片检测代理"
placeholder="聊天图片检测代理设置如果不设置可能会泄漏服务器ip"
disabled={loading}
/>
</FormControl>
</Stack>
<Button
variant="contained"
onClick={() => {

View File

@@ -376,6 +376,9 @@ const SystemSetting = () => {
</SubCard>
<SubCard title="配置 SMTP" subTitle="用以支持系统的邮件发送">
<Grid container spacing={{ xs: 3, sm: 2, md: 4 }}>
<Grid xs={12}>
<Alert severity="info">请注意有些邮箱服务商发送邮件时会携带你的服务器IP地址非个人使用时建议使用专业的邮件服务商</Alert>
</Grid>
<Grid xs={12} md={4}>
<FormControl fullWidth>
<InputLabel htmlFor="SMTPServer">SMTP 服务器地址</InputLabel>