You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "SkyeYoung (via GitHub)" <gi...@apache.org> on 2025/08/15 00:29:12 UTC
[PR] fix(FormItem): Labels [apisix-dashboard]
SkyeYoung opened a new pull request, #3174:
URL: https://github.com/apache/apisix-dashboard/pull/3174
Please answer these questions before submitting a pull request, **or your PR will get closed**.
**Why submit this pull request?**
- [x] Bugfix
- [ ] New feature provided
- [ ] Improve performance
- [ ] Backport patches
**What changes will this PR take into?**
**Related issues**
fix/resolve #3172
**Checklist:**
- [x] Did you explain what problem does this PR solve? Or what new features have been added?
- [x] Have you added corresponding test cases?
- [ ] Have you modified the corresponding document?
- [x] Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(FormItem): Labels [apisix-dashboard]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #3174:
URL: https://github.com/apache/apisix-dashboard/pull/3174#discussion_r2278444031
##########
src/apis/ssls.ts:
##########
@@ -43,3 +43,22 @@ export const putSSLReq = (req: AxiosInstance, data: APISIXType['SSL']) => {
export const postSSLReq = (req: AxiosInstance, data: SSLPostType) =>
req.post<APISIXType['SSL'], APISIXType['RespSSLDetail']>(API_SSLS, data);
+
+export const deleteAllSSLs = async (req: AxiosInstance) => {
+ const { PAGE_SIZE_MIN, PAGE_SIZE_MAX } = await import('@/config/constant');
Review Comment:
Using dynamic import inside a function that may be called multiple times is inefficient. Consider importing these constants at the module level or caching the import result.
```suggestion
// PAGE_SIZE_MIN and PAGE_SIZE_MAX are now statically imported
```
##########
src/apis/ssls.ts:
##########
@@ -43,3 +43,22 @@ export const putSSLReq = (req: AxiosInstance, data: APISIXType['SSL']) => {
export const postSSLReq = (req: AxiosInstance, data: SSLPostType) =>
req.post<APISIXType['SSL'], APISIXType['RespSSLDetail']>(API_SSLS, data);
+
+export const deleteAllSSLs = async (req: AxiosInstance) => {
+ const { PAGE_SIZE_MIN, PAGE_SIZE_MAX } = await import('@/config/constant');
+ const totalRes = await getSSLListReq(req, {
+ page: 1,
+ page_size: PAGE_SIZE_MIN,
+ });
+ const total = totalRes.total;
+ if (total === 0) return;
+ for (let times = Math.ceil(total / PAGE_SIZE_MAX); times > 0; times--) {
+ const res = await getSSLListReq(req, {
+ page: 1,
+ page_size: PAGE_SIZE_MAX,
+ });
+ await Promise.all(
+ res.list.map((d) => req.delete(`${API_SSLS}/${d.value.id}`))
+ );
+ }
Review Comment:
The loop continues to fetch page 1 repeatedly instead of tracking which records have been deleted. This could lead to inefficient deletion if records are not being removed in the expected order, potentially causing infinite loops or missing deletions.
```suggestion
const { PAGE_SIZE_MAX } = await import('@/config/constant');
const res = await getSSLListReq(req, {
page: 1,
page_size: PAGE_SIZE_MAX,
});
if (!res.list || res.list.length === 0) return;
await Promise.all(
res.list.map((d) => req.delete(`${API_SSLS}/${d.value.id}`))
);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(FormItem): Labels [apisix-dashboard]
Posted by "SkyeYoung (via GitHub)" <gi...@apache.org>.
SkyeYoung commented on code in PR #3174:
URL: https://github.com/apache/apisix-dashboard/pull/3174#discussion_r2278013233
##########
src/components/form-slice/FormSection/index.tsx:
##########
@@ -22,7 +22,7 @@ import {
type TableOfContentsProps,
} from '@mantine/core';
import { useShallowEffect } from '@mantine/hooks';
-import clsx from 'clsx';
+import { clsx } from 'clsx';
Review Comment:
fix lint
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(FormItem): Labels [apisix-dashboard]
Posted by "SkyeYoung (via GitHub)" <gi...@apache.org>.
SkyeYoung merged PR #3174:
URL: https://github.com/apache/apisix-dashboard/pull/3174
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org