diff --git a/pkg/plugin/driver.go b/pkg/plugin/driver.go index 300e786..1a15919 100644 --- a/pkg/plugin/driver.go +++ b/pkg/plugin/driver.go @@ -118,6 +118,7 @@ func GenerateConnectionString(settings Settings, version string) (string, error) } if settings.TlsMode != "disable" && + settings.TlsMode != "prefer" && settings.TlsMode != "require" && settings.TlsMode != "verify-ca" && settings.TlsMode != "verify-full" { diff --git a/pkg/plugin/driver_test.go b/pkg/plugin/driver_test.go index 7cd711b..0b67017 100644 --- a/pkg/plugin/driver_test.go +++ b/pkg/plugin/driver_test.go @@ -118,7 +118,7 @@ func TestConnect(t *testing.T) { var tlsModes []string if tlsEnabled == "true" { - tlsModes = []string{"require", "verify-ca", "verify-full"} + tlsModes = []string{"prefer", "require", "verify-ca", "verify-full"} } else { tlsModes = []string{"disable"} } diff --git a/src/selectors.ts b/src/selectors.ts index e9ea07f..1848562 100644 --- a/src/selectors.ts +++ b/src/selectors.ts @@ -13,12 +13,12 @@ export const Components = { }, Username: { label: 'Username', - placeholder: 'Username', + placeholder: 'admin', tooltip: 'QuestDB username', }, Password: { label: 'Password', - placeholder: 'Password', + placeholder: 'quest', tooltip: 'QuestDB password', }, TLSCACert: { diff --git a/src/types.ts b/src/types.ts index dd72294..9d15417 100644 --- a/src/types.ts +++ b/src/types.ts @@ -4,6 +4,7 @@ export const defaultQuery: Partial = {}; export enum PostgresTLSModes { disable = 'disable', + prefer = 'prefer', require = 'require', verifyCA = 'verify-ca', verifyFull = 'verify-full', diff --git a/src/views/QuestDBConfigEditor.tsx b/src/views/QuestDBConfigEditor.tsx index ed39371..ef011b7 100644 --- a/src/views/QuestDBConfigEditor.tsx +++ b/src/views/QuestDBConfigEditor.tsx @@ -100,6 +100,7 @@ export const ConfigEditor: React.FC = (props) => { const tlsModes: Array> = [ { value: PostgresTLSModes.disable, label: 'disable' }, + { value: PostgresTLSModes.prefer, label: 'prefer' }, { value: PostgresTLSModes.require, label: 'require' }, { value: PostgresTLSModes.verifyCA, label: 'verify-ca' }, { value: PostgresTLSModes.verifyFull, label: 'verify-full' }, @@ -127,7 +128,8 @@ export const ConfigEditor: React.FC = (props) => { = (props) => { onPortChange(e.currentTarget.value)} label={Components.ConfigEditor.ServerPort.label} aria-label={Components.ConfigEditor.ServerPort.label} @@ -161,7 +164,8 @@ export const ConfigEditor: React.FC = (props) => { = (props) => { label={Components.ConfigEditor.Password.label} aria-label={Components.ConfigEditor.Password.label} placeholder={Components.ConfigEditor.Password.placeholder} - value={secureJsonData.password || ''} + value={secureJsonData.password} + defaultValue={Components.ConfigEditor.Password.placeholder} isConfigured={(secureJsonFields && secureJsonFields.password) as boolean} onReset={onResetPassword} onChange={onUpdateDatasourceSecureJsonDataOption(props, 'password')} @@ -286,7 +291,7 @@ export const ConfigEditor: React.FC = (props) => { width={40} className="gf-form" options={tlsModes} - value={jsonData.tlsMode || PostgresTLSModes.verifyFull} + value={jsonData.tlsMode || PostgresTLSModes.prefer} onChange={(e) => onTlsModeChange(e.value)} placeholder={Components.ConfigEditor.TlsMode.placeholder} />