Skip to content

Commit aae23b9

Browse files
authored
add pagination to top usage insight (#210)
1 parent f52f277 commit aae23b9

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

src/views-ui/codeAnalytics/main.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,9 @@ vscode-panel-view {
540540
.duration {
541541
font-weight: bold;
542542
}
543+
544+
}
545+
.pagination-list{
543546
.prev {
544547
cursor: pointer;
545548
&.disabled {

src/views/codeAnalytics/InsightListView/SpanInsight.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export class SpanUsagesListViewItemsCreator implements IInsightListViewItemsCrea
7676

7777
let traceHtml = renderTraceLink(flow.sampleTraceIds?.firstOrDefault(), insight.span);
7878

79-
return /*html*/`<div class="flow-row flex-row">
79+
return /*html*/`<div class="flow-row flex-row item">
8080
<span class="flow-percent">${flow.percentage.toFixed(1)}%</span>
8181
<span class="flex-row flex-wrap ellipsis">
8282
${firstServiceHtml}
@@ -90,8 +90,18 @@ export class SpanUsagesListViewItemsCreator implements IInsightListViewItemsCrea
9090

9191
const template = new InsightTemplateHtml({
9292
title: "Top Usage",
93-
body: usages.join('')
94-
})
93+
body: `
94+
<div class="pagination-list" data-current-page="1" data-records-per-page="2">
95+
${usages.join('')}
96+
<div class="pagination-nav">
97+
<a class="prev">Prev</a>
98+
<a class="next">Next</a>
99+
<span class="page"></span>
100+
</div>
101+
</div>
102+
`
103+
});
104+
95105

96106
return {
97107
getHtml: ()=> template.renderHtml(),

0 commit comments

Comments
 (0)