@@ -114,14 +114,11 @@ function TeamUsage() {
114
114
return "" ;
115
115
}
116
116
const metaData = usage . metadata as WorkspaceInstanceUsageData ;
117
- if ( ! metaData . endTime ) {
118
- return "running" ;
119
- }
120
- const end = new Date ( metaData . endTime ) . getTime ( ) ;
117
+ const end = ! ! metaData . endTime ? new Date ( metaData . endTime ) . getTime ( ) : Date . now ( ) ;
121
118
const start = new Date ( metaData . startTime ) . getTime ( ) ;
122
119
const lengthOfUsage = Math . floor ( end - start ) ;
123
120
const inMinutes = ( lengthOfUsage / ( 1000 * 60 ) ) . toFixed ( 1 ) ;
124
- return inMinutes + " min" ;
121
+ return ( ! metaData . endTime ?? "running since " ) + inMinutes + " min" ;
125
122
} ;
126
123
127
124
const handleMonthClick = ( start : any , end : any ) => {
@@ -190,29 +187,31 @@ function TeamUsage() {
190
187
< div className = "text-base text-gray-500" > Total usage</ div >
191
188
< div className = "flex text-lg text-gray-600 font-semibold" >
192
189
< CreditsSvg className = "my-auto mr-1" />
193
- < span > { totalCreditsUsed } Credits</ span >
190
+ < span > { Intl . NumberFormat ( ) . format ( totalCreditsUsed ) } Credits</ span >
194
191
</ div >
195
192
</ div >
196
193
) }
197
194
</ div >
198
195
</ div >
199
- { ! isLoading && usagePage === undefined && ! errorMessage && (
200
- < div className = "flex flex-col w-full mb-8" >
201
- < h3 className = "text-center text-gray-500 mt-8" > No sessions found.</ h3 >
202
- < p className = "text-center text-gray-500 mt-1" >
203
- Have you started any
204
- < a className = "gp-link" href = { gitpodHostUrl . asWorkspacePage ( ) . toString ( ) } >
205
- { " " }
206
- workspaces
207
- </ a > { " " }
208
- in{ " " }
209
- { new Date ( startDateOfBillMonth ) . toLocaleString ( "default" , {
210
- month : "long" ,
211
- } ) } { " " }
212
- { new Date ( startDateOfBillMonth ) . getFullYear ( ) } or checked your other teams?
213
- </ p >
214
- </ div >
215
- ) }
196
+ { ! isLoading &&
197
+ ( usagePage === undefined || usagePage . usageEntriesList . length === 0 ) &&
198
+ ! errorMessage && (
199
+ < div className = "flex flex-col w-full mb-8" >
200
+ < h3 className = "text-center text-gray-500 mt-8" > No sessions found.</ h3 >
201
+ < p className = "text-center text-gray-500 mt-1" >
202
+ Have you started any
203
+ < a className = "gp-link" href = { gitpodHostUrl . asWorkspacePage ( ) . toString ( ) } >
204
+ { " " }
205
+ workspaces
206
+ </ a > { " " }
207
+ in{ " " }
208
+ { new Date ( startDateOfBillMonth ) . toLocaleString ( "default" , {
209
+ month : "long" ,
210
+ } ) } { " " }
211
+ { new Date ( startDateOfBillMonth ) . getFullYear ( ) } or checked your other teams?
212
+ </ p >
213
+ </ div >
214
+ ) }
216
215
{ isLoading && (
217
216
< div className = "flex flex-col place-items-center align-center w-full" >
218
217
< div className = "uppercase text-sm text-gray-400 dark:text-gray-500 mb-5" >
0 commit comments