Change process list formatting to raw instead of table, fixes ##44733

This commit is contained in:
Rachel Macfarlane
2018-02-28 10:56:43 -08:00
parent ac842329c2
commit 8e8749fdda
5 changed files with 12 additions and 79 deletions

View File

@@ -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) => {

View File

@@ -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}
\`\`\`
</details>
`;
this._data.processInfo.forEach(p => {
md += `|${p.pid}|${p.cpu}|${p.memory}|${p.name}|\n`;
});
md += '\n</details>';
return md;
}
private generateWorkspaceInfoMd(): string {

View File

@@ -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">

View File

@@ -126,7 +126,7 @@ body {
overflow-wrap: break-word;
}
pre {
margin: 0;
margin: 10px 20px;
}
pre code {
font-family: 'Menlo', 'Courier New', 'Courier', monospace;