|
16 | 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>.
|
17 | 17 | */
|
18 | 18 |
|
19 |
| -import styled from 'styled-components'; |
| 19 | +import { Box } from 'design'; |
20 | 20 |
|
21 |
| -import { Box, Flex, Link } from 'design'; |
22 |
| -import Table, { Cell } from 'design/DataTable'; |
23 |
| -import { Apple, Linux, Lock, Windows } from 'design/Icon'; |
24 |
| -import { IconCircle } from 'design/Icon/IconCircle'; |
25 |
| -import { P } from 'design/Text/Text'; |
| 21 | +import { FeatureBox } from 'teleport/components/Layout'; |
26 | 22 |
|
27 |
| -import { ButtonLockedFeature } from 'teleport/components/ButtonLockedFeature'; |
28 |
| -import { |
29 |
| - FeatureBox, |
30 |
| - FeatureHeader, |
31 |
| - FeatureHeaderTitle, |
32 |
| -} from 'teleport/components/Layout'; |
33 |
| -import { |
34 |
| - DeviceListProps, |
35 |
| - TrustedDeviceOSType, |
36 |
| -} from 'teleport/DeviceTrust/types'; |
37 |
| -import { CtaEvent } from 'teleport/services/userEvent'; |
| 23 | +import { EmptyList } from './EmptyList'; |
38 | 24 |
|
39 | 25 | export function DeviceTrustLocked() {
|
40 | 26 | return (
|
41 | 27 | <FeatureBox>
|
42 |
| - <FeatureHeader> |
43 |
| - <FeatureHeaderTitle>Trusted Devices</FeatureHeaderTitle> |
44 |
| - </FeatureHeader> |
45 |
| - <Box |
46 |
| - mr="6" |
47 |
| - mb="4" |
48 |
| - style={{ |
49 |
| - filter: 'blur(2px)', |
50 |
| - pointerEvents: 'none', |
51 |
| - userSelect: 'none', |
52 |
| - height: '100px', |
53 |
| - }} |
54 |
| - > |
55 |
| - <FakeDeviceList |
56 |
| - items={generateFakeItems(15)} |
57 |
| - fetchData={() => null} |
58 |
| - fetchStatus={''} |
59 |
| - /> |
| 28 | + <Box> |
| 29 | + <EmptyList /> |
60 | 30 | </Box>
|
61 |
| - <StyledMessageContainer> |
62 |
| - <Box p="3" borderRadius="50%"> |
63 |
| - <IconCircle Icon={Lock} size={64} /> |
64 |
| - </Box> |
65 |
| - <P textAlign="justify"> |
66 |
| - Device Trust enables trusted and authenticated device access. When |
67 |
| - resources are configured with the Device Trust mode “required”, |
68 |
| - Teleport will authenticate the Trusted Device, in addition to |
69 |
| - establishing the user's identity and enforcing the necessary roles, |
70 |
| - and leaves an audit trail with device information. For more details, |
71 |
| - please view{' '} |
72 |
| - <Link |
73 |
| - href={ |
74 |
| - 'https://goteleport.com/docs/access-controls/device-trust/guide/' |
75 |
| - } |
76 |
| - target="_blank" |
77 |
| - > |
78 |
| - Device Trust documentation |
79 |
| - </Link> |
80 |
| - . |
81 |
| - </P> |
82 |
| - <Box> |
83 |
| - <ButtonLockedFeature event={CtaEvent.CTA_TRUSTED_DEVICES}> |
84 |
| - Unlock Device Trust with Teleport Enterprise |
85 |
| - </ButtonLockedFeature> |
86 |
| - </Box> |
87 |
| - </StyledMessageContainer> |
88 | 31 | </FeatureBox>
|
89 | 32 | );
|
90 | 33 | }
|
91 |
| - |
92 |
| -function generateFakeItems(count) { |
93 |
| - const items = []; |
94 |
| - const osType = ['Windows', 'Linux', 'macOS']; |
95 |
| - |
96 |
| - for (let i = 0; i < count; i++) { |
97 |
| - items.push({ |
98 |
| - id: `id-${i}`, |
99 |
| - assetTag: `CLFBDAACC${i}`, |
100 |
| - enrollStatus: `enroll-status-${i}`, |
101 |
| - osType: osType[i % osType.length], |
102 |
| - }); |
103 |
| - } |
104 |
| - |
105 |
| - return items; |
106 |
| -} |
107 |
| - |
108 |
| -const FakeDeviceList = ({ |
109 |
| - items = [], |
110 |
| - pageSize = 20, |
111 |
| - fetchStatus = '', |
112 |
| - fetchData, |
113 |
| -}: DeviceListProps) => { |
114 |
| - return ( |
115 |
| - <Table |
116 |
| - data={items} |
117 |
| - columns={[ |
118 |
| - { |
119 |
| - key: 'osType', |
120 |
| - headerText: 'OS Type', |
121 |
| - render: ({ osType }) => <IconCell osType={osType} />, |
122 |
| - }, |
123 |
| - { |
124 |
| - key: 'assetTag', |
125 |
| - headerText: 'Asset Tag', |
126 |
| - }, |
127 |
| - { |
128 |
| - key: 'enrollStatus', |
129 |
| - headerText: 'Enroll Status', |
130 |
| - }, |
131 |
| - ]} |
132 |
| - emptyText="No Devices Found" |
133 |
| - pagination={{ pageSize }} |
134 |
| - fetching={{ onFetchMore: fetchData, fetchStatus }} |
135 |
| - /> |
136 |
| - ); |
137 |
| -}; |
138 |
| - |
139 |
| -const IconCell = ({ osType }: { osType: TrustedDeviceOSType }) => { |
140 |
| - let icon; |
141 |
| - switch (osType) { |
142 |
| - case 'Windows': |
143 |
| - icon = <Windows size="small" mr={1} />; |
144 |
| - break; |
145 |
| - case 'Linux': |
146 |
| - icon = <Linux size="small" mr={1} />; |
147 |
| - break; |
148 |
| - default: |
149 |
| - icon = <Apple size="small" mr={1} />; |
150 |
| - } |
151 |
| - return ( |
152 |
| - <Cell align="left" style={{ display: 'flex' }}> |
153 |
| - {icon} {osType} |
154 |
| - </Cell> |
155 |
| - ); |
156 |
| -}; |
157 |
| - |
158 |
| -const StyledMessageContainer = styled(Flex)` |
159 |
| - position: relative; |
160 |
| - top: 30%; |
161 |
| - left: 50%; |
162 |
| - transform: translate(-50%, -50%); |
163 |
| - background-color: ${({ theme }) => theme.colors.levels.elevated}; |
164 |
| - flex-direction: column; |
165 |
| - justify-content: center; |
166 |
| - align-items: center; |
167 |
| - padding: 24px; |
168 |
| - gap: 24px; |
169 |
| - width: 600px; |
170 |
| - box-shadow: |
171 |
| - 0 5px 5px -3px rgba(0, 0, 0, 0.2), |
172 |
| - 0 8px 10px 1px rgba(0, 0, 0, 0.14), |
173 |
| - 0 3px 14px 2px rgba(0, 0, 0, 0.12); |
174 |
| - border-radius: 8px; |
175 |
| -`; |
0 commit comments