Skip to content

Commit 6fc9e81

Browse files
Zzzz-zmyZzm0809
andauthored
[Fix] Fix the permission issue of the Kanban board (#3679)
Signed-off-by: Zzm0809 <934230207@qq.com> Co-authored-by: Zzm0809 <Zzm0809@users.noreply.github.com>
1 parent 4a17886 commit 6fc9e81

File tree

7 files changed

+139
-12
lines changed

7 files changed

+139
-12
lines changed
Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,39 @@
1+
INSERT INTO `dinky_sys_menu` (`parent_id`, `name`, `path`, `component`, `perms`, `icon`, `type`, `display`, `order_num`,
2+
`create_time`, `update_time`, `note`)
3+
VALUES (-1, '工作台', '/home', './Home', 'home', 'HomeOutlined', 'C', 0, 1, '2024-07-29 11:53:38',
4+
'2024-07-29 11:53:38', NULL);
15

6+
INSERT INTO `dinky_sys_menu` (`parent_id`, `name`, `path`, `component`, `perms`, `icon`, `type`, `display`, `order_num`,
7+
`create_time`, `update_time`, `note`)
8+
VALUES (164, '仪表盘列表', '/dashboard/list', './Dashboard', 'dashboard:list', 'UnorderedListOutlined', 'F', 0, 167,
9+
'2024-07-29 15:37:46', '2024-07-29 15:37:46', NULL);
210

3-
INSERT INTO `dinky_sys_menu` (`parent_id`, `name`, `path`, `component`, `perms`, `icon`, `type`, `display`, `order_num`, `create_time`, `update_time`, `note`)
4-
VALUES ( -1, '工作台', '/home', './Home', 'home', 'HomeOutlined', 'C', 0, 1, '2024-07-29 11:53:38', '2024-07-29 11:53:38', NULL);
11+
UPDATE `dinky_sys_menu`
12+
SET `path` = '/dashboard/list/add',
13+
perms='dashboard:list:add'
14+
WHERE `path` = '/dashboard/add';
15+
UPDATE `dinky_sys_menu`
16+
SET `path` = '/dashboard/list/edit',
17+
perms='dashboard:list:edit'
18+
WHERE `path` = '/dashboard/edit';
19+
UPDATE `dinky_sys_menu`
20+
SET `path` = '/dashboard/list/delete',
21+
perms='dashboard:list:delete'
22+
WHERE `path` = '/dashboard/delete';
23+
UPDATE `dinky_sys_menu`
24+
SET `path` = '/dashboard/list/view',
25+
perms='dashboard:list:view'
26+
WHERE `path` = '/dashboard/view';
27+
28+
INSERT INTO `dinky_sys_menu` (`parent_id`, `name`, `path`, `component`, `perms`, `icon`, `type`, `display`, `order_num`,
29+
`create_time`, `update_time`, `note`)
30+
VALUES (164, '看板布局', '/dashboard/dashboard-layout', './Dashboard/DashboardLayout', 'dashboard:dashboard-layout',
31+
'DashboardOutlined', 'F', 0, 168, '2024-07-29 16:16:45', '2024-07-29 16:17:28', NULL);
32+
INSERT INTO `dinky_sys_menu` (`parent_id`, `name`, `path`, `component`, `perms`, `icon`, `type`, `display`, `order_num`,
33+
`create_time`, `update_time`, `note`)
34+
VALUES (164, '添加看板', '/dashboard/chart/add', NULL, 'dashboard:chart:add', 'AreaChartOutlined', 'F', 0, 167,
35+
'2024-06-21 10:53:33', '2024-06-21 10:53:33', NULL);
36+
INSERT INTO `dinky_sys_menu` (`parent_id`, `name`, `path`, `component`, `perms`, `icon`, `type`, `display`, `order_num`,
37+
`create_time`, `update_time`, `note`)
38+
VALUES (164, '修改看板', '/dashboard/chart/edit', NULL, 'dashboard:chart:edit', 'BarChartOutlined', 'F', 0, 168,
39+
'2024-06-21 10:54:26', '2024-06-21 10:54:26', NULL);

dinky-admin/src/main/resources/db/migration/mysql/R20240729.1.1.0__release.sql

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,16 @@ SET FOREIGN_KEY_CHECKS = 0;
55

66
delete from dinky_sys_menu where `parent_id` = -1 and path = '/home';
77

8+
delete from dinky_sys_menu where `parent_id` = 164 and path = '/dashboard/list';
9+
10+
update dinky_sys_menu set path = '/dashboard/add', perms='dashboard:add' where path = '/dashboard/list/add';
11+
update dinky_sys_menu set path = '/dashboard/edit', perms='dashboard:edit' where path = '/dashboard/list/edit';
12+
update dinky_sys_menu set path = '/dashboard/delete', perms='dashboard:delete' where path = '/dashboard/list/delete';
13+
update dinky_sys_menu set path = '/dashboard/view', perms='dashboard:view' where path = '/dashboard/list/view';
14+
15+
delete from dinky_sys_menu where `parent_id` = 164 and path = '/dashboard/dashboard-layout';
16+
delete from dinky_sys_menu where `parent_id` = 164 and path = '/dashboard/chart/add';
17+
delete from dinky_sys_menu where `parent_id` = 164 and path = '/dashboard/chart/edit';
18+
19+
820
SET FOREIGN_KEY_CHECKS = 1;
Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,46 @@
1-
21
SET NAMES utf8mb4;
32
SET FOREIGN_KEY_CHECKS = 0;
43

5-
INSERT INTO `dinky_sys_menu` (`parent_id`, `name`, `path`, `component`, `perms`, `icon`, `type`, `display`, `order_num`, `create_time`, `update_time`, `note`)
6-
VALUES ( -1, '工作台', '/home', './Home', 'home', 'HomeOutlined', 'C', 0, 1, '2024-07-29 11:53:38', '2024-07-29 11:53:38', NULL);
4+
INSERT INTO `dinky_sys_menu` (`parent_id`, `name`, `path`, `component`, `perms`, `icon`, `type`, `display`, `order_num`,
5+
`create_time`, `update_time`, `note`)
6+
VALUES (-1, '工作台', '/home', './Home', 'home', 'HomeOutlined', 'C', 0, 1, '2024-07-29 11:53:38',
7+
'2024-07-29 11:53:38', NULL);
8+
9+
INSERT INTO `dinky_sys_menu` (`parent_id`, `name`, `path`, `component`, `perms`, `icon`, `type`, `display`, `order_num`,
10+
`create_time`, `update_time`, `note`)
11+
VALUES (164, '仪表盘列表', '/dashboard/list', './Dashboard', 'dashboard:list', 'UnorderedListOutlined', 'F', 0, 167,
12+
'2024-07-29 15:37:46', '2024-07-29 15:37:46', NULL);
13+
14+
UPDATE `dinky_sys_menu`
15+
SET `path` = '/dashboard/list/add',
16+
perms='dashboard:list:add'
17+
WHERE `path` = '/dashboard/add';
18+
UPDATE `dinky_sys_menu`
19+
SET `path` = '/dashboard/list/edit',
20+
perms='dashboard:list:edit'
21+
WHERE `path` = '/dashboard/edit';
22+
UPDATE `dinky_sys_menu`
23+
SET `path` = '/dashboard/list/delete',
24+
perms='dashboard:list:delete'
25+
WHERE `path` = '/dashboard/delete';
26+
UPDATE `dinky_sys_menu`
27+
SET `path` = '/dashboard/list/view',
28+
perms='dashboard:list:view'
29+
WHERE `path` = '/dashboard/view';
30+
31+
32+
INSERT INTO `dinky_sys_menu` (`parent_id`, `name`, `path`, `component`, `perms`, `icon`, `type`, `display`, `order_num`,
33+
`create_time`, `update_time`, `note`)
34+
VALUES (164, '看板布局', '/dashboard/dashboard-layout', './Dashboard/DashboardLayout', 'dashboard:dashboard-layout',
35+
'DashboardOutlined', 'F', 0, 168, '2024-07-29 16:16:45', '2024-07-29 16:17:28', NULL);
36+
INSERT INTO `dinky_sys_menu` (`parent_id`, `name`, `path`, `component`, `perms`, `icon`, `type`, `display`, `order_num`,
37+
`create_time`, `update_time`, `note`)
38+
VALUES (164, '添加看板', '/dashboard/chart/add', NULL, 'dashboard:chart:add', 'AreaChartOutlined', 'F', 0, 167,
39+
'2024-06-21 10:53:33', '2024-06-21 10:53:33', NULL);
40+
INSERT INTO `dinky_sys_menu` (`parent_id`, `name`, `path`, `component`, `perms`, `icon`, `type`, `display`, `order_num`,
41+
`create_time`, `update_time`, `note`)
42+
VALUES (164, '修改看板', '/dashboard/chart/edit', NULL, 'dashboard:chart:edit', 'BarChartOutlined', 'F', 0, 168,
43+
'2024-06-21 10:54:26', '2024-06-21 10:54:26', NULL);
44+
745

846
SET FOREIGN_KEY_CHECKS = 1;

dinky-admin/src/main/resources/db/migration/pgsql/R20240729.1.1.0__release.sql

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,14 @@
33

44
delete from public.dinky_sys_menu where parent_id = -1 and path = '/home';
55

6+
delete from public.dinky_sys_menu where parent_id = 164 and path = '/dashboard/list';
7+
8+
update public.dinky_sys_menu set path = '/dashboard/add', perms='dashboard:add' where path = '/dashboard/list/add';
9+
update public.dinky_sys_menu set path = '/dashboard/edit', perms='dashboard:edit' where path = '/dashboard/list/edit';
10+
update public.dinky_sys_menu set path = '/dashboard/delete', perms='dashboard:delete' where path = '/dashboard/list/delete';
11+
update public.dinky_sys_menu set path = '/dashboard/view', perms='dashboard:view' where path = '/dashboard/list/view';
12+
13+
14+
delete from public.dinky_sys_menu where `parent_id` = 164 and path = '/dashboard/dashboard-layout';
15+
delete from public.dinky_sys_menu where `parent_id` = 164 and path = '/dashboard/chart/add';
16+
delete from public.dinky_sys_menu where `parent_id` = 164 and path = '/dashboard/chart/edit';
Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,39 @@
1+
INSERT INTO public.dinky_sys_menu (parent_id, name, path, component, perms, icon, type, display, order_num, create_time,
2+
update_time, note)
3+
VALUES (-1, '工作台', '/home', './Home', 'home', 'HomeOutlined', 'C', 0, 1, '2024-07-29 11:53:38',
4+
'2024-07-29 11:53:38', NULL);
15

6+
INSERT INTO public.dinky_sys_menu (parent_id, name, path, component, perms, icon, type, display, order_num,
7+
create_time, update_time, note)
8+
VALUES (164, '仪表盘列表', '/dashboard/list', './Dashboard', 'dashboard:list', 'UnorderedListOutlined', 'F', 0, 167,
9+
'2024-07-29 15:37:46', '2024-07-29 15:37:46', NULL);
210

3-
INSERT INTO public.dinky_sys_menu (parent_id, name, path, component, perms, icon, type, display, order_num, create_time, update_time, note)
4-
VALUES ( -1, '工作台', '/home', './Home', 'home', 'HomeOutlined', 'C', 0, 1, '2024-07-29 11:53:38', '2024-07-29 11:53:38', NULL);
11+
UPDATE public.dinky_sys_menu
12+
SET path = '/dashboard/list/add',
13+
perms='dashboard:list:add'
14+
WHERE path = '/dashboard/add';
15+
UPDATE public.dinky_sys_menu
16+
SET path = '/dashboard/list/edit',
17+
perms='dashboard:list:edit'
18+
WHERE path = '/dashboard/edit';
19+
UPDATE public.dinky_sys_menu
20+
SET path = '/dashboard/list/delete',
21+
perms='dashboard:list:delete'
22+
WHERE path = '/dashboard/delete';
23+
UPDATE public.dinky_sys_menu
24+
SET path = '/dashboard/list/view',
25+
perms='dashboard:list:view'
26+
WHERE path = '/dashboard/view';
527

28+
INSERT INTO public.dinky_sys_menu (parent_id, name, path, component, perms, icon, type, display, order_num,
29+
create_time, update_time, note)
30+
VALUES (164, '看板布局', '/dashboard/dashboard-layout', './Dashboard/DashboardLayout', 'dashboard:dashboard-layout',
31+
'DashboardOutlined', 'F', 0, 168, '2024-07-29 16:16:45', '2024-07-29 16:17:28', NULL);
32+
INSERT INTO public.dinky_sys_menu (parent_id, name, path, component, perms, icon, type, display, order_num,
33+
create_time, update_time, note)
34+
VALUES (164, '添加看板', '/dashboard/chart/add', NULL, 'dashboard:chart:add', 'AreaChartOutlined', 'F', 0, 167,
35+
'2024-06-21 10:53:33', '2024-06-21 10:53:33', NULL);
36+
INSERT INTO public.dinky_sys_menu (parent_id, name, path, component, perms, icon, type, display, order_num,
37+
create_time, update_time, note)
38+
VALUES (164, '修改看板', '/dashboard/chart/edit', NULL, 'dashboard:chart:edit', 'BarChartOutlined', 'F', 0, 168,
39+
'2024-06-21 10:54:26', '2024-06-21 10:54:26', NULL);

dinky-web/src/pages/Dashboard/index.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ export default () => {
4949
const [activeKey, setActiveKey] = useState<React.Key | undefined>('tab1');
5050

5151
const [openDetailPage, setOpenDetailPage] = useState(false);
52-
const [detailPageData, setDetailPageData] = useState<Partial<Layout>>({});
5352
const [openCreate, setOpenCreate] = useState(false);
5453
const formRef = useRef<ProFormInstance>();
5554

@@ -140,7 +139,6 @@ export default () => {
140139
rel='noopener noreferrer'
141140
key='link'
142141
onClick={() => {
143-
setDetailPageData(row);
144142
history.push(`/dashboard/dashboard-layout?layoutId=${row.id}`);
145143
setOpenDetailPage(true);
146144
}}
@@ -220,7 +218,7 @@ export default () => {
220218
</Modal>
221219
{openDetailPage && (
222220
<>
223-
<DashboardLayout data={detailPageData} />
221+
<DashboardLayout />
224222
</>
225223
)}
226224
</>

dinky-web/src/pages/Metrics/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@ import MetricsFilter from '@/components/Flink/MetricsFilter/MetricsFilter';
2121
import useHookRequest from '@/hooks/useHookRequest';
2222
import { MetricsTimeFilter } from '@/pages/DevOps/JobDetail/data';
2323
import JobMetricsList from '@/pages/Metrics/JobMetricsList';
24-
import Server from '@/pages/Metrics/Server';
2524
import { getAllConfig } from '@/pages/Metrics/service';
2625
import { l } from '@/utils/intl';
27-
import { PageContainer, ProCard } from '@ant-design/pro-components';
26+
import { PageContainer } from '@ant-design/pro-components';
2827
import { Alert } from 'antd';
2928
import { useState } from 'react';
3029

0 commit comments

Comments
 (0)