Michael Davis | cb8bb19 | 2017-02-09 15:45:13 -0600 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <html lang="en"> |
| 3 | <head> |
| 4 | <meta charset="UTF-8"> |
| 5 | <title>openBMC</title> |
| 6 | <link rel="icon" href="favicon.ico?v=2"/> |
| 7 | <link rel="stylesheet" href="css/main.css"> |
| 8 | <script src="js/vendor/vendor.min.js"></script> |
| 9 | <script> |
| 10 | var user = 'root'; |
| 11 | var password = '0penBmc'; |
Michael Davis | 1947575 | 2017-02-23 18:30:23 -0600 | [diff] [blame^] | 12 | var ip = 'https://9.3.164.147'; |
Michael Davis | cb8bb19 | 2017-02-09 15:45:13 -0600 | [diff] [blame] | 13 | |
| 14 | function getList(){ |
Michael Davis | 1947575 | 2017-02-23 18:30:23 -0600 | [diff] [blame^] | 15 | |
Michael Davis | cb8bb19 | 2017-02-09 15:45:13 -0600 | [diff] [blame] | 16 | $.ajax({ |
| 17 | type: "GET", |
Michael Davis | 1947575 | 2017-02-23 18:30:23 -0600 | [diff] [blame^] | 18 | url: ip + "/xyz/openbmc_project/list", |
Michael Davis | cb8bb19 | 2017-02-09 15:45:13 -0600 | [diff] [blame] | 19 | dataType: "json", |
| 20 | async: true, |
| 21 | xhrFields: { |
| 22 | withCredentials: true |
| 23 | }, |
| 24 | headers: { |
| 25 | 'Accept': 'application/json', |
| 26 | 'Content-Type': 'application/json' |
| 27 | }, |
| 28 | success: function(response){ |
| 29 | var json = JSON.stringify(response); |
| 30 | var content = JSON.parse(json); |
| 31 | //console.log(content.data); |
| 32 | |
| 33 | for (var i = 0; i < content.data.length; i++) { |
| 34 | var item = content.data[i]; |
| 35 | console.log(item); |
| 36 | $('.container').append('<p>' + item + '</p>'); |
| 37 | } |
| 38 | }, |
| 39 | error: function(xhr, textStatus, errorThrown){ |
Michael Davis | 1947575 | 2017-02-23 18:30:23 -0600 | [diff] [blame^] | 40 | console.log("not a successful request!"); |
Michael Davis | cb8bb19 | 2017-02-09 15:45:13 -0600 | [diff] [blame] | 41 | console.log(xhr, textStatus, errorThrown) |
| 42 | } |
| 43 | }); |
| 44 | } |
| 45 | |
| 46 | var login = { |
| 47 | "type": "POST", |
| 48 | "url": ip + "/login", |
| 49 | "dataType": "json", |
| 50 | "async": true, |
| 51 | "headers": { |
| 52 | 'Accept': 'application/json', |
| 53 | 'Content-Type': 'application/json' |
| 54 | }, |
| 55 | "xhrFields": { |
| 56 | withCredentials: true |
| 57 | }, |
| 58 | "data": JSON.stringify({"data": [user, password]}), |
| 59 | "success": function(response){ |
| 60 | console.log(response); |
| 61 | getList(); |
| 62 | }, |
| 63 | "error": function(xhr, textStatus, errorThrown){ |
Michael Davis | 1947575 | 2017-02-23 18:30:23 -0600 | [diff] [blame^] | 64 | console.log("not a successful request!"); |
Michael Davis | cb8bb19 | 2017-02-09 15:45:13 -0600 | [diff] [blame] | 65 | console.log(xhr, textStatus, errorThrown) |
| 66 | } |
| 67 | }; |
| 68 | </script> |
| 69 | </head> |
| 70 | <body> |
| 71 | |
| 72 | <!-- Header & Navigation includes --> |
| 73 | <div id="header__wrapper"></div> |
| 74 | <div id="navigation"></div> |
Michael Davis | 1947575 | 2017-02-23 18:30:23 -0600 | [diff] [blame^] | 75 | <main class="content__container" role="main"> |
Michael Davis | cb8bb19 | 2017-02-09 15:45:13 -0600 | [diff] [blame] | 76 | <div class="row"> |
| 77 | <div class="column"> |
| 78 | |
| 79 | <!-- Main content --> |
| 80 | <script>$.ajax(login)</script> |
| 81 | <div id="data"></div> |
| 82 | |
| 83 | <p>Donec sollicitudin molestie malesuada. Pellentesque in ipsum id orci porta dapibus. Curabitur non nulla sit amet nisl tempus convallis quis ac lectus. Vivamus suscipit tortor eget felis porttitor volutpat. Cras ultricies ligula sed magna dictum porta. Sed porttitor lectus nibh. Praesent sapien massa, convallis a pellentesque nec, egestas non nisi. Vivamus suscipit tortor eget felis porttitor volutpat. Vivamus suscipit tortor eget felis porttitor volutpat. Nulla porttitor accumsan tincidunt.</p> |
| 84 | </div> |
| 85 | </div> |
Michael Davis | 1947575 | 2017-02-23 18:30:23 -0600 | [diff] [blame^] | 86 | </main> |
Michael Davis | cb8bb19 | 2017-02-09 15:45:13 -0600 | [diff] [blame] | 87 | |
| 88 | </body> |
| 89 | <script src="js/app.min.js"></script> |
Michael Davis | cb8bb19 | 2017-02-09 15:45:13 -0600 | [diff] [blame] | 90 | </html> |