Skip to content

Commit

Permalink
fix(fe): route search with status (#1205)
Browse files Browse the repository at this point in the history
* fix(fe): route search with status

* fix: version and status select box allowclear

* fix: remove console
  • Loading branch information
liuxiran authored Jan 5, 2021
1 parent de52887 commit cd3bb4f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
14 changes: 13 additions & 1 deletion web/src/pages/Route/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ const Page: React.FC = () => {
}

return (
<Select style={{ width: '100%' }}>
<Select style={{ width: '100%' }} allowClear>
{Object.keys(labelList)
.filter((item) => item === 'API_VERSION')
.map((key) => {
Expand Down Expand Up @@ -192,6 +192,18 @@ const Page: React.FC = () => {
)}
</>
),
renderFormItem: (_, { type }) => {
if (type === 'form') {
return null;
}

return (
<Select style={{ width: '100%' }} allowClear>
<option key={RouteStatus.Offline} value={RouteStatus.Offline}>{formatMessage({ id: 'page.route.unpublished' })}</option>
<option key={RouteStatus.Publish} value={RouteStatus.Publish}>{formatMessage({ id: 'page.route.published' })}</option>
</Select>
);
},
},
{
title: formatMessage({ id: 'component.global.updateTime' }),
Expand Down
3 changes: 2 additions & 1 deletion web/src/pages/Route/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,15 @@ export const fetchItem = (rid: number) =>
request(`/routes/${rid}`).then((data) => transformRouteData(data.data));

export const fetchList = ({ current = 1, pageSize = 10, ...res }) => {
const { labels, API_VERSION } = res;
const { labels, API_VERSION, status } = res;
return request<Res<ResListData<RouteModule.ResponseBody>>>('/routes', {
params: {
name: res.name,
uri: res.uri,
label: (labels || []).concat(API_VERSION).join(','),
page: current,
page_size: pageSize,
status
},
}).then(({ data }) => {
return {
Expand Down

0 comments on commit cd3bb4f

Please sign in to comment.