|
1 | 1 | import { DeleteOutlined, DownOutlined, EditOutlined, FileAddOutlined, MoreOutlined, ReadOutlined } from '@ant-design/icons';
|
2 | 2 | import type { TableColumnsType } from 'antd';
|
3 |
| -import { Badge, Col, Dropdown, Menu, Row, Space, Table, Typography } from 'antd'; |
| 3 | +import { Badge, Col, Dropdown, Menu, Row, Space, Table, Tooltip, Typography } from 'antd'; |
4 | 4 | import React, { useEffect, useState } from 'react';
|
5 | 5 | import { ModelFrontendEvent, ProtoAction } from "../../generated-sources/openapi";
|
6 | 6 | import './ResourceTable.css';
|
@@ -164,7 +164,25 @@ const ResourceTable: React.FC<ResourceTablePropsType> = ({ onEvent, handleCloseG
|
164 | 164 | title,
|
165 | 165 | dataIndex: index,
|
166 | 166 | key: index,
|
167 |
| - })); |
| 167 | + defaultSortOrder: 'descend', |
| 168 | + sorter: (a, b) => a[index].length - b[index].length, |
| 169 | + // filters: () => { |
| 170 | + // return [] |
| 171 | + // }, |
| 172 | + // filterMode: 'tree', |
| 173 | + // filterSearch: true, |
| 174 | + // onFilter: (value: string, record) => record[index].startsWith(value), |
| 175 | + ellipsis: { |
| 176 | + showTitle: false, |
| 177 | + }, |
| 178 | + render: (address) => ( |
| 179 | + <Tooltip placement="topLeft" title={address}> |
| 180 | + {address} |
| 181 | + </Tooltip> |
| 182 | + ), |
| 183 | + } |
| 184 | + |
| 185 | + )); |
168 | 186 |
|
169 | 187 | if (wsTableName !== message.name) {
|
170 | 188 | count = 0;
|
@@ -284,7 +302,7 @@ const ResourceTable: React.FC<ResourceTablePropsType> = ({ onEvent, handleCloseG
|
284 | 302 | />
|
285 | 303 | </Col>
|
286 | 304 |
|
287 |
| - {wsTableName === defaultIsolatorResourceType && |
| 305 | + {itableName === defaultIsolatorResourceType && |
288 | 306 | <Col>
|
289 | 307 | <FileAddOutlined
|
290 | 308 | style={{ color: "gray" }}
|
@@ -422,7 +440,7 @@ const ResourceTable: React.FC<ResourceTablePropsType> = ({ onEvent, handleCloseG
|
422 | 440 | <Table
|
423 | 441 | title={() => (
|
424 | 442 | <center>
|
425 |
| - <Typography.Title style={{ margin: "8px" }} level={5}> |
| 443 | + <Typography.Title style={{ padding: 0, margin: 0 }} level={5}> |
426 | 444 | {itableName.charAt(0).toUpperCase() + itableName.slice(1)} ({idataRows.length})
|
427 | 445 | </Typography.Title>
|
428 | 446 | </center>
|
@@ -451,6 +469,8 @@ const ResourceTable: React.FC<ResourceTablePropsType> = ({ onEvent, handleCloseG
|
451 | 469 | };
|
452 | 470 | }}
|
453 | 471 | // scroll={{ y: 1000 }}
|
| 472 | + scroll={{ x: 'max-content' }} |
| 473 | + // tableLayout='auto' |
454 | 474 | pagination={false}
|
455 | 475 | // pagination={{
|
456 | 476 | // pageSize: 100,
|
|
0 commit comments