|
@@ -2,6 +2,8 @@ import {
|
|
|
FC, useCallback, useEffect, useState,
|
|
FC, useCallback, useEffect, useState,
|
|
|
} from 'react';
|
|
} from 'react';
|
|
|
|
|
|
|
|
|
|
+import { useTranslation } from 'react-i18next';
|
|
|
|
|
+
|
|
|
import { apiv3Get, apiv3Put } from '~/client/util/apiv3-client';
|
|
import { apiv3Get, apiv3Put } from '~/client/util/apiv3-client';
|
|
|
import { toastError, toastSuccess } from '~/client/util/toastr';
|
|
import { toastError, toastSuccess } from '~/client/util/toastr';
|
|
|
|
|
|
|
@@ -9,6 +11,7 @@ import { LdapGroupSyncSettingsForm } from './LdapGroupSyncSettingsForm';
|
|
|
|
|
|
|
|
export const LdapGroupManagement: FC = () => {
|
|
export const LdapGroupManagement: FC = () => {
|
|
|
const [isUserBind, setIsUserBind] = useState(false);
|
|
const [isUserBind, setIsUserBind] = useState(false);
|
|
|
|
|
+ const { t } = useTranslation('admin');
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
const getIsUserBind = async() => {
|
|
const getIsUserBind = async() => {
|
|
@@ -29,19 +32,19 @@ export const LdapGroupManagement: FC = () => {
|
|
|
const password = e.target.password.value;
|
|
const password = e.target.password.value;
|
|
|
try {
|
|
try {
|
|
|
await apiv3Put('/external-user-groups/ldap/sync', { password });
|
|
await apiv3Put('/external-user-groups/ldap/sync', { password });
|
|
|
- toastSuccess('同期に成功しました');
|
|
|
|
|
|
|
+ toastSuccess(t('external_group.ldap.sync_succeeded'));
|
|
|
}
|
|
}
|
|
|
catch (e) {
|
|
catch (e) {
|
|
|
- toastError('同期に失敗しました。LDAP による認証設定や、グループ同期設定が正しいことを確認してください。');
|
|
|
|
|
|
|
+ toastError(t('external_group.ldap.sync_failed'));
|
|
|
}
|
|
}
|
|
|
- }, []);
|
|
|
|
|
|
|
+ }, [t]);
|
|
|
|
|
|
|
|
return <>
|
|
return <>
|
|
|
<LdapGroupSyncSettingsForm />
|
|
<LdapGroupSyncSettingsForm />
|
|
|
- <h3 className="border-bottom mb-3">同期実行</h3>
|
|
|
|
|
|
|
+ <h3 className="border-bottom mb-3">{t('external_group.execute_sync')}</h3>
|
|
|
<form onSubmit={onSyncBtnClick}>
|
|
<form onSubmit={onSyncBtnClick}>
|
|
|
{isUserBind && <div className="row form-group">
|
|
{isUserBind && <div className="row form-group">
|
|
|
- <label htmlFor="ldapGroupSyncPassword" className="text-left text-md-right col-md-3 col-form-label">パスワード</label>
|
|
|
|
|
|
|
+ <label htmlFor="ldapGroupSyncPassword" className="text-left text-md-right col-md-3 col-form-label">{t('external_group.ldap.password')}</label>
|
|
|
<div className="col-md-6">
|
|
<div className="col-md-6">
|
|
|
<input
|
|
<input
|
|
|
className="form-control"
|
|
className="form-control"
|
|
@@ -50,13 +53,13 @@ export const LdapGroupManagement: FC = () => {
|
|
|
id="ldapGroupSyncPassword"
|
|
id="ldapGroupSyncPassword"
|
|
|
/>
|
|
/>
|
|
|
<p className="form-text text-muted">
|
|
<p className="form-text text-muted">
|
|
|
- <small>認証設定がユーザBind のため、ログイン時のパスワードの入力が必要となります。</small>
|
|
|
|
|
|
|
+ <small>{t('external_group.ldap.password_detail')}</small>
|
|
|
</p>
|
|
</p>
|
|
|
</div>
|
|
</div>
|
|
|
</div>}
|
|
</div>}
|
|
|
<div className="row">
|
|
<div className="row">
|
|
|
<div className="col-md-3"></div>
|
|
<div className="col-md-3"></div>
|
|
|
- <div className="col-md-6"><button className="btn btn-primary" type="submit">同期</button></div>
|
|
|
|
|
|
|
+ <div className="col-md-6"><button className="btn btn-primary" type="submit">{t('external_group.sync')}</button></div>
|
|
|
</div>
|
|
</div>
|
|
|
</form>
|
|
</form>
|
|
|
</>;
|
|
</>;
|