Try to stop chrome form autofilling

This commit is contained in:
Henry Whitaker
2021-04-11 10:31:28 +01:00
parent a962865867
commit ce549b5b7a
5 changed files with 30 additions and 13 deletions

20
public/js/app.js vendored
View File

@@ -148429,10 +148429,12 @@ var SettingsIndex = /*#__PURE__*/function (_Component) {
type: 'text'
}, {
obj: data.influx_db_username,
type: 'text'
type: 'text',
autoComplete: false
}, {
obj: data.influx_db_password,
type: 'password'
type: 'password',
autoComplete: false
}]
};
});
@@ -148616,7 +148618,8 @@ var SettingsInput = /*#__PURE__*/function (_Component) {
url: _this.props.url,
inline: _this.props.inline ? 'd-inline-block' : 'd-block',
btnType: _this.props.btnType,
earlyReturn: _this.props.earlyReturn ? true : false
earlyReturn: _this.props.earlyReturn ? true : false,
autoComplete: String(_this.props.autoComplete ? true : "off")
};
return _this;
}
@@ -148644,7 +148647,8 @@ var SettingsInput = /*#__PURE__*/function (_Component) {
disabled: disabled,
min: this.state.min,
max: this.state.max,
onInput: this.handleInput
onInput: this.handleInput,
autoComplete: this.state.autoComplete
});
}
}, {
@@ -148685,7 +148689,8 @@ var SettingsInput = /*#__PURE__*/function (_Component) {
type: this.state.type,
defaultValue: this.state.value,
disabled: disabled,
onInput: this.handleInput
onInput: this.handleInput,
autoComplete: this.state.autoComplete
});
}
}, {
@@ -148696,7 +148701,8 @@ var SettingsInput = /*#__PURE__*/function (_Component) {
type: this.state.type,
defaultValue: this.state.value,
disabled: disabled,
onInput: this.handleInput
onInput: this.handleInput,
autoComplete: this.state.autoComplete
});
}
}, {
@@ -148874,7 +148880,7 @@ var SettingsTabs = /*#__PURE__*/function (_Component) {
description: setting.obj.description,
handler: handler,
label: setting.obj.name
}, _defineProperty(_React$createElement, "description", setting.obj.description), _defineProperty(_React$createElement, "options", setting.type == 'select' ? setting.options : []), _defineProperty(_React$createElement, "hideDescription", setting.hideDescription ? setting.hideDescription : false), _defineProperty(_React$createElement, "min", setting.min ? setting.min : false), _defineProperty(_React$createElement, "max", setting.max ? setting.max : false), _defineProperty(_React$createElement, "btnType", setting.btnType), _defineProperty(_React$createElement, "inline", setting.inline), _defineProperty(_React$createElement, "url", setting.url), _defineProperty(_React$createElement, "earlyReturn", setting.earlyReturn ? true : false), _defineProperty(_React$createElement, "classes", setting.classes ? setting.classes : ''), _React$createElement));
}, _defineProperty(_React$createElement, "description", setting.obj.description), _defineProperty(_React$createElement, "options", setting.type == 'select' ? setting.options : []), _defineProperty(_React$createElement, "hideDescription", setting.hideDescription ? setting.hideDescription : false), _defineProperty(_React$createElement, "min", setting.min ? setting.min : false), _defineProperty(_React$createElement, "max", setting.max ? setting.max : false), _defineProperty(_React$createElement, "btnType", setting.btnType), _defineProperty(_React$createElement, "inline", setting.inline), _defineProperty(_React$createElement, "url", setting.url), _defineProperty(_React$createElement, "earlyReturn", setting.earlyReturn ? true : false), _defineProperty(_React$createElement, "classes", setting.classes ? setting.classes : ''), _defineProperty(_React$createElement, "autoComplete", setting.autoComplete ? true : false), _React$createElement));
});
});

View File

@@ -279,11 +279,13 @@ export default class SettingsIndex extends Component {
},
{
obj: data.influx_db_username,
type: 'text'
type: 'text',
autoComplete: false,
},
{
obj: data.influx_db_password,
type: 'password'
type: 'password',
autoComplete: false,
}
],
};

View File

@@ -24,6 +24,7 @@ export default class SettingsInput extends Component {
inline: this.props.inline ? 'd-inline-block' : 'd-block',
btnType: this.props.btnType,
earlyReturn: this.props.earlyReturn ? true : false,
autoComplete: String(this.props.autoComplete ? true : Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 7)),
}
}
@@ -72,7 +73,8 @@ export default class SettingsInput extends Component {
disabled={disabled}
min={this.state.min}
max={this.state.max}
onInput={this.handleInput} />
onInput={this.handleInput}
autoComplete={this.state.autoComplete} />
}
generateSelectInput(disabled) {
@@ -109,7 +111,8 @@ export default class SettingsInput extends Component {
type={this.state.type}
defaultValue={this.state.value}
disabled={disabled}
onInput={this.handleInput} />
onInput={this.handleInput}
autoComplete={this.state.autoComplete} />
}
generatePasswordInput(disabled) {
@@ -118,7 +121,8 @@ export default class SettingsInput extends Component {
type={this.state.type}
defaultValue={this.state.value}
disabled={disabled}
onInput={this.handleInput} />
onInput={this.handleInput}
autoComplete={this.state.autoComplete} />
}
generateButtonGetInput() {

View File

@@ -107,6 +107,7 @@ export default class SettingsTabs extends Component {
url={setting.url}
earlyReturn={setting.earlyReturn ? true : false}
classes={setting.classes ? setting.classes : ''}
autoComplete={setting.autoComplete ? true : false}
/>
})
}

View File

@@ -32,7 +32,11 @@ export default class InfluxDBSettings extends Component {
return (
<Tab.Content>
{settings}
<form onSubmit={(e) => { e.preventDefault() }} autoComplete="off">
<input type="text" autoComplete="username" style={{ display: 'none' }} />
<input type="password" name="password" autoComplete="passoword" style={{ display: 'none' }} />
{settings}
</form>
<div className="mt-3">
<button className="btn btn-primary" onClick={() => { this.props.save(this.state.data, 'healthchecks.io') }}>Save</button>
</div>