Add an option that allows binding port 443

Kinda everts some changes of
"Implement MongoDB autostart and GC watching".
This commit makes launching MongoDB async
This commit is contained in:
fnrir
2023-08-18 13:57:50 +02:00
parent 2c07cf90bd
commit 62b54f33df
10 changed files with 256 additions and 11 deletions

View File

@@ -4,7 +4,7 @@ import React from 'react'
import TopBar from './components/TopBar'
import ServerLaunchSection from './components/ServerLaunchSection'
import MainProgressBar from './components/common/MainProgressBar'
import Options from './components/menu/Options'
import Options, { GrasscutterElevation } from './components/menu/Options'
import MiniDialog from './components/MiniDialog'
import DownloadList from './components/common/DownloadList'
import Downloads from './components/menu/Downloads'
@@ -15,7 +15,7 @@ import { ExtrasMenu } from './components/menu/ExtrasMenu'
import Notification from './components/common/Notification'
import GamePathNotify from './components/menu/GamePathNotify'
import { getConfigOption, setConfigOption } from '../utils/configuration'
import { getConfig, getConfigOption, setConfigOption } from '../utils/configuration'
import { invoke } from '@tauri-apps/api'
import { getVersion } from '@tauri-apps/api/app'
import { listen } from '@tauri-apps/api/event'
@@ -102,10 +102,28 @@ export class Main extends React.Component<IProps, IState> {
// Emitted for automatic processes
listen('grasscutter_closed', async () => {
const autoService = await getConfigOption('auto_mongodb')
const config = await getConfig()
if (autoService) {
await invoke('stop_service', { service: 'MongoDB' })
}
if ((await invoke('get_platform')) === 'linux') {
switch (config.grasscutter_elevation) {
case GrasscutterElevation.None:
break
case GrasscutterElevation.Capability:
await invoke('jvm_remove_cap', {
javaPath: config.java_path,
})
break
default:
console.error('Invalid grasscutter_elevation')
break
}
}
})
let min = false