This is an automated email from the ASF dual-hosted git repository.
sunyi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git
The following commit(s) were added to refs/heads/master by this push:
new 65f792a feat: added tip on the Metrics page (#1479)
65f792a is described below
commit 65f792ad1477fe5aca4f964431e69ee29eedc5c0
Author: 琚致远 <[email protected]>
AuthorDate: Fri Feb 19 09:54:13 2021 +0800
feat: added tip on the Metrics page (#1479)
---
web/cypress/integration/metrics/metrics-smoketest.spec.js | 2 +-
web/src/pages/Metrics/Metrics.tsx | 14 ++++++++++++--
web/src/pages/Metrics/locales/en-US.ts | 3 ++-
web/src/pages/Metrics/locales/zh-CN.ts | 1 +
4 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/web/cypress/integration/metrics/metrics-smoketest.spec.js
b/web/cypress/integration/metrics/metrics-smoketest.spec.js
index c046a1a..2e8a43d 100644
--- a/web/cypress/integration/metrics/metrics-smoketest.spec.js
+++ b/web/cypress/integration/metrics/metrics-smoketest.spec.js
@@ -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');
});
});
diff --git a/web/src/pages/Metrics/Metrics.tsx
b/web/src/pages/Metrics/Metrics.tsx
index cb8d3fc..1680478 100644
--- a/web/src/pages/Metrics/Metrics.tsx
+++ b/web/src/pages/Metrics/Metrics.tsx
@@ -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>();
@@ -32,7 +33,16 @@ const Metrics: React.FC = () => {
}, []);
return (
- <PageHeaderWrapper title={formatMessage({ id: 'menu.metrics' })}>
+ <PageHeaderWrapper
+ title={
+ <>
+ {formatMessage({ id: 'menu.metrics' })}
+ <Tooltip title={formatMessage({ id: 'page.metrics.tip' })}>
+ <QuestionCircleOutlined />
+ </Tooltip>
+ </>
+ }
+ >
<Card>
{!grafanaURL && (
<Empty
diff --git a/web/src/pages/Metrics/locales/en-US.ts
b/web/src/pages/Metrics/locales/en-US.ts
index 7841b7e..557a370 100644
--- a/web/src/pages/Metrics/locales/en-US.ts
+++ b/web/src/pages/Metrics/locales/en-US.ts
@@ -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.',
};
diff --git a/web/src/pages/Metrics/locales/zh-CN.ts
b/web/src/pages/Metrics/locales/zh-CN.ts
index 134b1dc..5ab0397 100644
--- a/web/src/pages/Metrics/locales/zh-CN.ts
+++ b/web/src/pages/Metrics/locales/zh-CN.ts
@@ -17,4 +17,5 @@
export default {
'page.metrics.empty.description.grafanaNotConfig': '您还未配置 Grafana',
'page.metrics.button.grafanaConfig': '现在配置',
+ 'page.metrics.tip': '使用浏览器 iframe 存储监控页访问地址,仅作用于本地。',
};