|
|
@@ -4,15 +4,29 @@ import PropTypes from 'prop-types';
|
|
|
import { withTranslation } from 'react-i18next';
|
|
|
|
|
|
import { withUnstatedContainers } from '../../UnstatedUtils';
|
|
|
+import { toastSuccess, toastError } from '../../../util/apiNotification';
|
|
|
|
|
|
import AppContainer from '../../../services/AppContainer';
|
|
|
import AdminAppContainer from '../../../services/AdminAppContainer';
|
|
|
+import AdminUpdateButtonRow from '../Common/AdminUpdateButtonRow';
|
|
|
|
|
|
|
|
|
function GcsSetting(props) {
|
|
|
const { t, adminAppContainer } = props;
|
|
|
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 (
|
|
|
<>
|
|
|
{gcsUseOnlyEnvVars && (
|
|
|
@@ -97,6 +111,9 @@ function GcsSetting(props) {
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
+
|
|
|
+ <AdminUpdateButtonRow onClick={submitHandler} disabled={adminAppContainer.state.retrieveError != null} />
|
|
|
+
|
|
|
</>
|
|
|
);
|
|
|
|