({ dataSource, pagination, loading, onEdit }: ToolTableProps)
| 23 | } |
| 24 | |
| 25 | const ToolTable = ({ dataSource, pagination, loading, onEdit }: ToolTableProps) => { |
| 26 | const columns: PrimaryTableCol<ToolData>[] = [ |
| 27 | { |
| 28 | colKey: 'display_name', |
| 29 | title: t('工具名称&简介'), |
| 30 | width: 200, |
| 31 | fixed: 'left', |
| 32 | cell: ({ row }) => ( |
| 33 | <> |
| 34 | <a |
| 35 | className="link-name text-weight-bold" |
| 36 | href={getToolRouter(row)} |
| 37 | target='_blank' |
| 38 | rel="noopener noreferrer" |
| 39 | > |
| 40 | {toolUtil.getName(row)} |
| 41 | </a> |
| 42 | <div className="mt-xs fs-12 text-grey-6"> |
| 43 | <EllipsisTemplate>{row.description}</EllipsisTemplate> |
| 44 | </div> |
| 45 | </> |
| 46 | ), |
| 47 | }, |
| 48 | { |
| 49 | colKey: 'org_detail', |
| 50 | title: t('提供方'), |
| 51 | width: 120, |
| 52 | cell: ({ row }) => row.org_detail?.name, |
| 53 | }, |
| 54 | { |
| 55 | colKey: 'created_time', |
| 56 | title: t('创建时间'), |
| 57 | width: 100, |
| 58 | cell: ({ row }) => formatDateTime(row.created_time), |
| 59 | }, |
| 60 | { |
| 61 | colKey: 'modified_time', |
| 62 | title: t('最近修改时间'), |
| 63 | width: 100, |
| 64 | cell: ({ row }) => formatDateTime(row.modified_time), |
| 65 | }, |
| 66 | { |
| 67 | colKey: 'status', |
| 68 | title: t('状态'), |
| 69 | width: 120, |
| 70 | cell: ({ row }) => ( |
| 71 | <Tag className={cn(s.toolTag, s[`status-${row.status}`])}> |
| 72 | {STATUS_CHOICES[row.status as StatusEnum]} |
| 73 | </Tag> |
| 74 | ), |
| 75 | }, |
| 76 | { |
| 77 | colKey: 'other', |
| 78 | title: t('权限状态'), |
| 79 | width: 120, |
| 80 | cell: ({ row }) => { |
| 81 | if (row.open_maintain) { |
| 82 | return ( |
nothing calls this directly
no test coverage detected