-
Notifications
You must be signed in to change notification settings - Fork 11.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* passing time filters * add settings * Cleanup and merge fixes --------- Co-authored-by: André Pereira <adrapereira@gmail.com>
- Loading branch information
1 parent
75f6e50
commit 43f148e
Showing
4 changed files
with
73 additions
and
4 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
56 changes: 56 additions & 0 deletions
56
public/app/plugins/datasource/jaeger/configuration/TraceIdTimeParams.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,56 @@ | ||
import { css } from '@emotion/css'; | ||
import React from 'react'; | ||
|
||
import { | ||
DataSourceJsonData, | ||
DataSourcePluginOptionsEditorProps, | ||
updateDatasourcePluginJsonDataOption, | ||
} from '@grafana/data'; | ||
import { InlineField, InlineFieldRow, InlineSwitch } from '@grafana/ui'; | ||
|
||
export interface TraceIdTimeParamsOptions { | ||
enabled?: boolean; | ||
} | ||
|
||
export interface TraceIdTimeParamsData extends DataSourceJsonData { | ||
traceIdTimeParams?: TraceIdTimeParamsOptions; | ||
} | ||
|
||
interface Props extends DataSourcePluginOptionsEditorProps<TraceIdTimeParamsData> {} | ||
|
||
export function TraceIdTimeParams({ options, onOptionsChange }: Props) { | ||
return ( | ||
<div className={styles.container}> | ||
<h3 className="page-heading">Query Trace by ID with Time Params</h3> | ||
<InlineFieldRow className={styles.row}> | ||
<InlineField | ||
tooltip="pass time parameters when querying trace by ID" | ||
label="Enable Time Parameters" | ||
labelWidth={26} | ||
> | ||
<InlineSwitch | ||
id="enableTraceIdTimeParams" | ||
value={options.jsonData.traceIdTimeParams?.enabled} | ||
onChange={(event: React.SyntheticEvent<HTMLInputElement>) => | ||
updateDatasourcePluginJsonDataOption({ onOptionsChange, options }, 'traceIdTimeParams', { | ||
...options.jsonData.traceIdTimeParams, | ||
enabled: event.currentTarget.checked, | ||
}) | ||
} | ||
/> | ||
</InlineField> | ||
</InlineFieldRow> | ||
</div> | ||
); | ||
} | ||
|
||
const styles = { | ||
container: css` | ||
label: container; | ||
width: 100%; | ||
`, | ||
row: css` | ||
label: row; | ||
align-items: baseline; | ||
`, | ||
}; |
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