This is an automated email from the ASF dual-hosted git repository.
benjobs pushed a commit to branch dev-2.1.6
in repository https://gitbox.apache.org/repos/asf/streampark.git
The following commit(s) were added to refs/heads/dev-2.1.6 by this push:
new 2cedd3af2 [Bug] vue router-name bug fixed.
2cedd3af2 is described below
commit 2cedd3af2c8f6a6cb9068bb427ed9579689580b0
Author: benjobs <[email protected]>
AuthorDate: Fri Apr 11 15:43:27 2025 +0800
[Bug] vue router-name bug fixed.
---
.../Application/src/AppDarkModeToggle.vue | 4 +++-
.../src/components/ContextMenu/src/ContextMenu.vue | 4 +++-
.../src/components/Form/src/BasicForm.vue | 2 +-
.../src/components/Page/src/PageFooter.vue | 4 +++-
.../components/Table/src/components/HeaderCell.vue | 2 +-
.../src/hooks/web/useLockPage.ts | 9 ++++++---
.../src/router/guard/permissionGuard.ts | 22 ++++------------------
.../src/router/routes/basic.ts | 4 ++--
.../streampark-console-webapp/src/utils/props.ts | 2 +-
.../src/views/flink/app/View.vue | 14 ++++++++------
10 files changed, 32 insertions(+), 35 deletions(-)
diff --git
a/streampark-console/streampark-console-webapp/src/components/Application/src/AppDarkModeToggle.vue
b/streampark-console/streampark-console-webapp/src/components/Application/src/AppDarkModeToggle.vue
index 19ba3b151..d4e0ce164 100644
---
a/streampark-console/streampark-console-webapp/src/components/Application/src/AppDarkModeToggle.vue
+++
b/streampark-console/streampark-console-webapp/src/components/Application/src/AppDarkModeToggle.vue
@@ -63,7 +63,9 @@
height: 18px;
background-color: #fff;
border-radius: 50%;
- transition: transform 0.5s, background-color 0.5s;
+ transition:
+ transform 0.5s,
+ background-color 0.5s;
will-change: transform;
}
diff --git
a/streampark-console/streampark-console-webapp/src/components/ContextMenu/src/ContextMenu.vue
b/streampark-console/streampark-console-webapp/src/components/ContextMenu/src/ContextMenu.vue
index e08c25f36..78cac5c5b 100644
---
a/streampark-console/streampark-console-webapp/src/components/ContextMenu/src/ContextMenu.vue
+++
b/streampark-console/streampark-console-webapp/src/components/ContextMenu/src/ContextMenu.vue
@@ -179,7 +179,9 @@
background-color: @component-background;
border: 1px solid rgb(0 0 0 / 8%);
border-radius: 0.25rem;
- box-shadow: 0 2px 2px 0 rgb(0 0 0 / 14%), 0 3px 1px -2px rgb(0 0 0 / 10%),
+ box-shadow:
+ 0 2px 2px 0 rgb(0 0 0 / 14%),
+ 0 3px 1px -2px rgb(0 0 0 / 10%),
0 1px 5px 0 rgb(0 0 0 / 6%);
background-clip: padding-box;
user-select: none;
diff --git
a/streampark-console/streampark-console-webapp/src/components/Form/src/BasicForm.vue
b/streampark-console/streampark-console-webapp/src/components/Form/src/BasicForm.vue
index 1cd7e3809..e5a9dacf6 100644
---
a/streampark-console/streampark-console-webapp/src/components/Form/src/BasicForm.vue
+++
b/streampark-console/streampark-console-webapp/src/components/Form/src/BasicForm.vue
@@ -113,7 +113,7 @@
});
const getBindValue = computed(
- () => ({ ...attrs, ...props, ...unref(getProps) } as Recordable),
+ () => ({ ...attrs, ...props, ...unref(getProps) }) as Recordable,
);
const getSchema = computed((): FormSchema[] => {
diff --git
a/streampark-console/streampark-console-webapp/src/components/Page/src/PageFooter.vue
b/streampark-console/streampark-console-webapp/src/components/Page/src/PageFooter.vue
index e89a6ce97..8fdbc8f41 100644
---
a/streampark-console/streampark-console-webapp/src/components/Page/src/PageFooter.vue
+++
b/streampark-console/streampark-console-webapp/src/components/Page/src/PageFooter.vue
@@ -39,7 +39,9 @@
line-height: 44px;
background-color: @component-background;
border-top: 1px solid @border-color-base;
- box-shadow: 0 -6px 16px -8px rgb(0 0 0 / 8%), 0 -9px 28px 0 rgb(0 0 0 /
5%),
+ box-shadow:
+ 0 -6px 16px -8px rgb(0 0 0 / 8%),
+ 0 -9px 28px 0 rgb(0 0 0 / 5%),
0 -12px 48px 16px rgb(0 0 0 / 3%);
transition: width 0.2s;
diff --git
a/streampark-console/streampark-console-webapp/src/components/Table/src/components/HeaderCell.vue
b/streampark-console/streampark-console-webapp/src/components/Table/src/components/HeaderCell.vue
index 35c080269..36ab854c5 100644
---
a/streampark-console/streampark-console-webapp/src/components/Table/src/components/HeaderCell.vue
+++
b/streampark-console/streampark-console-webapp/src/components/Table/src/components/HeaderCell.vue
@@ -22,7 +22,7 @@
props: {
column: {
type: Object as PropType<BasicColumn>,
- default: () => ({} as BasicColumn),
+ default: () => ({}) as BasicColumn,
},
},
setup(props) {
diff --git
a/streampark-console/streampark-console-webapp/src/hooks/web/useLockPage.ts
b/streampark-console/streampark-console-webapp/src/hooks/web/useLockPage.ts
index c543be954..9a6607421 100644
--- a/streampark-console/streampark-console-webapp/src/hooks/web/useLockPage.ts
+++ b/streampark-console/streampark-console-webapp/src/hooks/web/useLockPage.ts
@@ -32,9 +32,12 @@ export function useLockPage() {
}
clear();
- timeId = setTimeout(() => {
- lockPage();
- }, lockTime * 60 * 1000);
+ timeId = setTimeout(
+ () => {
+ lockPage();
+ },
+ lockTime * 60 * 1000,
+ );
}
function lockPage(): void {
diff --git
a/streampark-console/streampark-console-webapp/src/router/guard/permissionGuard.ts
b/streampark-console/streampark-console-webapp/src/router/guard/permissionGuard.ts
index 828a85225..5a621b49a 100644
---
a/streampark-console/streampark-console-webapp/src/router/guard/permissionGuard.ts
+++
b/streampark-console/streampark-console-webapp/src/router/guard/permissionGuard.ts
@@ -7,6 +7,8 @@ import { useUserStoreWithOut } from '/@/store/modules/user';
import { PAGE_NOT_FOUND_ROUTE } from '/@/router/routes/basic';
+import { PAGE_NOT_FOUND_NAME } from '/@/router/constant';
+
import { RootRoute } from '/@/router/routes';
const LOGIN_PATH = PageEnum.BASE_LOGIN;
@@ -18,12 +20,7 @@ const whitePathList: PageEnum[] = [LOGIN_PATH];
export function createPermissionGuard(router: Router) {
const userStore = useUserStoreWithOut();
const permissionStore = usePermissionStoreWithOut();
-
router.beforeEach(async (to, from, next) => {
- const isPageNoFound = [
- PAGE_NOT_FOUND_ROUTE.name,
- PAGE_NOT_FOUND_ROUTE.name + '_CHILD',
- ].includes(to.name as string);
if (
from.path === ROOT_PATH &&
to.path === PageEnum.BASE_HOME &&
@@ -33,7 +30,6 @@ export function createPermissionGuard(router: Router) {
next(userStore.getUserInfo.homePath);
return;
}
-
const token = userStore.getToken;
// Whitelist can be directly entered
if (whitePathList.includes(to.path as PageEnum)) {
@@ -77,23 +73,13 @@ export function createPermissionGuard(router: Router) {
// Jump to the 404 page after processing the login
if (
from.path === LOGIN_PATH &&
- isPageNoFound &&
+ to.name === PAGE_NOT_FOUND_NAME &&
to.fullPath !== (userStore.getUserInfo.homePath || PageEnum.BASE_HOME)
) {
next(userStore.getUserInfo.homePath || PageEnum.BASE_HOME);
return;
}
- // get userinfo while last fetch time is empty
- // if (userStore.getLastUpdateTime === 0) {
- // try {
- // await userStore.getUserInfoAction();
- // } catch (err) {
- // next();
- // return;
- // }
- // }
-
if (permissionStore.getIsDynamicAddedRoute) {
next();
return;
@@ -108,7 +94,7 @@ export function createPermissionGuard(router: Router) {
permissionStore.setDynamicAddedRoute(true);
- if (isPageNoFound) {
+ if (to.name === PAGE_NOT_FOUND_NAME) {
// After dynamically adding the route, it should be redirected to
fullPath here, otherwise the 404 page content will load
next({ path: to.fullPath, replace: true, query: to.query });
} else {
diff --git
a/streampark-console/streampark-console-webapp/src/router/routes/basic.ts
b/streampark-console/streampark-console-webapp/src/router/routes/basic.ts
index f3cd29c89..217da43a8 100644
--- a/streampark-console/streampark-console-webapp/src/router/routes/basic.ts
+++ b/streampark-console/streampark-console-webapp/src/router/routes/basic.ts
@@ -10,7 +10,7 @@ import {
// 404 on a page
export const PAGE_NOT_FOUND_ROUTE: AppRouteRecordRaw = {
path: '/:path(.*)*',
- name: PAGE_NOT_FOUND_NAME,
+ name: PAGE_NOT_FOUND_NAME + '_PARENT',
component: LAYOUT,
meta: {
title: 'ErrorPage',
@@ -20,7 +20,7 @@ export const PAGE_NOT_FOUND_ROUTE: AppRouteRecordRaw = {
children: [
{
path: '/:path(.*)*',
- name: PAGE_NOT_FOUND_NAME + '_CHILD',
+ name: PAGE_NOT_FOUND_NAME,
component: EXCEPTION_COMPONENT,
meta: {
title: 'ErrorPage',
diff --git a/streampark-console/streampark-console-webapp/src/utils/props.ts
b/streampark-console/streampark-console-webapp/src/utils/props.ts
index ebbe33a1a..5d1d35150 100644
--- a/streampark-console/streampark-console-webapp/src/utils/props.ts
+++ b/streampark-console/streampark-console-webapp/src/utils/props.ts
@@ -175,7 +175,7 @@ export const buildProps = <
: never;
};
-export const definePropType = <T>(val: any) => ({ [wrapperKey]: val } as
PropWrapper<T>);
+export const definePropType = <T>(val: any) => ({ [wrapperKey]: val }) as
PropWrapper<T>;
export const keyOf = <T extends Object>(arr: T) => Object.keys(arr) as
Array<keyof T>;
export const mutable = <T extends readonly any[] | Record<string,
unknown>>(val: T) =>
diff --git
a/streampark-console/streampark-console-webapp/src/views/flink/app/View.vue
b/streampark-console/streampark-console-webapp/src/views/flink/app/View.vue
index 6e9cf1149..b28b10942 100644
--- a/streampark-console/streampark-console-webapp/src/views/flink/app/View.vue
+++ b/streampark-console/streampark-console-webapp/src/views/flink/app/View.vue
@@ -294,7 +294,9 @@
allow-clear
v-model:value="searchRef.tags"
@change="() => handleResetReload()"
- :options="(tagsOptions || []).map((t: Recordable) => ({
label: t, value: t }))"
+ :options="
+ (tagsOptions || []).map((t: Recordable) => ({ label:
t, value: t }))
+ "
/>
</Form.Item>
</Col>
@@ -322,11 +324,11 @@
v-model:value="searchRef.userId"
@change="() => handleResetReload()"
:options="
- (users || []).map((u: Recordable) => ({
- label: u.nickName || u.username,
- value: u.userId,
- }))
- "
+ (users || []).map((u: Recordable) => ({
+ label: u.nickName || u.username,
+ value: u.userId,
+ }))
+ "
/>
</Form.Item>
</Col>