You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by su...@apache.org on 2021/02/19 01:51:49 UTC

[apisix-dashboard] branch master updated: feat: added tip for Plugin module (#1481)

This is an automated email from the ASF dual-hosted git repository.

sunyi 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 2b9ff48  feat: added tip for Plugin module (#1481)
2b9ff48 is described below

commit 2b9ff4837abc0cedcd439b71ecca3e25916f3d6e
Author: 琚致远 <ju...@apache.org>
AuthorDate: Fri Feb 19 09:51:42 2021 +0800

    feat: added tip for Plugin module (#1481)
---
 web/src/components/Plugin/PluginPage.tsx           | 12 +++++++++++
 .../Plugin/locales/en-US.ts}                       | 25 ++--------------------
 web/src/{ => components/Plugin}/locales/zh-CN.ts   | 25 ++--------------------
 web/src/locales/en-US.ts                           |  2 ++
 web/src/locales/zh-CN.ts                           |  2 ++
 5 files changed, 20 insertions(+), 46 deletions(-)

diff --git a/web/src/components/Plugin/PluginPage.tsx b/web/src/components/Plugin/PluginPage.tsx
index 6798f5f..a8a8117 100644
--- a/web/src/components/Plugin/PluginPage.tsx
+++ b/web/src/components/Plugin/PluginPage.tsx
@@ -18,6 +18,7 @@ import React, { useEffect, useState } from 'react';
 import { Anchor, Layout, Card, Button } from 'antd';
 import { PanelSection } from '@api7-dashboard/ui';
 import { omit, orderBy } from 'lodash';
+import { useIntl } from 'umi';
 
 import PluginDetail from './PluginDetail';
 import { fetchList } from './service';
@@ -54,6 +55,8 @@ const PluginPage: React.FC<Props> = ({
   type = 'scoped',
   onChange = () => {},
 }) => {
+  const { formatMessage } = useIntl();
+
   const [pluginList, setPluginList] = useState<PluginComponent.Meta[]>([]);
   const [name, setName] = useState<string>(NEVER_EXIST_PLUGIN_FLAG);
   const [typeList, setTypeList] = useState<string[]>([]);
@@ -158,6 +161,15 @@ const PluginPage: React.FC<Props> = ({
             </PanelSection>
           );
         })}
+        <br />
+        {formatMessage({ id: 'component.plugin.tip1' })}
+        <a
+          href="https://github.com/apache/apisix-dashboard/blob/master/docs/FAQ.md#4-after-modifying-the-plugin-schema-or-creating-a-custom-plugin-in-apache-apisix-why-cant-i-find-it-on-the-dashboard"
+          target="_blank"
+          rel="noreferrer"
+        >
+          {formatMessage({ id: 'component.plugin.tip2' })}
+        </a>
       </Content>
     </>
   );
diff --git a/web/src/locales/zh-CN.ts b/web/src/components/Plugin/locales/en-US.ts
similarity index 52%
copy from web/src/locales/zh-CN.ts
copy to web/src/components/Plugin/locales/en-US.ts
index 030cbcb..00e9689 100644
--- a/web/src/locales/zh-CN.ts
+++ b/web/src/components/Plugin/locales/en-US.ts
@@ -14,28 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-import { ActionBarZhCN } from '@/components/ActionBar';
-
-import component from './zh-CN/component';
-import globalHeader from './zh-CN/globalHeader';
-import menu from './zh-CN/menu';
-import pwa from './zh-CN/pwa';
-import settingDrawer from './zh-CN/settingDrawer';
-import settings from './zh-CN/setting';
-import PluginOrchestration from '../components/PluginOrchestration/locales/zh-CN';
-
 export default {
-  'navBar.lang': '语言',
-  'layout.user.link.help': '帮助',
-  'layout.user.link.privacy': '隐私',
-  'layout.user.link.terms': '条款',
-  'app.preview.down.block': '下载此页面到本地项目',
-  ...globalHeader,
-  ...menu,
-  ...settingDrawer,
-  ...settings,
-  ...pwa,
-  ...component,
-  ...ActionBarZhCN,
-  ...PluginOrchestration,
+  'component.plugin.tip1': 'NOTE: After customizing the plugin, you need to update schema.json.',
+  'component.plugin.tip2': 'How to update?',
 };
diff --git a/web/src/locales/zh-CN.ts b/web/src/components/Plugin/locales/zh-CN.ts
similarity index 52%
copy from web/src/locales/zh-CN.ts
copy to web/src/components/Plugin/locales/zh-CN.ts
index 030cbcb..d4d9b64 100644
--- a/web/src/locales/zh-CN.ts
+++ b/web/src/components/Plugin/locales/zh-CN.ts
@@ -14,28 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-import { ActionBarZhCN } from '@/components/ActionBar';
-
-import component from './zh-CN/component';
-import globalHeader from './zh-CN/globalHeader';
-import menu from './zh-CN/menu';
-import pwa from './zh-CN/pwa';
-import settingDrawer from './zh-CN/settingDrawer';
-import settings from './zh-CN/setting';
-import PluginOrchestration from '../components/PluginOrchestration/locales/zh-CN';
-
 export default {
-  'navBar.lang': '语言',
-  'layout.user.link.help': '帮助',
-  'layout.user.link.privacy': '隐私',
-  'layout.user.link.terms': '条款',
-  'app.preview.down.block': '下载此页面到本地项目',
-  ...globalHeader,
-  ...menu,
-  ...settingDrawer,
-  ...settings,
-  ...pwa,
-  ...component,
-  ...ActionBarZhCN,
-  ...PluginOrchestration,
+  'component.plugin.tip1': '注意:自定义插件后(修改、新增、删除等),需更新 schema.json。',
+  'component.plugin.tip2': '如何更新?',
 };
diff --git a/web/src/locales/en-US.ts b/web/src/locales/en-US.ts
index 3ca50eb..887df00 100644
--- a/web/src/locales/en-US.ts
+++ b/web/src/locales/en-US.ts
@@ -23,6 +23,7 @@ import pwa from './en-US/pwa';
 import settingDrawer from './en-US/settingDrawer';
 import settings from './en-US/setting';
 import PluginOrchestration from '../components/PluginOrchestration/locales/en-US';
+import Plugin from '../components/Plugin/locales/en-US';
 
 export default {
   'navBar.lang': 'Languages',
@@ -38,4 +39,5 @@ export default {
   ...component,
   ...ActionBarEnUS,
   ...PluginOrchestration,
+  ...Plugin,
 };
diff --git a/web/src/locales/zh-CN.ts b/web/src/locales/zh-CN.ts
index 030cbcb..c7989e2 100644
--- a/web/src/locales/zh-CN.ts
+++ b/web/src/locales/zh-CN.ts
@@ -23,6 +23,7 @@ import pwa from './zh-CN/pwa';
 import settingDrawer from './zh-CN/settingDrawer';
 import settings from './zh-CN/setting';
 import PluginOrchestration from '../components/PluginOrchestration/locales/zh-CN';
+import Plugin from '../components/Plugin/locales/zh-CN';
 
 export default {
   'navBar.lang': '语言',
@@ -38,4 +39,5 @@ export default {
   ...component,
   ...ActionBarZhCN,
   ...PluginOrchestration,
+  ...Plugin,
 };