Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(site): Handle carriage on logs output#7172

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
BrunoQuaresma merged 1 commit intomainfrombq/fix-carriage
Apr 17, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
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
2 changes: 1 addition & 1 deletionsite/src/components/Logs/Logs.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -66,7 +66,7 @@ export const LogLine: FC<{
lineNumbers: Boolean(number),
})
const output = useMemo(() => {
return convert.toHtml(line.output)
return convert.toHtml(line.output.split(/\r/g).pop() as string)
}, [line.output])

return (
Expand Down
38 changes: 14 additions & 24 deletionssite/src/components/Resources/AgentRow.stories.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,6 +20,20 @@ import { AgentRow, AgentRowProps } from "./AgentRow"
export default {
title: "components/AgentRow",
component: AgentRow,
args: {
storybookStartupLogs: [
"\x1b[91mCloning Git repository...",
"\x1b[2;37;41mStarting Docker Daemon...",
"\x1b[1;95mAdding some 🧙magic🧙...",
"Starting VS Code...",
"\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r100 1475 0 1475 0 0 4231 0 --:--:-- --:--:-- --:--:-- 4238",
].map((line, index) => ({
id: index,
level: "info",
output: line,
time: "",
})),
},
}

const Template: Story<AgentRowProps> = (args) => <AgentRow {...args} />
Expand DownExpand Up@@ -107,18 +121,6 @@ export const Starting = Template.bind({})
Starting.args = {
...Example.args,
agent: MockWorkspaceAgentStarting,

storybookStartupLogs: [
"\x1b[91mCloning Git repository...",
"\x1b[2;37;41mStarting Docker Daemon...",
"\x1b[1;95mAdding some 🧙magic🧙...",
"Starting VS Code...",
].map((line, index) => ({
id: index,
level: "info",
output: line,
time: "",
})),
}

export const Started = Template.bind({})
Expand All@@ -128,18 +130,6 @@ Started.args = {
...MockWorkspaceAgentReady,
startup_logs_length: 1,
},

storybookStartupLogs: [
"Cloning Git repository...",
"Starting Docker Daemon...",
"Adding some 🧙magic🧙...",
"Starting VS Code...",
].map((line, index) => ({
id: index,
level: "info",
output: line,
time: "",
})),
}

export const StartedNoMetadata = Template.bind({})
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp