You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by ju...@apache.org on 2020/12/30 09:09:25 UTC
[apisix-dashboard] branch feat-version-manager created (now 22623a3)
This is an automated email from the ASF dual-hosted git repository.
juzhiyuan pushed a change to branch feat-version-manager
in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git.
at 22623a3 Merge branch 'master' of github.com:apache/apisix-dashboard into feat-version-manager
This branch includes the following new commits:
new 2efb7a2 style: codes-format
new 22623a3 Merge branch 'master' of github.com:apache/apisix-dashboard into feat-version-manager
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[apisix-dashboard] 01/02: style: codes-format
Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
juzhiyuan pushed a commit to branch feat-version-manager
in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git
commit 2efb7a25083a9d65ed7d2cb14f30b13554e24636
Author: juzhiyuan <ju...@apache.org>
AuthorDate: Wed Dec 30 17:08:28 2020 +0800
style: codes-format
---
web/src/hooks/useForceIntl.ts | 2 +-
web/src/pages/Route/List.tsx | 49 ++++++++++++----------
.../pages/Route/components/Step1/LabelsDrawer.tsx | 14 ++++---
web/src/pages/Route/components/Step1/MetaView.tsx | 3 +-
4 files changed, 38 insertions(+), 30 deletions(-)
diff --git a/web/src/hooks/useForceIntl.ts b/web/src/hooks/useForceIntl.ts
index 8f67bef..890a16a 100644
--- a/web/src/hooks/useForceIntl.ts
+++ b/web/src/hooks/useForceIntl.ts
@@ -29,7 +29,7 @@ const useForceIntl = () => {
}
const { locale } = getIntl();
- if (locale === 'zh-cn') {
+ if (locale === 'zh-CN') {
return;
}
diff --git a/web/src/pages/Route/List.tsx b/web/src/pages/Route/List.tsx
index 3ac4019..2885747 100644
--- a/web/src/pages/Route/List.tsx
+++ b/web/src/pages/Route/List.tsx
@@ -179,29 +179,31 @@ const Page: React.FC = () => {
>
{formatMessage({ id: 'component.global.edit' })}
</Button>
- <Button
- type="primary"
- onClick={() => {
- handlePublishOffline(record.id, RouteStatus.Publish);
- }}
- style={{ marginRight: 10 }}
- disabled={Boolean(record.status)}
- >
- {formatMessage({ id: 'page.route.publish' })}
- </Button>
- <Popconfirm
- title={formatMessage({ id: 'page.route.popconfirm.title.offline' })}
- onConfirm={() => {
- handlePublishOffline(record.id, RouteStatus.Offline);
- }}
- okText={formatMessage({ id: 'component.global.confirm' })}
- cancelText={formatMessage({ id: 'component.global.cancel' })}
- disabled={Boolean(!record.status)}
- >
- <Button type="primary" danger disabled={Boolean(!record.status)}>
- {formatMessage({ id: 'page.route.offline' })}
+ {!Boolean(record.status) && (
+ <Button
+ type="primary"
+ onClick={() => {
+ handlePublishOffline(record.id, RouteStatus.Publish);
+ }}
+ style={{ marginRight: 10 }}
+ >
+ {formatMessage({ id: 'page.route.publish' })}
</Button>
- </Popconfirm>
+ )}
+ {Boolean(record.status) && (
+ <Popconfirm
+ title={formatMessage({ id: 'page.route.popconfirm.title.offline' })}
+ onConfirm={() => {
+ handlePublishOffline(record.id, RouteStatus.Offline);
+ }}
+ okText={formatMessage({ id: 'component.global.confirm' })}
+ cancelText={formatMessage({ id: 'component.global.cancel' })}
+ >
+ <Button type="primary" danger disabled={Boolean(!record.status)}>
+ {formatMessage({ id: 'page.route.offline' })}
+ </Button>
+ </Popconfirm>
+ )}
<Popconfirm
title={formatMessage({ id: 'component.global.popconfirm.title.delete' })}
onConfirm={() => {
@@ -213,6 +215,9 @@ const Page: React.FC = () => {
);
});
}}
+ okButtonProps={{
+ danger: true
+ }}
okText={formatMessage({ id: 'component.global.confirm' })}
cancelText={formatMessage({ id: 'component.global.cancel' })}
>
diff --git a/web/src/pages/Route/components/Step1/LabelsDrawer.tsx b/web/src/pages/Route/components/Step1/LabelsDrawer.tsx
index ba5b221..f4c68fc 100644
--- a/web/src/pages/Route/components/Step1/LabelsDrawer.tsx
+++ b/web/src/pages/Route/components/Step1/LabelsDrawer.tsx
@@ -22,11 +22,12 @@ import { useIntl } from 'umi';
import { transformLableValueToKeyValue } from '../../transform';
import { fetchLabelList } from '../../service';
-interface Props extends Pick<RouteModule.Step1PassProps, 'onChange'> {
- labelsDataSource: string[];
+type Props = {
+ title?: string;
+ dataSource: string[];
disabled: boolean;
onClose(): void;
-}
+} & Pick<RouteModule.Step1PassProps, 'onChange'>;
const LabelList = (disabled: boolean, labelList: RouteModule.LabelList) => {
const { formatMessage } = useIntl();
@@ -108,12 +109,13 @@ const LabelList = (disabled: boolean, labelList: RouteModule.LabelList) => {
};
const LabelsDrawer: React.FC<Props> = ({
+ title = "Label Manager",
disabled,
- labelsDataSource,
+ dataSource = [],
onClose,
onChange = () => {},
}) => {
- const transformLabel = transformLableValueToKeyValue(labelsDataSource);
+ const transformLabel = transformLableValueToKeyValue(dataSource);
const { formatMessage } = useIntl();
const [form] = Form.useForm();
@@ -126,7 +128,7 @@ const LabelsDrawer: React.FC<Props> = ({
return (
<Drawer
- title="Edit labels"
+ title={title}
placement="right"
width={512}
visible
diff --git a/web/src/pages/Route/components/Step1/MetaView.tsx b/web/src/pages/Route/components/Step1/MetaView.tsx
index 25e1f31..28aa7f5 100644
--- a/web/src/pages/Route/components/Step1/MetaView.tsx
+++ b/web/src/pages/Route/components/Step1/MetaView.tsx
@@ -35,7 +35,7 @@ const MetaView: React.FC<RouteModule.Step1PassProps> = ({ disabled, form, isEdit
if (form.getFieldValue('labels')) {
return (
<LabelsDrawer
- labelsDataSource={form.getFieldValue('labels')}
+ dataSource={form.getFieldValue('labels')}
disabled={disabled || false}
onChange={onChange}
onClose={() => setVisible(false)}
@@ -46,6 +46,7 @@ const MetaView: React.FC<RouteModule.Step1PassProps> = ({ disabled, form, isEdit
}}
</Form.Item>
)}
+
<Form.Item
label={formatMessage({ id: 'component.global.name' })}
name="name"
[apisix-dashboard] 02/02: Merge branch 'master' of
github.com:apache/apisix-dashboard into feat-version-manager
Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
juzhiyuan pushed a commit to branch feat-version-manager
in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git
commit 22623a3be2e3d3301fc7b3ba0efd0c8d245ba136
Merge: 2efb7a2 45d79b6
Author: juzhiyuan <ju...@apache.org>
AuthorDate: Wed Dec 30 17:09:02 2020 +0800
Merge branch 'master' of github.com:apache/apisix-dashboard into feat-version-manager
web/config/routes.ts | 8 +
.../consumer/create_and_delete_consumer.spec.js | 2 +
web/src/components/Plugin/CodeMirrorDrawer.tsx | 143 ------------
web/src/components/Plugin/PluginDetail.tsx | 242 ++++++++++++++++++++
web/src/components/Plugin/PluginPage.tsx | 245 ++++++++-------------
web/src/components/Plugin/service.ts | 4 +-
.../PluginOrchestration/customConfig.tsx | 10 +-
web/src/components/PluginOrchestration/index.tsx | 36 ++-
web/src/components/PluginOrchestration/service.ts | 4 +-
web/src/constants.ts | 2 +
web/src/helpers.tsx | 19 ++
web/src/locales/en-US.ts | 2 +-
web/src/locales/en-US/menu.ts | 1 +
web/src/locales/zh-CN.ts | 2 +-
web/src/locales/zh-CN/menu.ts | 1 +
web/src/pages/Consumer/Create.tsx | 32 +--
web/src/pages/Consumer/service.ts | 6 +
web/src/pages/Plugin/List.tsx | 138 ++++++++++++
web/src/pages/Plugin/PluginMarket.tsx | 61 +++++
.../Plugin/components/Step1.tsx} | 9 -
.../service.ts => pages/Plugin/locales/en-US.ts} | 10 +-
.../service.ts => pages/Plugin/locales/zh-CN.ts} | 10 +-
web/src/pages/{Consumer => Plugin}/service.ts | 44 ++--
.../service.ts => pages/Plugin/typing.d.ts} | 18 +-
web/src/pages/Route/Create.tsx | 5 +-
.../Route/components/CreateStep4/CreateStep4.tsx | 2 +-
26 files changed, 666 insertions(+), 390 deletions(-)