@@ -26,30 +26,45 @@ class Manual {
2626
2727 this . #server. use ( express . static ( this . #rootPath) ) ;
2828
29- this . #getLibList( )
30- this . #getTestList( )
29+ this . #getLibList( ) ;
30+ this . #getTestList( ) ;
3131
3232 this . #server. listen ( this . #port) ;
3333 console . log ( '[ HOSTING ]' + ' ' + '[ ' + 'http://127.0.0.1:' + this . #port + '/test/integration/manual' + ' ]' + ' press CTRL + C to stop' ) ;
3434 }
3535
36- async #getLibList( ) {
37- let libList = { localhost : 'http://127.0.0.1:' + this . #port + '/example/lib' } ;
38- libList [ 'HEAD' ] = 'https://' + remoteStableBucket + '/lib' ;
39- let vizzuListUrl = await fetch ( 'https://' + remoteCloudFunctions + '/getVizzuList' ) ;
40- let vizzuList = await vizzuListUrl . json ( ) ;
41- vizzuList . forEach ( vizzu => {
42- libList [ vizzu ] = 'https://' + remoteLatestBucket + '/' + vizzu ;
43- } ) ;
44- libList [ '0.2.0' ] = 'https://vizzuhq.github.io/vizzu-beta-release/0.2.0' ;
36+ #getLibList( ) {
4537 this . #server. get ( '/getLibList' , ( req , res ) => {
46- res . send ( libList ) ;
38+ let libList = { localhost : 'http://127.0.0.1:' + this . #port + '/example/lib' } ;
39+ libList [ 'HEAD' ] = 'https://' + remoteStableBucket + '/lib' ;
40+ this . #getLibJson( ) . then ( vizzuList => {
41+ vizzuList . slice ( ) . reverse ( ) . forEach ( vizzu => {
42+ libList [ vizzu . time . substring ( 0 , 10 ) + ' ' + vizzu . time . substring ( 11 , 16 ) + ' ' + vizzu . sha ] = 'https://' + remoteLatestBucket + '/' + vizzu . sha ;
43+ } ) ;
44+ //libList['0.3.1'] = 'https://cdn.jsdelivr.net/npm/[email protected] /dist'; 45+ //libList['0.3.0'] = 'https://cdn.jsdelivr.net/npm/[email protected] /dist'; 46+ libList [ '0.2.0' ] = 'https://vizzuhq.github.io/vizzu-beta-release/0.2.0' ;
47+ res . send ( libList ) ;
48+ } ) ;
49+ } ) ;
50+ }
51+
52+ #getLibJson( ) {
53+ return new Promise ( resolve => {
54+ fetch ( 'https://' + remoteCloudFunctions + '/getVizzuList' ) . then ( vizzuListUrl => {
55+ vizzuListUrl . json ( ) . then ( vizzuList => {
56+ resolve ( vizzuList ) ;
57+ } ) . catch ( ( err ) => {
58+ resolve ( this . #getLibJson( ) )
59+ } ) ;
60+ } ) ;
4761 } ) ;
4862 }
4963
5064 #getTestList( ) {
51- this . #setTestList( this . #testPath) ;
5265 this . #server. get ( '/getTestList' , ( req , res ) => {
66+ this . #testList = [ ] ;
67+ this . #setTestList( this . #testPath) ;
5368 res . send ( this . #testList) ;
5469 } ) ;
5570 }
0 commit comments