runner: initial automatic update (#2141)

This commit is contained in:
Andrey Nekrasov
2020-04-21 10:30:12 +03:00
committed by GitHub
parent e9ecdb3f56
commit 0354026292
37 changed files with 735 additions and 326 deletions

View File

@@ -7,6 +7,7 @@ import { CustomActionSettingsControl } from './CustomActionSettingsControl';
export class GeneralSettings extends React.Component <any, any> {
references: any = {};
download_updates_automatically_reference: any;
startup_reference: any;
elevated_reference: any;
restart_reference: any;
@@ -14,10 +15,11 @@ export class GeneralSettings extends React.Component <any, any> {
parent_on_change: Function;
constructor(props: any) {
super(props);
this.references={};
this.startup_reference=null;
this.elevated_reference=null;
this.restart_reference=null;
this.references = {};
this.download_updates_automatically_reference = null;
this.startup_reference = null;
this.elevated_reference = null;
this.restart_reference = null;
this.parent_on_change = props.on_change;
this.state = {
settings_key: props.settings_key,
@@ -42,6 +44,7 @@ export class GeneralSettings extends React.Component <any, any> {
});
let result : any = {};
result[this.state.settings_key]= {
download_updates_automatically: this.download_updates_automatically_reference.get_value().value,
startup: this.startup_reference.get_value().value,
run_elevated: this.elevated_reference != null && this.elevated_reference.get_value().value,
theme: this.theme_reference.get_value().value,
@@ -121,6 +124,17 @@ export class GeneralSettings extends React.Component <any, any> {
}
<Separator />
<Text variant='xLarge'>General</Text>
<Stack>
<Label>Download updates automatically</Label>
<BoolToggleSettingsControl
setting={{value: this.state.settings.general.download_updates_automatically}}
on_change={this.parent_on_change}
ref={(input) => {this.download_updates_automatically_reference=input;}}
/>
</Stack>
<Stack>
{this.state.settings.general.startup_disabled_reason != null &&
<span style={{color:"#c50500"}} dangerouslySetInnerHTML={{__html: this.state.settings.general.startup_disabled_reason }} />