diff options
| author | Larvan2 <[email protected]> | 2023-03-25 22:25:37 +0800 |
|---|---|---|
| committer | Larvan2 <[email protected]> | 2023-03-25 22:25:37 +0800 |
| commit | a12ed559b0779587f29fc183ac9afd45303c0462 (patch) | |
| tree | 0b366839bec4d3bc893a7f3c6381491577129236 /src/components | |
| parent | c7cbac93c823e03ae02f8bee72b4c363160604b2 (diff) | |
feat: add upgrade und restart API
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/Config.tsx | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/components/Config.tsx b/src/components/Config.tsx index 84be48e..f2b4b8c 100644 --- a/src/components/Config.tsx +++ b/src/components/Config.tsx @@ -15,8 +15,10 @@ import { flushFakeIPPool, getConfigs, reloadConfigFile, + restartCore, updateConfigs, updateGeoDatabasesFile, + upgradeCore, } from '../store/configs'; import { openModal } from '../store/modals'; import Button from './Button'; @@ -206,6 +208,14 @@ function ConfigImpl({ dispatch(reloadConfigFile(apiConfig)); }, [apiConfig, dispatch]); + const handleRestartCore = useCallback(() => { + dispatch(restartCore(apiConfig)); + }, [apiConfig, dispatch]); + + const handleUpgradeCore = useCallback(() => { + dispatch(upgradeCore(apiConfig)); + }, [apiConfig, dispatch]); + const handleUpdateGeoDatabasesFile = useCallback(() => { dispatch(updateGeoDatabasesFile(apiConfig)); }, [apiConfig, dispatch]); @@ -336,6 +346,22 @@ function ConfigImpl({ /> </div> <div> + <div className={s0.label}>Restart</div> + <Button + start={<RotateCw size={16} />} + label={t('restart_core')} + onClick={handleRestartCore} + /> + </div> + <div> + <div className={s0.label}>Upgrade</div> + <Button + start={<RotateCw size={16} />} + label={t('upgrade_core')} + onClick={handleUpgradeCore} + /> + </div> + <div> <div className={s0.label}>GEO Databases</div> <Button start={<DownloadCloud size={16} />} |
