mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-11-12 12:13:45 +08:00
优化和重构代码,增加前端可以设置加密配置数据的密钥
This commit is contained in:
@@ -79,17 +79,6 @@
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
svg {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
&:hover {
|
||||
--delay: 0.5s;
|
||||
width: var(--full-width);
|
||||
@@ -410,8 +399,8 @@
|
||||
|
||||
button {
|
||||
padding: 7px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Specific styles for iOS devices */
|
||||
@media screen and (max-device-width: 812px) and (-webkit-min-device-pixel-ratio: 2) {
|
||||
@@ -761,4 +750,4 @@
|
||||
transform: translateX(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -980,12 +980,12 @@ export function Settings() {
|
||||
onChange={(e) =>
|
||||
accessStore.update((access) => {
|
||||
const region = e.currentTarget.value;
|
||||
if (!/^[a-z]{2}-[a-z]+-\d+$/.test(region)) {
|
||||
showToast(Locale.Settings.Access.Bedrock.Region.Invalid);
|
||||
return;
|
||||
}
|
||||
if (!/^[a-z]{2}-[a-z]+-\d+$/.test(region)) {
|
||||
showToast(Locale.Settings.Access.Bedrock.Region.Invalid);
|
||||
return;
|
||||
}
|
||||
access.awsRegion = region;
|
||||
})
|
||||
})
|
||||
}
|
||||
/>
|
||||
</ListItem>
|
||||
@@ -999,7 +999,7 @@ export function Settings() {
|
||||
type="text"
|
||||
placeholder={Locale.Settings.Access.Bedrock.AccessKey.Placeholder}
|
||||
onChange={(e) => {
|
||||
accessStore.update((access) => {
|
||||
accessStore.update((access) => {
|
||||
const accessKey = e.currentTarget.value;
|
||||
if (accessKey && accessKey.length !== 20) {
|
||||
showToast(Locale.Settings.Access.Bedrock.AccessKey.Invalid);
|
||||
@@ -1022,11 +1022,11 @@ export function Settings() {
|
||||
placeholder={Locale.Settings.Access.Bedrock.SecretKey.Placeholder}
|
||||
onChange={(e) => {
|
||||
accessStore.update((access) => {
|
||||
const secretKey = e.currentTarget.value;
|
||||
if (secretKey && secretKey.length !== 40) {
|
||||
showToast(Locale.Settings.Access.Bedrock.SecretKey.Invalid);
|
||||
return;
|
||||
}
|
||||
const secretKey = e.currentTarget.value;
|
||||
if (secretKey && secretKey.length !== 40) {
|
||||
showToast(Locale.Settings.Access.Bedrock.SecretKey.Invalid);
|
||||
return;
|
||||
}
|
||||
access.awsSecretKey = secretKey;
|
||||
});
|
||||
}}
|
||||
@@ -1034,17 +1034,17 @@ export function Settings() {
|
||||
/>
|
||||
</ListItem>
|
||||
<ListItem
|
||||
title={Locale.Settings.Access.Bedrock.SessionToken.Title}
|
||||
subTitle={Locale.Settings.Access.Bedrock.SessionToken.SubTitle}
|
||||
title={Locale.Settings.Access.Bedrock.EncryptionKey.Title}
|
||||
subTitle={Locale.Settings.Access.Bedrock.EncryptionKey.SubTitle}
|
||||
>
|
||||
<PasswordInput
|
||||
aria-label={Locale.Settings.Access.Bedrock.SessionToken.Title}
|
||||
value={accessStore.awsSessionToken}
|
||||
aria-label={Locale.Settings.Access.Bedrock.EncryptionKey.Title}
|
||||
value={accessStore.bedrockEncryptionKey}
|
||||
type="text"
|
||||
placeholder={Locale.Settings.Access.Bedrock.SessionToken.Placeholder}
|
||||
placeholder={Locale.Settings.Access.Bedrock.EncryptionKey.Placeholder}
|
||||
onChange={(e) => {
|
||||
accessStore.update(
|
||||
(access) => (access.awsSessionToken = e.currentTarget.value),
|
||||
(access) => (access.bedrockEncryptionKey = e.currentTarget.value),
|
||||
);
|
||||
}}
|
||||
maskWhenShow={true}
|
||||
|
||||
Reference in New Issue
Block a user