File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55use Slim \App ;
66use XHGui \AbstractController ;
7+ use XHGui \Exception \NotImplementedException ;
78use XHGui \RequestProxy as Request ;
89use XHGui \Searcher \SearcherInterface ;
910
@@ -55,7 +56,12 @@ public function query($query, $retrieve)
5556 }
5657
5758 $ perPage = $ this ->config ('page.limit ' );
59+ try {
60+ $ results = $ this ->searcher ->query ($ conditions , $ perPage , $ fields );
61+ } catch (NotImplementedException $ e ) {
62+ return ['error ' => ['generic ' => 'Not available for your save handler. ' ]];
63+ }
5864
59- return $ this -> searcher -> query ( $ conditions , $ perPage , $ fields ) ;
65+ return $ results ;
6066 }
6167}
Original file line number Diff line number Diff line change 3939 </div ><!-- /span-->
4040
4141 </div ><!-- /row-->
42- <div class =" row-fluid" >
43-
44- <div class =" span12" >
42+ <div class =" row-fluid" >
43+ <div class =" span12" id =" run-button-container" >
4544 <div class =" btn btn-large" style =" display: block; margin-left: auto; margin-right: auto; width: 150px;" id =" runbutton" >Run</div >
4645 <div style =" display: block; margin-left: auto; margin-right: auto; width: 150px; display: none" id =" loading" ><img src =" {{ static(' img/loading.gif' ) }}" ></div >
4746 </div ><!-- /span-->
4847
49-
50-
51-
52-
53-
54-
5548 </div ><!-- /row-->
5649 <table class =" table table-hover" id =" results" >
5750 <thead >
10598 $ (" #loading" ).hide ();
10699 if (data .hasOwnProperty (' error' ))
107100 {
108- console .log (data .error );
109101 if (data .error .hasOwnProperty (' query' ))
110102 {
111103 $ (' #selection' ).animate (
127119 }
128120 );
129121 }
122+
123+ if (data .error .hasOwnProperty (' generic' ))
124+ {
125+ $ (' #run-button-container' ).animate (
126+ { backgroundColor: ' #FFD9D9' },
127+ 800 ,
128+ function () {
129+ $ (this ).animate ({ backgroundColor: ' #FFF' });
130+ }
131+ );
132+ $ (' #run-button-container' ).text (data .error .generic );
133+ }
130134 }else {
131135 $ .each ( data, function (i , n ){
132136 $ (" #results tbody" ).append (' <tr><td>' + n .meta .url + ' </td><td>' + n .meta .SERVER .REQUEST_TIME + ' </td><td>' + n .profile [' main()' ].wt + ' </td><td>' + n .profile [' main()' ].cpu + ' </td><td>' + n .profile [' main()' ].mu + ' </td><td>' + n .profile [' main()' ].pmu + ' </td></tr>' );
You can’t perform that action at this time.
0 commit comments