Skip to content

Commit

Permalink
fix: glitch on % display on wiretap ui
Browse files Browse the repository at this point in the history
fixes #46
  • Loading branch information
n0rig authored and daveshanley committed Nov 13, 2023
1 parent 49ae58f commit bca05ad
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions ui/src/wiretap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ export class WiretapComponent extends LitElement {
private _configChannelSubscription: Subscription;
private _staticChannelSubscription: Subscription;
private _useTLS: boolean = false;
private _headerStatsDefaultPrecision: number = 0;
private _complianceStatPrecision: number = 2;

private _transactionContainer: HttpTransactionContainerComponent;

Expand Down Expand Up @@ -355,23 +357,23 @@ export class WiretapComponent extends LitElement {
return html`
<wiretap-header
@wipeData=${this.wipeData}
requests="${this.requestCount}"
responses="${this.responseCount}"
violations="${this.violationsCount}"
violationsDelta="${this.violatedTransactions}"
compliance="${this.complianceLevel}"
requests="${this.requestCount.toFixed(this._headerStatsDefaultPrecision)}"
responses="${this.responseCount.toFixed(this._headerStatsDefaultPrecision)}"
violations="${this.violationsCount.toFixed(this._headerStatsDefaultPrecision)}"
violationsDelta="${this.violatedTransactions.toFixed(this._headerStatsDefaultPrecision)}"
compliance="${this.complianceLevel.toFixed(this._complianceStatPrecision)}"
noSpec>
</wiretap-header>
${transaction}`
}
return html`
<wiretap-header
@wipeData=${this.wipeData}
requests="${this.requestCount}"
responses="${this.responseCount}"
violations="${this.violationsCount}"
violationsDelta="${this.violatedTransactions}"
compliance="${this.complianceLevel}">
requests="${this.requestCount.toFixed(this._headerStatsDefaultPrecision)}"
responses="${this.responseCount.toFixed(this._headerStatsDefaultPrecision)}"
violations="${this.violationsCount.toFixed(this._headerStatsDefaultPrecision)}"
violationsDelta="${this.violatedTransactions.toFixed(this._headerStatsDefaultPrecision)}"
compliance="${this.complianceLevel.toFixed(this._complianceStatPrecision)}">
</wiretap-header>
${transaction}`
}
Expand Down

0 comments on commit bca05ad

Please sign in to comment.