diff --git a/src/CodingWithCalvin.CouchbaseExplorer/Dialogs/ConnectionDialog.xaml b/src/CodingWithCalvin.CouchbaseExplorer/Dialogs/ConnectionDialog.xaml index 3578218..cad3558 100644 --- a/src/CodingWithCalvin.CouchbaseExplorer/Dialogs/ConnectionDialog.xaml +++ b/src/CodingWithCalvin.CouchbaseExplorer/Dialogs/ConnectionDialog.xaml @@ -326,8 +326,17 @@ - + + + + diff --git a/src/CodingWithCalvin.CouchbaseExplorer/ViewModels/ConnectionDialogViewModel.cs b/src/CodingWithCalvin.CouchbaseExplorer/ViewModels/ConnectionDialogViewModel.cs index 56cace7..54d3dde 100644 --- a/src/CodingWithCalvin.CouchbaseExplorer/ViewModels/ConnectionDialogViewModel.cs +++ b/src/CodingWithCalvin.CouchbaseExplorer/ViewModels/ConnectionDialogViewModel.cs @@ -240,13 +240,6 @@ public ConnectionDialogViewModel(HashSet existingConnectionNames = null, _useSsl = existingConnection.UseSsl; _password = CredentialManagerService.GetPassword(existingConnection.Id); - - // Detect if it's Capella based on URL - if (!string.IsNullOrEmpty(_host) && _host.Contains(".cloud.couchbase.com")) - { - _isCouchbaseCapella = true; - _isCouchbaseServer = false; - } } TestConnectionCommand = new RelayCommand(async _ => await TestConnectionAsync(), CanTestConnection); @@ -254,12 +247,21 @@ public ConnectionDialogViewModel(HashSet existingConnectionNames = null, CancelCommand = new RelayCommand(_ => Cancel()); } - private void DetectCapellaUrl() + private bool IsCapellaUrl(string host) { - if (!string.IsNullOrEmpty(Host) && Host.Contains(".cloud.couchbase.com")) + if (string.IsNullOrEmpty(host)) { - IsCouchbaseCapella = true; + return false; } + + return host.Contains(".cloud.couchbase.com") || + host.StartsWith("couchbases://", StringComparison.OrdinalIgnoreCase); + } + + private void DetectCapellaUrl() + { + // Re-validate host when URL changes to show Capella error if needed + ValidateHost(); } private void ValidateConnectionName() @@ -285,6 +287,10 @@ private void ValidateHost() { HostError = "Host is required"; } + else if (IsCapellaUrl(Host)) + { + HostError = "Couchbase Capella connections are not supported yet"; + } else { HostError = null;