This is an automated email from the ASF dual-hosted git repository.
baoyuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git
The following commit(s) were added to refs/heads/master by this push:
new 9b1f8f019 fix: plugin config page error (#2739)
9b1f8f019 is described below
commit 9b1f8f01920ff1ccd0492baae5774410ece0cea0
Author: Baoyuan <[email protected]>
AuthorDate: Mon Feb 20 17:42:58 2023 +0800
fix: plugin config page error (#2739)
---
web/src/components/Plugin/PluginDetail.tsx | 4 ++--
web/src/components/Plugin/PluginPage.tsx | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/web/src/components/Plugin/PluginDetail.tsx
b/web/src/components/Plugin/PluginDetail.tsx
index 69c7a268f..5963fb3c8 100644
--- a/web/src/components/Plugin/PluginDetail.tsx
+++ b/web/src/components/Plugin/PluginDetail.tsx
@@ -181,7 +181,7 @@ const PluginDetail: React.FC<Props> = ({
useEffect(() => {
form.setFieldsValue({
- disable: isEnabled ? true : initialData[name] &&
!initialData[name]._meta.disable,
+ disable: isEnabled ? true : initialData[name] &&
!initialData[name]?._meta?.disable,
scope: 'global',
});
if (PLUGIN_UI_LIST.includes(name)) {
@@ -416,7 +416,7 @@ const PluginDetail: React.FC<Props> = ({
>
<Switch
defaultChecked={
- isEnabled ? true : initialData[name] &&
!initialData[name]._meta.disable
+ isEnabled ? true : initialData[name] &&
!initialData[name]?._meta?.disable
}
disabled={readonly || isEnabled}
/>
diff --git a/web/src/components/Plugin/PluginPage.tsx
b/web/src/components/Plugin/PluginPage.tsx
index 5c843f3c3..aa6c9ad58 100644
--- a/web/src/components/Plugin/PluginPage.tsx
+++ b/web/src/components/Plugin/PluginPage.tsx
@@ -101,7 +101,7 @@ const PluginPage: React.FC<Props> = ({
useEffect(() => {
const openPluginList = pluginList.filter(
- (item) => initialData[item.name] &&
!initialData[item.name]._meta.disable,
+ (item) => initialData[item.name] &&
!initialData[item.name]?._meta?.disable,
);
setPlugins(initialData);
setEnablePluginsList(openPluginList);
@@ -244,16 +244,16 @@ const PluginPage: React.FC<Props> = ({
actions={[
<Button
type={
- initialData[item.name] &&
!initialData[item.name]._meta.disable
+ initialData[item.name] &&
!initialData[item.name]?._meta?.disable
? 'primary'
: 'default'
}
- danger={initialData[item.name] &&
!initialData[item.name]._meta.disable}
+ danger={initialData[item.name] &&
!initialData[item.name]?._meta?.disable}
onClick={() => {
setName(item.name);
}}
>
- {initialData[item.name] &&
!initialData[item.name]._meta.disable
+ {initialData[item.name] &&
!initialData[item.name]?._meta?.disable
? formatMessage({ id: 'component.plugin.disable' })
: formatMessage({ id: 'component.plugin.enable' })}
</Button>,