Skip to content
This repository was archived by the owner on Feb 8, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
a5595ab
Add Clock icon
mcbattirola Jun 29, 2022
371d2c7
Add upgradeWindows service
mcbattirola Jul 4, 2022
49cd3ef
Add useUpgradeWindows hook
mcbattirola Jul 4, 2022
6b62095
Add ScheduleUpgrades component
mcbattirola Jul 4, 2022
c7b8416
Call upgrade schedule modal from Clusters
mcbattirola Jul 4, 2022
6e9ef82
(wip) Add update upgrade windows event to audit log
mcbattirola Jul 5, 2022
fd2cf4c
Merge branch 'master' of github.com:gravitational/webapps into mcbatt…
mcbattirola Jul 6, 2022
4032496
Handle upgrade window event and fix error state on component
mcbattirola Jul 6, 2022
4d6c95d
Add subtitle
mcbattirola Jul 7, 2022
4337a8b
Read current user ugprade window from backend
mcbattirola Jul 11, 2022
7ce182b
Remove TODO
mcbattirola Jul 11, 2022
3d11e6c
Merg master into branch
mcbattirola Jul 12, 2022
93afeff
Add icocomoon fonts again
mcbattirola Jul 12, 2022
cd48dc3
Undo font changes
mcbattirola Jul 12, 2022
af18a67
Rename upgrade window to UpgradeWindowStart
mcbattirola Jul 12, 2022
9a7b215
Update event to include Start
mcbattirola Jul 12, 2022
508b54a
Add default value to current window when request failed
mcbattirola Jul 12, 2022
3447b38
Fix error condition
mcbattirola Jul 12, 2022
aa556a4
ScheduledUpgrades style and copy
mcbattirola Jul 13, 2022
14158ec
Update available window
mcbattirola Jul 14, 2022
e8ce15c
Fix endpoint fields to match backend
mcbattirola Jul 14, 2022
44a2cec
Move schedule upgrades to Support page
mcbattirola Jul 14, 2022
51c7ff2
Add license headers
mcbattirola Jul 14, 2022
45a65ea
Revert webapps.e
mcbattirola Jul 14, 2022
32e0e67
Merge branch 'master' into mcbattirola/add-cloud-upgrade-windows
mcbattirola Jul 14, 2022
2eb0647
Fix audit event
mcbattirola Jul 14, 2022
764df3b
Merge branch 'master' into mcbattirola/add-cloud-upgrade-windows
mcbattirola Jul 14, 2022
2022c58
Merge branch 'mcbattirola/add-cloud-upgrade-windows' of github.com:gr…
mcbattirola Jul 18, 2022
3ce2252
Merge branch 'master' of github.com:gravitational/webapps into mcbatt…
mcbattirola Jul 18, 2022
15c56c3
Change req/res casing
mcbattirola Jul 18, 2022
68c920d
Change time labels
mcbattirola Jul 19, 2022
b7392ac
Add new section to Help & Support with upgrade times
mcbattirola Jul 19, 2022
7a5106e
Fix audit events showing undefined time
mcbattirola Jul 19, 2022
021ffca
Undo changes to Cluster and update snapshots
mcbattirola Jul 19, 2022
c5a91e4
Fix import order
mcbattirola Jul 19, 2022
3f63897
Merge branch 'master' into mcbattirola/add-cloud-upgrade-windows
mcbattirola Jul 19, 2022
4b23bb4
Merge branch 'master' into mcbattirola/add-cloud-upgrade-windows
mcbattirola Jul 20, 2022
d8f1076
Move scheduledUpgradeWindows to hook
mcbattirola Jul 21, 2022
a95869e
Make upgradeWindowService a named export
mcbattirola Jul 21, 2022
ca5d4c9
Address PR comments
mcbattirola Jul 21, 2022
3cf319a
Undo test thing
mcbattirola Jul 21, 2022
9587bd7
Add hover and style to edit
mcbattirola Jul 21, 2022
58e4996
Simplify upgradeWindowOptions
mcbattirola Jul 21, 2022
cd8a0c2
Merge branch 'master' into mcbattirola/add-cloud-upgrade-windows
mcbattirola Jul 21, 2022
5f28fb4
Add upgrade window update event to story
mcbattirola Jul 21, 2022
594f090
Remove unused import
mcbattirola Jul 21, 2022
ea4e27a
Move schedule upgrades to enterprise
mcbattirola Jul 22, 2022
4a56bd5
Update snapshot and stories
mcbattirola Jul 22, 2022
dace434
Move upgrade window service to enterprise
mcbattirola Jul 22, 2022
628c333
Merge branch 'master' into mcbattirola/add-cloud-upgrade-windows
mcbattirola Jul 22, 2022
1fdc98a
Remove line break
mcbattirola Jul 22, 2022
985f219
Update audit snapshot
mcbattirola Jul 22, 2022
4da005d
Add type for children
mcbattirola Jul 22, 2022
bd4f061
Merge branch 'master' into mcbattirola/add-cloud-upgrade-windows
mcbattirola Jul 22, 2022
a8c8115
Replace JSX.Element for React.ReactNode
mcbattirola Jul 22, 2022
01c56ae
Merge branch 'master' into mcbattirola/add-cloud-upgrade-windows
mcbattirola Jul 22, 2022
ceff454
Merge branch 'master' into mcbattirola/add-cloud-upgrade-windows
mcbattirola Jul 25, 2022
75895ea
Merge branch 'master' of github.com:gravitational/webapps into mcbatt…
mcbattirola Jul 26, 2022
1fd01ea
Merge branch 'mcbattirola/add-cloud-upgrade-windows' of github.com:gr…
mcbattirola Jul 26, 2022
2d2597f
Lint fix
mcbattirola Jul 26, 2022
3a45023
Merge branch 'master' into mcbattirola/add-cloud-upgrade-windows
mcbattirola Jul 27, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/design/src/Icon/Icon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export const ClipboardUser = makeFontIcon(
'ClipboardUser',
'icon-clipboard-user'
);
export const Clock = makeFontIcon('Clock', 'icon-clock3');
Comment thread
mcbattirola marked this conversation as resolved.
export const Close = makeFontIcon('Close', 'icon-close');
export const Cloud = makeFontIcon('Cloud', 'icon-cloud');
export const CloudSync = makeFontIcon('CloudSync', 'icon-cloud-sync');
Expand Down
1 change: 1 addition & 0 deletions packages/design/src/Icon/Icon.story.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export const ListOfIcons = () => (
<IconBox IconCmpt={Icon.Question} text="Question" />
<IconBox IconCmpt={Icon.Info} text="Info" />
<IconBox IconCmpt={Icon.ClipboardUser} text="ClipboardUser" />
<IconBox IconCmpt={Icon.Clock} text="Clock" />
<IconBox IconCmpt={Icon.Close} text="Close" />
<IconBox IconCmpt={Icon.Cloud} text="Cloud" />
<IconBox IconCmpt={Icon.CloudSync} text="CloudSync" />
Expand Down
1 change: 1 addition & 0 deletions packages/teleport/src/Audit/EventList/EventTypeCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ const EventIconMap: Record<EventCode, React.FC> = {
[eventCodes.X11_FORWARD]: Icons.Info,
[eventCodes.X11_FORWARD_FAILURE]: Icons.Info,
[eventCodes.CERTIFICATE_CREATED]: Icons.Keypair,
[eventCodes.UPGRADE_WINDOW_UPDATED]: Icons.Info,
Comment thread
mcbattirola marked this conversation as resolved.
[eventCodes.UNKNOWN]: Icons.Question,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,12 +358,12 @@ exports[`list of all events 1`] = `
</strong>
-
<strong>
85
86
</strong>
of

<strong>
85
86
</strong>
</div>
<button
Expand Down Expand Up @@ -841,6 +841,43 @@ exports[`list of all events 1`] = `
</button>
</td>
</tr>
<tr>
<td
style="vertical-align: inherit;"
>
<div
class="c14"
>
<span
class="c10 c15 icon icon-info_outline c10 c15"
color="light"
font-size="3"
/>
Upgrade Window Start Updated
</div>
</td>
<td
style="word-break: break-word;"
>
Upgrade Window Start updated to [23:00] by user [alice@example.com]
</td>
<td
style="min-width: 120px;"
>
2022-04-13T20:00:04.000Z
</td>
<td
align="right"
>
<button
class="c16"
kind="border"
width="87px"
>
Details
</button>
</td>
</tr>
<tr>
<td
style="vertical-align: inherit;"
Expand Down
7 changes: 7 additions & 0 deletions packages/teleport/src/Audit/fixtures/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1204,6 +1204,13 @@ export const events = [
time: '2022-05-23T08:29:14.126Z',
uid: '6fa08495-170a-4de9-884f-9931fbdb5982',
},
{
code: 'TUW01I',
time: '2022-04-13T20:00:04.000Z',
user: 'alice@example.com',
event: 'upgradewindowstart.update',
upgrade_window_start: '23:00',
},
].map(makeEvent);

export const eventsSample = [
Expand Down
5 changes: 3 additions & 2 deletions packages/teleport/src/Support/Support.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import React from 'react';

import { Support } from './Support';
import { Props, Support } from './Support';

export default {
title: 'Teleport/Support',
Expand All @@ -34,10 +34,11 @@ export const SupportWithTunnelAddress = () => (
<Support {...props} tunnelPublicAddress="localhost:11005"></Support>
);

const props = {
const props: Props = {
clusterId: 'test',
authVersion: '4.4.0-dev',
publicURL: 'localhost:3080',
isEnterprise: false,
isCloud: false,
tunnelPublicAddress: null,
};
58 changes: 37 additions & 21 deletions packages/teleport/src/Support/Support.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,20 @@
*/

import React from 'react';
import * as Icons from 'design/Icon';
import { Card, Box, Text, Flex } from 'design';
import * as Icons from 'design/Icon';

import styled from 'styled-components';

import { FeatureBox } from 'teleport/components/Layout';
import useTeleport from 'teleport/useTeleport';
import cfg from 'teleport/config';

export default function Container() {
export default function Container({
children,
}: {
children?: React.ReactNode;
}) {
const ctx = useTeleport();
const cluster = ctx.storeUser.state.cluster;

Expand All @@ -34,6 +38,7 @@ export default function Container() {
isEnterprise={cfg.isEnterprise}
tunnelPublicAddress={cfg.tunnelPublicAddress}
isCloud={cfg.isCloud}
children={children}
/>
);
}
Expand All @@ -45,6 +50,7 @@ export const Support = ({
isEnterprise,
tunnelPublicAddress,
isCloud,
children,
}: Props) => {
const docs = getDocUrls(authVersion, isEnterprise);

Expand Down Expand Up @@ -104,29 +110,38 @@ export const Support = ({
</Box>
</Flex>
</Card>
<Box
border="1px solid"
borderColor="primary.light"
mt={4}
mb={10}
borderRadius={3}
px={5}
py={4}
>
<Text as="h5" mb={4} fontWeight="bold" caps>
Cluster Information
</Text>
<ClusterData title="Cluster Name" data={clusterId} />
<ClusterData title="Teleport Version" data={authVersion} />
<ClusterData title="Public Address" data={publicURL} />
<DataContainer title="Cluster Information">
<DataItem title="Cluster Name" data={clusterId} />
<DataItem title="Teleport Version" data={authVersion} />
<DataItem title="Public Address" data={publicURL} />
{tunnelPublicAddress && (
<ClusterData title="Public SSH Tunnel" data={tunnelPublicAddress} />
<DataItem title="Public SSH Tunnel" data={tunnelPublicAddress} />
)}
</Box>
</DataContainer>

{children}
</FeatureBox>
);
};

export const DataContainer: React.FC<{ title: string }> = ({
title,
children,
}) => (
<Box
border="1px solid"
borderColor="primary.light"
mt={4}
borderRadius={3}
px={5}
py={4}
>
<Text as="h5" mb={4} fontWeight="bold" caps>
{title}
</Text>
{children}
</Box>
);
/**
* getDocUrls returns an object of URL's appended with
* UTM, version, and type of teleport.
Expand Down Expand Up @@ -189,7 +204,7 @@ const StyledSupportLink = styled.a.attrs({
}
`;

const ClusterData = ({ title = '', data = null }) => (
export const DataItem = ({ title = '', data = null }) => (
<Flex mb={3}>
<Text typography="body2" bold style={{ width: '130px' }}>
{title}:
Expand Down Expand Up @@ -217,11 +232,12 @@ const Header = ({ title = '', icon = null }) => (
</Flex>
);

type Props = {
export type Props = {
clusterId: string;
authVersion: string;
publicURL: string;
isEnterprise: boolean;
isCloud: boolean;
tunnelPublicAddress?: string;
children?: React.ReactNode;
};
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`support Cloud 1`] = `
.c6 {
display: inline-block;
transition: color 0.3s;
color: #FFFFFF;
}

.c3 {
box-sizing: border-box;
}

.c9 {
box-sizing: border-box;
margin-bottom: 72px;
margin-top: 24px;
padding-left: 32px;
padding-right: 32px;
Expand All @@ -24,6 +17,12 @@ exports[`support Cloud 1`] = `
border-color: #222C59;
}

.c6 {
display: inline-block;
transition: color 0.3s;
color: #FFFFFF;
}

.c1 {
box-sizing: border-box;
padding-bottom: 40px;
Expand Down Expand Up @@ -379,19 +378,12 @@ exports[`support Cloud 1`] = `
`;

exports[`support Enterprise 1`] = `
.c6 {
display: inline-block;
transition: color 0.3s;
color: #FFFFFF;
}

.c3 {
box-sizing: border-box;
}

.c9 {
box-sizing: border-box;
margin-bottom: 72px;
margin-top: 24px;
padding-left: 32px;
padding-right: 32px;
Expand All @@ -402,6 +394,12 @@ exports[`support Enterprise 1`] = `
border-color: #222C59;
}

.c6 {
display: inline-block;
transition: color 0.3s;
color: #FFFFFF;
}

.c1 {
box-sizing: border-box;
padding-bottom: 40px;
Expand Down Expand Up @@ -764,19 +762,12 @@ exports[`support Enterprise 1`] = `
`;

exports[`support OSS 1`] = `
.c6 {
display: inline-block;
transition: color 0.3s;
color: #FFFFFF;
}

.c3 {
box-sizing: border-box;
}

.c9 {
box-sizing: border-box;
margin-bottom: 72px;
margin-top: 24px;
padding-left: 32px;
padding-right: 32px;
Expand All @@ -787,6 +778,12 @@ exports[`support OSS 1`] = `
border-color: #222C59;
}

.c6 {
display: inline-block;
transition: color 0.3s;
color: #FFFFFF;
}

.c1 {
box-sizing: border-box;
padding-bottom: 40px;
Expand Down
7 changes: 7 additions & 0 deletions packages/teleport/src/services/audit/makeEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,13 @@ export const formatters: Formatters = {
return `Certificate of type [${cert_type}] issued for [${user}]`;
},
},
[eventCodes.UPGRADE_WINDOW_UPDATED]: {
type: 'upgradewindow.update',
desc: 'Upgrade Window Start Updated',
format: ({ user, upgrade_window_start }) => {
return `Upgrade Window Start updated to [${upgrade_window_start}] by user [${user}]`;
},
},
[eventCodes.UNKNOWN]: {
type: 'unknown',
desc: 'Unknown Event',
Expand Down
7 changes: 7 additions & 0 deletions packages/teleport/src/services/audit/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ export const eventCodes = {
X11_FORWARD: 'T3008I',
X11_FORWARD_FAILURE: 'T3008W',
CERTIFICATE_CREATED: 'TC000I',
UPGRADE_WINDOW_UPDATED: 'TUW01I',
} as const;

/**
Expand Down Expand Up @@ -730,6 +731,12 @@ export type RawEvents = {
identity: { user: string };
}
>;
[eventCodes.UPGRADE_WINDOW_UPDATED]: RawEvent<
typeof eventCodes.UPGRADE_WINDOW_UPDATED,
{
upgrade_window_start: string;
}
>;
};

/**
Expand Down