|
| 1 | +<html> |
| 2 | + <head> |
| 3 | + <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" |
| 4 | + integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" |
| 5 | + crossorigin="anonymous" |
| 6 | + rel="stylesheet"> |
| 7 | + <script src="https://code.jquery.com/jquery-3.2.1.min.js" |
| 8 | + integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" |
| 9 | + crossorigin="anonymous"></script> |
| 10 | + <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" |
| 11 | + integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" |
| 12 | + crossorigin="anonymous"></script> |
| 13 | + </head> |
| 14 | + <body> |
| 15 | + <div class="container"> |
| 16 | + <h2>Service Testing Interface <small>Mesos Playground</small></h2> |
| 17 | + <hr> |
| 18 | + <p class="lead">Use this page to make calls back into the cluster to test different parts of the system.</p> |
| 19 | + <hr> |
| 20 | + |
| 21 | + <div class="row"> |
| 22 | + <h4>UUID->GENERATE</h4> |
| 23 | + <form class="col-md-12 form-inline" id="uuid_generate"> |
| 24 | + <button type="submit" class="btn btn-default">Generate</button> |
| 25 | + </form> |
| 26 | + <div>Result: <span id="uuid_generate_result">0</span></div> |
| 27 | + </div> |
| 28 | + |
| 29 | + <hr /> |
| 30 | + |
| 31 | + <div class="row"> |
| 32 | + <h4>MATH->SUM</h4> |
| 33 | + <form class="col-md-12 form-inline" id="math_sum"> |
| 34 | + <div class="form-group"> |
| 35 | + <label for="math_sum_a">Left Addend: </label> |
| 36 | + <input type="text" class="form-control" id="math_sum_a" name="a" placeholder="Number"> |
| 37 | + </div> |
| 38 | + <div class="form-group"> |
| 39 | + <label for="math_sum_b">Right Addend: </label> |
| 40 | + <input type="text" class="form-control" id="math_sum_b" name="b" placeholder="Number"> |
| 41 | + </div> |
| 42 | + <button type="submit" class="btn btn-default">SUM</button> |
| 43 | + </form> |
| 44 | + <div>Result: <span id="math_sum_result">0</span></div> |
| 45 | + </div> |
| 46 | + |
| 47 | + <hr /> |
| 48 | + |
| 49 | + <div class="row"> |
| 50 | + <h4>MATH->PRODUCT</h4> |
| 51 | + <form class="col-md-12 form-inline" id="math_product"> |
| 52 | + <div class="form-group"> |
| 53 | + <label for="math_product_a">Left Factor: </label> |
| 54 | + <input type="text" class="form-control" id="math_product_a" name="a" placeholder="Number"> |
| 55 | + </div> |
| 56 | + <div class="form-group"> |
| 57 | + <label for="math_product_b">Right Factor: </label> |
| 58 | + <input type="text" class="form-control" id="math_product_b" name="b" placeholder="Number"> |
| 59 | + </div> |
| 60 | + <button type="submit" class="btn btn-default">PRODUCT</button> |
| 61 | + </form> |
| 62 | + <div>Result: <span id="math_product_result">0</span></div> |
| 63 | + </div> |
| 64 | + |
| 65 | + <hr /> |
| 66 | + |
| 67 | + </div> |
| 68 | + |
| 69 | + <script type="text/javascript"> |
| 70 | + |
| 71 | + $().ready(function () { |
| 72 | + $('#uuid_generate').submit(function(evt) { |
| 73 | + |
| 74 | + evt.preventDefault(); |
| 75 | + |
| 76 | + $.ajax({ |
| 77 | + method: 'GET', |
| 78 | + url: '/api/uuid', |
| 79 | + statusCode: { |
| 80 | + 400: function(d) { |
| 81 | + $('#uuid_generate_result').text(d.responseJSON.message + " [FAILED]"); |
| 82 | + } |
| 83 | + } |
| 84 | + }).done(function(d) { |
| 85 | + $('#uuid_generate_result').text(d.uuid + " [SUCCESS]"); |
| 86 | + }); |
| 87 | + }); |
| 88 | + |
| 89 | + $('#math_sum').submit(function(evt) { |
| 90 | + |
| 91 | + evt.preventDefault(); |
| 92 | + |
| 93 | + var a = Number(this.a.value) || this.a.value; |
| 94 | + var b = Number(this.b.value) || this.b.value; |
| 95 | + |
| 96 | + $.ajax({ |
| 97 | + method: 'POST', |
| 98 | + url: '/api/math/sum', |
| 99 | + data: { a: a, b: b }, |
| 100 | + statusCode: { |
| 101 | + 400: function(d) { |
| 102 | + $('#math_sum_result').text(d.responseJSON.message + " [FAILED]"); |
| 103 | + } |
| 104 | + } |
| 105 | + }).done(function(d) { |
| 106 | + $('#math_sum_result').text(d.sum + " [SUCCESS]"); |
| 107 | + }); |
| 108 | + }); |
| 109 | + |
| 110 | + $('#math_product').submit(function(evt) { |
| 111 | + |
| 112 | + evt.preventDefault(); |
| 113 | + |
| 114 | + var a = Number(this.a.value) || this.a.value; |
| 115 | + var b = Number(this.b.value) || this.b.value; |
| 116 | + |
| 117 | + $.ajax({ |
| 118 | + method: 'POST', |
| 119 | + url: '/api/math/product', |
| 120 | + data: { a: a, b: b }, |
| 121 | + statusCode: { |
| 122 | + 400: function(d) { |
| 123 | + $('#math_product_result').text(d.responseJSON.message + " [FAILED]"); |
| 124 | + } |
| 125 | + } |
| 126 | + }).done(function(d) { |
| 127 | + $('#math_product_result').text(d.product + " [SUCCESS]"); |
| 128 | + }); |
| 129 | + }); |
| 130 | + }); |
| 131 | + |
| 132 | + </script> |
| 133 | + </body> |
| 134 | +</html> |
0 commit comments