mirror of https://github.com/louislam/uptime-kuma
feat(login): Autofocus 2fa (#6128)
Co-authored-by: Frank Elsinga <frank@elsinga.de>pull/6098/head^2
parent
aed7b63fc4
commit
34e6292397
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
<div v-if="tokenRequired">
|
<div v-if="tokenRequired">
|
||||||
<div class="form-floating mt-3">
|
<div class="form-floating mt-3">
|
||||||
<input id="otp" v-model="token" type="text" maxlength="6" class="form-control" placeholder="123456" autocomplete="one-time-code" required>
|
<input id="otp" ref="otpInput" v-model="token" type="text" maxlength="6" class="form-control" placeholder="123456" autocomplete="one-time-code" required>
|
||||||
<label for="otp">{{ $t("Token") }}</label>
|
<label for="otp">{{ $t("Token") }}</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -55,6 +55,16 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
watch: {
|
||||||
|
tokenRequired(newVal) {
|
||||||
|
if (newVal) {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.otpInput?.focus();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
document.title += " - Login";
|
document.title += " - Login";
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue