Skip to content

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

Add a link util stub file

天舟8ed51aef27eb
diff --git a/frontend/src/utils/index.ts b/frontend/src/utils/index.ts
index 363813c0b6..7bfe16f844 100644
--- a/frontend/src/utils/index.ts
+++ b/frontend/src/utils/index.ts
@@ -1,4 +1,5 @@
export * from "./env";
+export * from "./link";
export * from "./slug";
export * from "./plan";
export * from "./task";
diff --git a/frontend/src/utils/link.ts b/frontend/src/utils/link.ts
new file mode 100644
index 0000000000..6d3c5cfd3a
--- /dev/null
+++ b/frontend/src/utils/link.ts
@@ -0,0 +1,20 @@
+export type LinkType =
+ | "UNKNOWN"
+ | "USER"
+ | "TASK"
+ | "ENVIRONMENT"
+ | "INSTANCE"
+ | "DATABASE"
+ | "DATASOURCE"
+ | "BOOKMARK";
+
+export function validLink(link: string): boolean {
+ return link != undefined;
+}
+
+export function linkfy(link: string): string {
+ if (!link.startsWith("/")) {
+ return "/" + link;
+ }
+ return link;
+}