add more elements to interface with analysis store code.
[sgn.git] / mason / brapiclient / calls.mas
blob74b2cab61c8eb3269883670b2b13b3606a7d5a2f
1 <%args>
2 </%args>
4 <h4>Calls</h4>
6 <div id="brapi_calls_home_div">
7 <button class="btn btn-primary" id="brapi_home_show_calls">Show Calls</button>
9 </div>
11 <script>
13 jQuery(document).ready(function() {
15 jQuery("#brapi_home_show_calls").click(function() {
16     jQuery.ajax( {
17       'url': jQuery('#brapi_home_url_select').val()+'/brapi/v1/calls?datatype=json&pageSize=100',
18       'method': 'GET',
19       'success': function(response) {
20         console.log(response);
21         var html = '<br/><ul>';
22         for(var i = 0; i < response.result.data.length; i++) {
23             html = html+'<li>'+response.result.data[i].call+'</li>';
24             html = html+'<ul>';
25                 html = html+'<li>Datatypes:';
26                 html = html+'<ul>';
27                 for(var j = 0; j < response.result.data[i].datatypes.length; j++){
28                     html = html+'<li>'+response.result.data[i].datatypes[j]+'</li>';
29                 }
30                 html = html+'</ul>';
31                 html = html+'<li>Methods:';
32                 html = html+'<ul>';
33                 for(var j = 0; j < response.result.data[i].methods.length; j++){
34                     html = html+'<li>'+response.result.data[i].methods[j]+'</li>';
35                 }
36                 html = html+'</ul>';
37             html = html+'</ul>';
38         }
39         html = html+'</ul>';
40         jQuery("#brapi_calls_home_div").empty().html(html);
41       },
42       error: function(response) {
43         alert('An error occurred getting calls');
44       }
45     });
46 });
48 });
50 </script>