Skip to content

Commit

Permalink
[Fix] Fix the permission issue of the Kanban board (DataLinkDC#3679)
Browse files Browse the repository at this point in the history
Signed-off-by: Zzm0809 <[email protected]>
Co-authored-by: Zzm0809 <[email protected]>
  • Loading branch information
Zzm0809 and Zzm0809 authored Jul 29, 2024
1 parent 4a17886 commit 6fc9e81
Show file tree
Hide file tree
Showing 7 changed files with 139 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,39 @@
INSERT INTO `dinky_sys_menu` (`parent_id`, `name`, `path`, `component`, `perms`, `icon`, `type`, `display`, `order_num`,
`create_time`, `update_time`, `note`)
VALUES (-1, '工作台', '/home', './Home', 'home', 'HomeOutlined', 'C', 0, 1, '2024-07-29 11:53:38',
'2024-07-29 11:53:38', NULL);

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

INSERT INTO `dinky_sys_menu` (`parent_id`, `name`, `path`, `component`, `perms`, `icon`, `type`, `display`, `order_num`, `create_time`, `update_time`, `note`)
VALUES ( -1, '工作台', '/home', './Home', 'home', 'HomeOutlined', 'C', 0, 1, '2024-07-29 11:53:38', '2024-07-29 11:53:38', NULL);
UPDATE `dinky_sys_menu`
SET `path` = '/dashboard/list/add',
perms='dashboard:list:add'
WHERE `path` = '/dashboard/add';
UPDATE `dinky_sys_menu`
SET `path` = '/dashboard/list/edit',
perms='dashboard:list:edit'
WHERE `path` = '/dashboard/edit';
UPDATE `dinky_sys_menu`
SET `path` = '/dashboard/list/delete',
perms='dashboard:list:delete'
WHERE `path` = '/dashboard/delete';
UPDATE `dinky_sys_menu`
SET `path` = '/dashboard/list/view',
perms='dashboard:list:view'
WHERE `path` = '/dashboard/view';

INSERT INTO `dinky_sys_menu` (`parent_id`, `name`, `path`, `component`, `perms`, `icon`, `type`, `display`, `order_num`,
`create_time`, `update_time`, `note`)
VALUES (164, '看板布局', '/dashboard/dashboard-layout', './Dashboard/DashboardLayout', 'dashboard:dashboard-layout',
'DashboardOutlined', 'F', 0, 168, '2024-07-29 16:16:45', '2024-07-29 16:17:28', NULL);
INSERT INTO `dinky_sys_menu` (`parent_id`, `name`, `path`, `component`, `perms`, `icon`, `type`, `display`, `order_num`,
`create_time`, `update_time`, `note`)
VALUES (164, '添加看板', '/dashboard/chart/add', NULL, 'dashboard:chart:add', 'AreaChartOutlined', 'F', 0, 167,
'2024-06-21 10:53:33', '2024-06-21 10:53:33', NULL);
INSERT INTO `dinky_sys_menu` (`parent_id`, `name`, `path`, `component`, `perms`, `icon`, `type`, `display`, `order_num`,
`create_time`, `update_time`, `note`)
VALUES (164, '修改看板', '/dashboard/chart/edit', NULL, 'dashboard:chart:edit', 'BarChartOutlined', 'F', 0, 168,
'2024-06-21 10:54:26', '2024-06-21 10:54:26', NULL);
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,16 @@ SET FOREIGN_KEY_CHECKS = 0;

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

delete from dinky_sys_menu where `parent_id` = 164 and path = '/dashboard/list';

update dinky_sys_menu set path = '/dashboard/add', perms='dashboard:add' where path = '/dashboard/list/add';
update dinky_sys_menu set path = '/dashboard/edit', perms='dashboard:edit' where path = '/dashboard/list/edit';
update dinky_sys_menu set path = '/dashboard/delete', perms='dashboard:delete' where path = '/dashboard/list/delete';
update dinky_sys_menu set path = '/dashboard/view', perms='dashboard:view' where path = '/dashboard/list/view';

delete from dinky_sys_menu where `parent_id` = 164 and path = '/dashboard/dashboard-layout';
delete from dinky_sys_menu where `parent_id` = 164 and path = '/dashboard/chart/add';
delete from dinky_sys_menu where `parent_id` = 164 and path = '/dashboard/chart/edit';


SET FOREIGN_KEY_CHECKS = 1;
Original file line number Diff line number Diff line change
@@ -1,8 +1,46 @@

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

INSERT INTO `dinky_sys_menu` (`parent_id`, `name`, `path`, `component`, `perms`, `icon`, `type`, `display`, `order_num`, `create_time`, `update_time`, `note`)
VALUES ( -1, '工作台', '/home', './Home', 'home', 'HomeOutlined', 'C', 0, 1, '2024-07-29 11:53:38', '2024-07-29 11:53:38', NULL);
INSERT INTO `dinky_sys_menu` (`parent_id`, `name`, `path`, `component`, `perms`, `icon`, `type`, `display`, `order_num`,
`create_time`, `update_time`, `note`)
VALUES (-1, '工作台', '/home', './Home', 'home', 'HomeOutlined', 'C', 0, 1, '2024-07-29 11:53:38',
'2024-07-29 11:53:38', NULL);

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

UPDATE `dinky_sys_menu`
SET `path` = '/dashboard/list/add',
perms='dashboard:list:add'
WHERE `path` = '/dashboard/add';
UPDATE `dinky_sys_menu`
SET `path` = '/dashboard/list/edit',
perms='dashboard:list:edit'
WHERE `path` = '/dashboard/edit';
UPDATE `dinky_sys_menu`
SET `path` = '/dashboard/list/delete',
perms='dashboard:list:delete'
WHERE `path` = '/dashboard/delete';
UPDATE `dinky_sys_menu`
SET `path` = '/dashboard/list/view',
perms='dashboard:list:view'
WHERE `path` = '/dashboard/view';


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


SET FOREIGN_KEY_CHECKS = 1;
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,14 @@

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

delete from public.dinky_sys_menu where parent_id = 164 and path = '/dashboard/list';

update public.dinky_sys_menu set path = '/dashboard/add', perms='dashboard:add' where path = '/dashboard/list/add';
update public.dinky_sys_menu set path = '/dashboard/edit', perms='dashboard:edit' where path = '/dashboard/list/edit';
update public.dinky_sys_menu set path = '/dashboard/delete', perms='dashboard:delete' where path = '/dashboard/list/delete';
update public.dinky_sys_menu set path = '/dashboard/view', perms='dashboard:view' where path = '/dashboard/list/view';


delete from public.dinky_sys_menu where `parent_id` = 164 and path = '/dashboard/dashboard-layout';
delete from public.dinky_sys_menu where `parent_id` = 164 and path = '/dashboard/chart/add';
delete from public.dinky_sys_menu where `parent_id` = 164 and path = '/dashboard/chart/edit';
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
INSERT INTO public.dinky_sys_menu (parent_id, name, path, component, perms, icon, type, display, order_num, create_time,
update_time, note)
VALUES (-1, '工作台', '/home', './Home', 'home', 'HomeOutlined', 'C', 0, 1, '2024-07-29 11:53:38',
'2024-07-29 11:53:38', NULL);

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

INSERT INTO public.dinky_sys_menu (parent_id, name, path, component, perms, icon, type, display, order_num, create_time, update_time, note)
VALUES ( -1, '工作台', '/home', './Home', 'home', 'HomeOutlined', 'C', 0, 1, '2024-07-29 11:53:38', '2024-07-29 11:53:38', NULL);
UPDATE public.dinky_sys_menu
SET path = '/dashboard/list/add',
perms='dashboard:list:add'
WHERE path = '/dashboard/add';
UPDATE public.dinky_sys_menu
SET path = '/dashboard/list/edit',
perms='dashboard:list:edit'
WHERE path = '/dashboard/edit';
UPDATE public.dinky_sys_menu
SET path = '/dashboard/list/delete',
perms='dashboard:list:delete'
WHERE path = '/dashboard/delete';
UPDATE public.dinky_sys_menu
SET path = '/dashboard/list/view',
perms='dashboard:list:view'
WHERE path = '/dashboard/view';

INSERT INTO public.dinky_sys_menu (parent_id, name, path, component, perms, icon, type, display, order_num,
create_time, update_time, note)
VALUES (164, '看板布局', '/dashboard/dashboard-layout', './Dashboard/DashboardLayout', 'dashboard:dashboard-layout',
'DashboardOutlined', 'F', 0, 168, '2024-07-29 16:16:45', '2024-07-29 16:17:28', NULL);
INSERT INTO public.dinky_sys_menu (parent_id, name, path, component, perms, icon, type, display, order_num,
create_time, update_time, note)
VALUES (164, '添加看板', '/dashboard/chart/add', NULL, 'dashboard:chart:add', 'AreaChartOutlined', 'F', 0, 167,
'2024-06-21 10:53:33', '2024-06-21 10:53:33', NULL);
INSERT INTO public.dinky_sys_menu (parent_id, name, path, component, perms, icon, type, display, order_num,
create_time, update_time, note)
VALUES (164, '修改看板', '/dashboard/chart/edit', NULL, 'dashboard:chart:edit', 'BarChartOutlined', 'F', 0, 168,
'2024-06-21 10:54:26', '2024-06-21 10:54:26', NULL);
4 changes: 1 addition & 3 deletions dinky-web/src/pages/Dashboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ export default () => {
const [activeKey, setActiveKey] = useState<React.Key | undefined>('tab1');

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

Expand Down Expand Up @@ -140,7 +139,6 @@ export default () => {
rel='noopener noreferrer'
key='link'
onClick={() => {
setDetailPageData(row);
history.push(`/dashboard/dashboard-layout?layoutId=${row.id}`);
setOpenDetailPage(true);
}}
Expand Down Expand Up @@ -220,7 +218,7 @@ export default () => {
</Modal>
{openDetailPage && (
<>
<DashboardLayout data={detailPageData} />
<DashboardLayout />
</>
)}
</>
Expand Down
3 changes: 1 addition & 2 deletions dinky-web/src/pages/Metrics/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ import MetricsFilter from '@/components/Flink/MetricsFilter/MetricsFilter';
import useHookRequest from '@/hooks/useHookRequest';
import { MetricsTimeFilter } from '@/pages/DevOps/JobDetail/data';
import JobMetricsList from '@/pages/Metrics/JobMetricsList';
import Server from '@/pages/Metrics/Server';
import { getAllConfig } from '@/pages/Metrics/service';
import { l } from '@/utils/intl';
import { PageContainer, ProCard } from '@ant-design/pro-components';
import { PageContainer } from '@ant-design/pro-components';
import { Alert } from 'antd';
import { useState } from 'react';

Expand Down

0 comments on commit 6fc9e81

Please sign in to comment.