feat(electron): added key managment ui

This commit is contained in:
2025-08-11 11:26:09 -04:00
parent d7d7615376
commit 268e4fbeae
28 changed files with 2525 additions and 247 deletions

View File

@@ -903,6 +903,711 @@ body.dark-mode .opat-table-container ::-webkit-scrollbar-thumb:hover {
background: #475569;
}
/* ===== KEY MANAGEMENT STYLING ===== */
/* Key Management Views Container */
#keys-view {
display: flex;
flex-direction: column;
height: 100%;
overflow: hidden;
background: var(--background-color);
}
/* Individual Key Management Views */
.key-management-view {
flex: 1;
overflow-y: auto;
padding: 2rem;
background: var(--background-color);
}
/* Key Management Headers */
.keys-header,
.generate-key-header,
.add-key-header,
.remotes-header {
margin-bottom: 2rem;
padding-bottom: 1rem;
border-bottom: 1px solid var(--border-color);
display: flex;
justify-content: space-between;
align-items: flex-end;
flex-wrap: wrap;
gap: 1rem;
}
.keys-header .keys-actions {
display: flex;
gap: 0.75rem;
align-items: center;
}
.keys-header h3,
.generate-key-header h3,
.add-key-header h3,
.remotes-header h3 {
color: var(--text-color);
font-size: 1.8rem;
font-weight: 600;
margin: 0 0 0.5rem 0;
}
.keys-header p,
.generate-key-header p,
.add-key-header p,
.remotes-header p {
color: var(--text-light);
font-size: 1rem;
margin: 0;
line-height: 1.5;
}
/* Form Styling */
.generate-key-form,
.add-key-form {
background: white;
border-radius: 12px;
padding: 2rem;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
border: 1px solid var(--border-color);
margin-bottom: 2rem;
}
.form-group {
margin-bottom: 1.5rem;
}
.form-group label {
display: block;
font-weight: 600;
color: var(--text-color);
margin-bottom: 0.5rem;
font-size: 0.95rem;
}
.form-group input,
.form-group select {
width: 100%;
padding: 0.75rem 1rem;
border: 1px solid var(--border-color);
border-radius: 8px;
font-size: 1rem;
background: white;
color: var(--text-color);
transition: all 0.2s ease;
}
.form-group input:focus,
.form-group select:focus {
outline: none;
border-color: var(--primary-color);
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.form-group small {
display: block;
color: var(--text-light);
font-size: 0.85rem;
margin-top: 0.25rem;
}
.form-actions {
margin-top: 2rem;
padding-top: 1rem;
border-top: 1px solid var(--border-color);
}
.form-row {
display: grid;
grid-template-columns: 1fr 2fr auto;
gap: 1rem;
align-items: end;
margin-bottom: 1.5rem;
}
/* Action Buttons */
.action-button {
padding: 0.75rem 1.5rem;
border: none;
border-radius: 8px;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
transition: all 0.2s ease;
display: inline-flex;
align-items: center;
gap: 0.5rem;
}
.action-button.primary {
background: var(--primary-color);
color: white;
}
.action-button.primary:hover {
background: var(--secondary-color);
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}
.action-button.secondary {
background: white;
color: var(--primary-color);
border: 1px solid var(--primary-color);
}
.action-button.secondary:hover {
background: var(--primary-color);
color: white;
}
.action-button.danger {
background: #ef4444;
color: white;
}
.action-button.danger:hover {
background: #dc2626;
}
/* Notice Banners */
.security-notice,
.info-notice {
margin-top: 2rem;
}
.warning-banner,
.info-banner {
display: flex;
align-items: flex-start;
gap: 1rem;
padding: 1rem 1.25rem;
border-radius: 8px;
border-left: 4px solid;
}
.warning-banner {
background: #fef3c7;
border-left-color: #f59e0b;
}
.info-banner {
background: #dbeafe;
border-left-color: var(--primary-color);
}
.warning-icon,
.info-icon {
font-size: 1.2rem;
flex-shrink: 0;
margin-top: 0.1rem;
}
.warning-text,
.info-text {
flex: 1;
}
.warning-text strong,
.info-text strong {
color: #92400e;
font-weight: 600;
}
.info-text strong {
color: #1e40af;
}
/* Keys List Container */
#keys-list-container {
background: white;
border-radius: 12px;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
border: 1px solid var(--border-color);
overflow: hidden;
}
/* Key Source Sections */
.key-source-section {
border-bottom: 1px solid var(--border-color);
}
.key-source-section:last-child {
border-bottom: none;
}
.source-header {
background: #f8fafc;
padding: 1rem 1.5rem;
border-bottom: 1px solid var(--border-color);
display: flex;
justify-content: space-between;
align-items: center;
}
.source-header h4 {
margin: 0;
color: var(--text-color);
font-size: 1.1rem;
font-weight: 600;
}
.key-count {
background: var(--primary-color);
color: white;
padding: 0.25rem 0.75rem;
border-radius: 12px;
font-size: 0.8rem;
font-weight: 500;
}
.keys-table-wrapper {
overflow-x: auto;
}
.keys-table {
width: 100%;
}
.keys-table table {
width: 100%;
border-collapse: collapse;
}
.keys-table th,
.keys-table td {
padding: 1rem 1.5rem;
text-align: left;
border-bottom: 1px solid var(--border-color);
}
.keys-table th {
background: #f8fafc;
font-weight: 600;
color: var(--text-color);
font-size: 0.9rem;
text-transform: uppercase;
letter-spacing: 0.05em;
}
.keys-table td {
color: var(--text-color);
font-size: 0.95rem;
}
.keys-table tr:last-child td {
border-bottom: none;
}
.keys-table tr:hover {
background: #f8fafc;
}
.key-fingerprint {
font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
font-size: 0.85rem;
color: var(--text-light);
background: #f1f5f9;
padding: 0.25rem 0.5rem;
border-radius: 4px;
}
.key-actions {
display: flex;
gap: 0.5rem;
justify-content: flex-end;
}
.btn {
padding: 0.5rem 1rem;
border: none;
border-radius: 6px;
font-size: 0.85rem;
font-weight: 500;
cursor: pointer;
transition: all 0.2s ease;
}
.btn-small {
padding: 0.375rem 0.75rem;
font-size: 0.8rem;
}
.btn-danger {
background: #ef4444;
color: white;
}
.btn-danger:hover {
background: #dc2626;
transform: translateY(-1px);
}
.btn-primary {
background: var(--primary-color);
color: white;
}
.btn-primary:hover {
background: var(--secondary-color);
transform: translateY(-1px);
}
/* Remote Sources Styling */
.add-remote-form {
background: white;
border-radius: 12px;
padding: 2rem;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
border: 1px solid var(--border-color);
margin-bottom: 2rem;
}
.add-remote-form h4 {
color: var(--text-color);
font-size: 1.2rem;
font-weight: 600;
margin: 0 0 1.5rem 0;
}
#remotes-list-container {
background: white;
border-radius: 12px;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
border: 1px solid var(--border-color);
overflow: hidden;
}
.remotes-table {
width: 100%;
border-collapse: collapse;
}
.remotes-table th,
.remotes-table td {
padding: 1rem;
text-align: left;
border-bottom: 1px solid var(--border-color);
}
.remotes-table th {
background: #f8fafc;
font-weight: 600;
color: var(--text-color);
font-size: 0.9rem;
text-transform: uppercase;
letter-spacing: 0.05em;
}
.remotes-table tr:hover {
background: #f8fafc;
}
/* Empty States */
.empty-state {
text-align: center;
padding: 3rem 2rem;
color: var(--text-light);
}
.empty-icon {
font-size: 3rem;
margin-bottom: 1rem;
opacity: 0.5;
}
.empty-state h3 {
color: var(--text-color);
font-size: 1.3rem;
font-weight: 600;
margin: 0 0 0.5rem 0;
}
.empty-state p {
color: var(--text-light);
font-size: 1rem;
margin: 0;
line-height: 1.5;
}
/* Dark Mode Support */
body.dark-mode .key-management-view {
background: var(--bg-color);
}
body.dark-mode .generate-key-form,
body.dark-mode .add-key-form,
body.dark-mode .add-remote-form,
body.dark-mode #keys-list-container,
body.dark-mode #remotes-list-container {
background: #1e293b;
border-color: #334155;
}
body.dark-mode .source-header {
background: #0f172a;
}
body.dark-mode .keys-table th,
body.dark-mode .remotes-table th {
background: #0f172a;
color: #f1f5f9;
}
body.dark-mode .keys-table tr:hover,
body.dark-mode .remotes-table tr:hover {
background: #0f172a;
}
body.dark-mode .form-group input,
body.dark-mode .form-group select {
background: #0f172a;
border-color: #334155;
color: #f1f5f9;
}
body.dark-mode .form-group input:focus,
body.dark-mode .form-group select:focus {
border-color: var(--primary-color);
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}
body.dark-mode .key-fingerprint {
background: #0f172a;
color: #94a3b8;
}
body.dark-mode .warning-banner {
background: rgba(245, 158, 11, 0.1);
border-left-color: #f59e0b;
}
body.dark-mode .info-banner {
background: rgba(59, 130, 246, 0.1);
border-left-color: var(--primary-color);
}
body.dark-mode .warning-text strong {
color: #fbbf24;
}
body.dark-mode .info-text strong {
color: #60a5fa;
}
/* Modern Key Add Success Modal */
.key-add-success-modern {
max-width: 500px;
margin: 0 auto;
text-align: center;
}
.success-header {
margin-bottom: 2rem;
}
.success-icon {
margin: 0 auto 1rem auto;
width: 48px;
height: 48px;
}
.success-header h3 {
color: var(--text-color);
font-size: 1.5rem;
font-weight: 600;
margin: 0 0 0.5rem 0;
}
.success-subtitle {
color: var(--text-light);
font-size: 1rem;
margin: 0;
line-height: 1.5;
}
.key-details-card {
background: #f8fafc;
border: 1px solid var(--border-color);
border-radius: 12px;
padding: 1.5rem;
margin: 1.5rem 0;
text-align: left;
}
.detail-row {
display: flex;
justify-content: space-between;
align-items: flex-start;
gap: 1rem;
margin-bottom: 1rem;
}
.detail-row:last-child {
margin-bottom: 0;
}
.detail-label {
display: flex;
align-items: center;
gap: 0.5rem;
color: var(--text-light);
font-size: 0.9rem;
font-weight: 500;
min-width: 100px;
flex-shrink: 0;
}
.detail-label svg {
color: var(--text-light);
}
.detail-value {
flex: 1;
color: var(--text-color);
font-size: 0.95rem;
word-break: break-all;
}
.fingerprint-value {
display: flex;
align-items: center;
gap: 0.75rem;
flex-wrap: wrap;
}
.fingerprint-value code {
font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
font-size: 0.8rem;
background: #e2e8f0;
color: #475569;
padding: 0.25rem 0.5rem;
border-radius: 4px;
flex: 1;
min-width: 0;
}
.copy-btn {
background: var(--primary-color);
color: white;
border: none;
padding: 0.25rem 0.75rem;
border-radius: 6px;
font-size: 0.8rem;
font-weight: 500;
cursor: pointer;
transition: all 0.2s ease;
flex-shrink: 0;
}
.copy-btn:hover {
background: var(--secondary-color);
transform: translateY(-1px);
}
.success-footer {
margin-top: 1.5rem;
}
.info-banner {
display: flex;
align-items: center;
gap: 0.75rem;
background: #dbeafe;
border: 1px solid #93c5fd;
border-radius: 8px;
padding: 0.75rem 1rem;
color: #1e40af;
font-size: 0.9rem;
text-align: left;
}
.info-banner svg {
color: #3b82f6;
flex-shrink: 0;
}
/* Dark Mode Support for Modern Modal */
body.dark-mode .key-details-card {
background: #1e293b;
border-color: #334155;
}
body.dark-mode .fingerprint-value code {
background: #0f172a;
color: #94a3b8;
}
body.dark-mode .info-banner {
background: rgba(59, 130, 246, 0.1);
border-color: rgba(59, 130, 246, 0.3);
color: #60a5fa;
}
body.dark-mode .info-banner svg {
color: #60a5fa;
}
/* Responsive Design */
@media (max-width: 1024px) {
.key-management-view {
padding: 1.5rem;
}
.form-row {
grid-template-columns: 1fr;
gap: 1rem;
}
}
@media (max-width: 768px) {
.key-management-view {
padding: 1rem;
}
.generate-key-form,
.add-key-form,
.add-remote-form {
padding: 1.5rem;
}
.keys-table,
.remotes-table {
font-size: 0.9rem;
}
.keys-table th,
.keys-table td,
.remotes-table th,
.remotes-table td {
padding: 0.75rem;
}
.key-actions {
flex-direction: column;
gap: 0.25rem;
}
.key-add-success-modern {
max-width: 100%;
}
.fingerprint-value {
flex-direction: column;
align-items: stretch;
}
.detail-row {
flex-direction: column;
gap: 0.5rem;
}
.detail-label {
min-width: auto;
}
}
#welcome-screen h1 {
font-size: 2rem;
margin-bottom: 0.5rem;