Skip to content

Commit

Permalink
feat: added tip for Plugin module (#1481)
Browse files Browse the repository at this point in the history
  • Loading branch information
juzhiyuan authored Feb 19, 2021
1 parent 20d5492 commit 2b9ff48
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 0 deletions.
12 changes: 12 additions & 0 deletions web/src/components/Plugin/PluginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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[]>([]);
Expand Down Expand Up @@ -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>
</>
);
Expand Down
20 changes: 20 additions & 0 deletions web/src/components/Plugin/locales/en-US.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default {
'component.plugin.tip1': 'NOTE: After customizing the plugin, you need to update schema.json.',
'component.plugin.tip2': 'How to update?',
};
20 changes: 20 additions & 0 deletions web/src/components/Plugin/locales/zh-CN.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default {
'component.plugin.tip1': '注意:自定义插件后(修改、新增、删除等),需更新 schema.json。',
'component.plugin.tip2': '如何更新?',
};
2 changes: 2 additions & 0 deletions web/src/locales/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -38,4 +39,5 @@ export default {
...component,
...ActionBarEnUS,
...PluginOrchestration,
...Plugin,
};
2 changes: 2 additions & 0 deletions web/src/locales/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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': '语言',
Expand All @@ -38,4 +39,5 @@ export default {
...component,
...ActionBarZhCN,
...PluginOrchestration,
...Plugin,
};

0 comments on commit 2b9ff48

Please sign in to comment.