-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds frontend for autogenerated Felix configuration docs
- Loading branch information
Showing
11 changed files
with
5,471 additions
and
435 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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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,46 @@ | ||
import React from 'react'; | ||
import DOMPurify from 'isomorphic-dompurify'; | ||
import styles from './styles.module.css'; | ||
|
||
const getSanitizedData = ({ fieldData }) => ({ | ||
sanitizedNAMEYAML: { __html: DOMPurify.sanitize(fieldData.NameYAML) }, | ||
sanitizedDescription: { __html: DOMPurify.sanitize(fieldData.DescriptionHTML) }, | ||
sanitizedSchema: { __html: DOMPurify.sanitize(fieldData.YAMLSchemaHTML) }, | ||
}); | ||
|
||
const TableCRD = ({ fieldData }) => { | ||
const { sanitizedNAMEYAML, sanitizedDescription, sanitizedSchema } = getSanitizedData({ fieldData }); | ||
|
||
return ( | ||
<table className={styles.felixTable}> | ||
<thead> | ||
<tr> | ||
<th>Attribute</th> | ||
<th>Value</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td>Key</td> | ||
<td> | ||
<code dangerouslySetInnerHTML={sanitizedNAMEYAML} /> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>Description</td> | ||
<td dangerouslySetInnerHTML={sanitizedDescription} /> | ||
</tr> | ||
<tr> | ||
<td>Schema</td> | ||
<td dangerouslySetInnerHTML={sanitizedSchema} /> | ||
</tr> | ||
<tr> | ||
<td>Default</td> | ||
<td>{fieldData.YAMLDefault === '' ? 'none' : <code>{fieldData.YAMLDefault}</code>}</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
); | ||
}; | ||
|
||
export default TableCRD; |
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,45 @@ | ||
import React from 'react'; | ||
import DOMPurify from 'isomorphic-dompurify'; | ||
import styles from './styles.module.css'; | ||
|
||
const getSanitizedData = ({ fieldData }) => ({ | ||
sanitizedDescription: { __html: DOMPurify.sanitize(fieldData.DescriptionHTML) }, | ||
sanitizedSchema: { __html: DOMPurify.sanitize(fieldData.StringSchemaHTML) }, | ||
}); | ||
|
||
const TableConfig = ({ fieldData }) => { | ||
const { sanitizedDescription, sanitizedSchema } = getSanitizedData({ fieldData }); | ||
|
||
return ( | ||
<table className={styles.felixTable}> | ||
<thead> | ||
<tr> | ||
<th>Attribute</th> | ||
<th>Value</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td>Key</td> | ||
<td> | ||
<code>{fieldData.NameConfigFile || 'No Default Value'}</code> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>Description</td> | ||
<td dangerouslySetInnerHTML={sanitizedDescription} /> | ||
</tr> | ||
<tr> | ||
<td>Schema</td> | ||
<td dangerouslySetInnerHTML={sanitizedSchema} /> | ||
</tr> | ||
<tr> | ||
<td>Default</td> | ||
<td>{fieldData.YAMLDefault === '' ? 'none' : <code>{fieldData.YAMLDefault}</code>}</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
); | ||
}; | ||
|
||
export default TableConfig; |
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,55 @@ | ||
import React from 'react'; | ||
import DOMPurify from 'isomorphic-dompurify'; | ||
import styles from './styles.module.css'; | ||
|
||
const getSanitizedData = ({ fieldData }) => ({ | ||
sanitizedDescription: { __html: DOMPurify.sanitize(fieldData.DescriptionHTML) }, | ||
sanitizedSchema: { __html: DOMPurify.sanitize(fieldData.StringSchemaHTML) }, | ||
}); | ||
|
||
const TableEnv = ({ fieldData }) => { | ||
const { sanitizedDescription, sanitizedSchema } = getSanitizedData({ fieldData }); | ||
|
||
return ( | ||
<table className={styles.felixTable}> | ||
<thead> | ||
<tr> | ||
<th>Attribute</th> | ||
<th>Value</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td>Key</td> | ||
<td> | ||
<code>{fieldData.NameEnvVar.toUpperCase() || 'No Default Value'}</code> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>Description</td> | ||
<td dangerouslySetInnerHTML={sanitizedDescription} /> | ||
</tr> | ||
<tr> | ||
<td>Schema</td> | ||
<td dangerouslySetInnerHTML={sanitizedSchema} /> | ||
</tr> | ||
<tr> | ||
<td>Default</td> | ||
<td> | ||
{fieldData.StringDefault === '' ? ( | ||
'none' | ||
) : fieldData.GoType === '*v1.Duration' ? ( | ||
<> | ||
<code>{fieldData.StringDefault}</code> ({fieldData.ParsedDefault}) | ||
</> | ||
) : ( | ||
<code>{fieldData.StringDefault}</code> | ||
)} | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
); | ||
}; | ||
|
||
export default TableEnv; |
Oops, something went wrong.