diff --git a/public/app/plugins/datasource/mssql/configuration/ConfigurationEditor.tsx b/public/app/plugins/datasource/mssql/configuration/ConfigurationEditor.tsx
index ed6e03b806d..22a56cc03eb 100644
--- a/public/app/plugins/datasource/mssql/configuration/ConfigurationEditor.tsx
+++ b/public/app/plugins/datasource/mssql/configuration/ConfigurationEditor.tsx
@@ -10,18 +10,19 @@ import {
updateDatasourcePluginJsonDataOption,
updateDatasourcePluginResetOption,
} from '@grafana/data';
+import { ConfigSection, ConfigSubSection, DataSourceDescription } from '@grafana/experimental';
import {
Alert,
FieldSet,
- InlineField,
- InlineFieldRow,
- InlineSwitch,
Input,
Link,
SecretInput,
Select,
useStyles2,
SecureSocksProxySettings,
+ Divider,
+ Field,
+ Switch,
} from '@grafana/ui';
import { NumberInput } from 'app/core/components/OptionsUI/NumberInput';
import { config } from 'app/core/config';
@@ -29,14 +30,18 @@ import { ConnectionLimits } from 'app/features/plugins/sql/components/configurat
import { useMigrateDatabaseFields } from 'app/features/plugins/sql/components/configuration/useMigrateDatabaseFields';
import { AzureAuthSettings } from '../azureauth/AzureAuthSettings';
-import { MSSQLAuthenticationType, MSSQLEncryptOptions, MssqlOptions, AzureAuthConfigType } from '../types';
+import {
+ MSSQLAuthenticationType,
+ MSSQLEncryptOptions,
+ MssqlOptions,
+ AzureAuthConfigType,
+ MssqlSecureOptions,
+} from '../types';
const SHORT_WIDTH = 15;
-const LONG_WIDTH = 46;
-const LABEL_WIDTH_SSL = 25;
-const LABEL_WIDTH_DETAILS = 20;
+const LONG_WIDTH = 40;
-export const ConfigurationEditor = (props: DataSourcePluginOptionsEditorProps) => {
+export const ConfigurationEditor = (props: DataSourcePluginOptionsEditorProps) => {
useMigrateDatabaseFields(props);
const { options: dsSettings, onOptionsChange } = props;
@@ -107,8 +112,25 @@ export const ConfigurationEditor = (props: DataSourcePluginOptionsEditorProps
-
+ />
+
+
- {config.secureSocksDSProxyEnabled && (
-
- )}
-
-
+
- {azureAuthIsSupported && jsonData.authenticationType === MSSQLAuthenticationType.azureAuth && (
-
- )}
-
-
-
-
+
+
-
- The database user should only be granted SELECT permissions on the specified database and tables you want to
- query. Grafana does not validate that queries are safe so queries can contain any SQL statement. For example,
- statements like USE otherdb; and DROP TABLE user; would be executed. To protect
- against this we highly recommend you create a specific MS SQL user with restricted permissions. Check
- out the{' '}
-
- Microsoft SQL Server Data Source Docs
- {' '}
- for more information.
-
+ {/* Basic SQL auth. Render if authType === MSSQLAuthenticationType.sqlAuth OR
+ if no authType exists, which will be the case when creating a new data source */}
+ {(jsonData.authenticationType === MSSQLAuthenticationType.sqlAuth || !jsonData.authenticationType) && (
+ <>
+
+
+
+
+
+
+ >
+ )}
+
+ {azureAuthIsSupported && jsonData.authenticationType === MSSQLAuthenticationType.azureAuth && (
+
+ )}
+
+
+
+
+
+
+
+
+ A lower limit for the auto group by time interval. Recommended to be set to write frequency, for example
+ 1m if your data is written every minute.
+
+ }
+ label="Min time interval"
+ >
+
+
+
+ The number of seconds to wait before canceling the request when connecting to the database. The default
+ is 0, meaning no timeout.
+
+ }
+ label="Connection timeout"
+ >
+
+
+
+ {config.secureSocksDSProxyEnabled && (
+
+ )}
+
>
);
};
diff --git a/public/app/plugins/datasource/mssql/types.ts b/public/app/plugins/datasource/mssql/types.ts
index 393224663bb..d950e4bef09 100644
--- a/public/app/plugins/datasource/mssql/types.ts
+++ b/public/app/plugins/datasource/mssql/types.ts
@@ -43,6 +43,10 @@ export interface MssqlOptions extends SQLOptions {
azureCredentials?: AzureCredentialsType;
}
+export interface MssqlSecureOptions {
+ password?: string;
+}
+
export type AzureAuthJSONDataType = DataSourceJsonData & {
azureCredentials: AzureCredentialsType;
};