feat(hosts): replace inline add form with modal dialog
The add-host form is now opened via a "+ Add host" button in the page header. The modal closes on Cancel, backdrop click, × button, or automatically after a successful creation. Adds modal CSS with backdrop blur and entry animation, .btn-primary / .btn-secondary shared button styles, and a .page-header flex layout reusable across list pages. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -859,35 +859,142 @@ td.col-actions {
|
||||
}
|
||||
|
||||
/* ============================================================
|
||||
HOSTS PAGE
|
||||
MODAL
|
||||
============================================================ */
|
||||
|
||||
.hosts-page h1 {
|
||||
margin-bottom: var(--size-lg);
|
||||
.modal-backdrop {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
background: rgba(0, 0, 0, 0.45);
|
||||
backdrop-filter: blur(3px);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 200;
|
||||
animation: backdrop-in var(--transition-base) both;
|
||||
}
|
||||
|
||||
.hosts-page .add-form {
|
||||
@keyframes backdrop-in {
|
||||
from { opacity: 0; }
|
||||
to { opacity: 1; }
|
||||
}
|
||||
|
||||
.modal {
|
||||
background: var(--bg-surface);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-lg);
|
||||
box-shadow: var(--shadow-sm);
|
||||
padding: var(--size-lg);
|
||||
margin-bottom: var(--size-md);
|
||||
box-shadow: var(--shadow-lg);
|
||||
padding: var(--size-lg) var(--size-xl);
|
||||
width: 90%;
|
||||
max-width: 440px;
|
||||
animation: modal-in var(--transition-base) both;
|
||||
}
|
||||
|
||||
.hosts-page .add-form h2 {
|
||||
margin-bottom: var(--size-md);
|
||||
@keyframes modal-in {
|
||||
from { opacity: 0; transform: translateY(-12px) scale(0.97); }
|
||||
to { opacity: 1; transform: translateY(0) scale(1); }
|
||||
}
|
||||
|
||||
.add-form__fields {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
|
||||
.modal__header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: var(--size-lg);
|
||||
}
|
||||
|
||||
.modal__header h2 {
|
||||
margin: 0;
|
||||
font-size: var(--font-lg);
|
||||
}
|
||||
|
||||
.modal__close {
|
||||
background: none;
|
||||
border: none;
|
||||
font-size: 1.4rem;
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
color: var(--text-secondary);
|
||||
padding: 2px 6px;
|
||||
border-radius: var(--radius-sm);
|
||||
transition: color var(--transition-fast), background var(--transition-fast);
|
||||
}
|
||||
|
||||
.modal__close:hover {
|
||||
color: var(--text);
|
||||
background: var(--bg-hover);
|
||||
}
|
||||
|
||||
/* Form fields inside modal — single column stack */
|
||||
.modal .add-form__fields {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--size-md);
|
||||
align-items: end;
|
||||
}
|
||||
|
||||
.add-form__fields button[type="submit"] {
|
||||
align-self: end;
|
||||
.modal .add-form__fields label {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--size-xs);
|
||||
font-size: var(--font-sm);
|
||||
font-weight: 500;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
/* Cancel / Submit button row */
|
||||
.modal__actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: var(--size-sm);
|
||||
margin-top: var(--size-lg);
|
||||
}
|
||||
|
||||
.btn-secondary {
|
||||
background: var(--bg-hover);
|
||||
color: var(--text);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-sm);
|
||||
padding: 7px var(--size-md);
|
||||
font-size: var(--font-sm);
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: background var(--transition-fast);
|
||||
}
|
||||
|
||||
.btn-secondary:hover {
|
||||
background: var(--bg-surface2);
|
||||
}
|
||||
|
||||
/* ============================================================
|
||||
HOSTS PAGE
|
||||
============================================================ */
|
||||
|
||||
/* Header row: title on the left, "Add host" button on the right */
|
||||
.page-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: var(--size-lg);
|
||||
}
|
||||
|
||||
.page-header h1 {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background: var(--accent);
|
||||
color: var(--text-on-accent);
|
||||
border: none;
|
||||
border-radius: var(--radius-sm);
|
||||
padding: 8px var(--size-md);
|
||||
font-size: var(--font-sm);
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: background var(--transition-fast);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.btn-primary:hover {
|
||||
background: var(--accent-hover);
|
||||
}
|
||||
|
||||
/* Delete button inside hosts table */
|
||||
|
||||
Reference in New Issue
Block a user