Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added tip on the Metrics page #1479

Merged
merged 2 commits into from
Feb 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web/cypress/integration/metrics/metrics-smoketest.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ context('metrics page smoke test', () => {
.children()
.should('contain', 'Metrics')
.and('contain', 'You have not configured Grafana')
.and('contain', 'Configure Now');
.and('contain', 'Configure');
});
});
14 changes: 12 additions & 2 deletions web/src/pages/Metrics/Metrics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@
*/
import React, { useState, useEffect } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Empty, Button, Card } from 'antd';
import { Empty, Button, Card, Tooltip } from 'antd';
import { history, useIntl } from 'umi';

import { getGrafanaURL } from './service';
import { QuestionCircleOutlined } from '@ant-design/icons';

const Metrics: React.FC = () => {
const [grafanaURL, setGrafanaURL] = useState<string | undefined>();
Expand All @@ -32,7 +33,16 @@ const Metrics: React.FC = () => {
}, []);

return (
<PageHeaderWrapper title={formatMessage({ id: 'menu.metrics' })}>
<PageHeaderWrapper
title={
<>
{formatMessage({ id: 'menu.metrics' })}&nbsp;
<Tooltip title={formatMessage({ id: 'page.metrics.tip' })}>
<QuestionCircleOutlined />
</Tooltip>
</>
}
>
<Card>
{!grafanaURL && (
<Empty
Expand Down
3 changes: 2 additions & 1 deletion web/src/pages/Metrics/locales/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
*/
export default {
'page.metrics.empty.description.grafanaNotConfig': 'You have not configured Grafana',
'page.metrics.button.grafanaConfig': 'Configure Now',
'page.metrics.button.grafanaConfig': 'Configure',
'page.metrics.tip': 'Use browser iframe to store monitor page URL, local only.',
};
1 change: 1 addition & 0 deletions web/src/pages/Metrics/locales/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@
export default {
'page.metrics.empty.description.grafanaNotConfig': '您还未配置 Grafana',
'page.metrics.button.grafanaConfig': '现在配置',
'page.metrics.tip': '使用浏览器 iframe 存储监控页访问地址,仅作用于本地。',
};