Skip to content

Commit b15ad85

Browse files
committed
[server, dashboard] Review comments
1 parent f9d4131 commit b15ad85

File tree

4 files changed

+22
-16
lines changed

4 files changed

+22
-16
lines changed
Lines changed: 1 addition & 1 deletion
Loading

components/dashboard/src/teams/TeamUsage.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -219,19 +219,19 @@ function TeamUsage() {
219219
<div className="flex flex-col w-full mb-8">
220220
<ItemsList className="mt-2 text-gray-500">
221221
<Item header={false} className="grid grid-cols-12 gap-x-3 bg-gray-100 mb-5">
222-
<ItemField className="col-span-2 my-auto">
223-
<span>Type</span>
222+
<ItemField className="col-span-2 my-auto ">
223+
<span className="font-medium">Type</span>
224224
</ItemField>
225225
<ItemField className="col-span-5 my-auto">
226-
<span>ID</span>
226+
<span className="font-medium">ID</span>
227227
</ItemField>
228228
<ItemField className="my-auto">
229-
<span>Credits</span>
229+
<span className="font-medium">Credits</span>
230230
</ItemField>
231231
<ItemField className="my-auto" />
232232
<ItemField className="col-span-3 my-auto cursor-pointer">
233233
<span
234-
className="flex my-auto"
234+
className="flex my-auto font-medium"
235235
onClick={() => setIsStartedTimeDescending(!isStartedTimeDescending)}
236236
>
237237
Timestamp
@@ -251,23 +251,23 @@ function TeamUsage() {
251251
className="flex p-3 grid grid-cols-12 gap-x-3 justify-between transition ease-in-out rounded-xl focus:bg-gitpod-kumquat-light"
252252
>
253253
<div className="flex flex-col col-span-2 my-auto">
254-
<span className="text-gray-700 dark:text-gray-400">
254+
<span className="text-gray-600 dark:text-gray-100 text-md font-medium">
255255
{getType(usage.workspaceType)}
256256
</span>
257257
<span className="text-sm text-gray-400 dark:text-gray-600">
258258
{usage.workspaceClass}
259259
</span>
260260
</div>
261261
<div className="flex flex-col col-span-5 my-auto">
262-
<span className="truncate text-gray-700 dark:text-gray-400">
262+
<span className="truncate text-gray-600 dark:text-gray-100 text-md font-medium">
263263
{usage.workspaceId}
264264
</span>
265265
<span className="text-sm truncate text-gray-400 dark:text-gray-600">
266266
{usage.contextURL && toRemoteURL(usage.contextURL)}
267267
</span>
268268
</div>
269269
<div className="flex flex-col my-auto">
270-
<span className="text-right text-gray-700 dark:text-gray-400">
270+
<span className="text-right text-gray-700 dark:text-gray-400 font-semibold">
271271
{usage.credits.toFixed(1)}
272272
</span>
273273
<span className="text-right truncate text-sm text-gray-400 dark:text-gray-600">
@@ -276,12 +276,12 @@ function TeamUsage() {
276276
</div>
277277
<div className="my-auto" />
278278
<div className="flex flex-col col-span-3 my-auto">
279-
<span className="text-gray-400 truncate">
279+
<span className="text-gray-400 truncate font-medium">
280280
{displayTime(usage.startTime)}
281281
</span>
282282
<div className="flex">
283283
{usage.workspaceType === "prebuild" ? (
284-
<UsageIcon className="my-auto" />
284+
<UsageIcon className="my-auto w-4 h-4 mr-2" />
285285
) : (
286286
""
287287
)}

components/gitpod-protocol/src/usage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export interface BillableSession {
3737

3838
export interface ExtendedBillableSession extends BillableSession {
3939
contextURL?: string;
40-
user?: User;
40+
user?: Pick<User, "name" | "avatarUrl">;
4141
}
4242

4343
export interface BillableSessionRequest {

components/server/ee/src/workspace/gitpod-server-impl.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2175,13 +2175,19 @@ export class GitpodServerEEImpl extends GitpodServerImpl {
21752175
const sessions = response.getSessionsList().map((s) => UsageService.mapBilledSession(s));
21762176
const extendedSessions = await Promise.all(
21772177
sessions.map(async (session) => {
2178-
let user;
21792178
const ws = await this.workspaceDb.trace(ctx).findWorkspaceAndInstance(session.workspaceId);
2179+
let profile: User.Profile | undefined = undefined;
21802180
if (session.workspaceType === "regular" && session.userId) {
2181-
user = await this.userDB.findUserById(session.userId);
2182-
return Object.assign(session, { contextURL: ws?.contextURL, user: user });
2181+
const user = await this.userDB.findUserById(session.userId);
2182+
if (user) {
2183+
profile = User.getProfile(user);
2184+
}
21832185
}
2184-
return Object.assign(session, { contextURL: ws?.contextURL });
2186+
return {
2187+
...session,
2188+
contextURL: ws?.contextURL,
2189+
user: profile ? { name: profile.name, avatarURL: profile.avatarURL } : undefined,
2190+
};
21852191
}),
21862192
);
21872193
return extendedSessions;

0 commit comments

Comments
 (0)