Skip to content

Commit a542f8a

Browse files
[Console] Align setting hints and Flink Gateway route path
Use HelpInfo tooltips for system setting labels and vertically center list items. Normalize Flink Gateway to /setting/flink-gateway with routing aliases, seed SQL, and upgrade scripts. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent a9c5d49 commit a542f8a

13 files changed

Lines changed: 229 additions & 64 deletions

File tree

streampark-console/streampark-console-service/src/main/assembly/script/data/mysql-data.sql

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,10 @@ insert into `t_menu` values (130303, 130300, 'resource delete', NULL, NULL, 'res
144144

145145
insert into `t_menu` values (140100, 140000, 'setting.system', '/setting/system', 'setting/system/View', null, null, '0', 1, 1, now(), now());
146146
insert into `t_menu` values (140200, 140000, 'setting.alarm', '/setting/alarm', 'setting/alarm/View', null, null, '0', 1, 2, now(), now());
147+
insert into `t_menu` values (140500, 140000, 'setting.flinkGateway', '/setting/flink-gateway', 'setting/FlinkGateway/index', null, null, '0', 1, 3, now(), now());
148+
insert into `t_menu` values (140501, 140500, 'add', null, null, 'gateway:add', null, '1', 1, null, now(), now());
149+
insert into `t_menu` values (140502, 140500, 'update', null, null, 'gateway:update', null, '1', 1, null, now(), now());
150+
insert into `t_menu` values (140503, 140500, 'delete', null, null, 'gateway:delete', null, '1', 1, null, now(), now());
147151
insert into `t_menu` values (140300, 140000, 'setting.externalLink', '/setting/extlink', 'setting/extlink/View', 'menu:view', null, '0', 1, 5, now(), now());
148152
insert into `t_menu` values (140400, 140000, 'setting.yarnQueue', '/setting/yarn-queue', 'setting/yarn-queue/View', 'menu:view', null, '0', 1, 6, now(), now());
149153
insert into `t_menu` values (140101, 140100, 'setting view', null, null, 'setting:view', null, '1', 1, null, now(), now());
@@ -245,6 +249,10 @@ insert into `t_role_menu` values (100043, 100001, 130303);
245249
insert into `t_role_menu` values (100044, 100001, 140000);
246250
insert into `t_role_menu` values (100045, 100001, 140100);
247251
insert into `t_role_menu` values (100046, 100001, 140101);
252+
insert into `t_role_menu` values (100111, 100001, 140500);
253+
insert into `t_role_menu` values (100112, 100001, 140501);
254+
insert into `t_role_menu` values (100113, 100001, 140502);
255+
insert into `t_role_menu` values (100114, 100001, 140503);
248256
insert into `t_role_menu` values (100047, 100002, 110000);
249257
insert into `t_role_menu` values (100048, 100002, 110100);
250258
insert into `t_role_menu` values (100049, 100002, 110101);
@@ -294,6 +302,10 @@ insert into `t_role_menu` values (100092, 100002, 140100);
294302
insert into `t_role_menu` values (100093, 100002, 140101);
295303
insert into `t_role_menu` values (100094, 100002, 140102);
296304
insert into `t_role_menu` values (100095, 100002, 140200);
305+
insert into `t_role_menu` values (100115, 100002, 140500);
306+
insert into `t_role_menu` values (100116, 100002, 140501);
307+
insert into `t_role_menu` values (100117, 100002, 140502);
308+
insert into `t_role_menu` values (100118, 100002, 140503);
297309
insert into `t_role_menu` values (100096, 100002, 140300);
298310
insert into `t_role_menu` values (100097, 100002, 140301);
299311
insert into `t_role_menu` values (100098, 100002, 140302);
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
use streampark;
19+
20+
set names utf8mb4;
21+
set foreign_key_checks = 0;
22+
23+
update `t_menu` set `path` = '/setting/flink-gateway' where `path` = '/setting/FlinkGateway';
24+
25+
set foreign_key_checks = 1;

streampark-console/streampark-console-service/src/main/assembly/script/upgrade/pgsql/2.2.0.sql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ insert into "public"."t_role_menu" (role_id, menu_id) values (100002, 120403);
8484
alter table "public"."t_user" alter column "password" TYPE varchar(64) collate "pg_catalog"."default";
8585
comment on column "public"."t_user"."login_type" is 'login type 0:password 1:ldap 2:sso';
8686

87-
insert into "public"."t_menu" values (120500, 130000, 'setting.flinkGateway', '/setting/FlinkGateway', 'setting/FlinkGateway/index', null, 'apartment', '0', '1', 3, now(), now());
88-
insert into "public"."t_menu" values (110501, 110500, 'add', null, null, 'gateway:add', null, '1', '1', null, now(), now());
89-
insert into "public"."t_menu" values (110502, 110500, 'update', null, null, 'gateway:update', null, '1', '1', null, now(), now());
90-
insert into "public"."t_menu" values (110503, 110500, 'delete', null, null, 'gateway:delete', null, '1', '1', null, now(), now());
87+
insert into "public"."t_menu" values (120500, 130000, 'setting.flinkGateway', '/setting/flink-gateway', 'setting/FlinkGateway/index', null, 'apartment', '0', '1', 3, now(), now());
88+
insert into "public"."t_menu" values (120501, 120500, 'add', null, null, 'gateway:add', null, '1', '1', null, now(), now());
89+
insert into "public"."t_menu" values (120502, 120500, 'update', null, null, 'gateway:update', null, '1', '1', null, now(), now());
90+
insert into "public"."t_menu" values (120503, 120500, 'delete', null, null, 'gateway:delete', null, '1', '1', null, now(), now());
9191

9292
insert into "public"."t_role_menu" (role_id, menu_id) values (100001, 120500);
9393
insert into "public"."t_role_menu" (role_id, menu_id) values (100001, 120501);

streampark-console/streampark-console-service/src/main/assembly/script/upgrade/pgsql/2.2.2.sql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ insert into "public"."t_role_menu" (role_id, menu_id) values (100002, 120403);
8484
alter table "public"."t_user" alter column "password" TYPE varchar(64) collate "pg_catalog"."default";
8585
comment on column "public"."t_user"."login_type" is 'login type 0:password 1:ldap 2:sso';
8686

87-
insert into "public"."t_menu" values (120500, 130000, 'setting.flinkGateway', '/setting/FlinkGateway', 'setting/FlinkGateway/index', null, 'apartment', '0', '1', 3, now(), now());
88-
insert into "public"."t_menu" values (110501, 110500, 'add', null, null, 'gateway:add', null, '1', '1', null, now(), now());
89-
insert into "public"."t_menu" values (110502, 110500, 'update', null, null, 'gateway:update', null, '1', '1', null, now(), now());
90-
insert into "public"."t_menu" values (110503, 110500, 'delete', null, null, 'gateway:delete', null, '1', '1', null, now(), now());
87+
insert into "public"."t_menu" values (120500, 130000, 'setting.flinkGateway', '/setting/flink-gateway', 'setting/FlinkGateway/index', null, 'apartment', '0', '1', 3, now(), now());
88+
insert into "public"."t_menu" values (120501, 120500, 'add', null, null, 'gateway:add', null, '1', '1', null, now(), now());
89+
insert into "public"."t_menu" values (120502, 120500, 'update', null, null, 'gateway:update', null, '1', '1', null, now(), now());
90+
insert into "public"."t_menu" values (120503, 120500, 'delete', null, null, 'gateway:delete', null, '1', '1', null, now(), now());
9191

9292
insert into "public"."t_role_menu" (role_id, menu_id) values (100001, 120500);
9393
insert into "public"."t_role_menu" (role_id, menu_id) values (100001, 120501);
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
update "public"."t_menu" set "path" = '/setting/flink-gateway' where "path" = '/setting/FlinkGateway';

streampark-console/streampark-console-service/src/main/resources/db/data-h2.sql

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,10 @@ insert into `t_menu` values (130303, 130300, 'resource delete', NULL, NULL, 'res
142142

143143
insert into `t_menu` values (140100, 140000, 'setting.system', '/setting/system', 'setting/system/View', null, null, '0', 1, 1, now(), now());
144144
insert into `t_menu` values (140200, 140000, 'setting.alarm', '/setting/alarm', 'setting/alarm/View', null, null, '0', 1, 2, now(), now());
145+
insert into `t_menu` values (140500, 140000, 'setting.flinkGateway', '/setting/flink-gateway', 'setting/FlinkGateway/index', null, null, '0', 1, 3, now(), now());
146+
insert into `t_menu` values (140501, 140500, 'add', null, null, 'gateway:add', null, '1', 1, null, now(), now());
147+
insert into `t_menu` values (140502, 140500, 'update', null, null, 'gateway:update', null, '1', 1, null, now(), now());
148+
insert into `t_menu` values (140503, 140500, 'delete', null, null, 'gateway:delete', null, '1', 1, null, now(), now());
145149
insert into `t_menu` values (140300, 140000, 'setting.externalLink', '/setting/extlink', 'setting/extlink/View', 'menu:view', null, '0', 1, 5, now(), now());
146150
insert into `t_menu` values (140400, 140000, 'setting.yarnQueue', '/setting/yarn-queue', 'setting/yarn-queue/View', 'menu:view', null, '0', 1, 6, now(), now());
147151
insert into `t_menu` values (140101, 140100, 'setting view', null, null, 'setting:view', null, '1', 1, null, now(), now());
@@ -243,6 +247,10 @@ insert into `t_role_menu` values (100043, 100001, 130303);
243247
insert into `t_role_menu` values (100044, 100001, 140000);
244248
insert into `t_role_menu` values (100045, 100001, 140100);
245249
insert into `t_role_menu` values (100046, 100001, 140101);
250+
insert into `t_role_menu` values (100111, 100001, 140500);
251+
insert into `t_role_menu` values (100112, 100001, 140501);
252+
insert into `t_role_menu` values (100113, 100001, 140502);
253+
insert into `t_role_menu` values (100114, 100001, 140503);
246254
insert into `t_role_menu` values (100047, 100002, 110000);
247255
insert into `t_role_menu` values (100048, 100002, 110100);
248256
insert into `t_role_menu` values (100049, 100002, 110101);
@@ -292,6 +300,10 @@ insert into `t_role_menu` values (100092, 100002, 140100);
292300
insert into `t_role_menu` values (100093, 100002, 140101);
293301
insert into `t_role_menu` values (100094, 100002, 140102);
294302
insert into `t_role_menu` values (100095, 100002, 140200);
303+
insert into `t_role_menu` values (100115, 100002, 140500);
304+
insert into `t_role_menu` values (100116, 100002, 140501);
305+
insert into `t_role_menu` values (100117, 100002, 140502);
306+
insert into `t_role_menu` values (100118, 100002, 140503);
295307
insert into `t_role_menu` values (100096, 100002, 140300);
296308
insert into `t_role_menu` values (100097, 100002, 140301);
297309
insert into `t_role_menu` values (100098, 100002, 140302);

streampark-console/streampark-console-webapp-v2/src/store/router/component-names.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
/** Maps view path (under views/) to Vue component `name` for keep-alive. */
1919
const VIEW_ALIASES: Record<string, string> = {
20+
'setting/FlinkGateway/index.vue': 'flink/gateway/index.vue',
2021
'spark/app/create.vue': 'spark/app/Add.vue',
2122
'spark/app/edit.vue': 'spark/app/Edit.vue',
2223
}

streampark-console/streampark-console-webapp-v2/src/store/router/helper.ts

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,32 @@ const metaFields: AppRoute.MetaKeys[] = [
2626

2727
const nativeViewModules = import.meta.glob('/src/views/**/*.vue')
2828

29+
/** Backend menu path aliases (historical paths -> canonical paths). */
30+
const PATH_ALIASES: Record<string, string> = {
31+
'/setting/FlinkGateway': '/setting/flink-gateway',
32+
}
33+
2934
/** Backend menu component path aliases (historical paths -> current views). */
3035
const COMPONENT_ALIASES: Record<string, string> = {
36+
'setting/FlinkGateway/index.vue': 'flink/gateway/index.vue',
3137
'spark/app/create.vue': 'spark/app/Add.vue',
3238
'spark/app/edit.vue': 'spark/app/Edit.vue',
3339
'base/redirect/index.vue': 'build-in/redirect/index.vue',
3440
'base/lock/index.vue': 'build-in/lock/index.vue',
3541
'base/error-log/index.vue': 'build-in/error-log/index.vue',
3642
}
3743

44+
function normalizeRoutePath(path: string): string {
45+
return PATH_ALIASES[path] ?? path
46+
}
47+
48+
function normalizeRowRoutes(routes: AppRoute.RowRoute[]): AppRoute.RowRoute[] {
49+
return routes.map((route) => ({
50+
...route,
51+
path: normalizeRoutePath(route.path),
52+
}))
53+
}
54+
3855
function normalizeComponentRel(componentPath: string): string {
3956
let rel = componentPath
4057
if (rel.startsWith('/src/views/')) rel = rel.replace('/src/views/', '')
@@ -106,7 +123,7 @@ function buildDirectoryRedirectRoutes(rowRoutes: AppRoute.RowRoute[]): AppRoute.
106123
pid: null,
107124
name: `dir_redirect_${String(dir.name).replace(/\W+/g, '_')}`,
108125
path: dir.path,
109-
redirect: target.path,
126+
redirect: normalizeRoutePath(target.path),
110127
component: Layout,
111128
meta: {
112129
title: dir.title,
@@ -118,10 +135,27 @@ function buildDirectoryRedirectRoutes(rowRoutes: AppRoute.RowRoute[]): AppRoute.
118135
return redirects
119136
}
120137

138+
/** Legacy menu paths redirect to canonical kebab-case routes. */
139+
function buildLegacyPathRedirectRoutes(): AppRoute.Route[] {
140+
return Object.entries(PATH_ALIASES).map(([legacyPath, targetPath], index) => ({
141+
id: -900000 - index,
142+
pid: null,
143+
name: `legacy_redirect_${legacyPath.replace(/\W+/g, '_')}`,
144+
path: legacyPath,
145+
redirect: targetPath,
146+
component: Layout,
147+
meta: {
148+
hide: true,
149+
requiresAuth: true,
150+
},
151+
}))
152+
}
153+
121154
export function createRoutes(routes: AppRoute.RowRoute[]) {
122155
const { hasPermission } = usePermission()
123156

124-
let resultRouter = standardizedRoutes(routes)
157+
const normalizedRoutes = normalizeRowRoutes(routes)
158+
let resultRouter = standardizedRoutes(normalizedRoutes)
125159
resultRouter = resultRouter.filter((i) => hasPermission(i.meta.roles))
126160

127161
resultRouter = resultRouter.map((item: AppRoute.Route) => {
@@ -137,7 +171,11 @@ export function createRoutes(routes: AppRoute.RowRoute[]) {
137171

138172
setRedirect(resultRouter)
139173
resultRouter = flattenAuthRoutes(resultRouter)
140-
resultRouter = [...buildDirectoryRedirectRoutes(routes), ...resultRouter]
174+
resultRouter = [
175+
...buildDirectoryRedirectRoutes(normalizedRoutes),
176+
...buildLegacyPathRedirectRoutes(),
177+
...resultRouter,
178+
]
141179

142180
const appRootRoute: RouteRecordRaw = {
143181
path: '/appRoot',
@@ -179,7 +217,7 @@ function setRedirect(routes: AppRoute.Route[]) {
179217
}
180218

181219
export function createMenus(userRoutes: AppRoute.RowRoute[]) {
182-
const resultMenus = standardizedRoutes(userRoutes)
220+
const resultMenus = standardizedRoutes(normalizeRowRoutes(userRoutes))
183221
const visibleMenus = resultMenus.filter((route) => !route.meta.hide)
184222
return arrayToTree(transformAuthRoutesToMenus(visibleMenus))
185223
}

streampark-console/streampark-console-webapp-v2/src/styles/index.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,11 @@ body,
1818
.drag-handle {
1919
cursor: move;
2020
}
21+
22+
.tip-info {
23+
display: block;
24+
margin-top: 4px;
25+
font-size: 12px;
26+
line-height: 1.5;
27+
color: var(--n-text-color-3);
28+
}

streampark-console/streampark-console-webapp-v2/src/views/flink/home/components/FlinkEnvModal.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,19 +176,19 @@ async function handleSubmit() {
176176
:placeholder="t('setting.flinkHome.flinkNamePlaceholder')"
177177
clearable
178178
/>
179-
<n-text depth="3" class="mt-4px text-12px">
179+
<span class="tip-info">
180180
{{ t('setting.flinkHome.operateMessage.flinkNameTips') }}
181-
</n-text>
181+
</span>
182182
</n-form-item>
183183
<n-form-item :label="t('setting.flinkHome.flinkHome')" path="flinkHome">
184184
<n-input
185185
v-model:value="formModel.flinkHome"
186186
:placeholder="t('setting.flinkHome.flinkHomePlaceholder')"
187187
clearable
188188
/>
189-
<n-text depth="3" class="mt-4px text-12px">
189+
<span class="tip-info">
190190
{{ t('setting.flinkHome.operateMessage.flinkHomeTips') }}
191-
</n-text>
191+
</span>
192192
</n-form-item>
193193
<n-form-item :label="t('setting.flinkHome.description')" path="description">
194194
<n-input

0 commit comments

Comments
 (0)