mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-01-18 06:29:44 +08:00
Settings: fix broken "Restart as administrator" button (#1733)
This commit is contained in:
parent
5605256c75
commit
958198b65a
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import {BaseSettingsControl} from './BaseSettingsControl';
|
||||
import {Label, Stack, PrimaryButton, Text } from 'office-ui-fabric-react';
|
||||
import {Label, Link, Stack, PrimaryButton, Text } from 'office-ui-fabric-react';
|
||||
|
||||
export class CustomActionSettingsControl extends BaseSettingsControl {
|
||||
colorpickerref:any = null;
|
||||
@ -10,7 +10,6 @@ export class CustomActionSettingsControl extends BaseSettingsControl {
|
||||
this.colorpickerref = null;
|
||||
this.state={
|
||||
property_values: props.setting,
|
||||
call_action_callback: props.action_callback,
|
||||
name: props.action_name
|
||||
}
|
||||
}
|
||||
@ -34,7 +33,6 @@ export class CustomActionSettingsControl extends BaseSettingsControl {
|
||||
<Label>{this.state.property_values.display_name}</Label>
|
||||
: null
|
||||
}
|
||||
{
|
||||
<Stack horizontal tokens={{childrenGap:5}}>
|
||||
{
|
||||
this.state.property_values.value ?
|
||||
@ -46,12 +44,20 @@ export class CustomActionSettingsControl extends BaseSettingsControl {
|
||||
: <span/>
|
||||
}
|
||||
{
|
||||
this.state.property_values.help_link ?
|
||||
this.state.property_values.help_link
|
||||
this.state.property_values.help_link_url && this.state.property_values.help_link_text ?
|
||||
<Link
|
||||
styles = {{
|
||||
root: {
|
||||
alignSelf:'center',
|
||||
paddingBottom: '0.5em'
|
||||
}
|
||||
}}
|
||||
href={ this.state.property_values.help_link_url }
|
||||
target='_blank'
|
||||
>{ this.state.property_values.help_link_text }</Link>
|
||||
: <span/>
|
||||
}
|
||||
</Stack>
|
||||
}
|
||||
<PrimaryButton
|
||||
styles={{
|
||||
root: {
|
||||
@ -59,7 +65,7 @@ export class CustomActionSettingsControl extends BaseSettingsControl {
|
||||
}
|
||||
}}
|
||||
text={this.state.property_values.button_text}
|
||||
onClick={()=>this.state.call_action_callback(this.state.name, this.state.property_values)}
|
||||
onClick={()=>this.props.action_callback(this.state.name, this.state.property_values)}
|
||||
/>
|
||||
</Stack>
|
||||
);
|
||||
|
@ -150,16 +150,8 @@ export class GeneralSettings extends React.Component <any, any> {
|
||||
display_name: '',
|
||||
value: 'Running as user. Do you wish to run as administrator instead?',
|
||||
button_text: 'Restart as administrator',
|
||||
help_link: <Link
|
||||
styles = {{
|
||||
root: {
|
||||
alignSelf:'center',
|
||||
paddingBottom: '0.5em'
|
||||
}
|
||||
}}
|
||||
href={"https://aka.ms/powertoysDetectedElevatedHelp"}
|
||||
target='_blank'
|
||||
>(Learn more about Admin mode)</Link>
|
||||
help_link_url: "https://aka.ms/powertoysDetectedElevatedHelp",
|
||||
help_link_text: "(Learn more about Admin mode)"
|
||||
}}
|
||||
action_name={'restart_elevation'}
|
||||
action_callback={(action_name: any, value:any) => {
|
||||
|
2
src/settings/settings-html/dist/bundle.js
vendored
2
src/settings/settings-html/dist/bundle.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user