mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-11-29 08:02:34 +02:00
Compare commits
3 Commits
2ee40d6105
...
319d982113
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
319d982113 | ||
|
|
95a0c667e4 | ||
|
|
b519832086 |
@@ -376,6 +376,7 @@
|
|||||||
## - "inline-menu-totp": Enable the use of inline menu TOTP codes in the browser extension.
|
## - "inline-menu-totp": Enable the use of inline menu TOTP codes in the browser extension.
|
||||||
## - "ssh-agent": Enable SSH agent support on Desktop. (Needs desktop >=2024.12.0)
|
## - "ssh-agent": Enable SSH agent support on Desktop. (Needs desktop >=2024.12.0)
|
||||||
## - "ssh-key-vault-item": Enable the creation and use of SSH key vault items. (Needs clients >=2024.12.0)
|
## - "ssh-key-vault-item": Enable the creation and use of SSH key vault items. (Needs clients >=2024.12.0)
|
||||||
|
## - "pm-25373-windows-biometrics-v2": Enable the new implementation of biometrics on Windows. (Needs desktop >= 2025.11.0)
|
||||||
## - "export-attachments": Enable support for exporting attachments (Clients >=2025.4.0)
|
## - "export-attachments": Enable support for exporting attachments (Clients >=2025.4.0)
|
||||||
## - "anon-addy-self-host-alias": Enable configuring self-hosted Anon Addy alias generator. (Needs Android >=2025.3.0, iOS >=2025.4.0)
|
## - "anon-addy-self-host-alias": Enable configuring self-hosted Anon Addy alias generator. (Needs Android >=2025.3.0, iOS >=2025.4.0)
|
||||||
## - "simple-login-self-host-alias": Enable configuring self-hosted Simple Login alias generator. (Needs Android >=2025.3.0, iOS >=2025.4.0)
|
## - "simple-login-self-host-alias": Enable configuring self-hosted Simple Login alias generator. (Needs Android >=2025.3.0, iOS >=2025.4.0)
|
||||||
|
|||||||
@@ -47,24 +47,11 @@ pub fn routes() -> Vec<Route> {
|
|||||||
|
|
||||||
#[get("/emergency-access/trusted")]
|
#[get("/emergency-access/trusted")]
|
||||||
async fn get_contacts(headers: Headers, conn: DbConn) -> Json<Value> {
|
async fn get_contacts(headers: Headers, conn: DbConn) -> Json<Value> {
|
||||||
if !CONFIG.emergency_access_allowed() {
|
let emergency_access_list = if CONFIG.emergency_access_allowed() {
|
||||||
return Json(json!({
|
EmergencyAccess::find_all_by_grantor_uuid(&headers.user.uuid, &conn).await
|
||||||
"data": [{
|
} else {
|
||||||
"id": "",
|
Vec::new()
|
||||||
"status": 2,
|
};
|
||||||
"type": 0,
|
|
||||||
"waitTimeDays": 0,
|
|
||||||
"granteeId": "",
|
|
||||||
"email": "",
|
|
||||||
"name": "NOTE: Emergency Access is disabled!",
|
|
||||||
"object": "emergencyAccessGranteeDetails",
|
|
||||||
|
|
||||||
}],
|
|
||||||
"object": "list",
|
|
||||||
"continuationToken": null
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
let emergency_access_list = EmergencyAccess::find_all_by_grantor_uuid(&headers.user.uuid, &conn).await;
|
|
||||||
let mut emergency_access_list_json = Vec::with_capacity(emergency_access_list.len());
|
let mut emergency_access_list_json = Vec::with_capacity(emergency_access_list.len());
|
||||||
for ea in emergency_access_list {
|
for ea in emergency_access_list {
|
||||||
if let Some(grantee) = ea.to_json_grantee_details(&conn).await {
|
if let Some(grantee) = ea.to_json_grantee_details(&conn).await {
|
||||||
|
|||||||
@@ -1035,6 +1035,7 @@ fn validate_config(cfg: &ConfigItems) -> Result<(), Error> {
|
|||||||
"ssh-agent",
|
"ssh-agent",
|
||||||
// Key Management Team
|
// Key Management Team
|
||||||
"ssh-key-vault-item",
|
"ssh-key-vault-item",
|
||||||
|
"pm-25373-windows-biometrics-v2",
|
||||||
// Tools
|
// Tools
|
||||||
"export-attachments",
|
"export-attachments",
|
||||||
// Mobile Team
|
// Mobile Team
|
||||||
|
|||||||
17
src/static/scripts/admin.css
vendored
17
src/static/scripts/admin.css
vendored
@@ -58,3 +58,20 @@ img {
|
|||||||
.abbr-badge {
|
.abbr-badge {
|
||||||
cursor: help;
|
cursor: help;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.theme-icon,
|
||||||
|
.theme-icon-active {
|
||||||
|
display: inline-flex;
|
||||||
|
flex: 0 0 1.75em;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-icon svg,
|
||||||
|
.theme-icon-active svg {
|
||||||
|
width: 1.25em;
|
||||||
|
height: 1.25em;
|
||||||
|
min-width: 1.25em;
|
||||||
|
min-height: 1.25em;
|
||||||
|
display: block;
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
13
src/static/scripts/admin.js
vendored
13
src/static/scripts/admin.js
vendored
@@ -106,7 +106,11 @@ const showActiveTheme = (theme, focus = false) => {
|
|||||||
const themeSwitcherText = document.querySelector("#bd-theme-text");
|
const themeSwitcherText = document.querySelector("#bd-theme-text");
|
||||||
const activeThemeIcon = document.querySelector(".theme-icon-active use");
|
const activeThemeIcon = document.querySelector(".theme-icon-active use");
|
||||||
const btnToActive = document.querySelector(`[data-bs-theme-value="${theme}"]`);
|
const btnToActive = document.querySelector(`[data-bs-theme-value="${theme}"]`);
|
||||||
const svgOfActiveBtn = btnToActive.querySelector("span use").textContent;
|
if (!btnToActive) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const btnIconUse = btnToActive ? btnToActive.querySelector("[data-theme-icon-use]") : null;
|
||||||
|
const iconHref = btnIconUse ? btnIconUse.getAttribute("href") || btnIconUse.getAttribute("xlink:href") : null;
|
||||||
|
|
||||||
document.querySelectorAll("[data-bs-theme-value]").forEach(element => {
|
document.querySelectorAll("[data-bs-theme-value]").forEach(element => {
|
||||||
element.classList.remove("active");
|
element.classList.remove("active");
|
||||||
@@ -115,7 +119,12 @@ const showActiveTheme = (theme, focus = false) => {
|
|||||||
|
|
||||||
btnToActive.classList.add("active");
|
btnToActive.classList.add("active");
|
||||||
btnToActive.setAttribute("aria-pressed", "true");
|
btnToActive.setAttribute("aria-pressed", "true");
|
||||||
activeThemeIcon.textContent = svgOfActiveBtn;
|
|
||||||
|
if (iconHref && activeThemeIcon) {
|
||||||
|
activeThemeIcon.setAttribute("href", iconHref);
|
||||||
|
activeThemeIcon.setAttribute("xlink:href", iconHref);
|
||||||
|
}
|
||||||
|
|
||||||
const themeSwitcherLabel = `${themeSwitcherText.textContent} (${btnToActive.dataset.bsThemeValue})`;
|
const themeSwitcherLabel = `${themeSwitcherText.textContent} (${btnToActive.dataset.bsThemeValue})`;
|
||||||
themeSwitcher.setAttribute("aria-label", themeSwitcherLabel);
|
themeSwitcher.setAttribute("aria-label", themeSwitcherLabel);
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,28 @@
|
|||||||
<script src="{{urlpath}}/vw_static/admin.js"></script>
|
<script src="{{urlpath}}/vw_static/admin.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<svg class="d-none">
|
||||||
|
<symbol id="vw-icon-sun" viewBox="0 0 24 24">
|
||||||
|
<circle cx="12" cy="12" r="5" fill="currentColor"></circle>
|
||||||
|
<g stroke="currentColor" stroke-width="1.5" stroke-linecap="round">
|
||||||
|
<line x1="12" y1="2" x2="12" y2="5"></line>
|
||||||
|
<line x1="12" y1="19" x2="12" y2="22"></line>
|
||||||
|
<line x1="4.22" y1="4.22" x2="6.34" y2="6.34"></line>
|
||||||
|
<line x1="17.66" y1="17.66" x2="19.78" y2="19.78"></line>
|
||||||
|
<line x1="2" y1="12" x2="5" y2="12"></line>
|
||||||
|
<line x1="19" y1="12" x2="22" y2="12"></line>
|
||||||
|
<line x1="4.22" y1="19.78" x2="6.34" y2="17.66"></line>
|
||||||
|
<line x1="17.66" y1="6.34" x2="19.78" y2="4.22"></line>
|
||||||
|
</g>
|
||||||
|
</symbol>
|
||||||
|
<symbol id="vw-icon-moon" viewBox="0 0 32 32">
|
||||||
|
<path fill="currentColor" transform="translate(0,-1.2)" d="M25.2 27.3a11.2 11.2 0 0 1-6.6-20.5A13 13 0 1 0 29.6 25.5 11.6 11.6 0 0 1 25.2 27.3z"></path>
|
||||||
|
</symbol>
|
||||||
|
<symbol id="vw-icon-auto" viewBox="0 0 24 24">
|
||||||
|
<circle cx="12" cy="12" r="9" fill="none" stroke="currentColor" stroke-width="1.5"></circle>
|
||||||
|
<path fill="currentColor" d="M12 3a9 9 0 1 1 0 18V3z"></path>
|
||||||
|
</symbol>
|
||||||
|
</svg>
|
||||||
<nav class="navbar navbar-expand-md navbar-dark bg-dark mb-4 shadow fixed-top">
|
<nav class="navbar navbar-expand-md navbar-dark bg-dark mb-4 shadow fixed-top">
|
||||||
<div class="container-xl">
|
<div class="container-xl">
|
||||||
<a class="navbar-brand" href="{{urlpath}}/admin"><img class="vaultwarden-icon" src="{{urlpath}}/vw_static/vaultwarden-icon.png" alt="V">aultwarden Admin</a>
|
<a class="navbar-brand" href="{{urlpath}}/admin"><img class="vaultwarden-icon" src="{{urlpath}}/vw_static/vaultwarden-icon.png" alt="V">aultwarden Admin</a>
|
||||||
@@ -46,7 +68,9 @@
|
|||||||
id="bd-theme" type="button" aria-expanded="false" data-bs-toggle="dropdown"
|
id="bd-theme" type="button" aria-expanded="false" data-bs-toggle="dropdown"
|
||||||
data-bs-display="static" aria-label="Toggle theme (auto)">
|
data-bs-display="static" aria-label="Toggle theme (auto)">
|
||||||
<span class="my-1 fs-4 theme-icon-active">
|
<span class="my-1 fs-4 theme-icon-active">
|
||||||
<use>☯</use>
|
<svg class="vw-theme-icon" focusable="false" aria-hidden="true">
|
||||||
|
<use data-theme-icon-use href="#vw-icon-auto"></use>
|
||||||
|
</svg>
|
||||||
</span>
|
</span>
|
||||||
<span class="d-md-none ms-2" id="bd-theme-text">Toggle theme</span>
|
<span class="d-md-none ms-2" id="bd-theme-text">Toggle theme</span>
|
||||||
</button>
|
</button>
|
||||||
@@ -55,7 +79,9 @@
|
|||||||
<button type="button" class="dropdown-item d-flex align-items-center"
|
<button type="button" class="dropdown-item d-flex align-items-center"
|
||||||
data-bs-theme-value="light" aria-pressed="false">
|
data-bs-theme-value="light" aria-pressed="false">
|
||||||
<span class="me-2 fs-4 theme-icon">
|
<span class="me-2 fs-4 theme-icon">
|
||||||
<use>☀</use>
|
<svg class="vw-theme-icon" focusable="false" aria-hidden="true">
|
||||||
|
<use data-theme-icon-use href="#vw-icon-sun"></use>
|
||||||
|
</svg>
|
||||||
</span>
|
</span>
|
||||||
Light
|
Light
|
||||||
</button>
|
</button>
|
||||||
@@ -64,7 +90,9 @@
|
|||||||
<button type="button" class="dropdown-item d-flex align-items-center"
|
<button type="button" class="dropdown-item d-flex align-items-center"
|
||||||
data-bs-theme-value="dark" aria-pressed="false">
|
data-bs-theme-value="dark" aria-pressed="false">
|
||||||
<span class="me-2 fs-4 theme-icon">
|
<span class="me-2 fs-4 theme-icon">
|
||||||
<use>★</use>
|
<svg class="vw-theme-icon" focusable="false" aria-hidden="true">
|
||||||
|
<use data-theme-icon-use href="#vw-icon-moon"></use>
|
||||||
|
</svg>
|
||||||
</span>
|
</span>
|
||||||
Dark
|
Dark
|
||||||
</button>
|
</button>
|
||||||
@@ -73,7 +101,9 @@
|
|||||||
<button type="button" class="dropdown-item d-flex align-items-center active"
|
<button type="button" class="dropdown-item d-flex align-items-center active"
|
||||||
data-bs-theme-value="auto" aria-pressed="true">
|
data-bs-theme-value="auto" aria-pressed="true">
|
||||||
<span class="me-2 fs-4 theme-icon">
|
<span class="me-2 fs-4 theme-icon">
|
||||||
<use>☯</use>
|
<svg class="vw-theme-icon" focusable="false" aria-hidden="true">
|
||||||
|
<use data-theme-icon-use href="#vw-icon-auto"></use>
|
||||||
|
</svg>
|
||||||
</span>
|
</span>
|
||||||
Auto
|
Auto
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user