Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

Format change

天舟9387f3765fbd
diff --git a/frontend/src/store/modules/router.ts b/frontend/src/store/modules/router.ts
index 9a5d9d2c5b..2368af45cd 100644
--- a/frontend/src/store/modules/router.ts
+++ b/frontend/src/store/modules/router.ts
@@ -8,103 +8,103 @@ const getters = {
return localStorage.getItem("ui.backPath") || "/";
},
- routeSlug: (state: RouterState) => (
- currentRoute: RouteLocationNormalized
- ): RouterSlug => {
- {
- // /environment/:environmentSlug
- // Total 2 elements, 2nd element is the issue slug
- const environmentComponents = currentRoute.path.match(
- "/environment/([0-9a-zA-Z_-]+)"
- ) || ["/", undefined];
- if (environmentComponents[1]) {
- return {
- environmentSlug: environmentComponents[1],
- };
+ routeSlug:
+ (state: RouterState) =>
+ (currentRoute: RouteLocationNormalized): RouterSlug => {
+ {
+ // /environment/:environmentSlug
+ // Total 2 elements, 2nd element is the issue slug
+ const environmentComponents = currentRoute.path.match(
+ "/environment/([0-9a-zA-Z_-]+)"
+ ) || ["/", undefined];
+ if (environmentComponents[1]) {
+ return {
+ environmentSlug: environmentComponents[1],
+ };
+ }
}
- }
- {
- // /project/:projectSlug
- // Total 2 elements, 2nd element is the project slug
- const projectComponents = currentRoute.path.match(
- "/project/([0-9a-zA-Z_-]+)"
- ) || ["/", undefined];
- if (projectComponents[1]) {
- return {
- projectSlug: projectComponents[1],
- };
+ {
+ // /project/:projectSlug
+ // Total 2 elements, 2nd element is the project slug
+ const projectComponents = currentRoute.path.match(
+ "/project/([0-9a-zA-Z_-]+)"
+ ) || ["/", undefined];
+ if (projectComponents[1]) {
+ return {
+ projectSlug: projectComponents[1],
+ };
+ }
}
- }
- {
- // /issue/:issueSlug
- // Total 2 elements, 2nd element is the issue slug
- const issueComponents = currentRoute.path.match(
- "/issue/([0-9a-zA-Z_-]+)"
- ) || ["/", undefined];
- if (issueComponents[1]) {
- return {
- issueSlug: issueComponents[1],
- };
+ {
+ // /issue/:issueSlug
+ // Total 2 elements, 2nd element is the issue slug
+ const issueComponents = currentRoute.path.match(
+ "/issue/([0-9a-zA-Z_-]+)"
+ ) || ["/", undefined];
+ if (issueComponents[1]) {
+ return {
+ issueSlug: issueComponents[1],
+ };
+ }
}
- }
- {
- // /db/:databaseSlug/datasource/:dataSourceSlug
- // Total 3 elements, 2nd element is the database slug, 3rd element is the data source slug
- const dataSourceComponents = currentRoute.path.match(
- "/db/([0-9a-zA-Z_-]+)/datasource/([0-9a-zA-Z_-]+)"
- ) || ["/", undefined, undefined];
- if (dataSourceComponents[1] && dataSourceComponents[2]) {
- return {
- databaseSlug: dataSourceComponents[1],
- dataSourceSlug: dataSourceComponents[2],
- };
+ {
+ // /db/:databaseSlug/datasource/:dataSourceSlug
+ // Total 3 elements, 2nd element is the database slug, 3rd element is the data source slug
+ const dataSourceComponents = currentRoute.path.match(
+ "/db/([0-9a-zA-Z_-]+)/datasource/([0-9a-zA-Z_-]+)"
+ ) || ["/", undefined, undefined];
+ if (dataSourceComponents[1] && dataSourceComponents[2]) {
+ return {
+ databaseSlug: dataSourceComponents[1],
+ dataSourceSlug: dataSourceComponents[2],
+ };
+ }
}
- }
- {
- // /db/:databaseSlug
- // Total 2 elements, 2nd element is the database slug
- const databaseComponents = currentRoute.path.match(
- "/db/([0-9a-zA-Z_-]+)"
- ) || ["/", undefined];
- if (databaseComponents[1]) {
- return {
- databaseSlug: databaseComponents[1],
- };
+ {
+ // /db/:databaseSlug
+ // Total 2 elements, 2nd element is the database slug
+ const databaseComponents = currentRoute.path.match(
+ "/db/([0-9a-zA-Z_-]+)"
+ ) || ["/", undefined];
+ if (databaseComponents[1]) {
+ return {
+ databaseSlug: databaseComponents[1],
+ };
+ }
}
- }
- {
- // /instance/:instanceSlug
- // Total 2 elements, 2nd element is the instance slug
- const instanceComponents = currentRoute.path.match(
- "/instance/([0-9a-zA-Z_-]+)"
- ) || ["/", undefined];
- if (instanceComponents[1]) {
- return {
- instanceSlug: instanceComponents[1],
- };
+ {
+ // /instance/:instanceSlug
+ // Total 2 elements, 2nd element is the instance slug
+ const instanceComponents = currentRoute.path.match(
+ "/instance/([0-9a-zA-Z_-]+)"
+ ) || ["/", undefined];
+ if (instanceComponents[1]) {
+ return {
+ instanceSlug: instanceComponents[1],
+ };
+ }
}
- }
- {
- // /u/:principalId
- // Total 2 elements, 2nd element is the principal id
- const profileComponents = currentRoute.path.match(
- "/u/([0-9a-zA-Z_-]+)"
- ) || ["/", undefined];
- if (profileComponents[1]) {
- return {
- principalId: profileComponents[1],
- };
+ {
+ // /u/:principalId
+ // Total 2 elements, 2nd element is the principal id
+ const profileComponents = currentRoute.path.match(
+ "/u/([0-9a-zA-Z_-]+)"
+ ) || ["/", undefined];
+ if (profileComponents[1]) {
+ return {
+ principalId: profileComponents[1],
+ };
+ }
}
- }
- return {};
- },
+ return {};
+ },
};
const actions = {