This is an automated email from the ASF dual-hosted git repository.
lzwang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/inlong.git
The following commit(s) were added to refs/heads/master by this push:
new b40a6a940c [INLONG-9196][Dashboard] Navigation widget user manual
optimization (#9197)
b40a6a940c is described below
commit b40a6a940cfc4e7288dde0edf2204e0cfa0a78fb
Author: Lizhen <[email protected]>
AuthorDate: Fri Nov 3 10:23:50 2023 +0800
[INLONG-9196][Dashboard] Navigation widget user manual optimization (#9197)
---
.../ui/components/Layout/NavWidget/HintSelect.tsx | 49 ++++++++++++++++++++++
.../src/ui/components/Layout/index.tsx | 16 ++-----
inlong-dashboard/src/ui/locales/cn.json | 1 +
inlong-dashboard/src/ui/locales/en.json | 1 +
4 files changed, 55 insertions(+), 12 deletions(-)
diff --git a/inlong-dashboard/src/ui/components/Layout/NavWidget/HintSelect.tsx
b/inlong-dashboard/src/ui/components/Layout/NavWidget/HintSelect.tsx
new file mode 100644
index 0000000000..c10bd41f3d
--- /dev/null
+++ b/inlong-dashboard/src/ui/components/Layout/NavWidget/HintSelect.tsx
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import React from 'react';
+import { Dropdown, Menu } from 'antd';
+import { QuestionCircleOutlined } from '@ant-design/icons';
+import { localesConfig } from '@/configs/locales';
+import i18n from '@/i18n';
+
+const HintSelect = () => {
+ const langMenu = (
+ <Menu>
+ <Menu.Item>
+ <a target="_blank"
href="https://inlong.apache.org/docs/next/introduction">
+ {i18n.t('components.Layout.UserManual')}
+ </a>
+ </Menu.Item>
+ <Menu.Item>
+ <a target="_blank" href="https://github.com/apache/inlong/discussions">
+ {i18n.t('components.Layout.Feedback')}
+ </a>
+ </Menu.Item>
+ </Menu>
+ );
+
+ return (
+ <Dropdown dropdownRender={() => langMenu} placement="bottomRight">
+ <QuestionCircleOutlined />
+ </Dropdown>
+ );
+};
+
+export default HintSelect;
diff --git a/inlong-dashboard/src/ui/components/Layout/index.tsx
b/inlong-dashboard/src/ui/components/Layout/index.tsx
index ead9a6c912..9b6cbd516e 100644
--- a/inlong-dashboard/src/ui/components/Layout/index.tsx
+++ b/inlong-dashboard/src/ui/components/Layout/index.tsx
@@ -17,8 +17,8 @@
* under the License.
*/
-import { Button, Tooltip } from 'antd';
-import { StarOutlined, BulbOutlined, QuestionCircleOutlined } from
'@ant-design/icons';
+import { Tooltip } from 'antd';
+import { StarOutlined, BulbOutlined } from '@ant-design/icons';
import { config } from '@/configs/default';
import menusTree from '@/configs/menus';
import defaultSettings from './defaultSettings';
@@ -37,7 +37,7 @@ import { State } from '@/core/stores';
import NavWidget from './NavWidget';
import LocaleSelect from './NavWidget/LocaleSelect';
import Tenant from './Tenant';
-import i18n from '@/i18n';
+import HintSelect from './NavWidget/HintSelect';
const BasicLayout: React.FC = props => {
const location = useLocation();
@@ -131,15 +131,7 @@ const BasicLayout: React.FC = props => {
</Tooltip>
),
<LocaleSelect />,
- <Tooltip title={i18n.t('components.Layout.UserManual')}>
- <Button
- type="link"
- style={{ color: 'grey' }}
- target="_blank"
- href="https://inlong.apache.org/docs/next/introduction"
- icon={<QuestionCircleOutlined />}
- ></Button>
- </Tooltip>,
+ <HintSelect />,
<NavWidget />,
<Tenant />,
]}
diff --git a/inlong-dashboard/src/ui/locales/cn.json
b/inlong-dashboard/src/ui/locales/cn.json
index ec52ed03a2..e389630a60 100644
--- a/inlong-dashboard/src/ui/locales/cn.json
+++ b/inlong-dashboard/src/ui/locales/cn.json
@@ -570,6 +570,7 @@
"components.Layout.NavWidget.Remind": "密码不一致,请重新输入",
"components.Layout.Tenant.Success": "切换成功",
"components.Layout.UserManual": "用户手册",
+ "components.Layout.Feedback": "建议反馈",
"components.HighSelect.Customize": "自定义",
"components.HighSelect.SearchPlaceholder": "请输入关键字搜索",
"components.NodeSelect.Create": "新建节点",
diff --git a/inlong-dashboard/src/ui/locales/en.json
b/inlong-dashboard/src/ui/locales/en.json
index 1594ba57e1..25856de861 100644
--- a/inlong-dashboard/src/ui/locales/en.json
+++ b/inlong-dashboard/src/ui/locales/en.json
@@ -570,6 +570,7 @@
"components.Layout.NavWidget.Remind": "Password does not match, please
re-enter",
"components.Layout.Tenant.Success": "Success",
"components.Layout.UserManual": "User manual",
+ "components.Layout.Feedback": "Feedback",
"components.HighSelect.Customize": "Customize",
"components.HighSelect.SearchPlaceholder": "Please enter keyword...",
"components.NodeSelect.Create": "Create Node",