Issue #123: Done.

This commit is contained in:
chiayin
2023-09-28 14:38:32 +08:00
parent 64c8aec657
commit 20c7e4316b
2 changed files with 4 additions and 4 deletions

View File

@@ -32,7 +32,7 @@
<td class="p-2 text-center">#{{ trace.id }}</td> <td class="p-2 text-center">#{{ trace.id }}</td>
<td class="p-2 min-w-[96px]"> <td class="p-2 min-w-[96px]">
<div class="h-4 w-full bg-neutral-300 rounded-sm overflow-hidden"> <div class="h-4 w-full bg-neutral-300 rounded-sm overflow-hidden">
<div class="h-full bg-primary" :style="progressWidth(trace.value)"></div> <div class="h-full bg-primary" :style="trace.value"></div>
</div> </div>
</td> </td>
<td class="py-2 text-right">{{ trace.count }}</td> <td class="py-2 text-right">{{ trace.count }}</td>
@@ -96,7 +96,7 @@ export default {
return this.traces.map(trace => { return this.traces.map(trace => {
return { return {
id: trace.id, id: trace.id,
value: Number((trace.ratio * 100).toFixed(1)), value: this.progressWidth(Number(((trace.count / this.traceCountTotal) * 100).toFixed(1))),
count: trace.count, count: trace.count,
ratio: this.getPercentLabel(trace.count / this.traceCountTotal), ratio: this.getPercentLabel(trace.count / this.traceCountTotal),
}; };

View File

@@ -23,7 +23,7 @@
<td class="p-2">#{{ trace.id }}</td> <td class="p-2">#{{ trace.id }}</td>
<td class="p-2 w-24"> <td class="p-2 w-24">
<div class="h-4 w-full bg-neutral-300 rounded-sm overflow-hidden"> <div class="h-4 w-full bg-neutral-300 rounded-sm overflow-hidden">
<div class="h-full bg-primary" :style="progressWidth(trace.value)"></div> <div class="h-full bg-primary" :style="trace.value"></div>
</div> </div>
</td> </td>
<td class="py-2 text-right">{{ trace.count }}</td> <td class="py-2 text-right">{{ trace.count }}</td>
@@ -88,7 +88,7 @@ export default {
return this.traces.map(trace => { return this.traces.map(trace => {
return { return {
id: trace.id, id: trace.id,
value: Number((trace.ratio * 100).toFixed(1)), value: this.progressWidth(Number(((trace.count / sum) * 100).toFixed(1))),
count: trace.count, count: trace.count,
ratio: this.getPercentLabel(trace.count / sum), ratio: this.getPercentLabel(trace.count / sum),
}; };