}
placeholder={t('data-source-picker.modal.input-placeholder', 'Select data source')}
onChange={(e) => {
setSearch(e.currentTarget.value);
reportSearchUsageOnce();
}}
/>
reportInteraction(INTERACTION_EVENT_NAME, {
item: INTERACTION_ITEM.CONFIG_NEW_DS_EMPTY_STATE,
src: analyticsInteractionSrc,
})
}
filter={(ds) => (filter ? filter?.(ds) : true) && matchDataSourceWithSearch(ds, search) && !ds.meta.builtIn}
variables={variables}
tracing={tracing}
metrics={metrics}
type={type}
annotations={annotations}
alerting={alerting}
pluginId={pluginId}
logs={logs}
dashboard={dashboard}
mixed={mixed}
/>
{uploadFile && config.featureToggles.editPanelCSVDragAndDrop && (
undefined}
options={{
maxSize: DFImport.maxFileSize,
multiple: false,
accept: DFImport.acceptedFiles,
onDrop: onFileDrop,
}}
>
)}
Open a new tab and configure a data source
{
reportInteraction(INTERACTION_EVENT_NAME, {
item: INTERACTION_ITEM.CONFIG_NEW_DS,
src: analyticsInteractionSrc,
});
onDismiss();
}}
/>
);
}
function getDataSourceModalStyles(theme: GrafanaTheme2) {
return {
modal: css({
width: '80%',
height: '80%',
maxWidth: '1200px',
maxHeight: '900px',
[theme.breakpoints.down('md')]: {
width: '100%',
},
}),
modalContent: css({
display: 'flex',
flexDirection: 'row',
height: '100%',
[theme.breakpoints.down('md')]: {
flexDirection: 'column',
},
}),
leftColumn: css({
display: 'flex',
flexDirection: 'column',
width: '50%',
height: '100%',
paddingRight: theme.spacing(4),
borderRight: `1px solid ${theme.colors.border.weak}`,
[theme.breakpoints.down('md')]: {
width: '100%',
borderRight: 0,
paddingRight: 0,
flex: 1,
overflowY: 'auto',
},
}),
rightColumn: css({
display: 'flex',
flexDirection: 'column',
width: '50%',
height: '100%',
justifyItems: 'space-evenly',
alignItems: 'stretch',
paddingLeft: theme.spacing(4),
[theme.breakpoints.down('md')]: {
width: '100%',
paddingLeft: 0,
flex: 0,
},
}),
builtInDataSources: css({
flex: '1 1',
marginBottom: theme.spacing(4),
[theme.breakpoints.down('md')]: {
flex: 0,
},
}),
builtInDataSourcesList: css({
[theme.breakpoints.down('md')]: {
display: 'none',
marginBottom: 0,
},
marginBottom: theme.spacing(4),
}),
appendBuiltInDataSourcesList: css({
[theme.breakpoints.up('md')]: {
display: 'none',
},
}),
newDSSection: css({
display: 'flex',
flexDirection: 'row',
width: '100%',
justifyContent: 'space-between',
alignItems: 'center',
}),
newDSDescription: css({
flex: '1 0',
textOverflow: 'ellipsis',
overflow: 'hidden',
whiteSpace: 'nowrap',
color: theme.colors.text.secondary,
}),
searchInput: css({
width: '100%',
minHeight: '32px',
marginBottom: theme.spacing(1),
}),
};
}