Skip to content

Commit

Permalink
Show Koji build submission logs
Browse files Browse the repository at this point in the history
  • Loading branch information
lbarcziova committed Nov 27, 2024
1 parent 8c72fb7 commit 737fc8f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions frontend/src/apiDefinitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ export interface KojiBuild {
status: string; // TODO: @Venefilyn - Probably an enum right? Change to be one if so
task_id: string;
web_url: string;
build_submission_stdout: string | null;
}

// /api/koji-tag-requests
Expand Down
33 changes: 33 additions & 0 deletions frontend/src/components/koji/KojiBuild.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ import {
Label,
PageSection,
Title,
Toolbar,
ToolbarContent,
ToolbarItem,
} from "@patternfly/react-core";
import { LogViewer, LogViewerSearch } from "@patternfly/react-log-viewer";
import { Table, Tbody, Td, Tr } from "@patternfly/react-table";
import { useQuery } from "@tanstack/react-query";
import { Link } from "@tanstack/react-router";
Expand Down Expand Up @@ -56,6 +60,34 @@ export const KojiBuild = () => {
</PageSection>
);
}

const logs = data.build_submission_stdout ? (
<PageSection hasBodyWrapper={false}>
<Card>
<CardBody>
<LogViewer
data={data.build_submission_stdout}
toolbar={
<Toolbar>
<ToolbarContent>
<ToolbarItem>
<LogViewerSearch
placeholder="Search value"
minSearchChars={3}
/>
</ToolbarItem>
</ToolbarContent>
</Toolbar>
}
hasLineNumbers={false}
/>
</CardBody>
</Card>
</PageSection>
) : (
""
);

return (
<>
<PageSection hasBodyWrapper={false}>
Expand Down Expand Up @@ -146,6 +178,7 @@ export const KojiBuild = () => {
</CardBody>
</Card>
</PageSection>
{logs}
</>
);
};
Expand Down

0 comments on commit 737fc8f

Please sign in to comment.