Skip to content

Commit 46f3047

Browse files
author
Laurie T. Malau
committed
add
1 parent dd1f8fe commit 46f3047

File tree

3 files changed

+113
-9
lines changed

3 files changed

+113
-9
lines changed

components/dashboard/src/components/Pagination.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,21 @@ function Pagination(props: { numberOfPages: number; currentPage: number; setCurr
1717

1818
return (
1919
<nav>
20-
<ul className="pagination justify-content-center">
21-
<li className="page-item">
22-
<span className="page-link" onClick={prevPage}>
20+
<ul className="flex justify-center space-x-5">
21+
<li className="text-gray-400">
22+
<span onClick={prevPage}>
2323
Previous
2424
</span>
2525
</li>
2626
{availablePageNumbers.map((pn) => (
27-
<li key={pn} className={`page-item ${currentPage === pn ? "active" : ""} `}>
28-
<span onClick={() => setCurrentPage(pn)} className="page-link">
27+
<li key={pn} className={`text-gray-500 ${currentPage === pn ? "bg-gray-200" : ""} `}>
28+
<span onClick={() => setCurrentPage(pn)}>
2929
{pn}
3030
</span>
3131
</li>
3232
))}
33-
<li className="page-item">
34-
<span className="page-link" onClick={nextPage}>
33+
<li className="text-gray-400">
34+
<span onClick={nextPage}>
3535
Next
3636
</span>
3737
</li>

components/dashboard/src/teams/TeamUsage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function TeamUsage() {
2626
const team = getCurrentTeam(location, teams);
2727
const [billedUsage, setBilledUsage] = useState<BillableSession[]>([]);
2828
const [currentPage, setCurrentPage] = useState(1);
29-
const [resultsPerPage] = useState(30);
29+
const [resultsPerPage] = useState(10);
3030

3131
useEffect(() => {
3232
if (!team) {
@@ -120,7 +120,7 @@ function TeamUsage() {
120120
</div>
121121
))}
122122
</ItemsList>
123-
<Pagination currentPage={currentPage} setCurrentPage={setCurrentPage} numberOfPages={numberOfPages} />
123+
{(billedUsage.length > resultsPerPage) && <Pagination currentPage={currentPage} setCurrentPage={setCurrentPage} numberOfPages={numberOfPages} />}
124124
</PageWithSubMenu>
125125
);
126126
}

components/gitpod-protocol/src/usage.ts

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,108 @@ export const billableSessionDummyData: BillableSession[] = [
143143
credits: 200,
144144
projectId: "project-345",
145145
},
146+
{
147+
attributionId: "some-attribution-id",
148+
userId: "prebuild",
149+
teamId: "prebuild",
150+
instanceId: "some-instance-id",
151+
workspaceId: "some-workspace-id",
152+
workspaceType: "prebuild",
153+
workspaceClass: "XL",
154+
startTime: new Date(Date.now() + -3 * 24 * 3600 * 1000).toISOString(), // 3 days ago
155+
endTime: new Date().toISOString(),
156+
credits: 320,
157+
projectId: "project-123",
158+
},
159+
{
160+
attributionId: "some-attribution-id2",
161+
userId: "some-user",
162+
teamId: "some-team",
163+
instanceId: "some-instance-id2",
164+
workspaceId: "some-workspace-id2",
165+
workspaceType: "regular",
166+
workspaceClass: "standard",
167+
startTime: new Date(Date.now() + -5 * 24 * 3600 * 1000).toISOString(),
168+
endTime: new Date().toISOString(),
169+
credits: 130,
170+
projectId: "project-123",
171+
},
172+
{
173+
attributionId: "some-attribution-id3",
174+
userId: "some-other-user",
175+
teamId: "some-other-team",
176+
instanceId: "some-instance-id3",
177+
workspaceId: "some-workspace-id3",
178+
workspaceType: "regular",
179+
workspaceClass: "XL",
180+
startTime: new Date(Date.now() + -5 * 24 * 3600 * 1000).toISOString(),
181+
endTime: new Date(Date.now() + -4 * 24 * 3600 * 1000).toISOString(),
182+
credits: 150,
183+
projectId: "project-134",
184+
},
185+
{
186+
attributionId: "some-attribution-id4",
187+
userId: "some-other-user2",
188+
teamId: "some-other-team2",
189+
instanceId: "some-instance-id4",
190+
workspaceId: "some-workspace-id4",
191+
workspaceType: "regular",
192+
workspaceClass: "standard",
193+
startTime: new Date(Date.now() + -10 * 24 * 3600 * 1000).toISOString(),
194+
endTime: new Date(Date.now() + -9 * 24 * 3600 * 1000).toISOString(),
195+
credits: 330,
196+
projectId: "project-137",
197+
},
198+
{
199+
attributionId: "some-attribution-id5",
200+
userId: "some-other-user3",
201+
teamId: "some-other-team3",
202+
instanceId: "some-instance-id5",
203+
workspaceId: "some-workspace-id5",
204+
workspaceType: "regular",
205+
workspaceClass: "XL",
206+
startTime: new Date(Date.now() + -2 * 24 * 3600 * 1000).toISOString(),
207+
endTime: new Date().toISOString(),
208+
credits: 222,
209+
projectId: "project-138",
210+
},
211+
{
212+
attributionId: "some-attribution-id6",
213+
userId: "some-other-user4",
214+
teamId: "some-other-team4",
215+
instanceId: "some-instance-id6",
216+
workspaceId: "some-workspace-id3",
217+
workspaceType: "regular",
218+
workspaceClass: "XL",
219+
startTime: new Date(Date.now() + -7 * 24 * 3600 * 1000).toISOString(),
220+
endTime: new Date(Date.now() + -6 * 24 * 3600 * 1000).toISOString(),
221+
credits: 300,
222+
projectId: "project-134",
223+
},
224+
{
225+
attributionId: "some-attribution-id8",
226+
userId: "some-other-user5",
227+
teamId: "some-other-team5",
228+
instanceId: "some-instance-id8",
229+
workspaceId: "some-workspace-id3",
230+
workspaceType: "regular",
231+
workspaceClass: "standard",
232+
startTime: new Date(Date.now() + -1 * 24 * 3600 * 1000).toISOString(),
233+
endTime: new Date().toISOString(),
234+
credits: 100,
235+
projectId: "project-567",
236+
},
237+
{
238+
attributionId: "some-attribution-id7",
239+
userId: "prebuild",
240+
teamId: "some-other-team7",
241+
instanceId: "some-instance-id7",
242+
workspaceId: "some-workspace-id7",
243+
workspaceType: "prebuild",
244+
workspaceClass: "XL",
245+
startTime: new Date(Date.now() + -1 * 24 * 3600 * 1000).toISOString(),
246+
endTime: new Date().toISOString(),
247+
credits: 200,
248+
projectId: "project-345",
249+
}
146250
];

0 commit comments

Comments
 (0)