mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
SAML UI: configuration file tooltip info (#67861)
* adds icon and text to the card if enabled in inifile * make use of verbose settings * add state to enabledInIniFile * rename to configFound and removal of default values
This commit is contained in:
parent
b96a2c1b62
commit
9b10664560
@ -63,6 +63,7 @@ export const AuthConfigPageUnconnected = ({ providerStatuses, isLoading, loadSet
|
|||||||
displayName={provider.displayName}
|
displayName={provider.displayName}
|
||||||
authType={provider.type}
|
authType={provider.type}
|
||||||
enabled={providerStatuses[provider.id]?.enabled}
|
enabled={providerStatuses[provider.id]?.enabled}
|
||||||
|
configFoundInIniFile={providerStatuses[provider.id]?.configFoundInIniFile}
|
||||||
configPath={provider.configPath}
|
configPath={provider.configPath}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
@ -88,6 +89,7 @@ export const AuthConfigPageUnconnected = ({ providerStatuses, isLoading, loadSet
|
|||||||
displayName={provider.displayName}
|
displayName={provider.displayName}
|
||||||
authType={provider.protocol}
|
authType={provider.protocol}
|
||||||
enabled={providerStatuses[provider.id]?.enabled}
|
enabled={providerStatuses[provider.id]?.enabled}
|
||||||
|
configFoundInIniFile={providerStatuses[provider.id]?.configFoundInIniFile}
|
||||||
configPath={provider.configPath}
|
configPath={provider.configPath}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
|
@ -2,7 +2,7 @@ import { css } from '@emotion/css';
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { GrafanaTheme2 } from '@grafana/data';
|
import { GrafanaTheme2 } from '@grafana/data';
|
||||||
import { Badge, Card, useStyles2 } from '@grafana/ui';
|
import { Badge, Card, useStyles2, Icon, Tooltip } from '@grafana/ui';
|
||||||
|
|
||||||
import { BASE_PATH } from '../constants';
|
import { BASE_PATH } from '../constants';
|
||||||
|
|
||||||
@ -12,18 +12,41 @@ type Props = {
|
|||||||
providerId: string;
|
providerId: string;
|
||||||
displayName: string;
|
displayName: string;
|
||||||
enabled: boolean;
|
enabled: boolean;
|
||||||
|
configFoundInIniFile?: boolean;
|
||||||
configPath?: string;
|
configPath?: string;
|
||||||
authType?: string;
|
authType?: string;
|
||||||
badges?: JSX.Element[];
|
badges?: JSX.Element[];
|
||||||
};
|
};
|
||||||
|
|
||||||
export function ProviderCard({ providerId, displayName, enabled, configPath, authType, badges }: Props) {
|
export function ProviderCard({
|
||||||
|
providerId,
|
||||||
|
displayName,
|
||||||
|
enabled,
|
||||||
|
configFoundInIniFile,
|
||||||
|
configPath,
|
||||||
|
authType,
|
||||||
|
badges,
|
||||||
|
}: Props) {
|
||||||
const styles = useStyles2(getStyles);
|
const styles = useStyles2(getStyles);
|
||||||
configPath = BASE_PATH + (configPath || providerId);
|
configPath = BASE_PATH + (configPath || providerId);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card href={configPath} className={styles.container}>
|
<Card href={configPath} className={styles.container}>
|
||||||
<Card.Heading className={styles.name}>{displayName}</Card.Heading>
|
<Card.Heading className={styles.name}>{displayName}</Card.Heading>
|
||||||
|
{configFoundInIniFile && (
|
||||||
|
<>
|
||||||
|
<span className={styles.initext}>
|
||||||
|
<Tooltip
|
||||||
|
content={`Note: Settings enabled in the .ini configuration file will overwritten by the current settings.`}
|
||||||
|
>
|
||||||
|
<>
|
||||||
|
<Icon name="adjust-circle" />
|
||||||
|
Configuration found in .ini file
|
||||||
|
</>
|
||||||
|
</Tooltip>
|
||||||
|
</span>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
<div className={styles.footer}>
|
<div className={styles.footer}>
|
||||||
{authType && <Badge text={authType} color="blue" icon="info-circle" />}
|
{authType && <Badge text={authType} color="blue" icon="info-circle" />}
|
||||||
{enabled ? <Badge text="Enabled" color="green" icon="check" /> : <Badge text="Not enabled" color="red" />}
|
{enabled ? <Badge text="Enabled" color="green" icon="check" /> : <Badge text="Not enabled" color="red" />}
|
||||||
@ -57,5 +80,11 @@ export const getStyles = (theme: GrafanaTheme2) => {
|
|||||||
color: ${theme.colors.text.primary};
|
color: ${theme.colors.text.primary};
|
||||||
margin: 0;
|
margin: 0;
|
||||||
`,
|
`,
|
||||||
|
initext: css`
|
||||||
|
font-size: ${theme.typography.bodySmall.fontSize};
|
||||||
|
color: ${theme.colors.text.secondary};
|
||||||
|
padding: ${theme.spacing(1)} 0; // Add some padding
|
||||||
|
max-width: 90%; // Add a max-width to prevent text from stretching too wide
|
||||||
|
`,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -11,6 +11,7 @@ export interface AuthConfigState {
|
|||||||
export interface AuthProviderStatus {
|
export interface AuthProviderStatus {
|
||||||
enabled: boolean;
|
enabled: boolean;
|
||||||
configured: boolean;
|
configured: boolean;
|
||||||
|
configFoundInIniFile?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SettingsError {
|
export interface SettingsError {
|
||||||
|
Loading…
Reference in New Issue
Block a user