Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ and listed with their assets on the
pushed the lane's real changes out within about four hours; its log
line was also the next take's telemetry. The take is no longer
journaled or logged as a request.
- **The dashboard's rows line up**: a service's or container's usage,
pin, state and actions stand in fixed columns, so they line up from row
to row and under the group's usage in its head, whatever the ports and
names; a row without usage keeps the column. The *Infrastructure* page
shows its Compose groups one under the other at full width instead of
in narrow columns that cut the container names short.
- **`devstack up` waits for the containers too** (#66): it waited for the
autostart services only, so a stack of Compose groups alone answered
right away while its images were still built and its containers started.
Expand Down
71 changes: 34 additions & 37 deletions ui/src/components/ContainerRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,46 +95,47 @@ const extraUrls = computed(() => webUrls.value.filter((u) => !props.container!.p
>
<Icon name="pin" :size="14" />
</button>
<StatusPill class="row-pill" v-if="look" :tone="look.tone" :label="look.label" :busy="look.busy" :title="container ? `${container.name}: ${container.state}${container.health ? ` (${container.health})` : ''}` : undefined" />
<StatusPill v-else class="row-pill" tone="neutral" label="Missing" />
<StatusPill class="col-pill" v-if="look" :tone="look.tone" :label="look.label" :busy="look.busy" :title="container ? `${container.name}: ${container.state}${container.health ? ` (${container.health})` : ''}` : undefined" />
<StatusPill v-else class="col-pill" tone="neutral" label="Missing" />
<!-- Someone else's lane (ADR-0040): nothing that would change it. -->
<template v-if="stack.readOnly" />
<button
v-else-if="!running"
type="button"
class="btn btn-ghost btn-sm btn-icon"
:aria-label="`Start container ${service}`"
:title="refuses ?? 'Start container'"
:disabled="busy || stack.stale || !!refuses"
data-testid="action-container-start"
@click="stack.containerAction(group, service, 'start')"
>
<span v-if="busy" class="spinner" /><Icon v-else name="play" />
</button>
<template v-else>
<div v-if="!stack.readOnly" class="col-actions">
<button
v-if="!running"
type="button"
class="btn btn-ghost btn-sm btn-icon"
:aria-label="`Restart container ${service}`"
:title="refuses ?? 'Restart container'"
:aria-label="`Start container ${service}`"
:title="refuses ?? 'Start container'"
:disabled="busy || stack.stale || !!refuses"
data-testid="action-container-restart"
@click="stack.containerAction(group, service, 'restart')"
>
<span v-if="busy" class="spinner" /><Icon v-else name="restart" />
</button>
<button
type="button"
class="btn btn-ghost btn-sm btn-icon btn-stop"
:aria-label="`Stop container ${service}`"
title="Stop container"
:disabled="busy || stack.stale"
data-testid="action-container-stop"
@click="stack.containerAction(group, service, 'stop')"
data-testid="action-container-start"
@click="stack.containerAction(group, service, 'start')"
>
<Icon name="stop" />
<span v-if="busy" class="spinner" /><Icon v-else name="play" />
</button>
</template>
<template v-else>
<button
type="button"
class="btn btn-ghost btn-sm btn-icon"
:aria-label="`Restart container ${service}`"
:title="refuses ?? 'Restart container'"
:disabled="busy || stack.stale || !!refuses"
data-testid="action-container-restart"
@click="stack.containerAction(group, service, 'restart')"
>
<span v-if="busy" class="spinner" /><Icon v-else name="restart" />
</button>
<button
type="button"
class="btn btn-ghost btn-sm btn-icon btn-stop"
:aria-label="`Stop container ${service}`"
title="Stop container"
:disabled="busy || stack.stale"
data-testid="action-container-stop"
@click="stack.containerAction(group, service, 'stop')"
>
<Icon name="stop" />
</button>
</template>
</div>
</li>
</template>

Expand Down Expand Up @@ -219,8 +220,4 @@ const extraUrls = computed(() => webUrls.value.filter((u) => !props.container!.p
.pin.on {
color: var(--accent);
}
.row-pill {
min-width: 88px;
justify-content: center;
}
</style>
4 changes: 4 additions & 0 deletions ui/src/components/RowUsage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,18 @@ const mem = computed(() => (stack.history.get(props.seriesKey) ?? []).map((p) =>
<span class="faint">{{ percent(load.cpu) }}</span>
</span>
</div>
<!-- Its column all the same: the next columns stay where the other rows have them. -->
<div v-else class="row-usage hide-sm" aria-hidden="true" />
</template>

<style scoped>
.row-usage {
display: flex;
align-items: center;
justify-content: flex-end;
gap: 6px;
flex: none;
width: var(--col-usage);
}
.nums {
display: flex;
Expand Down
12 changes: 2 additions & 10 deletions ui/src/components/ServiceRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ function open(e: MouseEvent) {
>
<Icon name="pin" :size="14" />
</button>
<StatusPill class="row-pill" :tone="look.tone" :label="look.label" :busy="look.busy" :title="look.detail ?? `since ${ago(service.since, now)}`" />
<div v-if="!stack.readOnly" class="actions">
<StatusPill class="col-pill" :tone="look.tone" :label="look.label" :busy="look.busy" :title="look.detail ?? `since ${ago(service.since, now)}`" />
<div v-if="!stack.readOnly" class="col-actions">
<button
v-if="isStopped"
type="button"
Expand Down Expand Up @@ -200,10 +200,6 @@ function open(e: MouseEvent) {
color: var(--accent, inherit);
text-decoration: underline;
}
.actions {
display: flex;
gap: 2px;
}
.detail {
padding-left: 38px;
}
Expand Down Expand Up @@ -292,8 +288,4 @@ function open(e: MouseEvent) {
.pin.on {
color: var(--accent);
}
.row-pill {
min-width: 88px;
justify-content: center;
}
</style>
20 changes: 20 additions & 0 deletions ui/src/styles/components.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,26 @@
margin-top: 2px;
}

/* The trailing columns of a member row and of its group's head (overview,
infrastructure): fixed widths, so usage, pin, state and actions line up
from row to row and from card to card, whatever the ports and names. */
:root {
--col-usage: 124px;
--col-pill: 100px;
--col-actions: 60px;
}
.col-pill {
width: var(--col-pill);
flex: none;
justify-content: center;
}
.col-actions {
width: var(--col-actions);
flex: none;
display: flex;
justify-content: flex-end;
gap: 2px;
}
.grid-cards {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
Expand Down
8 changes: 7 additions & 1 deletion ui/src/views/InfraView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ function summary(group: string) {
<span class="grow"><strong>Docker:</strong> {{ stack.usage.docker_error }}</span>
</div>

<div v-if="groups.length" class="grid-cards stale-dim">
<!-- One group under the other, full width: a container row needs the width the overview gives it. -->
<div v-if="groups.length" class="groups stale-dim">
<section v-for="g in groups" :key="g.group" class="card" :data-testid="`infra-${g.group}`">
<header class="card-header">
<Icon name="layers" :size="16" class="muted" />
Expand Down Expand Up @@ -72,6 +73,11 @@ function summary(group: string) {
</template>

<style scoped>
.groups {
display: flex;
flex-direction: column;
gap: var(--space-4);
}
.list {
list-style: none;
margin: 0;
Expand Down
44 changes: 26 additions & 18 deletions ui/src/views/OverviewView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -166,22 +166,24 @@ const starting = computed(() => !!(stack.id && hub.starting[stack.id]));
<span class="count">{{ card.members.length }}</span>
</button>
<RowUsage :series-key="`grp:${card.key}`" :load="groupLoad(card.key)" />
<span class="grow" />
<div v-if="!stack.readOnly && card.key !== '__other' && card.key !== '__pinned' && card.members.some((m) => m.kind === 'service')" class="group-actions" role="group" :aria-label="`Actions for ${card.label}`">
<button
v-for="a in groupActions"
:key="a.action"
type="button"
class="btn btn-ghost btn-sm btn-icon"
:class="{ 'btn-stop': a.action === 'stop' }"
:title="`${a.title} ${card.label}`"
:aria-label="`${a.title} ${card.label}`"
:disabled="!!stack.busy[`grp:${card.key}`] || stack.stale || hubAway"
:data-testid="`group-${a.action}`"
@click="stack.groupAction(card.key, card.label, a.action)"
>
<span v-if="stack.busy[`grp:${card.key}`] === a.action" class="spinner" /><Icon v-else :name="a.icon" />
</button>
<!-- As wide as a row's pin, state and actions: the group's usage stands over its members'. -->
<div class="head-tail">
<div v-if="!stack.readOnly && card.key !== '__other' && card.key !== '__pinned' && card.members.some((m) => m.kind === 'service')" class="group-actions" role="group" :aria-label="`Actions for ${card.label}`">
<button
v-for="a in groupActions"
:key="a.action"
type="button"
class="btn btn-ghost btn-sm btn-icon"
:class="{ 'btn-stop': a.action === 'stop' }"
:title="`${a.title} ${card.label}`"
:aria-label="`${a.title} ${card.label}`"
:disabled="!!stack.busy[`grp:${card.key}`] || stack.stale || hubAway"
:data-testid="`group-${a.action}`"
@click="stack.groupAction(card.key, card.label, a.action)"
>
<span v-if="stack.busy[`grp:${card.key}`] === a.action" class="spinner" /><Icon v-else :name="a.icon" />
</button>
</div>
</div>
</header>
<ul v-show="!folded[card.key]" class="members">
Expand Down Expand Up @@ -217,10 +219,16 @@ const starting = computed(() => !!(stack.id && hub.starting[stack.id]));
</template>

<style scoped>
.head-tail {
flex: none;
width: calc(28px + var(--col-pill) + var(--col-actions) + 20px);
display: flex;
justify-content: flex-end;
}
.group-actions {
display: flex;
gap: 2px;
margin: -4px -8px -4px 0;
margin: -4px 0;
}
.summary {
padding: 18px 20px;
Expand Down Expand Up @@ -400,7 +408,7 @@ const starting = computed(() => !!(stack.id && hub.starting[stack.id]));
}
}
.section-head {
gap: 8px;
gap: 10px;
}
.fold {
display: inline-flex;
Expand Down
Loading