added otp superusers help tooltip

This commit is contained in:
Gani Georgiev
2026-04-19 01:19:38 +03:00
parent 07679dd5ba
commit 3b49e8489e
3 changed files with 22 additions and 3 deletions

File diff suppressed because one or more lines are too long

2
ui/dist/index.html vendored
View File

@@ -13,7 +13,7 @@
<!-- prism --> <!-- prism -->
<script src="./libs/prism/prism.js" data-manual></script> <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="modulepreload" crossorigin href="./assets/pocketbase.es-B_4DUNUU.js">
<link rel="stylesheet" crossorigin href="./assets/index-ltAYvB1J.css"> <link rel="stylesheet" crossorigin href="./assets/index-ltAYvB1J.css">
</head> </head>

View File

@@ -13,6 +13,9 @@ export function otpAccordion(collection) {
return collection.otp; return collection.otp;
}, },
get isSuperusers() {
return collection.system && collection.name == "_superusers";
},
}); });
return t.details( return t.details(
@@ -52,12 +55,28 @@ export function otpAccordion(collection) {
name: "otp.enabled", name: "otp.enabled",
className: "switch", className: "switch",
checked: () => data.config.enabled, 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({ t.label({
htmlFor: uniqueId + ".enabled", htmlFor: uniqueId + ".enabled",
textContent: "Enable", 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( t.div(