-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
245e378
commit 131f6f5
Showing
69 changed files
with
3,379 additions
and
195 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { CodeEditor } from '@pluralsh/design-system' | ||
import { GqlError } from 'components/utils/Alert' | ||
import { ScrollablePage } from 'components/utils/layout/ScrollablePage' | ||
import { useSelfManageMutation } from 'generated/graphql' | ||
import { useState } from 'react' | ||
import { useNavigate } from 'react-router-dom' | ||
|
||
const INTRO_TEXT = | ||
'# Paste your helm values file here\n' + | ||
'# this will create a service that will auto-update your instance\n' + | ||
'# with these values persisted throughout' | ||
|
||
export default function SelfManage() { | ||
const navigate = useNavigate() | ||
const [values, setValues] = useState(INTRO_TEXT) | ||
const [mutation, { loading, error }] = useSelfManageMutation({ | ||
variables: { values }, | ||
onCompleted: () => navigate('/cd/services'), | ||
}) | ||
|
||
return ( | ||
<ScrollablePage | ||
heading="Configure Automatic Upgrades" | ||
gap="medium" | ||
scrollable={false} | ||
> | ||
{error && ( | ||
<GqlError | ||
error={error} | ||
header="Failed to update service" | ||
/> | ||
)} | ||
<CodeEditor | ||
value={INTRO_TEXT} | ||
language="yaml" | ||
save | ||
saving={loading} | ||
onChange={setValues} | ||
onSave={() => mutation()} | ||
saveLabel="Configure" | ||
/> | ||
</ScrollablePage> | ||
) | ||
} |
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,35 @@ | ||
import { Chip, Tooltip } from '@pluralsh/design-system' | ||
|
||
export function HelmHealthChip({ | ||
ready, | ||
message, | ||
}: { | ||
ready: boolean | ||
message?: string | null | undefined | ||
}) { | ||
const chip = ( | ||
<Chip severity={ready ? 'success' : 'critical'}> | ||
{ready ? 'Ready' : 'Failed'} | ||
</Chip> | ||
) | ||
|
||
const errorLines = (message || '').split('\n').map((line, i, arr) => ( | ||
<> | ||
{line} | ||
{i !== arr.length - 1 && <br />} | ||
</> | ||
)) | ||
|
||
if (message) { | ||
return ( | ||
<Tooltip | ||
placement="top" | ||
label={<div css={{ maxWidth: 500 }}>{errorLines}</div>} | ||
> | ||
{chip} | ||
</Tooltip> | ||
) | ||
} | ||
|
||
return chip | ||
} |
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
Oops, something went wrong.