mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
News Panel: Improve error message (#69060)
Add alert with link to documentation
This commit is contained in:
parent
c55c091145
commit
0b4c790e55
@ -2,7 +2,7 @@ import React, { useEffect } from 'react';
|
||||
|
||||
import { PanelProps } from '@grafana/data';
|
||||
import { RefreshEvent } from '@grafana/runtime';
|
||||
import { CustomScrollbar } from '@grafana/ui';
|
||||
import { Alert, CustomScrollbar, Icon } from '@grafana/ui';
|
||||
|
||||
import { News } from './component/News';
|
||||
import { DEFAULT_FEED_URL } from './constants';
|
||||
@ -32,7 +32,17 @@ export function NewsPanel(props: NewsPanelProps) {
|
||||
}, [getNews]);
|
||||
|
||||
if (state.error) {
|
||||
return <div>Error loading RSS feed.</div>;
|
||||
return (
|
||||
<Alert title="Error loading RSS feed">
|
||||
Make sure that the feed URL is correct and that CORS is configured correctly on the server. See{' '}
|
||||
<a
|
||||
style={{ textDecoration: 'underline' }}
|
||||
href="https://grafana.com/docs/grafana/latest/panels-visualizations/visualizations/news/"
|
||||
>
|
||||
News panel documentation. <Icon name="external-link-alt" />
|
||||
</a>
|
||||
</Alert>
|
||||
);
|
||||
}
|
||||
if (state.loading) {
|
||||
return <div>Loading...</div>;
|
||||
|
Loading…
Reference in New Issue
Block a user