Skip to content

Commit 7c4674e

Browse files
committed
feat: add lock icon and adjust column width
Signed-off-by: Yi-Ya Chen <[email protected]>
1 parent d48439c commit 7c4674e

File tree

4 files changed

+31
-12
lines changed

4 files changed

+31
-12
lines changed

src/routes/backingImage/BackingImageList.js

+7-6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import BackingImageActions from './BackingImageActions'
55
import { pagination } from '../../utils/page'
66
import { formatMib } from '../../utils/formatter'
77
import { nodeTagColor, diskTagColor } from '../../utils/constants'
8+
import styles from './BackingImageList.less'
89

910
function list({ loading, dataSource, backupProps, deleteBackingImage, showDiskStateMapDetail, rowSelection, createBackupBackingImage, downloadBackingImage, showUpdateMinCopiesCount, height }) {
1011
const backingImageActionsProps = {
@@ -50,13 +51,13 @@ function list({ loading, dataSource, backupProps, deleteBackingImage, showDiskSt
5051
title: 'Name',
5152
dataIndex: 'name',
5253
key: 'name',
53-
width: 150,
54+
width: 180,
5455
sorter: (a, b) => a.name.localeCompare(b.name),
5556
render: (text, record) => {
5657
return (
57-
<div onClick={() => { showDiskStateMapDetail(record) }} style={{ width: '100%', cursor: 'pointer', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
58+
<div onClick={() => { showDiskStateMapDetail(record) }}>
5859
{staticStateIcon(record)}
59-
<Button type="link" style={{ width: 'fit-content', paddingLeft: 8, paddingRight: 8 }} block>{text}</Button>
60+
<Button type="link" className={styles.encryptedBackingImage}>{text}</Button>
6061
{dynamicStateIcon(record)}
6162
</div>
6263
)
@@ -76,7 +77,7 @@ function list({ loading, dataSource, backupProps, deleteBackingImage, showDiskSt
7677
title: 'Size',
7778
dataIndex: 'size',
7879
key: 'size',
79-
width: 80,
80+
width: 100,
8081
sorter: (a, b) => a.size - b.size,
8182
render: (text) => {
8283
return (
@@ -90,7 +91,7 @@ function list({ loading, dataSource, backupProps, deleteBackingImage, showDiskSt
9091
title: 'Created From',
9192
dataIndex: 'sourceType',
9293
key: 'sourceType',
93-
width: 150,
94+
width: 120,
9495
sorter: (a, b) => a.sourceType.localeCompare(b.sourceType),
9596
render: (text) => {
9697
return (
@@ -103,7 +104,7 @@ function list({ loading, dataSource, backupProps, deleteBackingImage, showDiskSt
103104
title: 'Minimum Copies',
104105
dataIndex: 'minNumberOfCopies',
105106
key: 'minNumberOfCopies',
106-
width: 120,
107+
width: 130,
107108
sorter: (a, b) => a.minNumberOfCopies.toString().localeCompare(b.minNumberOfCopies.toString()),
108109
render: (text) => {
109110
return (
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.encryptedBackingImage {
2+
white-space: unset;
3+
height: auto;
4+
}

src/routes/backingImage/BackupBackingImageList.js

+16-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import React from 'react'
22
import PropTypes from 'prop-types'
3-
import { Table, message } from 'antd'
3+
import { Table, message, Icon, Tooltip } from 'antd'
44
import { CopyToClipboard } from 'react-copy-to-clipboard'
55
import BackupBackingImageActions from './BackupBackingImageActions'
66
import { pagination } from '../../utils/page'
77
import { formatMib } from '../../utils/formatter'
88
import { formatDate } from '../../utils/formatDate'
9-
9+
import styles from './BackupBackingImageList.less'
1010
function list({ loading, dataSource, deleteBackupBackingImage, restoreBackingImage, rowSelection, height }) {
1111
const actionsProps = {
1212
deleteBackupBackingImage,
@@ -26,10 +26,20 @@ function list({ loading, dataSource, deleteBackupBackingImage, restoreBackingIma
2626
title: 'Name',
2727
dataIndex: 'name',
2828
key: 'name',
29-
width: 120,
29+
width: 180,
3030
sorter: (a, b) => a.name.localeCompare(b.name),
31-
render: (text) => {
32-
return (<div>{text}</div>)
31+
render: (text, record) => {
32+
const isEncrypted = Boolean(record.secret || record.secretNamespace)
33+
return (
34+
<>
35+
{isEncrypted && (
36+
<Tooltip title="Encrypted Backing Image Backup">
37+
<Icon className="color-warning" type="lock" />
38+
</Tooltip>
39+
)}
40+
<span className={styles.encryptedBackup}>{text}</span>
41+
</>
42+
)
3343
},
3444
}, {
3545
title: 'State',
@@ -75,7 +85,7 @@ function list({ loading, dataSource, deleteBackupBackingImage, restoreBackingIma
7585
title: 'Created Time',
7686
dataIndex: 'created',
7787
key: 'created',
78-
width: 80,
88+
width: 100,
7989
sorter: (a, b) => a.created.localeCompare(b.created),
8090
render: (text) => {
8191
return (
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.encryptedBackup {
2+
padding: 0 8px;
3+
display: inline-block;
4+
}

0 commit comments

Comments
 (0)