Skip to content

Commit

Permalink
Issue #34: design review
Browse files Browse the repository at this point in the history
  • Loading branch information
idrissneumann committed Dec 13, 2023
1 parent 71578d4 commit 65ff78a
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/configuration/DataLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const DataLink = (props: Props) => {
const styles = useStyles2(getStyles);
const [showInternalLink, setShowInternalLink] = useInternalLink(value.datasourceUid);
const [base64TraceId, setBase64TraceId] = useState(true)
const labelWidth = 24

const handleChange = (field: keyof typeof value) => (event: React.ChangeEvent<HTMLInputElement>) => {
onChange({
Expand All @@ -50,7 +51,7 @@ export const DataLink = (props: Props) => {
<InlineField
label="Field"
htmlFor="elasticsearch-datasource-config-field"
labelWidth={12}
labelWidth={labelWidth}
tooltip={'Can be exact field name or a regex pattern that will match on the field name.'}
>
<Input
Expand All @@ -74,7 +75,7 @@ export const DataLink = (props: Props) => {

<InlineFieldRow>
<div className={styles.urlField}>
<InlineLabel htmlFor="elasticsearch-datasource-internal-link" width={12}>
<InlineLabel htmlFor="elasticsearch-datasource-internal-link" width={labelWidth}>
{showInternalLink ? 'Query' : 'URL'}
</InlineLabel>
<DataLinkInput
Expand Down Expand Up @@ -108,7 +109,16 @@ export const DataLink = (props: Props) => {
</InlineFieldRow>

<div className={styles.row}>
<InlineField label="Internal link" labelWidth={12}>
<InlineField label="Field encoded in base64?" labelWidth={labelWidth} tooltip="Quickwit encodes the traceID in base64 by default whereas Jaeger uses hex">
<InlineSwitch
value={base64TraceId}
onChange={() => handleBase64TraceId(!base64TraceId, value)}
/>
</InlineField>
</div>

<div className={styles.row}>
<InlineField label="Internal link" labelWidth={labelWidth}>
<InlineSwitch
label="Internal link"
value={showInternalLink || false}
Expand Down Expand Up @@ -137,16 +147,6 @@ export const DataLink = (props: Props) => {
/>
)}
</div>

<div className={styles.row}>
<InlineField label="Base64" labelWidth={12} title="Base64 traceId">
<InlineSwitch
label="Base64 traceId"
value={base64TraceId}
onChange={() => handleBase64TraceId(!base64TraceId, value)}
/>
</InlineField>
</div>
</div>
);
};
Expand Down

0 comments on commit 65ff78a

Please sign in to comment.