1+ import type { Workspace , WorkspaceKind } from '~/shared/types' ;
12import { WorkspaceState } from '~/shared/types' ;
23
34const generateMockWorkspace = (
@@ -10,52 +11,15 @@ const generateMockWorkspace = (
1011 podConfigId : string ,
1112 podConfigDisplayName : string ,
1213 pvcName : string ,
13- ) : {
14- name : string ;
15- namespace : string ;
16- workspaceKind : { name : string } ;
17- deferUpdates : boolean ;
18- paused : boolean ;
19- pausedTime : number ;
20- pendingRestart : boolean ;
21- state : WorkspaceState ;
22- stateMessage : string ;
23- podTemplate : {
24- podMetadata : { labels : object ; annotations : object } ;
25- volumes : {
26- home : { pvcName : string ; mountPath : string ; readOnly : boolean } ;
27- data : { pvcName : string ; mountPath : string ; readOnly : boolean } [ ] ;
28- } ;
29- options : {
30- imageConfig : {
31- current : {
32- id : string ;
33- displayName : string ;
34- description : string ;
35- labels : { key : string ; value : string } [ ] ;
36- } ;
37- } ;
38- podConfig : {
39- current : {
40- id : string ;
41- displayName : string ;
42- description : string ;
43- labels : ( { key : string ; value : string } | { key : string ; value : string } ) [ ] ;
44- } ;
45- } ;
46- } ;
47- } ;
48- activity : { lastActivity : number ; lastUpdate : number } ;
49- services : { httpService : { displayName : string ; httpPath : string } } [ ] ;
50- } => {
14+ ) : Workspace => {
5115 const currentTime = Date . now ( ) ;
5216 const lastActivityTime = currentTime - Math . floor ( Math . random ( ) * 1000000 ) ;
5317 const lastUpdateTime = currentTime - Math . floor ( Math . random ( ) * 100000 ) ;
5418
5519 return {
5620 name,
5721 namespace,
58- workspaceKind : { name : 'jupyterlab' } ,
22+ workspaceKind : { name : 'jupyterlab' } as WorkspaceKind ,
5923 deferUpdates : paused ,
6024 paused,
6125 pausedTime : paused ? currentTime - Math . floor ( Math . random ( ) * 1000000 ) : 0 ,
@@ -92,7 +56,7 @@ const generateMockWorkspace = (
9256 id : imageConfigId ,
9357 displayName : imageConfigDisplayName ,
9458 description : 'JupyterLab environment' ,
95- labels : [ { key : 'python_version' , value : ' 3.11' } ] ,
59+ labels : [ { key : 'python_version' , value : 3.11 } ] ,
9660 } ,
9761 } ,
9862 podConfig : {
0 commit comments