Skip to content

Commit 6af8f6c

Browse files
committed
make fmt lint
1 parent 8d86e8d commit 6af8f6c

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
@@ -4244,45 +4244,45 @@ export const MockNotificationTemplates: TypesGen.NotificationTemplate[] = [
42444244
export const MockNotificationMethodsResponse: TypesGen.NotificationMethodsResponse =
42454245
{ available: ["smtp", "webhook"], default: "smtp" };
42464246

4247-
export const MockWorkspaceAgentDevcontainerPorts: TypesGen.WorkspaceAgentDevcontainerPort[] = [
4248-
{
4249-
port: 1000,
4250-
network: "tcp",
4251-
host_port: 1000,
4252-
host_ip: "0.0.0.0"
4253-
},
4254-
{
4255-
port: 2001,
4256-
network: "tcp",
4257-
host_port: 2000,
4258-
host_ip: "::1"
4259-
},
4247+
export const MockWorkspaceAgentDevcontainerPorts: TypesGen.WorkspaceAgentDevcontainerPort[] =
4248+
[
4249+
{
4250+
port: 1000,
4251+
network: "tcp",
4252+
host_port: 1000,
4253+
host_ip: "0.0.0.0",
4254+
},
4255+
{
4256+
port: 2001,
4257+
network: "tcp",
4258+
host_port: 2000,
4259+
host_ip: "::1",
4260+
},
4261+
{
4262+
port: 8888,
4263+
network: "tcp",
4264+
},
4265+
];
4266+
4267+
export const MockWorkspaceAgentDevcontainer: TypesGen.WorkspaceAgentDevcontainer =
42604268
{
4261-
port: 8888,
4262-
network: "tcp",
4263-
}
4264-
]
4265-
4266-
export const MockWorkspaceAgentDevcontainer : TypesGen.WorkspaceAgentDevcontainer = {
4267-
created_at: "2024-01-04T15:53:03.21563Z",
4268-
id: "abcd1234",
4269-
name: "container-1",
4270-
image: "ubuntu:latest",
4271-
labels: {
4272-
"foo": "bar"
4273-
},
4274-
ports: [],
4275-
running: true,
4276-
status: "running",
4277-
volumes: {
4278-
"/mnt/volume1": "/volume1",
4279-
}
4280-
}
4269+
created_at: "2024-01-04T15:53:03.21563Z",
4270+
id: "abcd1234",
4271+
name: "container-1",
4272+
image: "ubuntu:latest",
4273+
labels: {
4274+
foo: "bar",
4275+
},
4276+
ports: [],
4277+
running: true,
4278+
status: "running",
4279+
volumes: {
4280+
"/mnt/volume1": "/volume1",
4281+
},
4282+
};
42814283

42824284
export const MockWorkspaceAgentListContainersResponse: TypesGen.WorkspaceAgentListContainersResponse =
4283-
{
4284-
containers: [
4285-
MockWorkspaceAgentDevcontainer,
4286-
],
4287-
"warnings": ["This is a warning"],
4288-
}
4285+
{
4286+
containers: [MockWorkspaceAgentDevcontainer],
4287+
warnings: ["This is a warning"],
4288+
};

0 commit comments

Comments
 (0)