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/05/07 10:55:38 UTC

[PR] feat: plugin_configs pages [apisix-dashboard]

SkyeYoung opened a new pull request, #3020:
URL: https://github.com/apache/apisix-dashboard/pull/3020

   Please answer these questions before submitting a pull request, **or your PR will get closed**.
   
   **Why submit this pull request?**
   
   - [ ] Bugfix
   - [x] New feature provided
   - [ ] Improve performance
   - [ ] Backport patches
   
   **What changes will this PR take into?**
   
   


-- 
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] feat: plugin_configs pages [apisix-dashboard]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #3020:
URL: https://github.com/apache/apisix-dashboard/pull/3020#discussion_r2077366493


##########
src/routes/plugin_configs/add.tsx:
##########
@@ -0,0 +1,72 @@
+import { createFileRoute, useRouter } from '@tanstack/react-router';
+import { useTranslation } from 'react-i18next';
+import { useMutation } from '@tanstack/react-query';
+import PageHeader from '@/components/page/PageHeader';
+import { FormProvider, useForm } from 'react-hook-form';
+import { zodResolver } from '@hookform/resolvers/zod';
+import { FormSubmitBtn } from '@/components/form/Btn';
+import { FormTOCBox } from '@/components/form-slice/FormSection';
+import { notifications } from '@mantine/notifications';
+import { pipeProduce } from '@/utils/producer';
+import { FormPartPluginConfig } from '@/components/form-slice/FormPartPluginConfig';
+import { APISIX } from '@/types/schema/apisix';
+import { putPluginConfigReq } from '@/apis/plugin_configs';
+import { nanoid } from 'nanoid';
+
+const PluginConfigAddForm = () => {
+  const { t } = useTranslation();
+  const router = useRouter();
+
+  const putPluginConfig = useMutation({

Review Comment:
   Consider adding an onError handler for the mutation to gracefully manage errors during the add operation.



##########
src/routes/plugin_configs/detail.$id.tsx:
##########
@@ -0,0 +1,118 @@
+import { createFileRoute, useParams } from '@tanstack/react-router';
+import { useTranslation } from 'react-i18next';
+import { useMutation, useSuspenseQuery } from '@tanstack/react-query';
+import PageHeader from '@/components/page/PageHeader';
+import { FormProvider, useForm } from 'react-hook-form';
+import { zodResolver } from '@hookform/resolvers/zod';
+import { FormSubmitBtn } from '@/components/form/Btn';
+import { notifications } from '@mantine/notifications';
+import { FormTOCBox } from '@/components/form-slice/FormSection';
+import { Skeleton, Button, Group } from '@mantine/core';
+import { useBoolean } from 'react-use';
+import { useEffect } from 'react';
+import { APISIX } from '@/types/schema/apisix';
+import {
+  getPluginConfigQueryOptions,
+  putPluginConfigReq,
+} from '@/apis/plugin_configs';
+import { FormPartPluginConfig } from '@/components/form-slice/FormPartPluginConfig';
+import { pipeProduce } from '@/utils/producer';
+
+type Props = {
+  id: string;
+  readOnly: boolean;
+  setReadOnly: (v: boolean) => void;
+};
+
+const PluginConfigDetailForm = (props: Props) => {
+  const { id, readOnly, setReadOnly } = props;
+  const { t } = useTranslation();
+
+  const pluginConfigQuery = useSuspenseQuery(getPluginConfigQueryOptions(id));
+  const { data } = pluginConfigQuery;
+  const initialValue = data.value;
+
+  const putPluginConfig = useMutation({

Review Comment:
   Add an onError handler for the putPluginConfig mutation to handle failure cases and provide user feedback.



-- 
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] feat: plugin_configs pages [apisix-dashboard]

Posted by "bzp2010 (via GitHub)" <gi...@apache.org>.
bzp2010 commented on PR #3020:
URL: https://github.com/apache/apisix-dashboard/pull/3020#issuecomment-2861791485

   CI seems broken, we should also remove the CodeQL for golang.


-- 
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] feat: plugin_configs pages [apisix-dashboard]

Posted by "SkyeYoung (via GitHub)" <gi...@apache.org>.
SkyeYoung merged PR #3020:
URL: https://github.com/apache/apisix-dashboard/pull/3020


-- 
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] feat: plugin_configs pages [apisix-dashboard]

Posted by "bzp2010 (via GitHub)" <gi...@apache.org>.
bzp2010 commented on PR #3020:
URL: https://github.com/apache/apisix-dashboard/pull/3020#issuecomment-2861899847

   I've seen too many people who don't read the docs, no one cares what you say in the docs if you don't "get a gun aimed at them".


-- 
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] feat: plugin_configs pages [apisix-dashboard]

Posted by "SkyeYoung (via GitHub)" <gi...@apache.org>.
SkyeYoung commented on PR #3020:
URL: https://github.com/apache/apisix-dashboard/pull/3020#issuecomment-2861888340

   > Probably later we could add a prominent hint to inform the user that service should be used in preference to plugin config unless he knows for sure that it is necessary to use it, as a superset it would cover most use cases.
   
   I think this should be written into the document...


-- 
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