import React, { PureComponent } from 'react'; import { dateTimeFormat } from '@grafana/data'; import { Button, Spinner } from '@grafana/ui'; import { SyncInfo } from 'app/types'; interface Props { ldapSyncInfo: SyncInfo; } interface State { isSyncing: boolean; } const format = 'dddd YYYY-MM-DD HH:mm zz'; export class LdapSyncInfo extends PureComponent { state = { isSyncing: false, }; handleSyncClick = () => { this.setState({ isSyncing: !this.state.isSyncing }); }; render() { const { ldapSyncInfo } = this.props; const { isSyncing } = this.state; const nextSyncTime = dateTimeFormat(ldapSyncInfo.nextSync, { format }); return ( <>

LDAP Synchronisation

Active synchronisation {ldapSyncInfo.enabled ? 'Enabled' : 'Disabled'}
Scheduled {ldapSyncInfo.schedule}
Next scheduled synchronisation {nextSyncTime}
); } }