import React, { useCallback } from 'react'; import { useTranslation } from 'react-i18next'; import { toastSuccess, toastError } from '~/client/util/apiNotification'; import { apiv3Post } from '~/client/util/apiv3-client'; import AdminInstallButtonRow from '../Common/AdminUpdateButtonRow'; // TODO: error notification (toast, loggerFactory) // TODO: i18n export const PluginInstallerForm = (): JSX.Element => { // const { t } = useTranslation('admin'); const submitHandler = useCallback(async(e) => { e.preventDefault(); const formData = e.target.elements; const { 'pluginInstallerForm[url]': { value: url }, // 'pluginInstallerForm[ghBranch]': { value: ghBranch }, // 'pluginInstallerForm[ghTag]': { value: ghTag }, } = formData; const pluginInstallerForm = { url, // ghBranch, // ghTag, }; try { await apiv3Post('/plugins-extension', { pluginInstallerForm }); toastSuccess('Plugin Install Successed!'); } catch (err) { toastError(err); // logger.error(err); } }, []); return (

You can install plugins by inputting the GitHub URL.

{/*

{t('admin:app_setting.sitename_change')}

*/}
{/*

branch name

tag name

*/}
); };