mirror of
https://github.com/UNITRONIX/BetterDesk.git
synced 2026-09-10 01:27:11 +00:00
e556b181df
Add OS-level admin detection and use it to gate sensitive agent UI and tray actions. Introduce privileges.rs (Windows TokenElevation / Unix geteuid) and expose is_os_admin as a Tauri command; wire it into tray setup to hide admin-only menu items (Settings, Quit) and re-check privileges before executing those actions. Add show_window helper and emit navigate events from the tray; frontend listens for navigate and conditionally renders /settings (shows AdminRequired component for non-admins). Update App.tsx to query is_os_admin on startup and include navigation listener; add AdminRequired component, styles, and i18n keys. Update Cargo.toml with platform deps (windows features + libc for unix). Also add UI/locale assets and CSS for agent lazy-loaded device tabs and a notifications dropdown, plus several web-nodejs route/view/style updates and new task docs describing phase work.
193 lines
3.8 KiB
CSS
193 lines
3.8 KiB
CSS
/* Navbar notification center — dropdown with unread badge, real-time pulse. */
|
|
|
|
.notif-wrapper {
|
|
position: relative;
|
|
display: inline-block;
|
|
}
|
|
|
|
.notif-btn {
|
|
position: relative;
|
|
}
|
|
|
|
/* Unread badge on bell icon. */
|
|
.notif-badge {
|
|
position: absolute;
|
|
top: 4px;
|
|
right: 4px;
|
|
min-width: 16px;
|
|
height: 16px;
|
|
padding: 0 4px;
|
|
border-radius: 8px;
|
|
background: var(--accent-red, #e74c3c);
|
|
color: #fff;
|
|
font-size: 10px;
|
|
font-weight: 600;
|
|
line-height: 16px;
|
|
text-align: center;
|
|
box-shadow: 0 0 0 2px var(--bg-primary, #0d1117);
|
|
pointer-events: none;
|
|
}
|
|
|
|
/* Real-time arrival pulse (400ms). */
|
|
@keyframes notif-pulse {
|
|
0% { transform: scale(1); }
|
|
30% { transform: scale(1.18); }
|
|
60% { transform: scale(0.94); }
|
|
100% { transform: scale(1); }
|
|
}
|
|
|
|
.notif-btn.notif-pulse .material-icons {
|
|
animation: notif-pulse 0.4s ease-out;
|
|
}
|
|
|
|
/* Dropdown panel. */
|
|
.notif-dropdown {
|
|
position: absolute;
|
|
top: calc(100% + 6px);
|
|
right: 0;
|
|
width: 340px;
|
|
max-width: calc(100vw - 24px);
|
|
background: var(--bg-secondary, #161b22);
|
|
border: 1px solid var(--border, #30363d);
|
|
border-radius: 10px;
|
|
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55);
|
|
z-index: 9999;
|
|
overflow: hidden;
|
|
animation: notif-fade-in 150ms ease-out;
|
|
}
|
|
|
|
@keyframes notif-fade-in {
|
|
from { opacity: 0; transform: translateY(-6px); }
|
|
to { opacity: 1; transform: translateY(0); }
|
|
}
|
|
|
|
.notif-header {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
padding: 12px 14px;
|
|
border-bottom: 1px solid var(--border, #30363d);
|
|
font-weight: 600;
|
|
font-size: 13px;
|
|
color: var(--text-primary, #e6edf3);
|
|
}
|
|
|
|
.notif-mark-all {
|
|
background: transparent;
|
|
border: none;
|
|
color: var(--accent-blue, #58a6ff);
|
|
font-size: 12px;
|
|
cursor: pointer;
|
|
padding: 4px 8px;
|
|
border-radius: 4px;
|
|
}
|
|
|
|
.notif-mark-all:hover {
|
|
background: rgba(88, 166, 255, 0.08);
|
|
}
|
|
|
|
.notif-list {
|
|
max-height: 360px;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
.notif-empty {
|
|
padding: 28px 16px;
|
|
text-align: center;
|
|
color: var(--text-secondary, #8b949e);
|
|
font-size: 13px;
|
|
}
|
|
|
|
.notif-item {
|
|
display: flex;
|
|
gap: 10px;
|
|
padding: 10px 14px;
|
|
border-bottom: 1px solid var(--border-subtle, #21262d);
|
|
text-decoration: none;
|
|
color: var(--text-primary, #e6edf3);
|
|
transition: background-color 120ms;
|
|
}
|
|
|
|
.notif-item:last-child {
|
|
border-bottom: none;
|
|
}
|
|
|
|
.notif-item:hover {
|
|
background: rgba(255, 255, 255, 0.03);
|
|
}
|
|
|
|
.notif-unread {
|
|
background: rgba(88, 166, 255, 0.06);
|
|
}
|
|
|
|
.notif-unread::before {
|
|
content: '';
|
|
width: 6px;
|
|
height: 6px;
|
|
border-radius: 50%;
|
|
background: var(--accent-blue, #58a6ff);
|
|
margin-top: 8px;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.notif-item-icon {
|
|
color: var(--accent-blue, #58a6ff);
|
|
font-size: 20px;
|
|
flex-shrink: 0;
|
|
margin-top: 2px;
|
|
}
|
|
|
|
.notif-item-body {
|
|
flex: 1;
|
|
min-width: 0;
|
|
}
|
|
|
|
.notif-item-title {
|
|
font-size: 13px;
|
|
font-weight: 600;
|
|
margin-bottom: 2px;
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
|
|
.notif-item-sub {
|
|
font-size: 12px;
|
|
color: var(--text-secondary, #8b949e);
|
|
line-height: 1.4;
|
|
display: -webkit-box;
|
|
-webkit-line-clamp: 2;
|
|
-webkit-box-orient: vertical;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.notif-item-time {
|
|
font-size: 11px;
|
|
color: var(--text-tertiary, #6e7681);
|
|
margin-top: 4px;
|
|
}
|
|
|
|
.notif-footer {
|
|
padding: 10px 14px;
|
|
border-top: 1px solid var(--border, #30363d);
|
|
text-align: center;
|
|
}
|
|
|
|
.notif-see-all {
|
|
color: var(--accent-blue, #58a6ff);
|
|
font-size: 12px;
|
|
text-decoration: none;
|
|
}
|
|
|
|
.notif-see-all:hover {
|
|
text-decoration: underline;
|
|
}
|
|
|
|
/* Responsive: narrow screens push dropdown to full width of navbar-right. */
|
|
@media (max-width: 480px) {
|
|
.notif-dropdown {
|
|
right: -60px;
|
|
width: 300px;
|
|
}
|
|
}
|