Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
8e8749fd
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8e8749fd
编写于
2月 28, 2018
作者:
R
Rachel Macfarlane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Change process list formatting to raw instead of table, fixes ##44733
上级
ac842329
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
12 addition
and
79 deletion
+12
-79
src/vs/code/electron-browser/issue/issueReporterMain.ts
src/vs/code/electron-browser/issue/issueReporterMain.ts
+1
-20
src/vs/code/electron-browser/issue/issueReporterModel.ts
src/vs/code/electron-browser/issue/issueReporterModel.ts
+6
-11
src/vs/code/electron-browser/issue/issueReporterPage.ts
src/vs/code/electron-browser/issue/issueReporterPage.ts
+2
-2
src/vs/code/electron-browser/issue/media/issueReporter.css
src/vs/code/electron-browser/issue/media/issueReporter.css
+1
-1
src/vs/code/electron-main/diagnostics.ts
src/vs/code/electron-main/diagnostics.ts
+2
-45
未找到文件。
src/vs/code/electron-browser/issue/issueReporterMain.ts
浏览文件 @
8e8749fd
...
...
@@ -679,26 +679,7 @@ export class IssueReporter extends Disposable {
private
updateProcessInfo
=
(
state
)
=>
{
const
target
=
document
.
querySelector
(
'
.block-process .block-info
'
);
let
tableHtml
=
`
<tr>
<th>pid</th>
<th>CPU %</th>
<th>Memory (MB)</th>
<th>Name</th>
</tr>`
;
state
.
processInfo
.
forEach
(
p
=>
{
tableHtml
+=
`
<tr>
<td>
${
p
.
pid
}
</td>
<td>
${
p
.
cpu
}
</td>
<td>
${
p
.
memory
}
</td>
<td>
${
p
.
name
}
</td>
</tr>`
;
});
target
.
innerHTML
=
`<table>
${
tableHtml
}
</table>`
;
target
.
innerHTML
=
`<code>
${
state
.
processInfo
}
</code>`
;
}
private
updateWorkspaceInfo
=
(
state
)
=>
{
...
...
src/vs/code/electron-browser/issue/issueReporterModel.ts
浏览文件 @
8e8749fd
...
...
@@ -144,20 +144,15 @@ ${this.getInfos()}
}
private
generateProcessInfoMd
():
string
{
let
md
=
`<details>
return
`<details>
<summary>Process Info</summary>
|pid|CPU|Memory (MB)|Name|
|---|---|---|---|
`
;
this
.
_data
.
processInfo
.
forEach
(
p
=>
{
md
+=
`|
${
p
.
pid
}
|
${
p
.
cpu
}
|
${
p
.
memory
}
|
${
p
.
name
}
|\n`
;
});
md
+=
'
\n
</details>
'
;
\`\`\`
${
this
.
_data
.
processInfo
}
\`\`\`
return
md
;
</details>
`
;
}
private
generateWorkspaceInfoMd
():
string
{
...
...
src/vs/code/electron-browser/issue/issueReporterPage.ts
浏览文件 @
8e8749fd
...
...
@@ -52,9 +52,9 @@ export default (): string => `
<label class="caption" for="includeProcessInfo">
${
escape
(
localize
(
'
sendData
'
,
"
Send my data
"
))}
</label>
</div>
</summary>
<
div
class="block-info">
<
pre
class="block-info">
<!-- To be dynamically filled -->
</
div
>
</
pre
>
</details>
</div>
<div class="block block-workspace">
...
...
src/vs/code/electron-browser/issue/media/issueReporter.css
浏览文件 @
8e8749fd
...
...
@@ -126,7 +126,7 @@ body {
overflow-wrap
:
break-word
;
}
pre
{
margin
:
0
;
margin
:
10px
20px
;
}
pre
code
{
font-family
:
'Menlo'
,
'Courier New'
,
'Courier'
,
monospace
;
...
...
src/vs/code/electron-main/diagnostics.ts
浏览文件 @
8e8749fd
...
...
@@ -39,7 +39,7 @@ export interface ProcessInfo {
}
export
interface
PerformanceInfo
{
processInfo
?:
ProcessInfo
[]
;
processInfo
?:
string
;
workspaceInfo
?:
string
;
}
...
...
@@ -78,7 +78,7 @@ export function getPerformanceInfo(info: IMainProcessInfo): Promise<PerformanceI
}
return
{
processInfo
:
ge
tProcessList
(
info
,
rootProcess
),
processInfo
:
forma
tProcessList
(
info
,
rootProcess
),
workspaceInfo
:
workspaceInfoMessages
.
join
(
'
\n
'
)
};
});
...
...
@@ -208,49 +208,6 @@ function formatLaunchConfigs(configs: WorkspaceStatItem[]): string {
return
output
.
join
(
'
\n
'
);
}
function
getProcessList
(
info
:
IMainProcessInfo
,
rootProcess
:
ProcessItem
):
ProcessInfo
[]
{
const
mapPidToWindowTitle
=
new
Map
<
number
,
string
>
();
info
.
windows
.
forEach
(
window
=>
mapPidToWindowTitle
.
set
(
window
.
pid
,
window
.
title
));
const
processes
:
ProcessInfo
[]
=
[];
if
(
rootProcess
)
{
getProcessItem
(
mapPidToWindowTitle
,
processes
,
rootProcess
,
0
);
}
return
processes
;
}
function
getProcessItem
(
mapPidToWindowTitle
:
Map
<
number
,
string
>
,
processes
:
ProcessInfo
[],
item
:
ProcessItem
,
indent
:
number
):
void
{
const
isRoot
=
(
indent
===
0
);
const
MB
=
1024
*
1024
;
// Format name with indent
let
name
:
string
;
if
(
isRoot
)
{
name
=
`
${
product
.
applicationName
}
main`
;
}
else
{
name
=
`
${
repeat
(
'
--
'
,
indent
)}
${
item
.
name
}
`
;
if
(
item
.
name
===
'
window
'
)
{
name
=
`
${
name
}
(
${
mapPidToWindowTitle
.
get
(
item
.
pid
)}
)`
;
}
}
const
memory
=
process
.
platform
===
'
win32
'
?
item
.
mem
:
(
os
.
totalmem
()
*
(
item
.
mem
/
100
));
processes
.
push
({
cpu
:
Number
(
item
.
load
.
toFixed
(
0
)),
memory
:
Number
((
memory
/
MB
).
toFixed
(
0
)),
pid
:
Number
((
item
.
pid
).
toFixed
(
0
)),
name
});
// Recurse into children if any
if
(
Array
.
isArray
(
item
.
children
))
{
item
.
children
.
forEach
(
child
=>
getProcessItem
(
mapPidToWindowTitle
,
processes
,
child
,
indent
+
1
));
}
}
function
formatEnvironment
(
info
:
IMainProcessInfo
):
string
{
const
MB
=
1024
*
1024
;
const
GB
=
1024
*
MB
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录