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

@@ -17,6 +17,12 @@ import * as meta from '../../../utils/rsa'
import HelpButton from '../common/HelpButton'
import SmallButton from '../common/SmallButton'
export enum GrasscutterElevation {
None = 'None',
Capability = 'Capability',
Root = 'Root',
}
interface IProps {
closeFn: () => void
downloadManager: DownloadHandler
@@ -44,6 +50,9 @@ interface IState {
un_elevated: boolean
redirect_more: boolean
// Linux stuff
grasscutter_elevation: string
// Swag stuff
akebi_path: string
migoto_path: string
@@ -76,6 +85,9 @@ export default class Options extends React.Component<IProps, IState> {
un_elevated: false,
redirect_more: false,
// Linux stuff
grasscutter_elevation: GrasscutterElevation.None,
// Swag stuff
akebi_path: '',
migoto_path: '',
@@ -132,6 +144,9 @@ export default class Options extends React.Component<IProps, IState> {
un_elevated: config.un_elevated || false,
redirect_more: config.redirect_more || false,
// Linux stuff
grasscutter_elevation: config.grasscutter_elevation || GrasscutterElevation.None,
// Swag stuff
akebi_path: config.akebi_path || '',
migoto_path: config.migoto_path || '',
@@ -297,6 +312,14 @@ export default class Options extends React.Component<IProps, IState> {
})
}
async setGCElevation(value: string) {
setConfigOption('grasscutter_elevation', value)
this.setState({
grasscutter_elevation: value,
})
}
async removeRSA() {
await meta.unpatchGame()
}
@@ -437,6 +460,25 @@ export default class Options extends React.Component<IProps, IState> {
{this.state.platform === 'linux' && (
<>
<Divider />
<div className="OptionSection" id="menuOptionsContainerGCElevation">
<div className="OptionLabel" id="menuOptionsLabelGCElevation">
<Tr text="options.grasscutter_elevation" />
<HelpButton contents="help.grasscutter_elevation_help_text" />
</div>
<select
value={this.state.grasscutter_elevation}
id="menuOptionsSelectGCElevation"
onChange={(event) => {
this.setGCElevation(event.target.value)
}}
>
{Object.keys(GrasscutterElevation).map((t) => (
<option key={t} value={t}>
{t}
</option>
))}
</select>
</div>
<div className="OptionSection" id="menuOptionsContainerCheckAAGL">
<div className="OptionLabel" id="menuOptionsLabelCheckAAGL">
<Tr text="options.check_aagl" />