Skip to content

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

chore: fix instance url (#10433)

boojack039f134ab942
diff --git a/frontend/src/components/AnomalyCenter/AnomalyCenterDashboard.vue b/frontend/src/components/AnomalyCenter/AnomalyCenterDashboard.vue
index 0cb803dbf7..5ed30b1556 100644
--- a/frontend/src/components/AnomalyCenter/AnomalyCenterDashboard.vue
+++ b/frontend/src/components/AnomalyCenter/AnomalyCenterDashboard.vue
@@ -138,12 +138,7 @@ import {
Anomaly,
Anomaly_AnomalySeverity,
} from "@/types/proto/v1/anomaly_service";
-import {
- databaseV1Url,
- instanceV1Slug,
- sortDatabaseV1List,
- sortInstanceV1List,
-} from "@/utils";
+import { databaseV1Url, sortDatabaseV1List, sortInstanceV1List } from "@/utils";
import AnomalyTable from "./AnomalyTable.vue";
type Summary = {
@@ -276,7 +271,7 @@ const instanceAnomalySectionList = computed(
if (anomalyListOfInstance.length > 0) {
sectionList.push({
title: `${instance.title} (${instance.environmentEntity.title})`,
- link: `/instance/${instanceV1Slug(instance)}`,
+ link: `/${instance.name}`,
list: anomalyListOfInstance,
});
}
diff --git a/frontend/src/components/InstanceAssignment.vue b/frontend/src/components/InstanceAssignment.vue
index 0a9d8646f5..7fa984d796 100644
--- a/frontend/src/components/InstanceAssignment.vue
+++ b/frontend/src/components/InstanceAssignment.vue
@@ -73,7 +73,7 @@
<div class="flex items-center gap-x-1">
<InstanceV1EngineIcon :instance="instance" />
<router-link
- :to="`/instance/${instanceV1Slug(instance)}`"
+ :to="`/${instance.name}`"
class="hover:underline"
active-class="link"
exact-active-class="link"
@@ -141,7 +141,6 @@ import {
} from "@/store";
import { ComposedInstance } from "@/types";
import {
- instanceV1Slug,
instanceV1Name,
hostPortOfInstanceV1,
hasWorkspacePermissionV2,
diff --git a/frontend/src/components/InstanceForm/InstanceForm.vue b/frontend/src/components/InstanceForm/InstanceForm.vue
index d880d78b38..23ec6188c8 100644
--- a/frontend/src/components/InstanceForm/InstanceForm.vue
+++ b/frontend/src/components/InstanceForm/InstanceForm.vue
@@ -381,7 +381,6 @@ import {
isDev,
isValidSpannerHost,
extractInstanceResourceName,
- instanceV1Slug,
calcUpdateMask,
onlyAllowNumber,
hasWorkspacePermissionV2,
@@ -772,7 +771,7 @@ const doCreate = async () => {
const createdInstance = await instanceV1Store.createInstance(
instanceCreate
);
- router.push(`/instance/${instanceV1Slug(createdInstance)}`);
+ router.push(`/${createdInstance.name}`);
pushNotification({
module: "bytebase",
style: "SUCCESS",
diff --git a/frontend/src/components/v2/Model/Instance/InstanceName.vue b/frontend/src/components/v2/Model/Instance/InstanceName.vue
index aa390b563b..52c01450e7 100644
--- a/frontend/src/components/v2/Model/Instance/InstanceName.vue
+++ b/frontend/src/components/v2/Model/Instance/InstanceName.vue
@@ -2,7 +2,7 @@
<component
:is="link ? 'router-link' : tag"
v-bind="bindings"
- :to="link && `/instance/${instance.id}`"
+ :to="link && `/${instance.name}`"
class="inline-flex items-center gap-x-1"
:class="link && 'normal-link'"
>
diff --git a/frontend/src/components/v2/Model/Instance/InstanceV1Name.vue b/frontend/src/components/v2/Model/Instance/InstanceV1Name.vue
index 1b59092472..787795ce2b 100644
--- a/frontend/src/components/v2/Model/Instance/InstanceV1Name.vue
+++ b/frontend/src/components/v2/Model/Instance/InstanceV1Name.vue
@@ -27,7 +27,7 @@
import { NEllipsis } from "naive-ui";
import { computed } from "vue";
import { Instance } from "@/types/proto/v1/instance_service";
-import { instanceV1Name, instanceV1Slug } from "@/utils";
+import { instanceV1Name } from "@/utils";
import InstanceV1EngineIcon from "./InstanceV1EngineIcon.vue";
const props = withDefaults(
@@ -55,7 +55,7 @@ const props = withDefaults(
const bindings = computed(() => {
if (props.link) {
return {
- to: `/instance/${instanceV1Slug(props.instance)}`,
+ to: `/${props.instance.name}`,
activeClass: "",
exactActiveClass: "",
onClick: (e: MouseEvent) => {