Add Portainer-style container bulk actions and network manager.
Release rolling / release (push) Successful in 8m41s
Release rolling / release (push) Successful in 8m41s
Always show a containers action bar (start/stop/restart/pause/resume/kill/ recreate/remove/prune) driven by row selection via typed bulk RPC. Rebuild the container Networking tab into a join/leave network manager with aliases and optional static IPs, plus a clearer ports table.
This commit is contained in:
+175
@@ -4926,3 +4926,178 @@
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* ─── Portainer-style containers action bar ─── */
|
||||
.containers-action-bar {
|
||||
border-radius: 12px;
|
||||
border: 1px solid var(--border-color);
|
||||
background:
|
||||
linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent),
|
||||
var(--bg-elevated);
|
||||
padding: 8px 10px;
|
||||
transition: border-color 0.15s ease, box-shadow 0.15s ease;
|
||||
}
|
||||
|
||||
.containers-action-bar.has-selection {
|
||||
border-color: rgba(45, 212, 191, 0.35);
|
||||
box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.08);
|
||||
}
|
||||
|
||||
.containers-action-bar-inner {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.containers-action-bar-meta {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
flex-wrap: wrap;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.containers-selected-count {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: 1.6rem;
|
||||
height: 1.6rem;
|
||||
padding: 0 6px;
|
||||
border-radius: 999px;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 750;
|
||||
font-variant-numeric: tabular-nums;
|
||||
color: var(--accent-primary);
|
||||
background: rgba(45, 212, 191, 0.12);
|
||||
border: 1px solid rgba(45, 212, 191, 0.28);
|
||||
}
|
||||
|
||||
.containers-action-hint {
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
|
||||
.containers-action-btns {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.containers-action-btns .btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.containers-action-btns .btn:disabled {
|
||||
opacity: 0.4;
|
||||
}
|
||||
|
||||
.containers-action-sep {
|
||||
width: 1px;
|
||||
height: 22px;
|
||||
background: var(--border-color);
|
||||
margin: 0 2px;
|
||||
}
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.containers-action-btns .btn span {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* ─── Advanced container network manager ─── */
|
||||
.net-mgr {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.net-mgr-header {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
flex-wrap: wrap;
|
||||
padding: 10px 12px;
|
||||
border-radius: 12px;
|
||||
background: var(--bg-elevated);
|
||||
border: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.net-mgr-title {
|
||||
margin: 0 0 4px;
|
||||
font-size: 0.95rem;
|
||||
font-weight: 700;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.net-mgr-sub {
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
.net-mgr-actions {
|
||||
display: flex;
|
||||
gap: 6px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.net-mgr-join-panel {
|
||||
padding: 12px;
|
||||
border-radius: 12px;
|
||||
border: 1px solid rgba(45, 212, 191, 0.28);
|
||||
background: rgba(45, 212, 191, 0.05);
|
||||
}
|
||||
|
||||
.net-mgr-join-panel[hidden] {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.net-mgr-join-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.net-mgr-field {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
margin: 0;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.net-mgr-field > span {
|
||||
font-size: 0.7rem;
|
||||
font-weight: 650;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.04em;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.net-mgr-join-footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 8px;
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.net-mgr-table-card {
|
||||
padding-bottom: 4px;
|
||||
}
|
||||
|
||||
.net-mgr-table td,
|
||||
.net-mgr-table th {
|
||||
vertical-align: middle;
|
||||
font-size: 0.8125rem;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.net-mgr-join-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -299,13 +299,10 @@ export async function disconnectContainerNetwork(containerId, networkId, network
|
||||
force: false,
|
||||
})
|
||||
showAlert('success', 'Disconnected from network')
|
||||
// refresh details if open
|
||||
if (typeof window.showContainerDetails === 'function' && window.currentContainerDetails) {
|
||||
// re-inspect
|
||||
const { sendCommand } = window
|
||||
if (typeof sendCommand === 'function') {
|
||||
sendCommand('inspectContainer', { id: containerId })
|
||||
}
|
||||
if (typeof window.refreshContainerNetworking === 'function') {
|
||||
window.refreshContainerNetworking(containerId)
|
||||
} else if (typeof window.sendCommand === 'function') {
|
||||
window.sendCommand('inspectContainer', { id: containerId })
|
||||
}
|
||||
} catch (err) {
|
||||
presentError(err, 'disconnectNetwork', { showAlert })
|
||||
|
||||
Reference in New Issue
Block a user