2019-03-28 11:17:01 -05:00
|
|
|
import React, { useContext } from 'react';
|
|
|
|
import { css } from 'emotion';
|
2019-04-08 02:48:15 -05:00
|
|
|
import { ThemeContext, LargeLinkButton, CallToActionCard } from '@grafana/ui';
|
2019-03-28 11:17:01 -05:00
|
|
|
|
|
|
|
export const NoDataSourceCallToAction = () => {
|
|
|
|
const theme = useContext(ThemeContext);
|
|
|
|
|
|
|
|
const message =
|
|
|
|
'Explore requires at least one data source. Once you have added a data source, you can query it here.';
|
|
|
|
const footer = (
|
|
|
|
<>
|
|
|
|
<i className="fa fa-rocket" />
|
|
|
|
<> ProTip: You can also define data sources through configuration files. </>
|
|
|
|
<a
|
|
|
|
href="http://docs.grafana.org/administration/provisioning/#datasources?utm_source=explore"
|
|
|
|
target="_blank"
|
|
|
|
className="text-link"
|
|
|
|
>
|
|
|
|
Learn more
|
|
|
|
</a>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
|
|
|
|
const ctaElement = (
|
2019-04-08 02:48:15 -05:00
|
|
|
<LargeLinkButton href="/datasources/new" icon="gicon gicon-datasources">
|
2019-03-28 11:17:01 -05:00
|
|
|
Add data source
|
2019-04-08 02:48:15 -05:00
|
|
|
</LargeLinkButton>
|
2019-03-28 11:17:01 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
const cardClassName = css`
|
|
|
|
max-width: ${theme.breakpoints.lg};
|
|
|
|
`;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<CallToActionCard
|
|
|
|
callToActionElement={ctaElement}
|
|
|
|
className={cardClassName}
|
|
|
|
footer={footer}
|
|
|
|
message={message}
|
|
|
|
theme={theme}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
};
|