1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-03 17:36:05 +00:00
webvirtcloud/static/css/webvirtcloud.css
catborise d5cc696d73 feat(instances): the VM page shows the VM's screen
A running or paused VM with a VNC or SPICE console shows its screen
beside the summary (virDomainScreenshot, PNG), read again every 10 s
while the page is in view; clicking it opens the console. It is for
those who may open the console (the screen shows what the console
does) and is left out while there is none to show, also on a host whose
libvirt gives PPM. The VM list does not read screens: one a VM would
cost too much.
2026-11-26 14:21:36 +03:00

401 lines
13 KiB
CSS

/*!
* WebVirtCloud (http://github.com/retspen/webvirtcloud)
* Code licensed under the Apache License v2.0.
* For details, see http://www.apache.org/licenses/LICENSE-2.0.
*/
/* pages stop at Bootstrap's lg container width (960px): its xl and xxl
widths (1140px, 1320px) leave the panel's forms and lists too wide */
@media (min-width: 1200px) {
.container {
max-width: 960px;
}
}
/* a count or label badge: text-bg-light keeps a light background with the
theme's light-text colour, white on grey in Darkly, Superhero and Vapor;
the page's own colours read in every theme */
.badge.text-bg-light.border {
color: var(--bs-body-color) !important;
background-color: var(--bs-body-bg) !important;
}
/* an outlined secondary button (Cancel, a row's menu): Bootstrap draws it
in the theme's secondary colour, near the page background in Cyborg,
Darkly, Slate, Solar, Superhero and Vapor; the page's own text colours
read in every theme, its hover stays the theme's */
.btn-outline-secondary {
color: var(--bs-body-color);
border-color: var(--bs-secondary-color);
}
#editor {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
/* Tom Select's control keeps the text colour of the select it replaces:
its own stylesheet fixes one, unreadable on some Bootswatch themes */
.ts-wrapper.form-select .ts-control,
.ts-wrapper.form-select .ts-control input {
color: inherit;
}
.xmlheight {
height: 364px;
}
.ace_editor {
height: 350px;
}
/* the VM's XML editor: as tall as most of the window, framed like a form field */
.xml-editor .ace_editor {
height: max(350px, 65vh);
border: var(--bs-border-width) solid var(--bs-border-color);
border-radius: var(--bs-border-radius);
}
/* the review dialog's diff: added and removed lines on a tint, a hunk starts with its line number */
.xml-diff > div {
padding: 0 .5rem;
}
.xml-diff .diff-add {
background-color: rgba(var(--bs-success-rgb), .12);
}
.xml-diff .diff-del {
background-color: rgba(var(--bs-danger-rgb), .12);
}
.xml-diff .diff-hunk:not(:first-child) {
margin-top: .75rem;
}
/* headers of sortable tables (static/js/sort_tables.js): the sorted one shows
its direction, up for ascending */
th[role=columnheader]:not([data-sort-method="none"]) {
cursor: pointer;
user-select: none;
}
th[aria-sort]:not([data-sort-method="none"])::after {
content: "";
display: inline-block;
margin-left: 0.4em;
vertical-align: middle;
border: 0.3em solid transparent;
border-top-color: currentColor;
}
th[aria-sort="ascending"]:not([data-sort-method="none"])::after {
border-top-color: transparent;
border-bottom-color: currentColor;
}
/* a phone keeps Bootstrap's own cell padding: some themes (Zephyr) double
it, and a list's last column no longer fits the screen */
@media (max-width: 575.98px) {
.table > :not(caption) > * > * {
padding-left: 0.5rem;
padding-right: 0.5rem;
}
}
/* a choice shown as a card around its radio button (the VM's disk source,
a new pool's type): the chosen card by its border only, as the
Bootswatch dark themes keep light "subtle" backgrounds */
.source-option {
cursor: pointer;
}
.source-option:has(input:checked) {
border-color: var(--bs-primary) !important;
box-shadow: inset 0 0 0 1px var(--bs-primary);
}
.source-option:has(input:focus-visible) {
outline: 2px solid var(--bs-primary);
outline-offset: 2px;
}
.host-collapsed tr[host] {
display: none;
}
/* a live chart (static/js/charts.js) fills the width of its card at this height */
.chart {
height: 160px;
}
/* the host's sections (computes/host_nav.html) on one line in every theme,
scrolled sideways on a phone:
one font size, and the divider spaced alike on its two sides (Zephyr
doubles the space after it) */
.host-nav .breadcrumb {
--bs-breadcrumb-item-padding-x: .5rem;
/* room for a link's focus outline inside the scrolling row, in a theme without padding */
padding: max(.25rem, var(--bs-breadcrumb-padding-y, 0px)) max(.25rem, var(--bs-breadcrumb-padding-x, 0px));
font-size: .875rem;
}
.host-nav .breadcrumb-item {
flex-shrink: 0;
}
.host-nav .breadcrumb-item + .breadcrumb-item::before {
padding-right: var(--bs-breadcrumb-item-padding-x);
}
/* the power tab's states: the current one filled, the others a ring */
.power-dot {
width: .8rem;
height: .8rem;
border-radius: 50%;
flex-shrink: 0;
border: 2px solid var(--bs-border-color);
}
.power-dot.bg-success, .power-dot.bg-warning, .power-dot.bg-secondary { border-color: transparent; }
/* the access tab's two login buttons line up */
.access-act { min-width: 9rem; }
/* the options tab: one row per device the guest sees, its name, its control and a note */
.option-row {
display: flex;
flex-wrap: wrap;
align-items: center;
column-gap: 1rem;
row-gap: .25rem;
padding: .6rem 0;
}
.option-name { flex: 0 0 8rem; }
/* the resize tab: one cell per vCPU up to the maximum, filled when on; memory now within its maximum */
.vcpu-cell {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 2.25rem;
height: 2.25rem;
padding: 0 .4rem;
border-radius: var(--bs-border-radius);
border: 2px solid var(--bs-primary);
background: var(--bs-body-bg);
color: var(--bs-primary);
font-size: .875rem;
font-weight: 600;
}
.vcpu-cell.on { background: var(--bs-primary); color: #fff; }
button.vcpu-cell:not(:disabled):hover { box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .25); }
button.vcpu-cell:disabled { opacity: .65; }
.memory-bar {
width: min(18rem, 100%);
height: .9rem;
border: 2px solid var(--bs-primary);
border-radius: var(--bs-border-radius);
overflow: hidden;
}
.memory-bar-now { height: 100%; background: var(--bs-primary); }
.resize-act { min-width: 9rem; }
/* the boot order: the devices the VM tries in turn, numbered and joined by a line */
.boot-chain { counter-reset: boot; }
.boot-node { position: relative; padding: .5rem 0; }
.boot-chain > .boot-node { counter-increment: boot; }
.boot-step {
display: inline-flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
width: 1.75rem;
height: 1.75rem;
border-radius: 50%;
border: 2px solid var(--bs-primary);
color: var(--bs-primary);
background: var(--bs-body-bg);
font-size: .8rem;
font-weight: 600;
position: relative;
z-index: 1;
}
.boot-chain .boot-step::before { content: counter(boot); }
.boot-chain > .boot-node:not(:last-child)::after {
content: "";
position: absolute;
left: calc(.875rem - 1px);
top: calc(50% + .875rem);
height: calc(100% - 1.75rem);
border-left: 2px solid var(--bs-border-color);
}
.boot-spare .boot-step { visibility: hidden; }
/* on a narrow screen a device's buttons go below its name, not over it */
.boot-text { min-width: 10rem; flex-basis: 10rem; }
.boot-chain .boot-spare-only, .boot-spare .boot-chain-only { display: none !important; }
/* the snapshots tab: the VM's history as a line, newest first; now on top, the snapshot the VM goes on from filled */
.snap-line { position: relative; padding-left: 1.75rem; }
.snap-line::before {
content: "";
position: absolute;
left: calc(.5rem - 1px);
top: .75rem;
bottom: .75rem;
border-left: 2px solid var(--bs-border-color);
}
.snap-node { position: relative; padding: .5rem 0; }
.snap-dot {
position: absolute;
left: -1.75rem;
top: .75rem;
width: 1rem;
height: 1rem;
border-radius: 50%;
border: 2px solid var(--bs-primary);
background: var(--bs-body-bg);
}
.snap-dot.bg-success, .snap-dot.bg-warning, .snap-dot.bg-secondary { border-color: transparent; }
.snap-dot.snap-current { background: var(--bs-primary); }
.snap-dot.snap-none { border-color: var(--bs-border-color); }
/* the network tab: a NIC as a cable to its source, solid while its link is up, dashed while down */
.nic-wire {
position: relative;
flex: 0 0 3.5rem;
margin-inline: .25rem;
color: var(--bs-secondary-color);
border-top: 2px dashed currentColor;
}
.nic-wire::before, .nic-wire::after {
content: "";
position: absolute;
top: -4px;
width: 6px;
height: 6px;
border-radius: 50%;
background: currentColor;
}
.nic-wire::before { left: -3px; }
.nic-wire::after { right: -3px; }
.nic-wire.nic-up { color: var(--bs-success); border-top-style: solid; }
/* a job state badge starts with a capital, as the VM state badges; the label stays
lowercase for sentences ("… is running on this resource"), and the page's lang
gives Turkish its dotted İ */
.job-state::first-letter {
text-transform: uppercase;
}
/* a log message keeps a readable width when its table scrolls on a phone */
.log-message {
min-width: 16rem;
}
/* the VM's new console password: only with "Set a new one" */
fieldset:not(:has(input[value="set"]:checked)) > .console-new-password {
display: none;
}
/* the account forms (user, group, password): each section says what it is
about on the left, its fields on the right, with a rule between sections */
.form-section {
border-top: 1px solid var(--bs-border-color);
padding: 1.5rem 0;
}
.form-section:first-of-type {
border-top: 0;
padding-top: .5rem;
}
.form-section-fields {
max-width: 52rem;
}
/* a choice drawn as a card (the user's role, how a user signs in) */
.form-choice:has(input:checked) {
border-color: var(--bs-primary) !important;
box-shadow: inset 0 0 0 1px var(--bs-primary);
}
/* a user's password fields: only while With a password is chosen */
.form-section-fields:has(input[name="usable_password"][value="false"]:checked) > .with-password {
display: none;
}
/* a list's tag pills and a row's tag badges: a long tag name breaks within, not beyond a phone's width */
#tag-pills .nav-link,
.tag-badge {
max-width: 100%;
overflow-wrap: anywhere;
text-align: start;
}
.tag-badge {
white-space: normal;
}
/* the tags "…" shows in a table's cell: below the others, within the cell's width as it is
(no width of their own), so the table's columns do not move */
td .tag-more {
display: block;
width: 0;
min-width: 100%;
}
/* the tag pills behind "…", once shown: in the row of the others */
.tag-pills-more:not([hidden]) {
display: contents;
}
/* a VM's or host's tags: smaller than other badges, so a row with several stays narrow */
.tag-badge {
font-size: 0.65rem;
font-weight: 500;
}
.tag-badge svg {
width: 0.85em;
height: 0.85em;
}
/* "Skip to content" brings #main up below the sticky navbar, not behind it */
#main {
scroll-margin-top: 5rem;
}
/* a backup schedule's runs, a mark a day: filled backed up, crossed failed, hollow skipped, half running */
.run-days { display: inline-flex; gap: 2px; }
.run-mark {
display: inline-flex;
align-items: center;
justify-content: center;
width: .75rem;
height: .75rem;
border: 2px solid transparent;
border-radius: 3px;
vertical-align: middle;
text-decoration: none;
}
.run-grid .run-mark { width: 1.125rem; height: 1.125rem; }
.run-grid td, .run-grid th { padding: 2px; }
.run-grid-vm { max-width: 14rem; padding-right: .75rem !important; position: sticky; left: 0; background: var(--bs-body-bg); }
/* the grid scrolls on a phone starting at its newest day, at the right */
.run-grid-scroll { overflow-x: auto; direction: rtl; width: fit-content; max-width: 100%; }
.run-grid-scroll > table { direction: ltr; }
.run-succeeded { background: var(--bs-success); }
.run-failed { background: var(--bs-danger); }
.run-failed::after { content: "\00d7"; color: #fff; font-size: .75rem; font-weight: 700; line-height: 1; }
.run-days .run-failed::after { font-size: .625rem; }
.run-skipped { border-color: var(--bs-secondary-color); }
.run-running { border-color: var(--bs-info); background: linear-gradient(90deg, var(--bs-info) 50%, transparent 50%); }
.run-none { background: var(--bs-secondary-bg); }
/* high contrast themes would drop the marks' colours, which carry their meaning */
@media (forced-colors: active) { .run-mark { forced-color-adjust: none; } }
/* the VM page's screen thumbnail (instance.html): the console's picture, a button that opens it */
.vm-screen {
display: block;
padding: 0;
width: 100%;
max-width: 16rem;
aspect-ratio: 4 / 3;
overflow: hidden;
background: #000;
border: 1px solid var(--bs-border-color);
border-radius: var(--bs-border-radius);
}
.vm-screen[hidden] { display: none; }
.vm-screen img { display: block; width: 100%; height: 100%; object-fit: contain; }
.vm-screen:focus-visible { outline: 0; box-shadow: var(--bs-focus-ring-x, 0) var(--bs-focus-ring-y, 0) 0 var(--bs-focus-ring-width) var(--bs-focus-ring-color); }
@media (min-width: 768px) { .vm-screen { flex: none; width: 13rem; align-self: flex-start; } }