itizawa 6 лет назад
Родитель
Сommit
58720c967f

+ 1 - 0
resource/locales/en-US/translation.json

@@ -540,6 +540,7 @@
       "note for the only env option": "The setting item that enables or disables the SAML authentication and the highlighted setting items use only the value of environment variables.<br>To change this setting, please change to false or delete the value of the environment variable <code>{{env}}</code> ."
     },
     "Basic": {
+      "enable_basic":"enable Basic",
       "name": "Basic Authentication",
       "desc_1": "Login with <code>username</code> in Authorization header.",
       "desc_2": "User will be automatically generated if not exist."

+ 1 - 0
resource/locales/ja/translation.json

@@ -535,6 +535,7 @@
       "note for the only env option": "現在SAML認証のON/OFFの設定値及びハイライトされている設定値は環境変数の値のみを使用するようになっています<br>この設定を変更する場合は環境変数 <code>{{env}}</code> の値をfalseに変更もしくは削除してください"
     },
     "Basic": {
+      "enable_basic":"Basic を有効にする",
       "name": "Basic 認証",
       "desc_1": "Authorization ヘッダに格納されている <code>username</code> でログインします。",
       "desc_2": "ユーザーが存在しなかった場合は自動生成します。"

+ 19 - 1
src/client/js/components/Admin/Security/BasicSecuritySetting.jsx

@@ -11,7 +11,7 @@ import AdminGeneralSecurityContainer from '../../../services/AdminGeneralSecurit
 class BasicSecurityManagement extends React.Component {
 
   render() {
-    const { t } = this.props;
+    const { t, adminGeneralSecurityContainer } = this.props;
 
     return (
       <React.Fragment>
@@ -20,6 +20,24 @@ class BasicSecurityManagement extends React.Component {
           { t('security_setting.Basic.name') } { t('security_setting.configuration') }
         </h2>
 
+        <div className="row mb-5">
+          <strong className="col-xs-3 text-right">{ t('security_setting.Basic.name') }</strong>
+          <div className="col-xs-6 text-left">
+            <div className="checkbox checkbox-success">
+              <input
+                id="isBasicEnabled"
+                type="checkbox"
+                checked={adminGeneralSecurityContainer.state.isBasicEnabled}
+                onChange={() => { adminGeneralSecurityContainer.switchIsBasicEnabled() }}
+              />
+              <label htmlFor="isBasicEnabled">
+                { t('security_setting.Basic.enable_basic') }
+              </label>
+            </div>
+          </div>
+        </div>
+
+
       </React.Fragment>
     );
   }

+ 8 - 0
src/client/js/services/AdminGeneralSecurityContainer.js

@@ -26,6 +26,7 @@ export default class AdminGeneralSecurityContainer extends Container {
       isLdapEnabled: true,
       isSamlEnabled: true,
       isOidcEnabled: true,
+      isBasicEnabled: true,
     };
 
     this.init();
@@ -81,4 +82,11 @@ export default class AdminGeneralSecurityContainer extends Container {
     this.setState({ isOidcEnabled: !this.state.isOidcEnabled });
   }
 
+  /**
+   * Switch Basic enabled
+   */
+  switchIsBasicEnabled() {
+    this.setState({ isBasicEnabled: !this.state.isBasicEnabled });
+  }
+
 }