From 69336fc38a6ebbc0854a0a282b014b3f68ac8ed3 Mon Sep 17 00:00:00 2001 From: leoliu Date: Sat, 22 Feb 2020 15:16:10 +0800 Subject: [PATCH] fix: Fix search by app --- src/pages/projects/containers/Pods/index.jsx | 3 ++- src/pages/projects/containers/Routes/index.jsx | 3 ++- src/pages/projects/containers/Services/index.jsx | 3 ++- src/pages/projects/containers/Workloads/Base.jsx | 3 ++- src/utils/index.js | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/pages/projects/containers/Pods/index.jsx b/src/pages/projects/containers/Pods/index.jsx index 1f4b6405aea..5e14c0e15b6 100644 --- a/src/pages/projects/containers/Pods/index.jsx +++ b/src/pages/projects/containers/Pods/index.jsx @@ -130,10 +130,11 @@ export default class Pods extends Base { }, { title: t('Application'), - dataIndex: 'app', + dataIndex: 'app.kubernetes.io/name', isHideable: true, search: true, width: '15%', + render: (_, record) => record.app, }, { title: t('Updated Time'), diff --git a/src/pages/projects/containers/Routes/index.jsx b/src/pages/projects/containers/Routes/index.jsx index 0c34608dc2b..d96ea84d8fc 100644 --- a/src/pages/projects/containers/Routes/index.jsx +++ b/src/pages/projects/containers/Routes/index.jsx @@ -158,10 +158,11 @@ export default class Routes extends Base { }, { title: t('Application'), - dataIndex: 'app', + dataIndex: 'app.kubernetes.io/name', isHideable: true, search: true, width: '22%', + render: (_, record) => record.app, }, { title: t('Created Time'), diff --git a/src/pages/projects/containers/Services/index.jsx b/src/pages/projects/containers/Services/index.jsx index b90ea899362..69ec4892faf 100644 --- a/src/pages/projects/containers/Services/index.jsx +++ b/src/pages/projects/containers/Services/index.jsx @@ -176,10 +176,11 @@ export default class Services extends Base { }, { title: t('Application'), - dataIndex: 'app', + dataIndex: 'app.kubernetes.io/name', isHideable: true, search: true, width: '16%', + render: (_, record) => record.app, }, { title: t('Created Time'), diff --git a/src/pages/projects/containers/Workloads/Base.jsx b/src/pages/projects/containers/Workloads/Base.jsx index 8b8ae914114..608db6d984c 100644 --- a/src/pages/projects/containers/Workloads/Base.jsx +++ b/src/pages/projects/containers/Workloads/Base.jsx @@ -141,10 +141,11 @@ export default class WorkloadsBaseList extends Base { }, { title: t('Application'), - dataIndex: 'app', + dataIndex: 'app.kubernetes.io/name', isHideable: true, search: true, width: '25%', + render: (_, record) => record.app, }, this.module === 'deployments' ? { diff --git a/src/utils/index.js b/src/utils/index.js index cec02595013..c9223ad2b76 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -169,7 +169,7 @@ export const getQueryString = params => export const getFilterString = ( params, - fuzzyMatchKeys = ['name', 'app', 'label', 'annotation'] + fuzzyMatchKeys = ['name', 'app.kubernetes.io/name', 'label', 'annotation'] ) => Object.keys(params) .filter(key => !isUndefined(params[key]) && params[key] !== '')