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

Commit56bf9cf

Browse files
fix(site): Handle carriage on logs output (#7172)
1 parentb44e6e6 commit56bf9cf

File tree

2 files changed

+15
-25
lines changed

2 files changed

+15
-25
lines changed

‎site/src/components/Logs/Logs.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export const LogLine: FC<{
6666
lineNumbers:Boolean(number),
6767
})
6868
constoutput=useMemo(()=>{
69-
returnconvert.toHtml(line.output)
69+
returnconvert.toHtml(line.output.split(/\r/g).pop()asstring)
7070
},[line.output])
7171

7272
return(

‎site/src/components/Resources/AgentRow.stories.tsx‎

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,20 @@ import { AgentRow, AgentRowProps } from "./AgentRow"
2020
exportdefault{
2121
title:"components/AgentRow",
2222
component:AgentRow,
23+
args:{
24+
storybookStartupLogs:[
25+
"\x1b[91mCloning Git repository...",
26+
"\x1b[2;37;41mStarting Docker Daemon...",
27+
"\x1b[1;95mAdding some 🧙magic🧙...",
28+
"Starting VS Code...",
29+
"\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r100 1475 0 1475 0 0 4231 0 --:--:-- --:--:-- --:--:-- 4238",
30+
].map((line,index)=>({
31+
id:index,
32+
level:"info",
33+
output:line,
34+
time:"",
35+
})),
36+
},
2337
}
2438

2539
constTemplate:Story<AgentRowProps>=(args)=><AgentRow{...args}/>
@@ -107,18 +121,6 @@ export const Starting = Template.bind({})
107121
Starting.args={
108122
...Example.args,
109123
agent:MockWorkspaceAgentStarting,
110-
111-
storybookStartupLogs:[
112-
"\x1b[91mCloning Git repository...",
113-
"\x1b[2;37;41mStarting Docker Daemon...",
114-
"\x1b[1;95mAdding some 🧙magic🧙...",
115-
"Starting VS Code...",
116-
].map((line,index)=>({
117-
id:index,
118-
level:"info",
119-
output:line,
120-
time:"",
121-
})),
122124
}
123125

124126
exportconstStarted=Template.bind({})
@@ -128,18 +130,6 @@ Started.args = {
128130
...MockWorkspaceAgentReady,
129131
startup_logs_length:1,
130132
},
131-
132-
storybookStartupLogs:[
133-
"Cloning Git repository...",
134-
"Starting Docker Daemon...",
135-
"Adding some 🧙magic🧙...",
136-
"Starting VS Code...",
137-
].map((line,index)=>({
138-
id:index,
139-
level:"info",
140-
output:line,
141-
time:"",
142-
})),
143133
}
144134

145135
exportconstStartedNoMetadata=Template.bind({})

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp