itizawa 5 лет назад
Родитель
Сommit
531a0c361d
1 измененных файлов с 17 добавлено и 0 удалено
  1. 17 0
      src/client/js/components/Admin/App/GcsSettings.jsx

+ 17 - 0
src/client/js/components/Admin/App/GcsSettings.jsx

@@ -4,15 +4,29 @@ import PropTypes from 'prop-types';
 import { withTranslation } from 'react-i18next';
 import { withTranslation } from 'react-i18next';
 
 
 import { withUnstatedContainers } from '../../UnstatedUtils';
 import { withUnstatedContainers } from '../../UnstatedUtils';
+import { toastSuccess, toastError } from '../../../util/apiNotification';
 
 
 import AppContainer from '../../../services/AppContainer';
 import AppContainer from '../../../services/AppContainer';
 import AdminAppContainer from '../../../services/AdminAppContainer';
 import AdminAppContainer from '../../../services/AdminAppContainer';
+import AdminUpdateButtonRow from '../Common/AdminUpdateButtonRow';
 
 
 
 
 function GcsSetting(props) {
 function GcsSetting(props) {
   const { t, adminAppContainer } = props;
   const { t, adminAppContainer } = props;
   const { gcsUseOnlyEnvVars } = adminAppContainer.state;
   const { gcsUseOnlyEnvVars } = adminAppContainer.state;
 
 
+  async function submitHandler() {
+    const { t } = props;
+
+    try {
+      await adminAppContainer.updateGcpSettingHandler();
+      toastSuccess(t('toaster.update_successed', { target: t('admin:app_setting.file_upload_settings') }));
+    }
+    catch (err) {
+      toastError(err);
+    }
+  }
+
   return (
   return (
     <>
     <>
       {gcsUseOnlyEnvVars && (
       {gcsUseOnlyEnvVars && (
@@ -97,6 +111,9 @@ function GcsSetting(props) {
           </tr>
           </tr>
         </tbody>
         </tbody>
       </table>
       </table>
+
+      <AdminUpdateButtonRow onClick={submitHandler} disabled={adminAppContainer.state.retrieveError != null} />
+
     </>
     </>
   );
   );