mirror of
https://github.com/lWolvesl/antigravity-usage-monitor.git
synced 2026-11-26 17:09:28 +08:00
feat(account): add multi-account switcher and passphrase vault
- Enable Windows multi-account sign-in via loopback PKCE OAuth and unified borderless quota cards with Ultra 5x/20x tier detection and instant cached-list preloading - Keep active-account quota strictly on live host telemetry while supporting configurable background OAuth refresh intervals (10m-24h, default 1h) for saved backup accounts - Add optional scrypt + AES-256-GCM secondary passphrase encryption with per-email AAD binding, unlock backoff, key zeroing, at-rest token minimization, and OAuth client_id allowlisting - Harden account mutations with inline two-step switch/remove confirmations, HMAC action nonces, Webview context checks, standalone web 403 isolation, and user-only vault directory ACLs
This commit is contained in:
@@ -641,6 +641,484 @@
|
||||
line-height: 1.35;
|
||||
}
|
||||
|
||||
.settings-account-root [hidden] {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.account-toolbar-panel {
|
||||
padding: 9px 12px;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.account-toolbar-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 8px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.account-toolbar-left,
|
||||
.account-toolbar-right {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.account-toolbar-right {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.account-toolbar-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
min-height: calc(25px * var(--ui-font-scale, 1));
|
||||
height: auto;
|
||||
padding: 2px 10px;
|
||||
font-size: var(--fs-md);
|
||||
font-weight: 500;
|
||||
border-radius: var(--radius-xs);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.account-toolbar-btn.is-open {
|
||||
color: var(--accent-primary);
|
||||
background: var(--accent-primary-soft);
|
||||
}
|
||||
|
||||
.account-reload-btn {
|
||||
width: calc(25px * var(--ui-font-scale, 1));
|
||||
height: calc(25px * var(--ui-font-scale, 1));
|
||||
padding: 0;
|
||||
border-radius: var(--radius-xs);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.account-refresh-select {
|
||||
flex: 0 0 auto;
|
||||
width: auto;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.account-refresh-select .select-trigger {
|
||||
width: auto;
|
||||
min-height: calc(25px * var(--ui-font-scale, 1));
|
||||
height: auto;
|
||||
padding: 2px 8px;
|
||||
gap: 5px;
|
||||
font-size: var(--fs-sm);
|
||||
border: 1px solid var(--border-hairline);
|
||||
border-radius: var(--radius-xs);
|
||||
background: var(--surface-subtle);
|
||||
}
|
||||
|
||||
[data-modern-ui="true"] .account-refresh-select .select-trigger {
|
||||
border: none;
|
||||
background: var(--modern-surface-subtle);
|
||||
}
|
||||
|
||||
[data-modern-ui="true"] .account-refresh-select .select-trigger:hover,
|
||||
[data-modern-ui="true"] .account-refresh-select.is-open .select-trigger {
|
||||
background: var(--modern-surface-hover);
|
||||
}
|
||||
|
||||
.account-refresh-select .select-menu {
|
||||
right: 0;
|
||||
left: auto;
|
||||
min-width: 108px;
|
||||
width: max-content;
|
||||
}
|
||||
|
||||
.account-status-inline {
|
||||
font-size: var(--fs-sm);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 210px;
|
||||
}
|
||||
|
||||
.account-status-inline.is-ok {
|
||||
color: var(--metric-ok);
|
||||
}
|
||||
|
||||
.account-status-inline.is-error,
|
||||
.account-card-note.is-error {
|
||||
color: var(--metric-danger);
|
||||
}
|
||||
|
||||
.account-status-inline.is-info {
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.account-import-drawer {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 5px;
|
||||
padding-top: 2px;
|
||||
}
|
||||
|
||||
.account-import-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.account-import-input {
|
||||
flex: 1 1 150px;
|
||||
min-width: 0;
|
||||
min-height: calc(26px * var(--ui-font-scale, 1));
|
||||
}
|
||||
|
||||
.account-import-hint {
|
||||
font-size: var(--fs-xs);
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.account-unlock-box {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
padding: 8px 10px;
|
||||
border-radius: var(--radius-xs);
|
||||
background: var(--surface-subtle);
|
||||
}
|
||||
|
||||
.account-unlock-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.account-unlock-title {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
font-size: var(--fs-sm);
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.account-unlock-title .svg-icon {
|
||||
color: var(--metric-warn);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.account-link-btn {
|
||||
padding: 0;
|
||||
border: none;
|
||||
background: transparent;
|
||||
font-size: var(--fs-xs);
|
||||
color: var(--text-muted);
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.account-link-btn:hover {
|
||||
color: var(--text-primary);
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.account-reset-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
gap: 6px 10px;
|
||||
padding-top: 4px;
|
||||
}
|
||||
|
||||
.account-reset-row .settings-action-desc {
|
||||
flex: 1 1 180px;
|
||||
font-size: var(--fs-xs);
|
||||
}
|
||||
|
||||
.account-pwd-tabs {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
align-self: flex-start;
|
||||
gap: 4px;
|
||||
padding: 2px;
|
||||
border-radius: var(--radius-xs);
|
||||
background: var(--surface-subtle);
|
||||
}
|
||||
|
||||
.account-pwd-tab {
|
||||
padding: 2px 8px;
|
||||
border: none;
|
||||
border-radius: var(--radius-xs);
|
||||
background: transparent;
|
||||
font-size: var(--fs-xs);
|
||||
font-weight: 500;
|
||||
color: var(--text-secondary);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.account-pwd-tab.is-active {
|
||||
background: var(--bg-elevated);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.account-card-btn.is-confirm-warn {
|
||||
color: var(--accent-primary);
|
||||
background: var(--accent-primary-soft);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.account-confirm-danger-btn {
|
||||
color: var(--metric-danger);
|
||||
background: color-mix(in srgb, var(--metric-danger) 12%, transparent);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.account-confirm-danger-btn:hover:not(:disabled) {
|
||||
background: color-mix(in srgb, var(--metric-danger) 20%, transparent);
|
||||
}
|
||||
|
||||
.account-flow-strip {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
gap: 6px 10px;
|
||||
padding: 6px 9px;
|
||||
border-radius: var(--radius-xs);
|
||||
background: var(--surface-subtle);
|
||||
font-size: var(--fs-sm);
|
||||
}
|
||||
|
||||
.account-flow-strip.is-info {
|
||||
background: var(--accent-primary-soft);
|
||||
}
|
||||
|
||||
.account-flow-strip.is-info .account-flow-msg {
|
||||
color: var(--accent-primary);
|
||||
}
|
||||
|
||||
.account-flow-strip.is-ok {
|
||||
background: color-mix(in srgb, var(--metric-ok) 10%, transparent);
|
||||
}
|
||||
|
||||
.account-flow-strip.is-ok .account-flow-msg {
|
||||
color: var(--metric-ok);
|
||||
}
|
||||
|
||||
.account-flow-strip.is-warn {
|
||||
background: color-mix(in srgb, var(--metric-warn) 10%, transparent);
|
||||
color: var(--metric-warn);
|
||||
}
|
||||
|
||||
.account-flow-strip.is-error {
|
||||
background: color-mix(in srgb, var(--metric-danger) 10%, transparent);
|
||||
}
|
||||
|
||||
.account-flow-strip.is-error .account-flow-msg {
|
||||
color: var(--metric-danger);
|
||||
}
|
||||
|
||||
.account-flow-link {
|
||||
font-size: var(--fs-sm);
|
||||
font-weight: 500;
|
||||
color: var(--accent-primary);
|
||||
text-decoration: none;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.account-flow-link:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.account-cards-stack {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-3);
|
||||
}
|
||||
|
||||
.account-card {
|
||||
gap: 10px;
|
||||
padding: 11px 14px;
|
||||
}
|
||||
|
||||
.account-card-head {
|
||||
gap: 8px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.account-card-meta {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 6px;
|
||||
min-width: 0;
|
||||
flex: 1 1 150px;
|
||||
}
|
||||
|
||||
.account-active-dot {
|
||||
background: var(--metric-ok);
|
||||
box-shadow: 0 0 0 2px color-mix(in srgb, var(--metric-ok) 20%, transparent);
|
||||
}
|
||||
|
||||
.account-card-email {
|
||||
font-size: var(--fs-base);
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.account-tag {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
min-height: calc(18px * var(--ui-font-scale, 1));
|
||||
padding: 1px 6px;
|
||||
font-size: var(--fs-xs);
|
||||
font-weight: 600;
|
||||
line-height: 1.2;
|
||||
border-radius: var(--radius-xs);
|
||||
border: none;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.account-tag.is-active {
|
||||
color: var(--metric-ok);
|
||||
background: color-mix(in srgb, var(--metric-ok) 12%, transparent);
|
||||
}
|
||||
|
||||
.account-tag.is-tier {
|
||||
color: var(--accent-primary);
|
||||
background: var(--accent-primary-soft);
|
||||
}
|
||||
|
||||
.account-tag.is-written {
|
||||
color: var(--metric-warn);
|
||||
background: color-mix(in srgb, var(--metric-warn) 12%, transparent);
|
||||
}
|
||||
|
||||
.account-card-actions {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
flex-shrink: 0;
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.account-card-btn {
|
||||
min-height: calc(23px * var(--ui-font-scale, 1));
|
||||
height: auto;
|
||||
padding: 1px 8px;
|
||||
font-size: var(--fs-sm);
|
||||
font-weight: 500;
|
||||
border-radius: var(--radius-xs);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.account-icon-btn {
|
||||
width: calc(23px * var(--ui-font-scale, 1));
|
||||
height: calc(23px * var(--ui-font-scale, 1));
|
||||
padding: 0;
|
||||
border-radius: var(--radius-xs);
|
||||
}
|
||||
|
||||
.account-pools-stack {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 9px;
|
||||
}
|
||||
|
||||
.account-pool-group {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.account-pool-name {
|
||||
font-size: var(--fs-xs);
|
||||
font-weight: 600;
|
||||
color: var(--text-muted);
|
||||
line-height: 1.25;
|
||||
letter-spacing: 0.01em;
|
||||
}
|
||||
|
||||
.account-pool-meters {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 8px 14px;
|
||||
}
|
||||
|
||||
.account-pool-meters.is-single {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
}
|
||||
|
||||
@media (max-width: 310px) {
|
||||
.account-pool-meters {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
.account-meter-col {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.account-meter-head {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: space-between;
|
||||
gap: 6px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.settings-account-quota {
|
||||
font-size: var(--fs-sm);
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.account-meter-reset {
|
||||
font-size: var(--fs-2xs);
|
||||
color: var(--text-muted);
|
||||
white-space: nowrap;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.account-progress-track {
|
||||
height: 5px;
|
||||
}
|
||||
|
||||
.account-empty-panel {
|
||||
padding: 18px 14px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.account-empty-text {
|
||||
text-align: center;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
@keyframes anim-account-spin {
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.icon-btn.is-spinning .svg-icon {
|
||||
animation: anim-account-spin 0.8s linear infinite;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.icon-btn.is-spinning .svg-icon {
|
||||
animation: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.settings-context-model .select-option-meta {
|
||||
max-width: 62%;
|
||||
text-align: right;
|
||||
|
||||
Reference in New Issue
Block a user