connections.js 630 B

123456789101112131415161718192021222324
  1. function connections_view() {
  2. var str = '<table border="1" width="100%">';
  3. str += '<tr><td><textarea style="width:95%; height:240px" id="connections"/></td></tr>';
  4. str += '</table>';
  5. $('#content').html(str);
  6. $.ajax({
  7. type : 'get',
  8. dataType : 'json',
  9. contentType : 'application/json; charset=utf-8',
  10. url : '../jaxrs/connections',
  11. xhrFields : {
  12. 'withCredentials' : true
  13. },
  14. crossDomain : true
  15. }).done(function(data) {
  16. if (data.type == 'success') {
  17. if (data.data) {
  18. $('#connections', '#content').val(JSON.stringify(data.data, null, '\t'));
  19. }
  20. } else {
  21. failure(data);
  22. }
  23. });
  24. }