10000 feat: Add workspace build logs page by BrunoQuaresma · Pull Request #1598 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

feat: Add workspace build logs page #1598

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
May 19, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Remove custom type
  • Loading branch information
BrunoQuaresma committed May 19, 2022
commit fe8496fb0df19b594cc73ac7f5897ac26018fd4f
6 changes: 3 additions & 3 deletions site/src/api/api.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import axios, { AxiosRequestHeaders } from "axios"
import { mutate } from "swr"
import { ProvisionerJobLog, WorkspaceBuildTransition } from "./types"
import { WorkspaceBuildTransition } from "./types"
import * as TypesGen from "./typesGenerated"

const CONTENT_TYPE_JSON: AxiosRequestHeaders = {
Expand Down Expand Up @@ -254,7 +254,7 @@ export const getWorkspaceBuild = async (workspaceId: string): Promise<TypesGen.W
return response.data
}

export const getWorkspaceBuildLogs = async (buildname: string): Promise<ProvisionerJobLog[]> => {
const response = await axios.get<ProvisionerJobLog[]>(`/api/v2/workspacebuilds/${buildname}/logs`)
export const getWorkspaceBuildLogs = async (buildname: string): Promise<TypesGen.ProvisionerJobLog[]> => {
const response = await axios.get<TypesGen.ProvisionerJobLog[]>(`/api/v2/workspacebuilds/${buildname}/logs`)
return response.data
}
9 changes: 0 additions & 9 deletions site/src/api/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import * as TypesGen from "./typesGenerated"

export interface UserAgent {
readonly browser: string
readonly device: string
Expand All @@ -14,10 +12,3 @@ export interface ReconnectingPTYRequest {
}

export type WorkspaceBuildTransition = "start" | "stop" | "delete"

// The generated type for ProvisionerJobLog is different than the one returned
// by the API.
export interface ProvisionerJobLog extends TypesGen.ProvisionerJobLog {
readonly source: string
readonly level: string
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { assign, createMachine } from "xstate"
import * as API from "../../api/api"
import { ProvisionerJobLog } from "../../api/types"
import { WorkspaceBuild } from "../../api/typesGenerated"
import { ProvisionerJobLog, WorkspaceBuild } from "../../api/typesGenerated"

type LogsContext = {
// Build
Expand Down
0