Skip to content

Commit 8338af3

Browse files
committed
make fmt lint
1 parent 999469f commit 8338af3

File tree

4 files changed

+49
-47
lines changed

4 files changed

+49
-47
lines changed

coderd/workspaceagents_test.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -1173,10 +1173,12 @@ func TestWorkspaceAgentContainers(t *testing.T) {
11731173
Labels: testLabels,
11741174
Running: true,
11751175
Status: "running",
1176-
Ports: []codersdk.WorkspaceAgentListeningPort{
1176+
Ports: []codersdk.WorkspaceAgentDevcontainerPort{
11771177
{
1178-
Network: "tcp",
1179-
Port: 80,
1178+
Network: "tcp",
1179+
Port: 80,
1180+
HostIP: "0.0.0.0",
1181+
HostPort: 8000,
11801182
},
11811183
},
11821184
Volumes: map[string]string{

site/src/modules/resources/AgentDevcontainerCard.stories.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import type { Meta, StoryObj } from "@storybook/react";
2-
import { AgentDevcontainerCard } from "./AgentDevcontainerCard";
32
import {
43
MockWorkspace,
54
MockWorkspaceAgentDevcontainer,
65
MockWorkspaceAgentDevcontainerPorts,
76
} from "testHelpers/entities";
7+
import { AgentDevcontainerCard } from "./AgentDevcontainerCard";
88

99
const meta: Meta<typeof AgentDevcontainerCard> = {
1010
title: "modules/resources/AgentDevcontainerCard",

site/src/modules/resources/AgentDevcontainerCard.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Link from "@mui/material/Link";
2+
import Tooltip, { type TooltipProps } from "@mui/material/Tooltip";
23
import type {
34
Workspace,
45
WorkspaceAgentDevcontainer,
@@ -10,7 +11,6 @@ import { portForwardURL } from "utils/portForward";
1011
import { AgentButton } from "./AgentButton";
1112
import { AgentDevcontainerSSHButton } from "./SSHButton/SSHButton";
1213
import { TerminalLink } from "./TerminalLink/TerminalLink";
13-
import Tooltip, { type TooltipProps } from "@mui/material/Tooltip";
1414

1515
type AgentDevcontainerCardProps = {
1616
container: WorkspaceAgentDevcontainer;
@@ -52,13 +52,13 @@ export const AgentDevcontainerCard: FC<AgentDevcontainerCardProps> = ({
5252
/>
5353
{wildcardHostname !== "" &&
5454
container.ports.map((port) => {
55-
let portLabel = `${port.port}/${port.network.toUpperCase()}`;
56-
let hasHostBind =
55+
const portLabel = `${port.port}/${port.network.toUpperCase()}`;
56+
const hasHostBind =
5757
port.host_port !== undefined &&
5858
port.host_port !== null &&
5959
port.host_ip !== undefined &&
6060
port.host_ip !== null;
61-
let helperText = hasHostBind
61+
const helperText = hasHostBind
6262
? `${port.host_ip}:${port.host_port}`
6363
: "Not bound to host";
6464
return (

site/src/testHelpers/entities.ts

+39-39
Original file line numberDiff line numberDiff line change
@@ -4273,45 +4273,45 @@ function mockTwoDaysAgo() {
42734273
return date.toISOString();
42744274
}
42754275

4276-
export const MockWorkspaceAgentDevcontainerPorts: TypesGen.WorkspaceAgentDevcontainerPort[] = [
4277-
{
4278-
port: 1000,
4279-
network: "tcp",
4280-
host_port: 1000,
4281-
host_ip: "0.0.0.0"
4282-
},
4283-
{
4284-
port: 2001,
4285-
network: "tcp",
4286-
host_port: 2000,
4287-
host_ip: "::1"
4288-
},
4276+
export const MockWorkspaceAgentDevcontainerPorts: TypesGen.WorkspaceAgentDevcontainerPort[] =
4277+
[
4278+
{
4279+
port: 1000,
4280+
network: "tcp",
4281+
host_port: 1000,
4282+
host_ip: "0.0.0.0",
4283+
},
4284+
{
4285+
port: 2001,
4286+
network: "tcp",
4287+
host_port: 2000,
4288+
host_ip: "::1",
4289+
},
4290+
{
4291+
port: 8888,
4292+
network: "tcp",
4293+
},
4294+
];
4295+
4296+
export const MockWorkspaceAgentDevcontainer: TypesGen.WorkspaceAgentDevcontainer =
42894297
{
4290-
port: 8888,
4291-
network: "tcp",
4292-
}
4293-
]
4294-
4295-
export const MockWorkspaceAgentDevcontainer : TypesGen.WorkspaceAgentDevcontainer = {
4296-
created_at: "2024-01-04T15:53:03.21563Z",
4297-
id: "abcd1234",
4298-
name: "container-1",
4299-
image: "ubuntu:latest",
4300-
labels: {
4301-
"foo": "bar"
4302-
},
4303-
ports: [],
4304-
running: true,
4305-
status: "running",
4306-
volumes: {
4307-
"/mnt/volume1": "/volume1",
4308-
}
4309-
}
4298+
created_at: "2024-01-04T15:53:03.21563Z",
4299+
id: "abcd1234",
4300+
name: "container-1",
4301+
image: "ubuntu:latest",
4302+
labels: {
4303+
foo: "bar",
4304+
},
4305+
ports: [],
4306+
running: true,
4307+
status: "running",
4308+
volumes: {
4309+
"/mnt/volume1": "/volume1",
4310+
},
4311+
};
43104312

43114313
export const MockWorkspaceAgentListContainersResponse: TypesGen.WorkspaceAgentListContainersResponse =
4312-
{
4313-
containers: [
4314-
MockWorkspaceAgentDevcontainer,
4315-
],
4316-
"warnings": ["This is a warning"],
4317-
}
4314+
{
4315+
containers: [MockWorkspaceAgentDevcontainer],
4316+
warnings: ["This is a warning"],
4317+
};

0 commit comments

Comments
 (0)