diff --git a/public/app/plugins/datasource/azuremonitor/components/AzureCredentialsForm.tsx b/public/app/plugins/datasource/azuremonitor/components/AzureCredentialsForm.tsx index 434e4bbaf20..66240426676 100644 --- a/public/app/plugins/datasource/azuremonitor/components/AzureCredentialsForm.tsx +++ b/public/app/plugins/datasource/azuremonitor/components/AzureCredentialsForm.tsx @@ -1,13 +1,12 @@ import React, { ChangeEvent } from 'react'; import { SelectableValue } from '@grafana/data'; -import { LegacyForms, Button, Select, InlineField } from '@grafana/ui'; +import { ConfigSection } from '@grafana/experimental'; +import { Button, Select, Field, Input } from '@grafana/ui'; import { selectors } from '../e2e/selectors'; import { AzureAuthType, AzureCredentials } from '../types'; -const { Input } = LegacyForms; - export interface Props { managedIdentityEnabled: boolean; credentials: AzureCredentials; @@ -28,8 +27,6 @@ const authTypeOptions: Array> = [ }, ]; -const LABEL_WIDTH = 18; - export const AzureCredentialsForm = (props: Props) => { const { credentials, azureCloudOptions, onCredentialsChange, disabled, managedIdentityEnabled } = props; @@ -94,12 +91,11 @@ export const AzureCredentialsForm = (props: Props) => { }; return ( -
+ {managedIdentityEnabled && ( - @@ -110,15 +106,13 @@ export const AzureCredentialsForm = (props: Props) => { onChange={onAuthTypeChange} disabled={disabled} /> - + )} {credentials.authType === 'clientsecret' && ( <> {azureCloudOptions && ( - { options={azureCloudOptions} onChange={onAzureCloudChange} /> - + )} - -
- -
-
- + + -
- -
-
+ + {!disabled && (typeof credentials.clientSecret === 'symbol' ? ( - +
{ Reset
-
+ ) : ( - { id="client-secret" disabled={disabled} /> - + ))} )} {props.children} -
+ ); }; diff --git a/public/app/plugins/datasource/azuremonitor/components/ConfigEditor.tsx b/public/app/plugins/datasource/azuremonitor/components/ConfigEditor.tsx index 8dc4ffd5052..ee9bec6cb03 100644 --- a/public/app/plugins/datasource/azuremonitor/components/ConfigEditor.tsx +++ b/public/app/plugins/datasource/azuremonitor/components/ConfigEditor.tsx @@ -1,8 +1,9 @@ import React, { PureComponent } from 'react'; import { DataSourcePluginOptionsEditorProps, SelectableValue, updateDatasourcePluginOption } from '@grafana/data'; +import { ConfigSection, DataSourceDescription } from '@grafana/experimental'; import { getBackendSrv, getTemplateSrv, isFetchError, TemplateSrv } from '@grafana/runtime'; -import { Alert, SecureSocksProxySettings } from '@grafana/ui'; +import { Alert, Divider, SecureSocksProxySettings } from '@grafana/ui'; import { config } from 'app/core/config'; import ResponseParser from '../azure_monitor/response_parser'; @@ -96,6 +97,12 @@ export class ConfigEditor extends PureComponent { return ( <> + + {error && ( @@ -104,7 +111,17 @@ export class ConfigEditor extends PureComponent { )} {config.secureSocksDSProxyEnabled && ( - + <> + + + + + )} ); diff --git a/public/app/plugins/datasource/azuremonitor/components/DefaultSubscription.tsx b/public/app/plugins/datasource/azuremonitor/components/DefaultSubscription.tsx index f354bae4e7f..939852ca876 100644 --- a/public/app/plugins/datasource/azuremonitor/components/DefaultSubscription.tsx +++ b/public/app/plugins/datasource/azuremonitor/components/DefaultSubscription.tsx @@ -1,14 +1,12 @@ import React, { useEffect, useReducer } from 'react'; import { SelectableValue } from '@grafana/data'; -import { InlineField, Select, Button } from '@grafana/ui'; +import { Select, Button, Field } from '@grafana/ui'; import { isCredentialsComplete } from '../credentials'; import { selectors } from '../e2e/selectors'; import { AzureCredentials, AzureDataSourceJsonData } from '../types'; -const LABEL_WIDTH = 18; - export interface Props { options: AzureDataSourceJsonData; credentials: AzureCredentials; @@ -70,9 +68,8 @@ export const DefaultSubscription = (props: Props) => { return ( <> - @@ -97,7 +94,7 @@ export const DefaultSubscription = (props: Props) => { Load Subscriptions - + ); }; diff --git a/public/app/plugins/datasource/azuremonitor/components/MonitorConfig.tsx b/public/app/plugins/datasource/azuremonitor/components/MonitorConfig.tsx index 4be1881085f..affa617f708 100644 --- a/public/app/plugins/datasource/azuremonitor/components/MonitorConfig.tsx +++ b/public/app/plugins/datasource/azuremonitor/components/MonitorConfig.tsx @@ -43,7 +43,6 @@ export const MonitorConfig = (props: Props) => { return ( <> -

Authentication