Skip to content

Commit 9f0a999

Browse files
committed
fix(web): name machines by address in folded task and host summaries
1 parent e5d35a8 commit 9f0a999

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

‎apps/web/src/components/settings/DeviceHostsSettings.tsx‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ function DeviceHostList({
293293
const check = hostChecks?.[member.environmentId];
294294
const summary = state?.hosts.find((value) => value.id === member.host.id);
295295
const label = environmentLabels.get(member.environmentId)?.primary ?? member.label;
296+
const address = environmentLabels.get(member.environmentId)?.secondary;
296297
const error =
297298
check?.status === "failed"
298299
? check.error
@@ -304,7 +305,8 @@ function DeviceHostList({
304305
return {
305306
...member,
306307
label,
307-
address: environmentLabels.get(member.environmentId)?.secondary,
308+
address,
309+
name: [label, address].filter(Boolean).join(" · "),
308310
state,
309311
status,
310312
check,
@@ -381,7 +383,7 @@ function DeviceHostList({
381383
<div className="space-y-1">
382384
{failed.map((result) => (
383385
<p key={result.environmentId}>
384-
{result.label}: {result.error || "Connection failed"}
386+
{result.name}: {result.error || "Connection failed"}
385387
</p>
386388
))}
387389
</div>
@@ -446,7 +448,7 @@ function DeviceHostList({
446448
render={<InlineButton tone="muted" />}
447449
>
448450
<span className="line-clamp-1 break-all text-left">
449-
{summarizeLabels(results.map((result) => result.label))}
451+
{summarizeLabels(results.map((result) => result.name))}
450452
</span>
451453
<ChevronDownIcon className="size-3 shrink-0" />
452454
</CollapsibleTrigger>

‎apps/web/src/components/settings/ScheduledTasksSettings.tsx‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ import { readEnvironmentScope } from "~/state/session";
6868
import { useSettingsScope } from "./SettingsScopeContext";
6969
import { EnvironmentRow, environmentTransportLabel } from "./EnvironmentRow";
7070
import { SettingsGroup } from "./SettingsGroup";
71-
import { settingsScopeEnvironmentLabels } from "./settingsScopeAxis";
71+
import { settingsScopeEnvironmentLabel, settingsScopeEnvironmentLabels } from "./settingsScopeAxis";
7272
import {
7373
WEBHOOK_SIGNATURE_DEFAULTS,
7474
matchesScheduledTaskScope,
@@ -390,16 +390,17 @@ function ScheduledTaskEnvironmentList({
390390
"No tasks on": [],
391391
};
392392
for (const { environment, connected, tasks, error } of states) {
393+
const label = settingsScopeEnvironmentLabel(environment, environments);
393394
if (!connected) {
394395
summaries["Not connected:"]!.push(
395-
`${environment.label} (${connectionStatusTitle(environment.connection)})`,
396+
`${label} (${connectionStatusTitle(environment.connection)})`,
396397
);
397398
} else if (error !== null) {
398-
summaries["Could not load scheduled tasks:"]!.push(`${environment.label}: ${error}`);
399+
summaries["Could not load scheduled tasks:"]!.push(`${label}: ${error}`);
399400
} else if (!tasks) {
400-
summaries["Loading scheduled tasks on"]!.push(environment.label);
401+
summaries["Loading scheduled tasks on"]!.push(label);
401402
} else if (tasks.length === 0 && populated.length > 0) {
402-
summaries["No tasks on"]!.push(environment.label);
403+
summaries["No tasks on"]!.push(label);
403404
}
404405
}
405406

0 commit comments

Comments
 (0)