Skip to content

Commit

Permalink
Refactor net.html to extract the creation of main div into a separate…
Browse files Browse the repository at this point in the history
… function and dispose the previous chart instance
  • Loading branch information
arloor committed Oct 25, 2024
1 parent 186dcd7 commit 300037e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions rust_http_proxy/html/net.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@ <h1 class="in"></h1>
newMainDiv.className = 'out';
// 将新的 main div 添加到文档中
document.body.appendChild(newMainDiv);
myChart.dispose();
myChart = null;
if (myChart) {
myChart.dispose();
myChart = null;
}
return newMainDiv;
}
function formatDataRateIEC(num, precision = -1) {
Expand Down

0 comments on commit 300037e

Please sign in to comment.