mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-11-14 06:25:35 +08:00
refactor: add api Flush fake-ip
This commit is contained in:
parent
fd1153709e
commit
3cabaf7a3e
@ -45,6 +45,15 @@ export const upgradeBackendAPI = async () => {
|
|||||||
setUpgradingBackend(false)
|
setUpgradingBackend(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const flushFakeIP = async () => {
|
||||||
|
const request = useRequest()
|
||||||
|
setUpgradingBackend(true)
|
||||||
|
try {
|
||||||
|
await request.post('cache/fakeip/flush')
|
||||||
|
} catch {}
|
||||||
|
setUpgradingBackend(false)
|
||||||
|
}
|
||||||
|
|
||||||
export const restartBackendAPI = async () => {
|
export const restartBackendAPI = async () => {
|
||||||
const request = useRequest()
|
const request = useRequest()
|
||||||
setRestartingBackend(true)
|
setRestartingBackend(true)
|
||||||
|
@ -50,6 +50,7 @@ export default {
|
|||||||
renderInTwoColumns: 'Render in two columns',
|
renderInTwoColumns: 'Render in two columns',
|
||||||
updateGEODatabases: 'Update GEO Databases',
|
updateGEODatabases: 'Update GEO Databases',
|
||||||
restartCore: 'Restart Core',
|
restartCore: 'Restart Core',
|
||||||
|
flushFakeIP: 'Flush fake-ip',
|
||||||
upgradeCore: 'Upgrade Core',
|
upgradeCore: 'Upgrade Core',
|
||||||
proxiesSorting: 'Proxies Sorting',
|
proxiesSorting: 'Proxies Sorting',
|
||||||
orderNatural: 'Original order in config file',
|
orderNatural: 'Original order in config file',
|
||||||
|
@ -50,6 +50,7 @@ export default {
|
|||||||
renderInTwoColumns: '双列渲染',
|
renderInTwoColumns: '双列渲染',
|
||||||
updateGEODatabases: '更新 GEO 数据库文件',
|
updateGEODatabases: '更新 GEO 数据库文件',
|
||||||
restartCore: '重启核心',
|
restartCore: '重启核心',
|
||||||
|
flushFakeIP: '清空 FakeIP',
|
||||||
upgradeCore: '更新核心',
|
upgradeCore: '更新核心',
|
||||||
proxiesSorting: '节点排序',
|
proxiesSorting: '节点排序',
|
||||||
orderNatural: '原配置文件中的排序',
|
orderNatural: '原配置文件中的排序',
|
||||||
|
@ -15,6 +15,7 @@ import {
|
|||||||
fetchBackendConfigAPI,
|
fetchBackendConfigAPI,
|
||||||
fetchBackendVersionAPI,
|
fetchBackendVersionAPI,
|
||||||
restartBackendAPI,
|
restartBackendAPI,
|
||||||
|
flushFakeIP,
|
||||||
restartingBackend,
|
restartingBackend,
|
||||||
updateBackendConfigAPI,
|
updateBackendConfigAPI,
|
||||||
updateGEODatabasesAPI,
|
updateGEODatabasesAPI,
|
||||||
@ -217,6 +218,10 @@ const ConfigForm = () => {
|
|||||||
{t('upgradeCore')}
|
{t('upgradeCore')}
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
|
<Button loading={upgradingBackend()} onClick={flushFakeIP}>
|
||||||
|
{t('flushFakeIP')}
|
||||||
|
</Button>
|
||||||
|
|
||||||
<Button loading={restartingBackend()} onClick={restartBackendAPI}>
|
<Button loading={restartingBackend()} onClick={restartBackendAPI}>
|
||||||
{t('restartCore')}
|
{t('restartCore')}
|
||||||
</Button>
|
</Button>
|
||||||
|
Loading…
Reference in New Issue
Block a user