feat(nebula): add NebulaGraph 3.x browser support
This commit is contained in:
1 parent
e59a8c1bd4
commit
ef05a6a19b
69 files changed
+1737
-41
No files matched your search
@@ -151,7 +151,7 @@ import { resolveVisibleDatabaseSaveAction } from "@/components/sidebar/visibleDa
|
||||
import { canSaveVisibleDatabaseSelection, connectionUsesVisibleSchemaFilter, filterDatabaseNamesForVisiblePicker, filterSchemaNamesForVisiblePicker, buildDraftVisibleSchemasConnectionId, normalizeVisibleSchemaSelection } from "@/lib/database/visibleDatabases";
|
||||
import { isSchemaAware, isSingleDatabase, supportsDataDictionary } from "@/lib/database/databaseFeatureSupport";
|
||||
import { normalizeConnectionScope, normalizeConnectionTimeouts } from "@/lib/connection/connectionSubmitNormalization";
|
||||
import { databaseConnectionFormKind } from "@/lib/database/databaseDriverManifest";
|
||||
import { databaseConnectionFormKind, databaseManifestEntry } from "@/lib/database/databaseDriverManifest";
|
||||
import VisibleSchemasDialog from "@/components/sidebar/VisibleSchemasDialog.vue";
|
||||
import CloudflareD1ConnectionFields from "@/components/connection/CloudflareD1ConnectionFields.vue";
|
||||
import SpannerConnectionFields from "@/components/connection/SpannerConnectionFields.vue";
|
||||
@@ -1184,6 +1184,8 @@ const driverProfiles: Record<string, ConnectionProfileDefinition> = {
|
||||
...CONNECTION_PROFILES,
|
||||
...jdbcProductDriverProfiles(),
|
||||
};
|
||||
const nebulaDriverProfiles = databaseManifestEntry("nebula")?.driverProfiles ?? [];
|
||||
const nebulaDefaultDriverProfile = nebulaDriverProfiles[0]?.profile ?? "nebula";
|
||||
|
||||
function profileForConfig(config: ConnectionConfig) {
|
||||
if (config.db_type === "plugin" && config.plugin_id && config.plugin_connection_provider) {
|
||||
@@ -2804,7 +2806,7 @@ function applyProfile(val: string, preserveConnectionFields = false) {
|
||||
const previousDatabaseType = form.value.db_type;
|
||||
selectedType.value = val;
|
||||
form.value.db_type = profile.type;
|
||||
form.value.driver_profile = val;
|
||||
form.value.driver_profile = val === "nebula" ? nebulaDefaultDriverProfile : val;
|
||||
form.value.driver_label = isCustomCompatibleProfile() ? customDriverName.value.trim() || profile.label : profile.label;
|
||||
const preserveMeilisearchConfig = preserveConnectionFields && previousDatabaseType === "meilisearch" && profile.type === "meilisearch";
|
||||
if (profile.type !== "sqlserver" && !preserveMeilisearchConfig) {
|
||||
@@ -3434,6 +3436,12 @@ function switchEtcdApiVersion(profile: "etcd" | "etcd-v2") {
|
||||
resetTestState();
|
||||
}
|
||||
|
||||
function switchNebulaDriverProfile(profile: unknown) {
|
||||
if (typeof profile !== "string" || !nebulaDriverProfiles.some((entry) => entry.profile === profile)) return;
|
||||
form.value.driver_profile = profile;
|
||||
resetTestState();
|
||||
}
|
||||
|
||||
function switchH2DriverProfile(profile: "h2" | "h2-v1" | "h2-v2" | "h2-v3" | "h2-custom") {
|
||||
form.value.driver_profile = profile;
|
||||
if (profile === "h2-custom") {
|
||||
@@ -3650,11 +3658,12 @@ const tlsCapableDatabaseTypes = new Set<DatabaseType>([
|
||||
"influxdb",
|
||||
"victoriametrics",
|
||||
"cassandra",
|
||||
"nebula",
|
||||
"zookeeper",
|
||||
]);
|
||||
const supportsTlsToggle = computed(() => tlsCapableDatabaseTypes.has(form.value.db_type) || supportsMysqlTlsTab(form.value.db_type, selectedType.value));
|
||||
const supportsCaCertificatePath = computed(() => form.value.db_type === "clickhouse" || form.value.db_type === "victoriametrics");
|
||||
const supportsGenericUrlParams = computed(() => form.value.db_type !== "manticoresearch" && form.value.db_type !== "hbase");
|
||||
const supportsGenericUrlParams = computed(() => form.value.db_type !== "manticoresearch" && form.value.db_type !== "hbase" && form.value.db_type !== "nebula");
|
||||
const showGenericUrlParamsHint = computed(() => form.value.db_type === "mysql" || form.value.db_type === "doris" || form.value.db_type === "starrocks");
|
||||
const bareMysqlProfiles = new Set(["doris", "selectdb", "oceanbase"]);
|
||||
const supportsMysqlTlsOptions = computed(() => mysqlTlsOptionsSupported(form.value.db_type, selectedType.value));
|
||||
@@ -4628,6 +4637,9 @@ function connectionConfigForSubmit(id: string, generatedName = "", validatePlugi
|
||||
} else {
|
||||
config = { ...formValueForSubmit(), id } as LegacyConnectionConfig;
|
||||
}
|
||||
if (config.db_type === "nebula" && (!config.driver_profile || config.driver_profile === "nebula")) {
|
||||
config.driver_profile = nebulaDefaultDriverProfile;
|
||||
}
|
||||
config.database_info = undefined;
|
||||
config.database = normalizeStoredConnectionDatabase(config.db_type, config.database);
|
||||
config.note = config.note?.trim() || undefined;
|
||||
@@ -7031,6 +7043,20 @@ function openExternalUrl(url: string) {
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div v-if="form.db_type === 'nebula'" class="grid grid-cols-4 items-center gap-4">
|
||||
<Label :class="connectionLabelClass">{{ t("connection.version") }}</Label>
|
||||
<div class="col-span-3">
|
||||
<Select :model-value="form.driver_profile === 'nebula' ? nebulaDefaultDriverProfile : form.driver_profile" @update:model-value="switchNebulaDriverProfile">
|
||||
<SelectTrigger class="w-full">
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem v-for="profile in nebulaDriverProfiles" :key="profile.profile" :value="profile.profile">{{ profile.label }}</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- OceanBase mode toggle -->
|
||||
<div v-if="selectedType === 'oceanbase'" class="grid grid-cols-4 items-center gap-4">
|
||||
<Label :class="connectionLabelSmallClass">{{ t("connection.mode") }}</Label>
|
||||
@@ -9322,7 +9348,7 @@ function openExternalUrl(url: string) {
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<template v-if="form.db_type === 'etcd' || form.db_type === 'consul' || form.db_type === 'zookeeper' || form.db_type === 'elasticsearch' || form.db_type === 'easysearch'">
|
||||
<template v-if="form.db_type === 'etcd' || form.db_type === 'consul' || form.db_type === 'zookeeper' || form.db_type === 'elasticsearch' || form.db_type === 'easysearch' || form.db_type === 'nebula'">
|
||||
<div class="grid grid-cols-4 items-start gap-4">
|
||||
<Label :class="connectionLabelSmallPaddedClass">
|
||||
<span class="inline-flex items-center justify-end gap-1">
|
||||
@@ -9375,7 +9401,7 @@ function openExternalUrl(url: string) {
|
||||
<TooltipContent>{{ t("connection.etcdClientKeyBrowse") }}</TooltipContent>
|
||||
</Tooltip>
|
||||
</div>
|
||||
<p class="text-[11px] leading-4 text-muted-foreground">
|
||||
<p v-if="form.db_type !== 'nebula'" class="text-[11px] leading-4 text-muted-foreground">
|
||||
{{ t("connection.etcdClientCertHint") }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user