2021-04-21 07:25:43 -05:00
|
|
|
import React from 'react';
|
2021-04-01 07:15:23 -05:00
|
|
|
import { css } from '@emotion/css';
|
2021-04-21 07:25:43 -05:00
|
|
|
import { LinkButton, CallToActionCard, Icon, useTheme } from '@grafana/ui';
|
2019-03-28 11:17:01 -05:00
|
|
|
|
|
|
|
export const NoDataSourceCallToAction = () => {
|
2021-04-21 07:25:43 -05:00
|
|
|
const theme = useTheme();
|
2019-03-28 11:17:01 -05:00
|
|
|
|
|
|
|
const message =
|
|
|
|
'Explore requires at least one data source. Once you have added a data source, you can query it here.';
|
|
|
|
const footer = (
|
|
|
|
<>
|
2020-04-12 15:20:02 -05:00
|
|
|
<Icon name="rocket" />
|
2019-03-28 11:17:01 -05:00
|
|
|
<> ProTip: You can also define data sources through configuration files. </>
|
|
|
|
<a
|
|
|
|
href="http://docs.grafana.org/administration/provisioning/#datasources?utm_source=explore"
|
|
|
|
target="_blank"
|
2020-11-18 08:36:35 -06:00
|
|
|
rel="noreferrer"
|
2019-03-28 11:17:01 -05:00
|
|
|
className="text-link"
|
|
|
|
>
|
|
|
|
Learn more
|
|
|
|
</a>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
|
|
|
|
const ctaElement = (
|
2020-07-01 14:04:06 -05:00
|
|
|
<LinkButton size="lg" href="datasources/new" icon="database">
|
2019-03-28 11:17:01 -05:00
|
|
|
Add data source
|
2019-06-17 09:15:49 -05:00
|
|
|
</LinkButton>
|
2019-03-28 11:17:01 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
const cardClassName = css`
|
|
|
|
max-width: ${theme.breakpoints.lg};
|
2019-08-28 03:26:48 -05:00
|
|
|
margin-top: ${theme.spacing.md};
|
|
|
|
align-self: center;
|
2019-03-28 11:17:01 -05:00
|
|
|
`;
|
|
|
|
|
|
|
|
return (
|
2021-04-21 02:45:12 -05:00
|
|
|
<CallToActionCard callToActionElement={ctaElement} className={cardClassName} footer={footer} message={message} />
|
2019-03-28 11:17:01 -05:00
|
|
|
);
|
|
|
|
};
|