@@ -34,6 +34,12 @@ <h1 class="my-4">Snapshots list
3434 < small id ="selectedsnap "> </ small >
3535 </ h1 >
3636 < ul class ="list-unstyled mb-0 " id ="snapshotlist "> </ ul >
37+
38+ < div class ="d-flex align-items-center invisible " id ="loading ">
39+ < strong > Loading...</ strong >
40+ < div class ="spinner-border ml-auto " role ="status " aria-hidden ="true "> </ div >
41+ </ div >
42+
3743 </ div >
3844
3945 <!-- Sidebar Widgets Column -->
@@ -108,6 +114,7 @@ <h5 class="modal-title" id="exampleModalLabel">X-tract indices from snapshot</h5
108114
109115</ div > <!-- /.modal -->
110116
117+
111118</ body >
112119
113120< script src ="/assets/js/jquery-3.5.1.min.js "> </ script >
@@ -194,15 +201,18 @@ <h5 class="modal-title" id="exampleModalLabel">X-tract indices from snapshot</h5
194201
195202$ ( '#repolist' ) . on ( 'click' , 'a.repos' , function ( e ) {
196203 var reponame = e . target . dataset . id ;
204+
205+ $ ( "#loading" ) . removeClass ( 'invisible' ) ;
206+
197207 $ ( '#selectedsnap' ) . html ( "from <strong>" + reponame + "</strong>" ) ;
198-
208+
199209 var post = {
200210 "action" : "get_snapshots" ,
201211 "values" : {
202212 "repo" : reponame
203213 }
204214 } ;
205-
215+
206216 $ . ajax ( {
207217 type : "POST" ,
208218 url : "/api/" ,
@@ -211,9 +221,9 @@ <h5 class="modal-title" id="exampleModalLabel">X-tract indices from snapshot</h5
211221 contentType : 'application/json' ,
212222 success : function ( data ) {
213223 var str = "" ;
214-
224+
215225 dlicon = '<svg width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-download" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M.5 9.9a.5.5 0 0 1 .5.5v2.5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2.5a.5.5 0 0 1 1 0v2.5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-2.5a.5.5 0 0 1 .5-.5z"/><path fill-rule="evenodd" d="M7.646 11.854a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 10.293V1.5a.5.5 0 0 0-1 0v8.793L5.354 8.146a.5.5 0 1 0-.708.708l3 3z"/></svg>' ;
216-
226+
217227 for ( var k in data ) {
218228 snapshot = data [ k ] . id ;
219229 uniqid = data [ k ] . start_epoch ;
@@ -229,6 +239,8 @@ <h5 class="modal-title" id="exampleModalLabel">X-tract indices from snapshot</h5
229239
230240 str += "<li><h4 class='font-weight-bold list-group-item list-group-item-action' title='" + status + "'>" + icon + " <strong>" + snapshot + "</strong> created at " + hdate + "<a href='#' class='float-right btn' title='X-tract it' data-target='#update_instance' data-toggle='modal' data-repo='" + reponame + "' data-id='" + data [ k ] . id + "'>" + dlicon + "</a></h4></li>" ;
231241 }
242+
243+ $ ( "#loading" ) . addClass ( 'invisible' ) ;
232244 $ ( '#snapshotlist' ) . html ( str ) ;
233245 }
234246 } ) ;
0 commit comments