Skip to content

Commit 5b6f264

Browse files
committed
Rename LogSourceID -> SourceID
1 parent 7cf6f0c commit 5b6f264

File tree

13 files changed

+102
-80
lines changed

13 files changed

+102
-80
lines changed

coderd/apidoc/docs.go

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/workspaceagents.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2256,6 +2256,7 @@ func convertWorkspaceAgentLog(logEntry database.WorkspaceAgentLog) codersdk.Work
22562256
CreatedAt: logEntry.CreatedAt,
22572257
Output: logEntry.Output,
22582258
Level: codersdk.LogLevel(logEntry.Level),
2259+
SourceID: logEntry.LogSourceID,
22592260
}
22602261
}
22612262

codersdk/workspaceagents.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -765,11 +765,11 @@ const (
765765
)
766766

767767
type WorkspaceAgentLog struct {
768-
ID int64 `json:"id"`
769-
CreatedAt time.Time `json:"created_at" format:"date-time"`
770-
Output string `json:"output"`
771-
Level LogLevel `json:"level"`
772-
LogSourceID uuid.UUID `json:"log_source_id" format:"uuid"`
768+
ID int64 `json:"id"`
769+
CreatedAt time.Time `json:"created_at" format:"date-time"`
770+
Output string `json:"output"`
771+
Level LogLevel `json:"level"`
772+
SourceID uuid.UUID `json:"source_id" format:"uuid"`
773773
}
774774

775775
type AgentSubsystem string

docs/api/agents.md

Lines changed: 20 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/api/schemas.md

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/src/api/typesGenerated.ts

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/src/components/Logs/Logs.stories.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const lines = MockWorkspaceBuildLogs.map((log) => ({
1414
time: log.created_at,
1515
output: log.output,
1616
level: "info" as LogLevel,
17+
source_id: log.log_source,
1718
}))
1819
export const Example = Template.bind({})
1920
Example.args = {

site/src/components/Logs/Logs.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export interface Line {
1111
time: string
1212
output: string
1313
level: LogLevel
14+
source_id: string
1415
}
1516

1617
export interface LogsProps {

site/src/components/Resources/AgentStatus.tsx

Lines changed: 28 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -250,39 +250,34 @@ const OffLifecycle: React.FC = () => {
250250
const ConnectedStatus: React.FC<{
251251
agent: WorkspaceAgent
252252
}> = ({ agent }) => {
253-
switch (agent.startup_script_behavior) {
254-
case "non-blocking":
255-
return <ReadyLifecycle />
256-
case "blocking":
257-
return (
258-
<ChooseOne>
259-
<Cond condition={agent.lifecycle_state === "ready"}>
260-
<ReadyLifecycle />
261-
</Cond>
262-
<Cond condition={agent.lifecycle_state === "start_timeout"}>
263-
<StartTimeoutLifecycle agent={agent} />
264-
</Cond>
265-
<Cond condition={agent.lifecycle_state === "start_error"}>
266-
<StartErrorLifecycle agent={agent} />
267-
</Cond>
268-
<Cond condition={agent.lifecycle_state === "shutting_down"}>
269-
<ShuttingDownLifecycle />
270-
</Cond>
271-
<Cond condition={agent.lifecycle_state === "shutdown_timeout"}>
272-
<ShutdownTimeoutLifecycle agent={agent} />
273-
</Cond>
274-
<Cond condition={agent.lifecycle_state === "shutdown_error"}>
275-
<ShutdownErrorLifecycle agent={agent} />
276-
</Cond>
277-
<Cond condition={agent.lifecycle_state === "off"}>
278-
<OffLifecycle />
279-
</Cond>
280-
<Cond>
281-
<StartingLifecycle />
282-
</Cond>
283-
</ChooseOne>
284-
)
285-
}
253+
return (
254+
<ChooseOne>
255+
<Cond condition={agent.lifecycle_state === "ready"}>
256+
<ReadyLifecycle />
257+
</Cond>
258+
<Cond condition={agent.lifecycle_state === "start_timeout"}>
259+
<StartTimeoutLifecycle agent={agent} />
260+
</Cond>
261+
<Cond condition={agent.lifecycle_state === "start_error"}>
262+
<StartErrorLifecycle agent={agent} />
263+
</Cond>
264+
<Cond condition={agent.lifecycle_state === "shutting_down"}>
265+
<ShuttingDownLifecycle />
266+
</Cond>
267+
<Cond condition={agent.lifecycle_state === "shutdown_timeout"}>
268+
<ShutdownTimeoutLifecycle agent={agent} />
269+
</Cond>
270+
<Cond condition={agent.lifecycle_state === "shutdown_error"}>
271+
<ShutdownErrorLifecycle agent={agent} />
272+
</Cond>
273+
<Cond condition={agent.lifecycle_state === "off"}>
274+
<OffLifecycle />
275+
</Cond>
276+
<Cond>
277+
<StartingLifecycle />
278+
</Cond>
279+
</ChooseOne>
280+
)
286281
}
287282

288283
const DisconnectedStatus: React.FC = () => {

0 commit comments

Comments
 (0)