diff --git a/core/src/common/interface.d.ts b/core/src/common/interface.d.ts index c0a0e2c678..62b1f9a70e 100644 --- a/core/src/common/interface.d.ts +++ b/core/src/common/interface.d.ts @@ -19,7 +19,8 @@ export { AntTreeNodeSelectedEvent } from 'antd/lib/tree/Tree'; export { RangePickerProps, RangePickerValue } from 'antd/es/date-picker/interface'; export { UploadProps } from 'antd/es/upload'; export { InputProps } from 'antd/es/input'; -export { PaginationConfig, SorterResult, ColumnProps } from 'antd/lib/table'; +export { PaginationConfig, SorterResult } from 'antd/lib/table'; +export { ColumnProps } from '../nusi/wrapped-table'; export { ModalProps } from 'antd/es/modal'; export { FormComponentProps } from 'antd/es/form'; diff --git a/core/src/nusi/index.tsx b/core/src/nusi/index.tsx index ec0fb0fd5d..8869cd4c36 100644 --- a/core/src/nusi/index.tsx +++ b/core/src/nusi/index.tsx @@ -43,7 +43,6 @@ import { Spin, Steps, Switch, - Table, Tabs, Transfer, Tree, @@ -55,6 +54,7 @@ import { } from 'antd'; import { FixedSelect } from './fixed-select'; import FixRangePicker from './range-picker'; +import Table from './wrapped-table'; import '@terminus/nusi/dist/nusi.scss'; import 'antd/dist/antd.less'; import { diff --git a/core/src/nusi/wrapped-table.tsx b/core/src/nusi/wrapped-table.tsx new file mode 100644 index 0000000000..3e62d88285 --- /dev/null +++ b/core/src/nusi/wrapped-table.tsx @@ -0,0 +1,43 @@ +// Copyright (c) 2021 Terminus, Inc. +// +// This program is free software: you can use, redistribute, and/or modify +// it under the terms of the GNU Affero General Public License, version 3 +// or later ("AGPL"), as published by the Free Software Foundation. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +import * as React from 'react'; +import { Table } from 'antd'; +import { ColumnProps as AntdColumnProps, TableProps } from 'antd/lib/table'; + +export interface ColumnProps extends AntdColumnProps { + /** + * id\number - 72 + * user\status\type\cpu\memory - 120 + * email\phone\roles\ip - 160 + * time - 200 + * operations - 80 * n, according to the number of buttons and the number of words + * detail\content\description - No need to increase the width of the adaptive, and add the scroll.x of a certain number to the table + * All width should be at least larger than the Title in English + */ + width?: 64 | 72 | 80 | 96 | 120 | 160 | 176 | 200 | 240 | 280 | 320; +} + +interface IProps extends TableProps { + columns: Array>; +} + +function WrappedTable({ columns, ...props }: IProps) { + const newColumns = columns?.map(({ ...args }: ColumnProps) => ({ + ellipsis: true, + ...args, + })); + return ; +} + +export default WrappedTable; diff --git a/shell/app/common/__tests__/components/paging-table.test.tsx b/shell/app/common/__tests__/components/paging-table.test.tsx index fffc7d189f..d7b685bef2 100644 --- a/shell/app/common/__tests__/components/paging-table.test.tsx +++ b/shell/app/common/__tests__/components/paging-table.test.tsx @@ -52,11 +52,11 @@ describe('PagingTable', () => { dataSource, }); expect(wrapper.find('.table-title').text()).toBe('project list'); - expect(wrapper.find('Table').prop('columns')).toHaveLength(columns.length); + expect(wrapper.find('WrappedTable').prop('columns')).toHaveLength(columns.length); wrapper.setProps({ basicOperation: true, }); - expect(wrapper.find('Table').prop('columns')).toHaveLength(columns.length + 1); + expect(wrapper.find('WrappedTable').prop('columns')).toHaveLength(columns.length + 1); const wrapperInstance = wrapper.instance(); wrapperInstance.onChangePage(2); expect(wrapperInstance.page).toStrictEqual({ pageNo: 2, pageSize: 15 }); diff --git a/shell/app/common/components/authorize-member-modal.tsx b/shell/app/common/components/authorize-member-modal.tsx index 7968410442..a284456d2a 100644 --- a/shell/app/common/components/authorize-member-modal.tsx +++ b/shell/app/common/components/authorize-member-modal.tsx @@ -121,14 +121,7 @@ export const AuthorizeMemberModal = ({ type, member, closeModal }: IProps) => { ]} width={600} > -
+
); }; diff --git a/shell/app/common/components/key-value-table.tsx b/shell/app/common/components/key-value-table.tsx index 7aad376dd7..dfce6dd090 100644 --- a/shell/app/common/components/key-value-table.tsx +++ b/shell/app/common/components/key-value-table.tsx @@ -128,7 +128,6 @@ interface IProps { pageSize: number; current?: number; }; - size?: 'small' | 'middle' | 'default'; className?: string; addBtnText?: string; disableAdd?: boolean; @@ -246,7 +245,6 @@ export class KeyValueTable extends React.Component { form, title = '', pagination = { pageSize: 5, hideOnSinglePage: true }, - size = 'small', className = '', addBtnText = i18n.t('common:add'), disableAdd = false, @@ -270,7 +268,7 @@ export class KeyValueTable extends React.Component { { title: 'KEY', dataIndex: 'key', - width: '40%', + width: 280, render: (text: string, record: IItemData) => ( { { title: 'VALUE', dataIndex: 'value', - width: '40%', render: (text: string, record: IItemData) => ( { if (!disableDelete) { columns.push({ title: i18n.t('common:operation'), - width: 100, + width: 160, dataIndex: 'operation', className: 'operation', render: (_text, record) => { @@ -344,12 +341,11 @@ export class KeyValueTable extends React.Component { columns={columns} rowKey="uniKey" pagination={showPagination ? pagination : false} - size={size} className={`key-value-table ${className}`} - scroll={{ x: '100%' }} ref={(ref) => { this.table = ref; }} + scroll={{ x: 800 }} /> ); diff --git a/shell/app/common/components/members-table.tsx b/shell/app/common/components/members-table.tsx index 43f9293fce..746bb5046a 100644 --- a/shell/app/common/components/members-table.tsx +++ b/shell/app/common/components/members-table.tsx @@ -16,6 +16,7 @@ import { usePerm } from 'app/user/common'; import userStore from 'app/user/stores'; import appMemberStore from 'common/stores/application-member'; import { AddMemberModal, Copy, FilterGroup, FormModal, IF, DropdownSelect } from 'common'; +import { ColumnProps } from 'core/common/interface'; import { useLoading } from 'core/stores/loading'; import { AuthorizeMemberModal } from './authorize-member-modal'; import i18n from 'i18n'; @@ -331,138 +332,152 @@ export const MembersTable = ({ ); const columns = React.useMemo( - () => [ - { - title: i18n.t('nickname'), - dataIndex: 'nick', - render: (nick: string, record: IMember) => { - const { userId, removed } = record; - return ( -
- {nick || i18n.t('common:none')} - - [{i18n.t('current user')}] - - - [{i18n.t('exit the organization')}] - -
- ); + () => + [ + { + title: i18n.t('nickname'), + dataIndex: 'nick', + width: 200, + render: (nick: string, record: IMember) => { + const { userId, removed } = record; + return ( +
+ {nick || i18n.t('common:none')} + + [{i18n.t('current user')}] + + + [{i18n.t('exit the organization')}] + +
+ ); + }, }, - }, - { - title: i18n.t('user name'), - dataIndex: 'name', - render: (name: string) => { - return ( -
- {name || i18n.t('common:none')} -
- ); + { + title: i18n.t('user name'), + dataIndex: 'name', + width: 200, + render: (name: string) => { + return ( +
+ {name || i18n.t('common:none')} +
+ ); + }, }, - }, - { - title: 'Email', - dataIndex: 'email', - render: (value: string) => ( - - + { + title: 'Email', + dataIndex: 'email', + width: 200, + render: (value: string) => ( + + + {value || i18n.t('common:none')} + + + ), + }, + { + title: i18n.t('cellphone'), + dataIndex: 'mobile', + render: (value: string | number) => ( + {value || i18n.t('common:none')} - - ), - }, - { - title: i18n.t('cellphone'), - dataIndex: 'mobile', - render: (value: string | number) => ( - - {value || i18n.t('common:none')} - - ), - }, - { - title: i18n.t('role'), - dataIndex: 'roles', - render: (roles: string[]) => { - const rolesStr = map(roles, (role) => roleMap[role] || i18n.t('common:other')).join(','); - return ( -
- - {rolesStr} - -
- ); + ), }, - }, - ...insertWhen(scope.type === MemberScope.ORG, [ { - title: i18n.t('member label'), - dataIndex: 'labels', - render: (val: string[]) => { - const curLabels = map(val, (item) => { - const labelObj = find(memberLabels, { label: item }) || { name: item, label: item }; - return ( -
- {labelObj.name} -
- ); - }); + title: i18n.t('role'), + dataIndex: 'roles', + width: 200, + render: (roles: string[]) => { + const rolesStr = map(roles, (role) => roleMap[role] || i18n.t('common:other')).join(','); return ( -
- get(triggerNode, 'parentElement')} - > - {curLabels} +
+ + {rolesStr}
); }, }, - ]), - ...insertWhen(!readOnly, [ - { - title: i18n.t('operations'), - key: 'op', - width: 150, - fixed: 'right', - render: (record: IMember) => { - const { userId, removed, labels } = record; - const isCurrentUser = currentUserId === userId; - const editOp = memberAuth.edit ? ( - updater.editMember({ ...record, labels: labels || [] })} - > - {i18n.t('edit')} - - ) : null; - const removeOp = - isCurrentUser || memberAuth.delete ? ( - confirmDelete(record, isCurrentUser)}> - {isCurrentUser ? i18n.t('exit') : memberAuth.delete ? i18n.t('remove') : null} - - ) : null; - const authorizeOp = - showAuthorize && memberAuth.showAuthorize ? ( - updater.authorizeMember(record)}> - {i18n.t('authorize')} + ...insertWhen(scope.type === MemberScope.ORG, [ + { + title: i18n.t('member label'), + dataIndex: 'labels', + render: (val: string[]) => { + const curLabels = map(val, (item) => { + const labelObj = find(memberLabels, { label: item }) || { name: item, label: item }; + return ( +
+ {labelObj.name} +
+ ); + }); + return ( +
+ get(triggerNode, 'parentElement')} + > + {curLabels} + +
+ ); + }, + }, + ]), + ...insertWhen(!readOnly, [ + { + title: i18n.t('operations'), + key: 'op', + width: 200, + fixed: 'right', + render: (record: IMember) => { + const { userId, removed, labels } = record; + const isCurrentUser = currentUserId === userId; + const editOp = memberAuth.edit ? ( + updater.editMember({ ...record, labels: labels || [] })} + > + {i18n.t('edit')} ) : null; + const removeOp = + isCurrentUser || memberAuth.delete ? ( + confirmDelete(record, isCurrentUser)}> + {isCurrentUser ? i18n.t('exit') : memberAuth.delete ? i18n.t('remove') : null} + + ) : null; + const authorizeOp = + showAuthorize && memberAuth.showAuthorize ? ( + updater.authorizeMember(record)} + > + {i18n.t('authorize')} + + ) : null; - return ( -
- {updateMembers && !removed ? editOp : null} - {authorizeOp} - {removeOp} -
- ); + return ( +
+ {updateMembers && !removed ? editOp : null} + {authorizeOp} + {removeOp} +
+ ); + }, }, - }, - ]), - ], + ]), + ] as Array>, [ confirmDelete, currentUserId, @@ -498,8 +513,7 @@ export const MembersTable = ({ pagination={{ ...paging, onChange: onChangePage }} columns={columns} dataSource={list} - tableLayout="auto" - scroll={{ x: '100%' }} + scroll={{ x: 1100 }} /> ); }, [columns, list, onTableSelectChange, paging, state.queryParams, state.selectedKeys, updater, hideRowSelect]); diff --git a/shell/app/modules/addonPlatform/pages/common/components/addon-detail-drawer.tsx b/shell/app/modules/addonPlatform/pages/common/components/addon-detail-drawer.tsx index 8c2a3f7063..5e1b184fd0 100644 --- a/shell/app/modules/addonPlatform/pages/common/components/addon-detail-drawer.tsx +++ b/shell/app/modules/addonPlatform/pages/common/components/addon-detail-drawer.tsx @@ -37,11 +37,13 @@ const refTableList = [ title: i18n.t('application'), dataIndex: 'applicationName', key: 'applicationName', + width: 220, }, { title: i18n.t('application instance'), dataIndex: 'runtimeName', key: 'runtimeName', + width: 220, }, { title: i18n.t('addonPlatform:deployment details'), @@ -106,7 +108,7 @@ const AddonDetailDrawer = (props: IProps) => {
{i18n.t('org:reference detail')}
{ title: i18n.t('common:state'), dataIndex: ['state', 'state'], key: 'state.state', - width: 140, + width: 160, render: (v) => { return ( { @@ -155,7 +155,7 @@ export default () => { title: i18n.t('create time'), dataIndex: 'createTime', key: 'createTime', - width: 180, + width: 200, render: (v) => formatTime(v, 'YYYY-MM-DD HH:mm:ss'), }, isHistory @@ -217,7 +217,7 @@ export default () => { columns={getCols(false)} rowKey="profiling" pagination={false} - scroll={{ x: '100%' }} + scroll={{ x: 900 }} /> @@ -232,7 +232,7 @@ export default () => { total: historyPaging.total, onChange: (no: number) => getHistoryList({ pageNo: no }), }} - scroll={{ x: '100%' }} + scroll={{ x: 900 }} /> diff --git a/shell/app/modules/apiManagePlatform/components/sla-select.tsx b/shell/app/modules/apiManagePlatform/components/sla-select.tsx index 4ee0170f17..0f8f0971fd 100644 --- a/shell/app/modules/apiManagePlatform/components/sla-select.tsx +++ b/shell/app/modules/apiManagePlatform/components/sla-select.tsx @@ -75,17 +75,16 @@ const SLASelect = ({ dataSource, onChange, defaultSelectKey }: IProps) => {
4 ? { y: 150 } : undefined} + scroll={limits.length > 4 ? { y: 150, x: 800 } : { x: 800 }} columns={[ { title: i18n.t('times'), dataIndex: 'limit', - width: 300, + width: 320, }, { title: i18n.t('unit'), dataIndex: 'unit', - width: 228, render: (unit) => slaUnitMap[unit], }, ]} diff --git a/shell/app/modules/apiManagePlatform/pages/access-manage/detail/authorization-user.tsx b/shell/app/modules/apiManagePlatform/pages/access-manage/detail/authorization-user.tsx index a602eb6d2e..1936ca2823 100644 --- a/shell/app/modules/apiManagePlatform/pages/access-manage/detail/authorization-user.tsx +++ b/shell/app/modules/apiManagePlatform/pages/access-manage/detail/authorization-user.tsx @@ -101,6 +101,7 @@ const AuthorizationUser = ({ swaggerVersion, assetID }: { swaggerVersion: string { title: i18n.t('client name'), dataIndex: ['client', 'displayName'], + width: 120, render: (text, record) => { return (
@@ -126,6 +127,7 @@ const AuthorizationUser = ({ swaggerVersion, assetID }: { swaggerVersion: string { title: i18n.t('client identifier'), dataIndex: ['client', 'name'], + width: 120, }, { title: i18n.t('current SLA'), @@ -138,6 +140,7 @@ const AuthorizationUser = ({ swaggerVersion, assetID }: { swaggerVersion: string { title: i18n.t('status'), dataIndex: ['contract', 'status'], + width: 80, render: (text, { contract }) => { if (contract.requestSLAID && text === 'proved') { return i18n.t('apply to change SLA'); @@ -148,7 +151,8 @@ const AuthorizationUser = ({ swaggerVersion, assetID }: { swaggerVersion: string { title: i18n.t('operation'), dataIndex: 'permission', - width: 220, + width: 240, + fixed: 'right', render: ({ edit }: API_ACCESS.ClientPermission, { contract }) => { if (!edit) { return null; @@ -202,7 +206,7 @@ const AuthorizationUser = ({ swaggerVersion, assetID }: { swaggerVersion: string }, }; }} - scroll={{ x: '100%' }} + scroll={{ x: 800 }} /> { { title: i18n.t('request limit'), dataIndex: 'limits', + width: 160, render: (limits: API_ACCESS.SlaLimit[]) => { const limitsStr = (limits || []).map(({ limit, unit }) => { return `${limit} ${slaUnitMap[unit]}`; @@ -96,19 +97,20 @@ const Sla = () => { { title: i18n.t('number of client'), dataIndex: 'clientCount', - width: 120, + width: 160, render: (count) => count || 0, }, { title: i18n.t('authorization method'), dataIndex: 'approval', - width: 150, + width: 200, render: (approval) => slaAuthorizationMap[approval]?.name, }, { title: i18n.t('operation'), dataIndex: 'id', - width: 150, + width: 160, + fixed: 'right', render: (_id, record: API_ACCESS.SlaItem) => { if (!canEdit || record.source === 'system') { return null; @@ -144,7 +146,7 @@ const Sla = () => { columns={columns} dataSource={slaLis} pagination={false} - scroll={{ x: '100%' }} + scroll={{ x: 800 }} /> { { title: i18n.t('number of versions'), dataIndex: 'totalChildren', + width: 160, }, ]; const subColumns: Array> = [ @@ -86,16 +87,19 @@ const AccessList = () => { { title: i18n.t('number of related clients'), dataIndex: 'appCount', + width: 200, }, { title: i18n.t('create time'), dataIndex: 'createdAt', + width: 176, render: (date) => moment(date).format('YYYY-MM-DD HH:mm:ss'), }, { title: i18n.t('operation'), dataIndex: 'permission', width: 120, + fixed: 'right', render: ({ edit, delete: canDelete }: API_ACCESS.AccessPermission, record) => { return ( @@ -137,7 +141,7 @@ const AccessList = () => { }, }; }} - scroll={{ x: '100%' }} + scroll={{ x: 800 }} /> ); }; diff --git a/shell/app/modules/apiManagePlatform/pages/api-market/detail/components/api-preview-2.0.tsx b/shell/app/modules/apiManagePlatform/pages/api-market/detail/components/api-preview-2.0.tsx index 9e67d2f7c7..be12c9adeb 100644 --- a/shell/app/modules/apiManagePlatform/pages/api-market/detail/components/api-preview-2.0.tsx +++ b/shell/app/modules/apiManagePlatform/pages/api-market/detail/components/api-preview-2.0.tsx @@ -85,7 +85,7 @@ const columns = [ title: i18n.t('required'), dataIndex: 'required', render: (val: boolean) => (val ? i18n.t('common:yes') : i18n.t('common:no')), - width: 60, + width: 64, }, ]; diff --git a/shell/app/modules/apiManagePlatform/pages/api-market/detail/components/api-preview-3.0.tsx b/shell/app/modules/apiManagePlatform/pages/api-market/detail/components/api-preview-3.0.tsx index f6b9ef6a1f..ada183ed9f 100644 --- a/shell/app/modules/apiManagePlatform/pages/api-market/detail/components/api-preview-3.0.tsx +++ b/shell/app/modules/apiManagePlatform/pages/api-market/detail/components/api-preview-3.0.tsx @@ -130,7 +130,7 @@ const columns = [ }, }, { title: i18n.t('description'), dataIndex: 'description' }, - { title: i18n.t('required'), dataIndex: 'required', width: 60 }, + { title: i18n.t('required'), dataIndex: 'required', width: 80 }, ]; const getSchema = (content = {}) => { @@ -368,7 +368,7 @@ const ApiPreviewV3 = ({ dataSource, extra }: IProps) => { props: { title: i18n.t('response code'), columns: [ - { title: i18n.t('response code'), dataIndex: 'code', width: 100 }, + { title: i18n.t('response code'), dataIndex: 'code', width: 128 }, { title: i18n.t('description'), dataIndex: 'description' }, ], }, diff --git a/shell/app/modules/apiManagePlatform/pages/api-market/list/index.tsx b/shell/app/modules/apiManagePlatform/pages/api-market/list/index.tsx index 579dcda038..dbda9d7e2f 100644 --- a/shell/app/modules/apiManagePlatform/pages/api-market/list/index.tsx +++ b/shell/app/modules/apiManagePlatform/pages/api-market/list/index.tsx @@ -16,7 +16,7 @@ import { useDebounce, useUnmount } from 'react-use'; import { CustomFilter, TableActions, UserInfo, useUpdate } from 'common'; import apiMarketStore from 'app/modules/apiManagePlatform/stores/api-market'; import { useLoading } from 'core/stores/loading'; -import { Input, Button, Table } from 'app/nusi'; +import { Input, Button, Table, Tooltip } from 'app/nusi'; import i18n from 'i18n'; import { goTo } from 'common/utils'; import AssetModal, { IMode, IScope } from 'app/modules/apiManagePlatform/pages/api-market/components/asset-modal'; @@ -154,6 +154,7 @@ const ApiMarketList = () => { { title: i18n.t('API name'), dataIndex: ['asset', 'assetName'], + width: 240, }, { title: i18n.t('API description'), @@ -162,23 +163,30 @@ const ApiMarketList = () => { { title: 'API ID', dataIndex: ['asset', 'assetID'], + width: 200, }, { title: i18n.t('update time'), dataIndex: ['asset', 'updatedAt'], - width: 180, + width: 200, render: (date) => moment(date).format('YYYY-MM-DD HH:mm:ss'), }, { title: i18n.t('creator'), dataIndex: ['asset', 'creatorID'], - width: 180, - render: (text) => , + width: 160, + render: (text) => ( + }> + + <> + + ), }, { title: i18n.t('operation'), dataIndex: 'permission', - width: 200, + width: 280, + fixed: 'right', render: ({ manage, addVersion, hasAccess }: API_MARKET.AssetPermission, { asset }) => { return ( @@ -245,7 +253,7 @@ const ApiMarketList = () => { }} onChange={handleTableChange} loading={isFetchList} - scroll={{ x: '100%' }} + scroll={{ x: 1300 }} /> `${major}.${minor}.${patch}`, }, { @@ -227,18 +228,20 @@ const VersionInfo = ({ assetID, onRelation, onSelectVersion, versionRef }: IProp { title: i18n.t('creator'), dataIndex: ['version', 'creatorID'], + width: 120, render: (text) => } />, }, { title: i18n.t('create time'), dataIndex: ['version', 'createdAt'], - width: 180, + width: 200, render: (text) => (text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''), }, { title: i18n.t('operate'), dataIndex: ['version', 'id'], - width: 200, + width: 280, + fixed: 'right', render: (_text, { version }) => (
{ { title: i18n.t('API name'), dataIndex: 'assetName', + width: 200, render: (text, record) => { return (
@@ -203,6 +204,7 @@ const ClientDetail = () => { { title: i18n.t('version'), dataIndex: 'swaggerVersion', + width: 160, }, ]; if (statue === 'proved') { @@ -220,6 +222,7 @@ const ClientDetail = () => { title: i18n.t('operation'), width: '150', dataIndex: 'id', + fixed: 'right', render: (_id: number, record: API_CLIENT.Contract) => ( { onChange={(pagination) => { handleChangeTable(value, pagination); }} - scroll={{ x: '100%' }} + scroll={{ x: 800 }} /> ))} diff --git a/shell/app/modules/apiManagePlatform/pages/client/list/index.tsx b/shell/app/modules/apiManagePlatform/pages/client/list/index.tsx index 7da2699483..cab6277554 100644 --- a/shell/app/modules/apiManagePlatform/pages/client/list/index.tsx +++ b/shell/app/modules/apiManagePlatform/pages/client/list/index.tsx @@ -72,11 +72,13 @@ const ClientList = () => { { title: i18n.t('client name'), dataIndex: ['client', 'displayName'], + width: 200, render: (text, record) => text || record.client.name, }, { title: i18n.t('client identifier'), dataIndex: ['client', 'name'], + width: 200, }, { title: i18n.t('description'), @@ -85,7 +87,8 @@ const ClientList = () => { { title: i18n.t('operation'), dataIndex: ['client', 'id'], - width: 120, + width: 160, + fixed: 'right', render: (text, record) => { return ( @@ -135,7 +138,7 @@ const ClientList = () => { }, }; }} - scroll={{ x: '100%' }} + scroll={{ x: 800 }} /> { { title: 'ID', dataIndex: 'id', + width: 64, }, { title: i18n.t('project/application/branch'), dataIndex: 'projectName', width: 240, - ellipsis: true, render: (projectName: string, record: any) => { const mainInfo = `${projectName}/${record.applicationName}/${record.branchName}`; return {mainInfo}; @@ -105,6 +105,7 @@ const PureDeployList = (props: IProps) => { { title: i18n.t('application:pipeline ID'), dataIndex: 'buildId', + width: 120, render: (val: string, record: DEPLOY.IDeploy) => { if (!val) return ''; const { buildId, projectId, applicationId } = record; @@ -119,6 +120,7 @@ const PureDeployList = (props: IProps) => { { title: i18n.t('applicant'), dataIndex: 'operator', + width: 120, render: (val: string) => { const curUser = userMap[val]; return curUser ? curUser.nick || curUser.name : ''; @@ -150,6 +152,8 @@ const PureDeployList = (props: IProps) => { pending: { title: i18n.t('operate'), key: 'operation', + width: 120, + fixed: 'right', render: (_: any, record: DEPLOY.IDeploy) => { return (
@@ -179,6 +183,7 @@ const PureDeployList = (props: IProps) => { approved: { title: i18n.t('org:approval result'), dataIndex: 'approvalStatus', + width: 160, render: (val: string) => (approvalStatusMap[val] || {}).name, }, }, @@ -194,7 +199,7 @@ const PureDeployList = (props: IProps) => { }; const action = get(actionMap, `${type}.${status}`); - action && columns.push({ ...action, width: 120, fixed: 'right', align: 'center' }); + action && columns.push({ ...action, fixed: 'right', align: 'center' }); const { onSubmit, onReset, fetchDataWithQuery, autoPagination } = useFilter({ getData: getList, @@ -244,7 +249,13 @@ const PureDeployList = (props: IProps) => {
-
+
{ const type = getProblemType().find((t) => t.value === text); return type ? type.name : '-'; @@ -106,7 +106,7 @@ export const ProblemList = (props: Pick { const priority: any = ProblemPriority.find((t: any) => t.value === text); return {priority.name}; @@ -115,19 +115,19 @@ export const ProblemList = (props: Pick fromNow(text), }, ...insertWhen(ticketType !== 'open', [ { title: i18n.t('close person'), dataIndex: 'content', - width: 150, + width: 120, render: (_text, record) => { return record.status === 'closed' ? record.lastOperatorUser : ''; }, @@ -135,7 +135,7 @@ export const ProblemList = (props: Pick (text === 'closed' ? fromNow(record[updateKeyMap[text]]) : ''), }, ] as Array>), @@ -164,6 +164,7 @@ export const ProblemList = (props: Pick diff --git a/shell/app/modules/application/pages/quality/index.tsx b/shell/app/modules/application/pages/quality/index.tsx index 908e4d564d..98d825d3f7 100644 --- a/shell/app/modules/application/pages/quality/index.tsx +++ b/shell/app/modules/application/pages/quality/index.tsx @@ -169,7 +169,7 @@ const CodeQuality = () => { const columns: Array> = [ { title: i18n.t('application:file name'), - width: 360, + width: 240, key: 'name', render: ({ name }) => ( @@ -185,14 +185,14 @@ const CodeQuality = () => { }, { title: SONAR_MAP[type].percentCNName, - width: 150, + width: 160, key: 'percentCNName', render: ({ measures }) => `${measures.find((item: QA.Measure) => item.metric === SONAR_MAP[type].percentName)?.value} %`, }, { title: SONAR_MAP[type].lineCNName, - width: 150, + width: 240, key: 'lineCNName', render: ({ measures }) => `${measures.find((item: QA.Measure) => item.metric === SONAR_MAP[type].linesName)?.value}`, @@ -213,7 +213,7 @@ const CodeQuality = () => { }, }; }} - scroll={{ x: '100%' }} + scroll={{ x: 900 }} /> ); }; diff --git a/shell/app/modules/application/pages/repo/repo-tree.tsx b/shell/app/modules/application/pages/repo/repo-tree.tsx index 55e5f90cb5..86bfaa2ce2 100644 --- a/shell/app/modules/application/pages/repo/repo-tree.tsx +++ b/shell/app/modules/application/pages/repo/repo-tree.tsx @@ -170,7 +170,7 @@ const RepoTree = ({ tree, info, isFetchingInfo, isFetchingTree }: ITreeProps) => dataSource={dataSource} pagination={false} rowKey="name" - scroll={{ x: '100%' }} + scroll={{ x: 800 }} onRow={({ name, id }) => { const tropicalPathName = encodeURI(name); return { @@ -189,11 +189,11 @@ const RepoTree = ({ tree, info, isFetchingInfo, isFetchingTree }: ITreeProps) => { title: 'Name', dataIndex: 'name', - width: '30%', + width: 220, render: (text, record) => { const iconProps = record.type === 'tree' ? { type: 'folder' } : { type: 'page' }; return ( - + {record.type ? : null} {text} @@ -203,7 +203,6 @@ const RepoTree = ({ tree, info, isFetchingInfo, isFetchingTree }: ITreeProps) => { title: 'Last Commit', dataIndex: ['commit', 'commitMessage'], - width: '55%', render: (text, record) => ( {renderAsLink( @@ -218,7 +217,7 @@ const RepoTree = ({ tree, info, isFetchingInfo, isFetchingTree }: ITreeProps) => { title: 'Last Update', dataIndex: ['commit', 'author', 'when'], - width: 115, + width: 220, render: (text) => (text ? fromNow(text) : ''), }, ]} diff --git a/shell/app/modules/application/pages/repo/util.tsx b/shell/app/modules/application/pages/repo/util.tsx index a413f1fc74..e89708672d 100644 --- a/shell/app/modules/application/pages/repo/util.tsx +++ b/shell/app/modules/application/pages/repo/util.tsx @@ -29,7 +29,7 @@ export const renderAsLink = ( ) => { const link = mergeRepoPathWith(`/${replace}/${commitHash}`); return ( - e.stopPropagation()}> + e.stopPropagation()} title={text}> {text} ); diff --git a/shell/app/modules/application/pages/settings/components/app-notify/common-notify-group.tsx b/shell/app/modules/application/pages/settings/components/app-notify/common-notify-group.tsx index a69d8b8693..0b58b2174f 100644 --- a/shell/app/modules/application/pages/settings/components/app-notify/common-notify-group.tsx +++ b/shell/app/modules/application/pages/settings/components/app-notify/common-notify-group.tsx @@ -405,8 +405,9 @@ const NotifyGroup = ({ memberStore, commonPayload }: IProps) => { dataIndex: 'targets', className: 'notify-info', ellipsis: true, + width: 200, render: (targets) => ( -
+
), @@ -414,17 +415,20 @@ const NotifyGroup = ({ memberStore, commonPayload }: IProps) => { { title: i18n.t('default:creator'), dataIndex: 'creator', + width: 160, render: (text) => userMap[text]?.nick, }, { title: i18n.t('default:create time'), dataIndex: 'createdAt', + width: 176, render: (text) => moment(text).format('YYYY-MM-DD HH:mm:ss'), }, { title: i18n.t('default:operation'), dataIndex: 'id', - width: 150, + width: 160, + fixed: 'right', render: (id: number, record) => { return (
@@ -470,7 +474,7 @@ const NotifyGroup = ({ memberStore, commonPayload }: IProps) => { modalProps={{ destroyOnClose: true }} /> -
+
); diff --git a/shell/app/modules/application/pages/settings/components/app-notify/notify-config.tsx b/shell/app/modules/application/pages/settings/components/app-notify/notify-config.tsx index 49f6d6a606..22c34fba92 100644 --- a/shell/app/modules/application/pages/settings/components/app-notify/notify-config.tsx +++ b/shell/app/modules/application/pages/settings/components/app-notify/notify-config.tsx @@ -218,8 +218,9 @@ export const NotifyConfig = ({ commonPayload, memberStore }: IProps) => { dataIndex: ['notifyGroup', 'targets'], ellipsis: true, className: 'notify-info', + width: 200, render: (targets) => ( -
+
), @@ -227,17 +228,20 @@ export const NotifyConfig = ({ commonPayload, memberStore }: IProps) => { { title: i18n.t('default:creator'), dataIndex: 'creator', + width: 160, render: (text) => userMap[text]?.nick, }, { title: i18n.t('default:create time'), dataIndex: 'createdAt', + width: 176, render: (text) => moment(text).format('YYYY-MM-DD HH:mm:ss'), }, { title: i18n.t('default:operation'), dataIndex: 'id', - width: 150, + width: 160, + fixed: 'right', render: (text, record) => { return (
@@ -293,7 +297,7 @@ export const NotifyConfig = ({ commonPayload, memberStore }: IProps) => { modalProps={{ destroyOnClose: true }} /> -
+
); diff --git a/shell/app/modules/application/pages/settings/components/app-variable-config.tsx b/shell/app/modules/application/pages/settings/components/app-variable-config.tsx index 4d59a90995..cc0114952f 100644 --- a/shell/app/modules/application/pages/settings/components/app-variable-config.tsx +++ b/shell/app/modules/application/pages/settings/components/app-variable-config.tsx @@ -15,6 +15,7 @@ import { useLoading } from 'core/stores/loading'; import configStore from 'app/modules/application/stores/pipeline-config'; import appStore from 'application/stores/application'; import { Copy, IF, useUpdate, CustomFilter, FileEditor } from 'common'; +import { ColumnProps } from 'core/common/interface'; import { WORKSPACE_LIST } from 'common/constants'; import routeInfoStore from 'core/stores/route'; import i18n from 'i18n'; @@ -203,14 +204,15 @@ const VariableConfig = ({ }); }; - const getColumns = (_env: string) => [ + const getColumns = (_env: string): Array> => [ { title: 'Key', dataIndex: 'key', + width: 176, sorter: (a: IKey, b: IKey) => a.key.charCodeAt(0) - b.key.charCodeAt(0), render: (text: string, { isFromDefault, source }: IKey) => (
- + {text} @@ -228,6 +230,7 @@ const VariableConfig = ({ title: 'Value', dataIndex: 'value', className: 'nowrap', + width: 176, render: (text: string, record: IKey) => { return record.type === typeMap.kv ? ( record.encrypt ? ( @@ -247,6 +250,7 @@ const VariableConfig = ({ { title: i18n.t('application:type'), dataIndex: 'type', + width: 96, render: (text: string) => (text === typeMap.kv ? i18n.t('application:value') : i18n.t('application:file')), }, { @@ -257,7 +261,8 @@ const VariableConfig = ({ { title: i18n.t('common:operation'), dataIndex: 'operations', - width: 160, + width: 200, + fixed: 'right', render: (operations: IKeyOperations, record: IKey) => { const { canDelete, canDownload, canEdit } = operations || {}; const { encrypt } = record; @@ -380,7 +385,7 @@ const VariableConfig = ({ )} -
+
); })} diff --git a/shell/app/modules/application/pages/test/test-list.tsx b/shell/app/modules/application/pages/test/test-list.tsx index 385bfceb37..0ce65ec9e4 100644 --- a/shell/app/modules/application/pages/test/test-list.tsx +++ b/shell/app/modules/application/pages/test/test-list.tsx @@ -68,6 +68,7 @@ const columns: Array> = [ { title: i18n.t('default:name'), dataIndex: 'name', + width: 176, render: (text) => {cutStr(text, 30, { showTip: true })}, }, { @@ -77,19 +78,23 @@ const columns: Array> = [ { title: i18n.t('default:creator'), dataIndex: 'operatorName', + width: 120, }, { title: i18n.t('default:create time'), dataIndex: 'createdAt', + width: 176, render: (text) => fromNow(text), }, { title: i18n.t('default:type'), dataIndex: 'type', + width: 120, }, { title: i18n.t('application:time consuming'), dataIndex: ['totals', 'duration'], + width: 160, render: (text) => getTestDuration(text), }, { @@ -134,7 +139,7 @@ const TestList = () => { ...testListPaging, onChange: handlePageChange, }} - scroll={{ x: '100%' }} + scroll={{ x: 1100 }} /> diff --git a/shell/app/modules/cmp/common/addon-detail/resource.tsx b/shell/app/modules/cmp/common/addon-detail/resource.tsx index a912237502..1ba3ce0260 100644 --- a/shell/app/modules/cmp/common/addon-detail/resource.tsx +++ b/shell/app/modules/cmp/common/addon-detail/resource.tsx @@ -34,30 +34,34 @@ export const PureResourceList = ({ renderOp, resourceList, loading, drawerComp } title: i18n.t('container IP'), dataIndex: 'containerIP', key: 'containerIP', - width: 150, + width: 160, fixed: 'left', }, { title: i18n.t('host IP'), dataIndex: 'hostIP', key: 'hostIP', + width: 160, }, { title: i18n.t('cpu limit'), dataIndex: 'cpuLimit', key: 'cpuLimit', + width: 120, sorter: (a: IResource, b: IResource) => a.cpuLimit - b.cpuLimit, }, { title: i18n.t('org:CPU allocation'), dataIndex: 'cpuRequest', key: 'cpuRequest', + width: 120, sorter: (a: IResource, b: IResource) => a.cpuRequest - b.cpuRequest, }, { title: i18n.t('memory limit'), dataIndex: 'memLimit', key: 'memLimit', + width: 120, render: (v: number) => getFormatter('CAPACITY', 'MB').format(v), sorter: (a: IResource, b: IResource) => a.memLimit - b.memLimit, }, @@ -65,6 +69,7 @@ export const PureResourceList = ({ renderOp, resourceList, loading, drawerComp } title: i18n.t('org:MEM allocation'), dataIndex: 'memRequest', key: 'memRequest', + width: 120, render: (v: number) => getFormatter('CAPACITY', 'MB').format(v), sorter: (a: IResource, b: IResource) => a.memRequest - b.memRequest, }, @@ -72,7 +77,6 @@ export const PureResourceList = ({ renderOp, resourceList, loading, drawerComp } title: i18n.t('image'), dataIndex: 'image', key: 'image', - width: 300, render: (image: string) => ( @@ -92,7 +96,7 @@ export const PureResourceList = ({ renderOp, resourceList, loading, drawerComp } title: i18n.t('status'), dataIndex: 'status', key: 'status', - width: 100, + width: 120, render: (v: string) => v === 'Healthy' ? ( <> @@ -114,7 +118,7 @@ export const PureResourceList = ({ renderOp, resourceList, loading, drawerComp } { title: i18n.t('operations'), key: 'operation', - width: 120, + width: 176, fixed: 'right', render: renderOp, }, diff --git a/shell/app/modules/cmp/pages/cluster-manage/cluster-list.tsx b/shell/app/modules/cmp/pages/cluster-manage/cluster-list.tsx index 6be18614d7..9c4ad604fa 100644 --- a/shell/app/modules/cmp/pages/cluster-manage/cluster-list.tsx +++ b/shell/app/modules/cmp/pages/cluster-manage/cluster-list.tsx @@ -287,6 +287,7 @@ const ClusterList = ({ dataSource, onEdit }: IProps) => { { title: i18n.t('application:status'), dataIndex: 'clusterStatus', + width: 120, render: (_text, record) => { const clusterDetail = getClusterDetail(record.name); const status = get(clusterDetail, 'basic.clusterStatus.value') as keyof typeof statusMap; @@ -309,7 +310,7 @@ const ClusterList = ({ dataSource, onEdit }: IProps) => { { title: i18n.t('application:type'), dataIndex: 'clusterType', - width: 125, + width: 160, ellipsis: true, render: (_text, record) => { const clusterDetail = getClusterDetail(record.name); @@ -327,6 +328,7 @@ const ClusterList = ({ dataSource, onEdit }: IProps) => { { title: i18n.t('cmp:management method'), dataIndex: 'manageType', + width: 120, render: (_text, record) => { const clusterDetail = getClusterDetail(record.name); const manageType = get(clusterDetail, 'basic.manageType.value'); @@ -336,6 +338,7 @@ const ClusterList = ({ dataSource, onEdit }: IProps) => { { title: i18n.t('version'), dataIndex: 'clusterVersion', + width: 96, render: (_text, record) => { const clusterDetail = getClusterDetail(record.name); return get(clusterDetail, 'basic.clusterVersion.value', ''); @@ -344,6 +347,7 @@ const ClusterList = ({ dataSource, onEdit }: IProps) => { { title: i18n.t('machines'), dataIndex: 'nodeCount', + width: 96, render: (_text, record) => { const clusterDetail = getClusterDetail(record.name); return get(clusterDetail, 'basic.nodeCount.value', '-'); @@ -448,6 +452,7 @@ const ClusterList = ({ dataSource, onEdit }: IProps) => { pagination={false} rowKey="id" loading={loadingList || loadingDetail} + scroll={{ x: 1500 }} /> diff --git a/shell/app/modules/cmp/pages/cluster-manage/operation-history.tsx b/shell/app/modules/cmp/pages/cluster-manage/operation-history.tsx index 926a53ca73..afa00164b7 100644 --- a/shell/app/modules/cmp/pages/cluster-manage/operation-history.tsx +++ b/shell/app/modules/cmp/pages/cluster-manage/operation-history.tsx @@ -80,7 +80,7 @@ export const OperationHistory = () => { { title: 'ID', dataIndex: 'recordID', - width: 90, + width: 96, }, { title: i18n.t('org:cluster name'), @@ -90,7 +90,7 @@ export const OperationHistory = () => { { title: `${i18n.t('operation')}${i18n.t('name')}`, dataIndex: 'recordType', - width: 140, + width: 160, render: (val: string) => { return {val}; }, @@ -111,7 +111,7 @@ export const OperationHistory = () => { { title: i18n.t('time'), dataIndex: 'createTime', - width: 190, + width: 200, render: (createTime: string) => { return {moment(createTime).format('YYYY-MM-DD HH:mm:ss')}; }, @@ -119,7 +119,7 @@ export const OperationHistory = () => { { title: i18n.t('user'), dataIndex: 'userID', - width: 100, + width: 120, render: (id: string) => userMap[id] ? {cutStr(userMap[id].nick || userMap[id].name, 8, { showTip: true })} : null, }, @@ -194,7 +194,7 @@ export const OperationHistory = () => { total: operationPaging.total, onChange: (no: number) => getList({ pageNo: no, ...filters }), }} - scroll={{ x: '100%' }} + scroll={{ x: 1100 }} /> updater.curRow(null)} /> diff --git a/shell/app/modules/dcos/pages/machine-manager/machine-table.tsx b/shell/app/modules/dcos/pages/machine-manager/machine-table.tsx index 07800b9c77..0d29614771 100644 --- a/shell/app/modules/dcos/pages/machine-manager/machine-table.tsx +++ b/shell/app/modules/dcos/pages/machine-manager/machine-table.tsx @@ -479,7 +479,7 @@ const MachineTable = ({ list, gotoMachineMonitor, gotoMachineTasks, isFetching = const columns: Array> = [ { title: , - width: 150, + width: 160, fixed: 'left', dataIndex: 'ip', // ...getInputFilter('ip', { placeholder: '根据IP搜索' }), @@ -508,7 +508,7 @@ const MachineTable = ({ list, gotoMachineMonitor, gotoMachineTasks, isFetching = { title: i18n.t('org:number of instance'), dataIndex: 'tasks', - width: 100, + width: 176, sorter: (a: ORG_MACHINE.IMachine, b: ORG_MACHINE.IMachine) => Number(a.tasks) - Number(b.tasks), render: (_val: string, record: ORG_MACHINE.IMachine) => { return ( @@ -521,7 +521,7 @@ const MachineTable = ({ list, gotoMachineMonitor, gotoMachineTasks, isFetching = }, { title: 'CPU', - width: 125, + width: 120, dataIndex: 'cpuAllocatable', // sorter: (a: ORG_MACHINE.IMachine, b: ORG_MACHINE.IMachine) => Number(a.cpuUsage / a.cpuTotal) - Number(b.cpuUsage / b.cpuTotal), render: (_, data: ORG_MACHINE.IMachine) => { @@ -543,7 +543,7 @@ const MachineTable = ({ list, gotoMachineMonitor, gotoMachineTasks, isFetching = }, { title: i18n.t('memory'), - width: 125, + width: 120, dataIndex: 'memProportion', // sorter: (a: ORG_MACHINE.IMachine, b: ORG_MACHINE.IMachine) => Number(a.memUsage / a.memTotal) - Number(b.memUsage / b.memTotal), render: (_, data: ORG_MACHINE.IMachine) => { @@ -564,7 +564,7 @@ const MachineTable = ({ list, gotoMachineMonitor, gotoMachineTasks, isFetching = }, { title: i18n.t('org:Disk usage'), - width: 125, + width: 120, dataIndex: 'diskProportion', sorter: (a: ORG_MACHINE.IMachine, b: ORG_MACHINE.IMachine) => Number(a.diskUsage / a.diskTotal) - Number(b.diskUsage / b.diskTotal), @@ -586,7 +586,7 @@ const MachineTable = ({ list, gotoMachineMonitor, gotoMachineTasks, isFetching = { title: i18n.t('load'), dataIndex: 'load5', - width: 90, + width: 96, sorter: (a: ORG_MACHINE.IMachine, b: ORG_MACHINE.IMachine) => Number(a.load5) - Number(b.load5), }, { @@ -602,7 +602,7 @@ const MachineTable = ({ list, gotoMachineMonitor, gotoMachineTasks, isFetching = dataIndex: 'id', key: 'operation', fixed: 'right', - width: 150, + width: 160, render: (_id: string, record: ORG_MACHINE.IMachine) => { return ( diff --git a/shell/app/modules/dcos/pages/service-manager/service-list.tsx b/shell/app/modules/dcos/pages/service-manager/service-list.tsx index 3f42bc8e63..af7317e1c8 100644 --- a/shell/app/modules/dcos/pages/service-manager/service-list.tsx +++ b/shell/app/modules/dcos/pages/service-manager/service-list.tsx @@ -71,7 +71,7 @@ const getImageText = (text: string) => { const headTxt = text.substr(0, 5); const tailTxt = text.substr(5); return ( -
+
{headTxt} {tailTxt}
@@ -188,7 +188,7 @@ function ServiceList({ title: i18n.t('org:number of instance'), dataIndex: 'instance', key: 'instance', - width: 100, + width: 176, }, { title: 'CPU', @@ -269,7 +269,7 @@ function ServiceList({ { title: 'IP', key: 'ip_addr', - // width: 120, + width: 120, sorter: (a: any, b: any) => Number((a.ip_addr || a.ipAddress || '').replace(/\./g, '')) - Number((b.ip_addr || b.ipAddress || '').replace(/\./g, '')), @@ -310,7 +310,7 @@ function ServiceList({ title: 'CPU', dataIndex: 'cpu', key: 'cpu', - width: 125, + width: 120, sorter: (a: any, b: any) => { if (!haveMetrics) return Number(a.cpu) - Number(b.cpu); const use_a = getMetricsInfo(a, 'cpuUsagePercent') || 0; @@ -329,7 +329,7 @@ function ServiceList({ title: i18n.t('memory'), dataIndex: 'memory', key: 'memory', - width: 125, + width: 120, sorter: (a: any, b: any) => { if (!haveMetrics) return Number(a.memory) - Number(b.memory); const use_a = getMetricsInfo(a, 'memUsage') || 0; @@ -347,7 +347,7 @@ function ServiceList({ title: i18n.t('disk'), dataIndex: 'disk', key: 'disk', - width: 125, + width: 120, sorter: (a: any, b: any) => Number(a.disk) - Number(b.disk), render: (size: number) => getFormatter('STORAGE', 'MB').format(size), }, @@ -393,7 +393,7 @@ function ServiceList({ pagination={false} columns={cols as Array>} dataSource={list} - scroll={{ x: '100%' }} + scroll={{ x: 1100 }} /> {drawer} diff --git a/shell/app/modules/ecp/pages/resource/machine-manage.tsx b/shell/app/modules/ecp/pages/resource/machine-manage.tsx index 5630f53e51..5bf63e7360 100644 --- a/shell/app/modules/ecp/pages/resource/machine-manage.tsx +++ b/shell/app/modules/ecp/pages/resource/machine-manage.tsx @@ -88,18 +88,18 @@ export default () => { const columns: Array> = [ { title: 'IP', - width: 150, + width: 160, dataIndex: 'ip', }, { title: i18n.t('org:number of instance'), dataIndex: 'tasks', - width: 100, + width: 176, sorter: (a: ORG_MACHINE.IMachine, b: ORG_MACHINE.IMachine) => Number(a.tasks) - Number(b.tasks), }, { title: 'CPU', - width: 125, + width: 120, dataIndex: 'cpuAllocatable', render: (_, data: ORG_MACHINE.IMachine) => { const { cpuAllocatable, cpuUsage, cpuRequest, cpuUsagePercent, cpuDispPercent } = data; @@ -119,7 +119,7 @@ export default () => { }, { title: i18n.t('memory'), - width: 125, + width: 120, dataIndex: 'memProportion', render: (_, data: ORG_MACHINE.IMachine) => { const { memAllocatable, memUsage, memRequest, memUsagePercent, memDispPercent } = data; @@ -140,7 +140,6 @@ export default () => { { title: {i18n.t('tags')} , dataIndex: 'labels', - width: 400, className: 'machine-labels', render: (value: string) => { const keyArray = value?.split(',') || []; @@ -157,7 +156,8 @@ export default () => { title: i18n.t('operations'), dataIndex: 'id', key: 'operation', - width: 120, + width: 180, + fixed: 'right', render: (_id: string, record: ORG_MACHINE.IMachine) => { return ( @@ -194,7 +194,7 @@ export default () => { bordered columns={columns} dataSource={tableList} - scroll={{ x: '100%' }} + scroll={{ x: 1300 }} /> { { title: `${i18n.t('msp:response map')}(${i18n.t('msp:nearly 1 hour')})`, dataIndex: 'chart', - width: 144, + width: 160, render: (_text: string, record: any) => { const { chart } = record; if (!chart) { diff --git a/shell/app/modules/msp/monitor/trace-insight/pages/trace-querier/trace-search.tsx b/shell/app/modules/msp/monitor/trace-insight/pages/trace-querier/trace-search.tsx index a85ba0f615..7e0efe8970 100644 --- a/shell/app/modules/msp/monitor/trace-insight/pages/trace-querier/trace-search.tsx +++ b/shell/app/modules/msp/monitor/trace-insight/pages/trace-querier/trace-search.tsx @@ -16,6 +16,7 @@ import { get, isEmpty } from 'lodash'; import moment from 'moment'; import { CustomFilter, useFilter, PureBoardGrid, Copy, useSwitch, useUpdate, TagsRow } from 'common'; import { getTimeRanges } from 'common/utils'; +import { ColumnProps } from 'core/common/interface'; import { Select, DatePicker, Table, Drawer } from 'app/nusi'; import { useEffectOnce } from 'react-use'; import i18n from 'i18n'; @@ -30,6 +31,13 @@ const { Option } = Select; const limits = [10, 20, 50, 100, 200, 500, 1000]; +interface RecordType { + id: string; + elapsed: number; + startTime: number; + services: string[]; +} + export default () => { const initialRange = [moment().subtract(1, 'hours'), moment()]; const [traceCount, traceSummary] = traceStore.useStore((s) => [s.traceCount, s.traceSummary]); @@ -212,34 +220,37 @@ export default () => { [traceCount], ); - const columns = [ + const columns: Array> = [ { title: i18n.t('msp:trace id'), dataIndex: 'id', - width: 350, render: (id: string) => {id}, }, { title: i18n.t('msp:time consuming'), dataIndex: 'elapsed', + width: 240, sorter: (a: any, b: any) => a.elapsed - b.elapsed, render: (elapsed: number) => getFormatter('TIME', 'ns').format(elapsed), }, { title: i18n.t('msp:start time'), dataIndex: 'startTime', + width: 200, render: (time: number) => moment(time).format('YYYY-MM-DD HH:mm:ss'), }, { title: i18n.t('service'), dataIndex: 'services', + width: 240, render: (services: string[]) => ({ label: service }))} />, }, { title: i18n.t('common:operation'), dataIndex: 'operation', - width: 180, - render: (_: any, record: any) => ( + width: 200, + fixed: 'right', + render: (_: any, record: RecordType) => (
handleCheckTraceDetail(e, record.id)} className="table-operations-btn"> {i18n.t('check detail')} @@ -255,7 +266,7 @@ export default () => {
-
+
{ dataIndex: 'displayName', key: 'displayName', fixed: 'left', - width: 150, + width: 160, ellipsis: { showTitle: false, }, @@ -70,7 +70,7 @@ export const ProjectList = () => { title: i18n.t('org:application/Member Statistics'), dataIndex: 'stats', key: 'countApplications', - width: 140, + width: 160, render: (stats: PROJECT.ProjectStats) => ( { title: i18n.t('latest active'), dataIndex: 'activeTime', key: 'activeTime', - width: 110, + width: 120, sorter: true, render: (text) => (text ? fromNow(text) : i18n.t('none')), }, @@ -129,7 +129,7 @@ export const ProjectList = () => { title: i18n.t('total CPU allocation'), dataIndex: 'cpuQuota', key: 'cpuQuota', - width: 180, + width: 200, sorter: true, render: (text: string) => `${text} Core`, }, @@ -144,7 +144,6 @@ export const ProjectList = () => { { title: CPU / {i18n.t('Memory usage')}, dataIndex: 'usage', - width: 330, key: 'usage', render: (t, record: PROJECT.Detail) => { const { @@ -237,7 +236,7 @@ export const ProjectList = () => { title: i18n.t('operations'), key: 'op', dataIndex: 'id', - width: 100, + width: 120, fixed: 'right', render: (id) => { return ( @@ -298,7 +297,7 @@ export const ProjectList = () => { total, }} onChange={handleTableChange} - scroll={{ x: '100%' }} + scroll={{ x: 1500 }} /> diff --git a/shell/app/modules/project/common/components/branch-rule.tsx b/shell/app/modules/project/common/components/branch-rule.tsx index 7ed15a2adc..69ae82ce09 100644 --- a/shell/app/modules/project/common/components/branch-rule.tsx +++ b/shell/app/modules/project/common/components/branch-rule.tsx @@ -143,10 +143,12 @@ const extraColumnsMap = { { title: i18n.t('project:deployment environment'), dataIndex: 'workspace', + width: 196, }, { title: i18n.t('project:artifact deployment environment'), dataIndex: 'artifactWorkspace', + width: 244, }, // { // title: i18n.t('project:app release confirmation'), @@ -229,6 +231,7 @@ const BranchRule = (props: IProps) => { { title: i18n.t('application:branch'), dataIndex: 'rule', + width: 200, }, ...(extraColumnsMap[scopeType] || []), { @@ -239,7 +242,7 @@ const BranchRule = (props: IProps) => { title: i18n.t('common:operation'), key: 'operation', fixed: 'right', - width: 150, + width: 160, align: 'center', render: (_: any, record: PROJECT.IBranchRule) => { return ( @@ -320,7 +323,7 @@ const BranchRule = (props: IProps) => { -
+
onOptionalSelectChange(rowKeys), }; - const optionalColumns = [ + const optionalColumns: Array> = [ { title: i18n.t('project:rule name'), dataIndex: 'metricKey', @@ -115,21 +116,27 @@ export default function ScanRule(props: IProps) { { title: i18n.t('description'), dataIndex: 'metricKeyDesc', - width: 200, }, { title: i18n.t('comparison operator'), dataIndex: 'operational', align: 'center', + width: 176, }, { title: i18n.t('project:access control value'), dataIndex: 'metricValue', align: 'center', + width: 160, render: (val: string, record: any) => { if (record.valueType === 'RATING') { return ( - handleChange(value, record)} + getPopupContainer={() => document.body} + > {map(valueRateMap, (rate) => (
+
); }; diff --git a/shell/app/modules/project/pages/test-manage/case/columns/index.tsx b/shell/app/modules/project/pages/test-manage/case/columns/index.tsx index 4c91f80e06..a2ef9b0c23 100644 --- a/shell/app/modules/project/pages/test-manage/case/columns/index.tsx +++ b/shell/app/modules/project/pages/test-manage/case/columns/index.tsx @@ -23,27 +23,26 @@ export const commonColumns: Array> = [ title: '', dataIndex: 'checkbox', key: 'checkbox', - width: 40, + width: 64, }, { title: 'ID', dataIndex: 'id', key: 'id', - width: 70, + width: 72, sorter: true, }, { title: i18n.t('project:use case title'), dataIndex: 'name', key: 'name', - width: 380, render: (value: string, record: any) => renderContent((value) => value, value, record), }, { title: i18n.t('project:priority'), dataIndex: 'priority', key: 'priority', - width: 85, + width: 96, sorter: true, render: (value: string, record: any) => renderContent((value) => value, value, record), }, @@ -51,7 +50,7 @@ export const commonColumns: Array> = [ title: i18n.t('project:updater'), dataIndex: 'updaterID', key: 'updaterID', - width: 85, + width: 96, ellipsis: true, sorter: true, render: (value: string, record: any) => @@ -66,7 +65,7 @@ export const commonColumns: Array> = [ title: i18n.t('project:updated'), dataIndex: 'updatedAt', key: 'updatedAt', - width: 190, + width: 200, sorter: true, render: (value: string, record: any) => renderContent( @@ -77,12 +76,12 @@ export const commonColumns: Array> = [ }, ]; -const renderContent = (children, value: string, record: any) => { +const renderContent = (children, value: string, record: any, dataIndex?: string) => { const obj = { children: children(value, record), props: {}, }; - if (!record.id) { + if (!record.id && dataIndex !== 'operation') { obj.props.colSpan = 0; } return obj; @@ -95,9 +94,14 @@ export const columns: Array> = [ dataIndex: 'operation', key: 'operation', className: 'operation', - width: 140, + width: 160, fixed: 'right', render: (value: string, record: any) => - renderContent((value: string, record: any) => record.id && , value, record), + renderContent( + (value: string, record: any) => record.id && , + value, + record, + 'operation', + ), }, ]; diff --git a/shell/app/modules/project/pages/test-manage/components/case-table/index.tsx b/shell/app/modules/project/pages/test-manage/components/case-table/index.tsx index ec8a84cf38..1d630dc9c4 100644 --- a/shell/app/modules/project/pages/test-manage/components/case-table/index.tsx +++ b/shell/app/modules/project/pages/test-manage/components/case-table/index.tsx @@ -176,7 +176,7 @@ const CaseTable = ({ query: queryProp, columns, onClickRow, scope, onChange, tes return { children: , props: { - colSpan: 6, + colSpan: 5, }, }; }, @@ -188,7 +188,6 @@ const CaseTable = ({ query: queryProp, columns, onClickRow, scope, onChange, tes Object.assign(nameColumn, { // title: , title: {i18n.t('project:use case title')}, - width: isScroll ? 380 : undefined, render: (name: string, record: any) => { const obj = { children: , @@ -299,6 +298,7 @@ const CaseTable = ({ query: queryProp, columns, onClickRow, scope, onChange, tes pageSize: parseInt(query.pageSize, 10) || defaultPageSize, showSizeChanger: true, }} + scroll={{ x: 900 }} /> ); }; diff --git a/shell/app/modules/project/pages/test-plan/test-plan.tsx b/shell/app/modules/project/pages/test-plan/test-plan.tsx index 3b7e52bbe7..40a306b009 100644 --- a/shell/app/modules/project/pages/test-plan/test-plan.tsx +++ b/shell/app/modules/project/pages/test-plan/test-plan.tsx @@ -80,9 +80,11 @@ const TestPlan = () => { dataIndex: 'name', render: (text, record) => { return ( -
+
{iconMap[record.status]} - {record.id}-{text} + + {record.id}-{text} +
); }, @@ -90,12 +92,14 @@ const TestPlan = () => { { title: i18n.t('project:principal'), dataIndex: 'ownerID', + width: 120, render: (text) => data.nick || data.name} />, }, { title: i18n.t('project:passing rate'), dataIndex: 'useCasePassedCount', className: 'passing-rate', + width: 160, render: (_text, { relsCount }) => { const { total, succ } = relsCount; const percent = Math.floor((succ / (total || 1)) * 100 || 0); @@ -111,6 +115,7 @@ const TestPlan = () => { title: i18n.t('project:exacutive rate'), dataIndex: 'executionRate', className: 'passing-rate', + width: 160, render: (_text, { relsCount }) => { const { total, succ, fail, block } = relsCount; const percent = Math.floor(((succ + fail + block) / (total || 1)) * 100 || 0); @@ -125,7 +130,8 @@ const TestPlan = () => { { title: i18n.t('default:operation'), dataIndex: 'id', - width: 140, + width: 176, + fixed: 'right', render: (id) => { return (
@@ -215,7 +221,7 @@ const TestPlan = () => { pageSize: page.pageSize, onChange: onPageChange, }} - scroll={{ x: '100%' }} + scroll={{ x: 800 }} />
diff --git a/shell/app/modules/project/pages/ticket/index.tsx b/shell/app/modules/project/pages/ticket/index.tsx index 5a1d074f6e..7ccafa407f 100644 --- a/shell/app/modules/project/pages/ticket/index.tsx +++ b/shell/app/modules/project/pages/ticket/index.tsx @@ -229,7 +229,7 @@ const Ticket = () => { render: (val: string, record: ISSUE.Issue) => { return ( -
clickTicket(record)}> +
clickTicket(record)}> {val}
@@ -299,7 +299,7 @@ const Ticket = () => { { title: i18n.t('project:priority'), dataIndex: 'priority', - width: 80, + width: 120, render: (val: string, record: ISSUE.Ticket) => { const checkRole = [isCreator(record.creator), isAssignee(record.assignee)]; const editAuth = getAuth(ticketPerm.edit, checkRole); @@ -318,7 +318,7 @@ const Ticket = () => { { title: i18n.t('project:severity'), dataIndex: 'severity', - width: 100, + width: 120, render: (val: string, record: ISSUE.Issue) => { const checkRole = [isCreator(record.creator), isAssignee(record.assignee)]; const editAuth = getAuth(ticketPerm.edit, checkRole); @@ -337,7 +337,7 @@ const Ticket = () => { { title: i18n.t('project:assignee'), dataIndex: 'assignee', - width: 120, + width: 160, render: (v: string, record: ISSUE.Ticket) => { const checkRole = [isCreator(record.creator), isAssignee(record.assignee)]; const editAuth = getAuth(ticketPerm.edit, checkRole); @@ -443,7 +443,7 @@ const Ticket = () => { dataSource={list} rowKey="id" pagination={pagination} - scroll={{ x: '100%' }} + scroll={{ x: 800 }} /> >(mode === 'LIBRARY', [ { title: i18n.t('publisher:version number'), - width: 150, + width: 160, dataIndex: 'latestVersion', render: (text) => text || '-', }, @@ -141,7 +142,7 @@ export const PurePublisherList = ({ ]), { title: i18n.t('default:status'), - width: 100, + width: 120, dataIndex: 'public', render: (bool) => { return ( @@ -199,7 +200,7 @@ export const PurePublisherList = ({ ...paging, onChange: handlePageChange, }} - scroll={{ x: '100%' }} + scroll={{ x: 800 }} />
diff --git a/shell/app/modules/runtime/common/components/instance-table.tsx b/shell/app/modules/runtime/common/components/instance-table.tsx index 007f878fb8..1c18425873 100644 --- a/shell/app/modules/runtime/common/components/instance-table.tsx +++ b/shell/app/modules/runtime/common/components/instance-table.tsx @@ -84,7 +84,7 @@ const InstanceTable = ({ instances, isFetching, withHeader = true, opsCol, ...ta { title: i18n.t('runtime:instance ip'), dataIndex: 'ipAddress', - // width: 100, + width: 120, render: (text: string, record: { [prop: string]: any }) => { const { status } = record; return withHeader ? ( @@ -101,13 +101,12 @@ const InstanceTable = ({ instances, isFetching, withHeader = true, opsCol, ...ta }, { title: i18n.t('runtime:host address'), - // width: 100, + width: 120, dataIndex: 'host', }, { title: i18n.t('runtime:status'), dataIndex: 'status', - width: 150, className: 'th-status', render: (text: string, record: any) => { const { message } = record; @@ -121,7 +120,7 @@ const InstanceTable = ({ instances, isFetching, withHeader = true, opsCol, ...ta }, { title: i18n.t('create time'), - width: 170, + width: 176, dataIndex: 'startedAt', className: 'th-time nowrap', render: (text: string) => moment(text).format('YYYY-MM-DD HH:mm:ss'), @@ -159,7 +158,7 @@ const InstanceTable = ({ instances, isFetching, withHeader = true, opsCol, ...ta }} loading={isFetching} pagination={paginationMap[pagingType]} - scroll={{ x: '100%' }} + scroll={{ x: 800 }} {...tableProps} />
diff --git a/shell/app/modules/runtime/common/components/pod-table.tsx b/shell/app/modules/runtime/common/components/pod-table.tsx index a766288192..591a908daa 100644 --- a/shell/app/modules/runtime/common/components/pod-table.tsx +++ b/shell/app/modules/runtime/common/components/pod-table.tsx @@ -17,6 +17,7 @@ import i18n from 'i18n'; import moment from 'moment'; import runtimeServiceStore from 'runtime/stores/service'; import { useUpdate } from 'common'; +import { ColumnProps } from 'core/common/interface'; interface IProps { runtimeID: number; @@ -71,28 +72,33 @@ const PodTable = (props: IProps) => { }); }; - const podTableColumn = [ + const podTableColumn: Array> = [ { title: i18n.t('runtime:pod IP'), dataIndex: 'ipAddress', + width: 120, }, { title: i18n.t('org:pod instance'), dataIndex: 'podName', + width: 160, render: (text: string) => {text}, }, { title: i18n.t('runtime:status'), dataIndex: 'phase', + width: 80, }, { title: i18n.t('org:namespace'), dataIndex: 'k8sNamespace', + width: 120, render: (text: string) => {text}, }, { title: i18n.t('runtime:Host IP'), dataIndex: 'host', + width: 120, }, { title: i18n.t('runtime:message content'), @@ -100,7 +106,7 @@ const PodTable = (props: IProps) => { }, { title: i18n.t('create time'), - width: 170, + width: 176, dataIndex: 'startedAt', className: 'th-time nowrap', render: (text: string) => moment(text).format('YYYY-MM-DD HH:mm:ss'), @@ -108,7 +114,8 @@ const PodTable = (props: IProps) => { { title: i18n.t('application:operation'), dataIndex: 'op', - width: 60, + width: 96, + fixed: 'right', render: (_v: any, record: RUNTIME_SERVICE.Pod) => { return (
@@ -122,7 +129,7 @@ const PodTable = (props: IProps) => { ]; return (
{ }; const opsCol = { title: i18n.t('operate'), - width: 250, + width: 240, key: 'operate', + fixed: 'right', render: (record: RUNTIME_SERVICE.Instance) => { const { isRunning } = record; return (