added otp superusers help tooltip
This commit is contained in:
File diff suppressed because one or more lines are too long
2
ui/dist/index.html
vendored
2
ui/dist/index.html
vendored
@@ -13,7 +13,7 @@
|
||||
|
||||
<!-- prism -->
|
||||
<script src="./libs/prism/prism.js" data-manual></script>
|
||||
<script type="module" crossorigin src="./assets/index-BDa4X9xH.js"></script>
|
||||
<script type="module" crossorigin src="./assets/index-BRwfFM7z.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="./assets/pocketbase.es-B_4DUNUU.js">
|
||||
<link rel="stylesheet" crossorigin href="./assets/index-ltAYvB1J.css">
|
||||
</head>
|
||||
|
||||
@@ -13,6 +13,9 @@ export function otpAccordion(collection) {
|
||||
|
||||
return collection.otp;
|
||||
},
|
||||
get isSuperusers() {
|
||||
return collection.system && collection.name == "_superusers";
|
||||
},
|
||||
});
|
||||
|
||||
return t.details(
|
||||
@@ -52,12 +55,28 @@ export function otpAccordion(collection) {
|
||||
name: "otp.enabled",
|
||||
className: "switch",
|
||||
checked: () => data.config.enabled,
|
||||
onchange: (e) => (data.config.enabled = e.target.checked),
|
||||
onchange: (e) => {
|
||||
data.config.enabled = e.target.checked;
|
||||
|
||||
if (data.isSuperusers) {
|
||||
collection.mfa.enabled = e.target.checked;
|
||||
}
|
||||
},
|
||||
}),
|
||||
t.label({
|
||||
htmlFor: uniqueId + ".enabled",
|
||||
textContent: "Enable",
|
||||
}),
|
||||
() => {
|
||||
if (!data.isSuperusers) {
|
||||
return
|
||||
}
|
||||
|
||||
return t.i({
|
||||
className: "ri-information-line link-hint",
|
||||
ariaDescription: app.attrs.tooltip("Superusers can have OTP only as part of Two-factor authentication."),
|
||||
})
|
||||
},
|
||||
),
|
||||
),
|
||||
t.div(
|
||||
|
||||
Reference in New Issue
Block a user