-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dash navigation to individual aws resource tables
- Loading branch information
1 parent
3e5c84f
commit dd7e49f
Showing
12 changed files
with
567 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/** | ||
* Teleport | ||
* Copyright (C) 2024 Gravitational, Inc. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* 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. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import styled from 'styled-components'; | ||
|
||
import { NavLink } from 'react-router-dom'; | ||
|
||
export const TabsContainer = styled.div` | ||
position: relative; | ||
display: flex; | ||
gap: ${p => p.theme.space[5]}px; | ||
align-items: center; | ||
padding: 0 ${p => p.theme.space[5]}px; | ||
border-bottom: 1px solid ${p => p.theme.colors.spotBackground[0]}; | ||
`; | ||
|
||
export const TabContainer = styled(NavLink)<{ selected?: boolean }>` | ||
padding: ${p => p.theme.space[1] + p.theme.space[2]}px | ||
${p => p.theme.space[2]}px; | ||
position: relative; | ||
cursor: pointer; | ||
z-index: 2; | ||
opacity: ${p => (p.selected ? 1 : 0.5)}; | ||
transition: opacity 0.3s linear; | ||
color: ${p => p.theme.colors.text.main}; | ||
font-weight: 300; | ||
font-size: 22px; | ||
line-height: ${p => p.theme.space[5]}px; | ||
white-space: nowrap; | ||
text-decoration: none; | ||
&:hover { | ||
opacity: 1; | ||
} | ||
`; | ||
|
||
export const TabBorder = styled.div` | ||
position: absolute; | ||
bottom: -1px; | ||
background: ${p => p.theme.colors.brand}; | ||
height: 2px; | ||
transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1); | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
web/packages/teleport/src/Integrations/status/AwsOidc/Details/Agents.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/** | ||
* Teleport | ||
* Copyright (C) 2024 Gravitational, Inc. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* 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. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import React from 'react'; | ||
|
||
import Table, { LabelCell } from 'design/DataTable'; | ||
|
||
export function Agents() { | ||
return ( | ||
<Table | ||
data={[]} | ||
columns={[ | ||
{ | ||
key: 'name', | ||
headerText: 'Service Name', | ||
isSortable: true, | ||
}, | ||
{ | ||
key: 'region', | ||
headerText: 'Region', | ||
isSortable: true, | ||
}, | ||
{ | ||
key: 'tags', | ||
headerText: 'Tags', | ||
isSortable: true, | ||
onSort: (a, b) => { | ||
const aStr = a.tags.toString(); | ||
const bStr = b.tags.toString(); | ||
|
||
if (aStr < bStr) { | ||
return -1; | ||
} | ||
if (aStr > bStr) { | ||
return 1; | ||
} | ||
|
||
return 0; | ||
}, | ||
render: ({ tags }) => <LabelCell data={tags} />, | ||
}, | ||
]} | ||
emptyText="Agents details coming soon" | ||
isSearchable | ||
/> | ||
); | ||
} |
51 changes: 51 additions & 0 deletions
51
web/packages/teleport/src/Integrations/status/AwsOidc/Details/Details.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/** | ||
* Teleport | ||
* Copyright (C) 2024 Gravitational, Inc. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* 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. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import React from 'react'; | ||
|
||
import { useParams } from 'react-router'; | ||
|
||
import { FeatureBox } from 'teleport/components/Layout'; | ||
import { AwsOidcHeader } from 'teleport/Integrations/status/AwsOidc/AwsOidcHeader'; | ||
import { useAwsOidcStatus } from 'teleport/Integrations/status/AwsOidc/useAwsOidcStatus'; | ||
import { AwsResource } from 'teleport/Integrations/status/AwsOidc/StatCard'; | ||
import { IntegrationKind } from 'teleport/services/integrations'; | ||
import { Rds } from 'teleport/Integrations/status/AwsOidc/Details/Rds'; | ||
import { Ec2 } from 'teleport/Integrations/status/AwsOidc/Details/Ec2'; | ||
import { Eks } from 'teleport/Integrations/status/AwsOidc/Details/Eks'; | ||
|
||
export function Details() { | ||
const { resourceKind } = useParams<{ | ||
type: IntegrationKind; | ||
name: string; | ||
resourceKind: AwsResource; | ||
}>(); | ||
|
||
const { integrationAttempt } = useAwsOidcStatus(); | ||
const { data: integration } = integrationAttempt; | ||
return ( | ||
<FeatureBox css={{ maxWidth: '1400px', paddingTop: '16px', gap: '30px' }}> | ||
{integration && ( | ||
<AwsOidcHeader integration={integration} resource={resourceKind} /> | ||
)} | ||
{resourceKind == AwsResource.ec2 && <Ec2 />} | ||
{resourceKind == AwsResource.eks && <Eks />} | ||
{resourceKind == AwsResource.rds && <Rds />} | ||
</FeatureBox> | ||
); | ||
} |
57 changes: 57 additions & 0 deletions
57
web/packages/teleport/src/Integrations/status/AwsOidc/Details/Ec2.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/** | ||
* Teleport | ||
* Copyright (C) 2024 Gravitational, Inc. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* 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. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import React from 'react'; | ||
|
||
import Table, { LabelCell } from 'design/DataTable'; | ||
|
||
export function Ec2() { | ||
return ( | ||
<Table | ||
data={[]} | ||
columns={[ | ||
{ | ||
key: 'region', | ||
headerText: 'Region', | ||
isSortable: true, | ||
}, | ||
{ | ||
key: 'labels', | ||
headerText: 'Labels', | ||
isSortable: true, | ||
onSort: (a, b) => { | ||
const aStr = a.labels.toString(); | ||
const bStr = b.labels.toString(); | ||
|
||
if (aStr < bStr) { | ||
return -1; | ||
} | ||
if (aStr > bStr) { | ||
return 1; | ||
} | ||
|
||
return 0; | ||
}, | ||
render: ({ labels }) => <LabelCell data={labels} />, | ||
}, | ||
]} | ||
emptyText="EC2 details coming soon" | ||
isSearchable | ||
/> | ||
); | ||
} |
Oops, something went wrong.