From 511d962426402f63170479f52bcf41dfdc827fc4 Mon Sep 17 00:00:00 2001 From: lizhi Date: Tue, 26 Mar 2019 09:25:06 +0800 Subject: [PATCH 1/2] fix: Hide pagination for helm's cluster --- src/components/Base/Table/index.jsx | 17 +++++++++++------ .../Dashboard/Clusters/Detail/Helm/index.jsx | 11 ++--------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/components/Base/Table/index.jsx b/src/components/Base/Table/index.jsx index 34582d83..598f4623 100644 --- a/src/components/Base/Table/index.jsx +++ b/src/components/Base/Table/index.jsx @@ -22,6 +22,7 @@ export class Table extends React.Component { dataSource: PropTypes.array, filterList: PropTypes.array, isLoading: PropTypes.bool, + noPagination: PropTypes.bool, pagination: PropTypes.object, prefixCls: PropTypes.string, rowSelection: PropTypes.shape({ @@ -38,6 +39,7 @@ export class Table extends React.Component { columns: [], pagination: {}, rowKey: 'key', + noPagination: false, rowSelection: { // selectedRowKeys: [], onChange: _.noop, @@ -415,7 +417,8 @@ export class Table extends React.Component { style, pagination, isLoading, - rowSelection + rowSelection, + noPagination } = this.props; const { selectedRowKeys } = this.state; @@ -423,11 +426,13 @@ export class Table extends React.Component {
{this.renderTable()} - + {!noPagination && ( + + )}
); diff --git a/src/pages/Dashboard/Clusters/Detail/Helm/index.jsx b/src/pages/Dashboard/Clusters/Detail/Helm/index.jsx index cc3731be..b45e31fa 100644 --- a/src/pages/Dashboard/Clusters/Detail/Helm/index.jsx +++ b/src/pages/Dashboard/Clusters/Detail/Helm/index.jsx @@ -83,9 +83,7 @@ export default class HelmCluster extends React.Component { onChangeNodeStatus, selectNodeStatus, extendedRowKeys, - onChangeExtend, - changePaginationNode, - totalNodeCount + onChangeExtend } = clusterDetailStore; const props = { @@ -96,12 +94,7 @@ export default class HelmCluster extends React.Component { onChange: onChangeNodeStatus, selectValue: selectNodeStatus }), - pagination: { - tableType: 'Clusters', - onChange: changePaginationNode, - total: totalNodeCount, - current: 1 - } + noPagination: true }; if (nodeType === 'Additional') { From 3c5153be070d7d297ab4bcfc8784d06922c316e9 Mon Sep 17 00:00:00 2001 From: lizhi Date: Tue, 26 Mar 2019 09:39:01 +0800 Subject: [PATCH 2/2] fix: ExtendedTr line --- src/components/Base/Table/index.jsx | 12 +++++++++++- src/components/Base/Table/index.scss | 11 ++++++++++- src/pages/Dashboard/Clusters/Detail/Helm/index.jsx | 1 + 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/components/Base/Table/index.jsx b/src/components/Base/Table/index.jsx index 598f4623..0941cbb4 100644 --- a/src/components/Base/Table/index.jsx +++ b/src/components/Base/Table/index.jsx @@ -418,12 +418,22 @@ export class Table extends React.Component { pagination, isLoading, rowSelection, + hasExtendedTr, noPagination } = this.props; const { selectedRowKeys } = this.state; return ( -
+
{this.renderTable()} {!noPagination && ( diff --git a/src/components/Base/Table/index.scss b/src/components/Base/Table/index.scss index 5f407b4a..b7a9279a 100644 --- a/src/components/Base/Table/index.scss +++ b/src/components/Base/Table/index.scss @@ -243,11 +243,20 @@ } } +.extendedTable { + :global(.pi-table) { + &-tbody > tr > td:first-child { + padding-left: 5px; + } + } +} + .noData { padding: 20px 0; text-align: center; border-radius: 2px; - box-shadow: 0 1px 4px 0 rgba(73, 33, 173, 0.06), 0 4px 8px 0 rgba(35, 35, 36, 0.04); + box-shadow: 0 1px 4px 0 rgba(73, 33, 173, 0.06), + 0 4px 8px 0 rgba(35, 35, 36, 0.04); background-color: $N0; .word { margin-bottom: 16px; diff --git a/src/pages/Dashboard/Clusters/Detail/Helm/index.jsx b/src/pages/Dashboard/Clusters/Detail/Helm/index.jsx index b45e31fa..56a7c9bb 100644 --- a/src/pages/Dashboard/Clusters/Detail/Helm/index.jsx +++ b/src/pages/Dashboard/Clusters/Detail/Helm/index.jsx @@ -94,6 +94,7 @@ export default class HelmCluster extends React.Component { onChange: onChangeNodeStatus, selectValue: selectNodeStatus }), + hasExtendedTr: true, noPagination: true };