Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
21b0d13b
authored
May 05, 2025
by
tbphp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 样式修复
parent
b648b3cf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
15 deletions
+13
-15
web/src/components/RateLimitSetting.js
+8
-9
web/src/pages/Setting/RateLimit/SettingsRequestRateLimit.js
+5
-6
No files found.
web/src/components/RateLimitSetting.js
View file @
21b0d13b
...
...
@@ -34,7 +34,7 @@ const RateLimitSetting = () => {
newInputs
[
item
.
key
]
=
item
.
value
;
}
});
setInputs
(
newInputs
);
}
else
{
showError
(
message
);
...
...
@@ -44,28 +44,28 @@ const RateLimitSetting = () => {
try
{
setLoading
(
true
);
await
getOptions
();
// showSuccess('刷新成功');
// showSuccess('刷新成功');
}
catch
(
error
)
{
showError
(
'刷新失败'
);
}
finally
{
setLoading
(
false
);
}
}
useEffect
(()
=>
{
onRefresh
();
},
[]);
return
(
<>
<
Spin
spinning
=
{
loading
}
size
=
'large'
>
{
/* AI请求速率限制 */
}
{
/* AI请求速率限制 */
}
<
Card
style
=
{{
marginTop
:
'10px'
}}
>
<
RequestRateLimit
options
=
{
inputs
}
refresh
=
{
onRefresh
}
/
>
<
/Card
>
<
/Spin
>
<
/
>
);
};
export
default
RateLimitSetting
;
\ No newline at end of file
};
export
default
RateLimitSetting
;
web/src/pages/Setting/RateLimit/SettingsRequestRateLimit.js
View file @
21b0d13b
...
...
@@ -23,7 +23,7 @@ export default function RequestRateLimit(props) {
});
const
refForm
=
useRef
();
const
[
inputsRow
,
setInputsRow
]
=
useState
(
inputs
);
function
onSubmit
()
{
const
updateArray
=
compareObjects
(
inputs
,
inputsRow
);
if
(
!
updateArray
.
length
)
return
showWarning
(
t
(
'你似乎并没有修改什么'
));
...
...
@@ -65,7 +65,7 @@ export default function RequestRateLimit(props) {
setLoading
(
false
);
});
}
useEffect
(()
=>
{
const
currentInputs
=
{};
for
(
let
key
in
props
.
options
)
{
...
...
@@ -75,9 +75,9 @@ export default function RequestRateLimit(props) {
}
setInputs
(
currentInputs
);
setInputsRow
(
structuredClone
(
currentInputs
));
refForm
.
current
.
setValues
(
currentInputs
);
refForm
.
current
.
setValues
(
currentInputs
);
},
[
props
.
options
]);
return
(
<>
<
Spin
spinning
=
{
loading
}
>
...
...
@@ -201,4 +201,4 @@ export default function RequestRateLimit(props) {
<
/Spin
>
<
/
>
);
}
\ No newline at end of file
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment