mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-09-22 04:39:20 +08:00
feat(login): Autofocus 2fa (#6128)
Co-authored-by: Frank Elsinga <frank@elsinga.de>
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
|
||||
<div v-if="tokenRequired">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
@@ -55,6 +55,16 @@ export default {
|
||||
};
|
||||
},
|
||||
|
||||
watch: {
|
||||
tokenRequired(newVal) {
|
||||
if (newVal) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.otpInput?.focus();
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
document.title += " - Login";
|
||||
},
|
||||
|
Reference in New Issue
Block a user