|
3 | 3 | <head>
|
4 | 4 | <meta charset="UTF-8">
|
5 | 5 | <title>X-Force IP Check</title>
|
6 |
| - <script src="jquery.js"></script> |
7 |
| - <script src="jquery.validate.js"></script> |
| 6 | + <script src="https://code.jquery.com/jquery-3.2.1.slim.js" |
| 7 | + integrity="sha256-tA8y0XqiwnpwmOIl3SGAcFl2RvxHjA8qp0+1uCGmRmg=" crossorigin="anonymous"></script> |
| 8 | + <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.17.0/jquery.validate.js"></script> |
| 9 | + <script> |
| 10 | + function warn_stop() |
| 11 | + { |
| 12 | + var conf = confirm("This will stop the web server and close your browser tab/window. You will loose any"+ |
| 13 | + "data returned from X-Force. Proceed?" ); |
| 14 | + |
| 15 | + if (conf) |
| 16 | + { |
| 17 | + $.post("/stop_demo", function(data){ alert("Data Loaded: " + data); }); |
| 18 | + } |
| 19 | + /*$.post( "/stop_demo", function() { |
| 20 | +
|
| 21 | + }) |
| 22 | + .success(data, status, ajaxRequestObj) function() { |
| 23 | +
|
| 24 | + .done(function() { |
| 25 | + alert( "second success" ); |
| 26 | + }) |
| 27 | + .fail(function() { |
| 28 | + alert( "error" ); |
| 29 | + }) |
| 30 | + .always(function() { |
| 31 | + alert( "finished" ); |
| 32 | + }); |
| 33 | + }*/ |
| 34 | + } |
| 35 | + </script> |
8 | 36 | <link rel="stylesheet" type="text/css" href="xfipchk.css"/>
|
9 |
| - :w |
10 | 37 | </head>
|
11 | 38 | <body>
|
12 | 39 | <div id="column">
|
13 |
| - <form id="the-form" action="process_form"> |
| 40 | + <form id="the_form" action="process_form" method="post"> |
14 | 41 | <div>
|
15 |
| - <p><span>Instructions:</span> |
| 42 | + <p><span class="instructions">Instructions:</span></p> |
16 | 43 | <ol>
|
17 | 44 | <li>Paste your IBM X-Force API key and password into the corresponding fields.</li>
|
18 |
| - <li>Enter IP addresses in the box labeled accordingly. They may be delimited by commas or newlines.</li> |
| 45 | + <li>Enter IP addresses in the box labeled accordingly. They must be delimited by commas or newlines.</li> |
19 | 46 | <li>Press the Submit button to call the API.</li>
|
| 47 | + <li>Review the results.</li> |
| 48 | + <li>Press the Stop Demo button to stop the demo.</li> |
20 | 49 | </ol>
|
21 | 50 | </p>
|
22 |
| - <label for="api-key">X-Force API Key</label> |
23 |
| - <input type="text" autofocus required class="api-cred" name="api_key" id="api-key" title="api-key" |
24 |
| - placeholder="01234567-9abc-def0-1234-56789abcdef0"/> |
25 |
| - <label for="api-password">X-Force API Password</label> |
26 |
| - <input type="text" class="api-cred" required name="api_password" id="api-password" title="api-password" |
27 |
| - placeholder="01234567-9abc-def0-1234-56789abcdef0"/> |
| 51 | + <label for="api_key">X-Force API Key</label> |
| 52 | + <input type="text" autofocus required class="api_cred" name="api_key" id="api_key" title="api_key" |
| 53 | + placeholder="01234567-9abc-def0-1234-56789abcdef0" pattern="^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" max="36"/> |
| 54 | + <br/> |
| 55 | + <label for="api_password">X-Force API Password</label> |
| 56 | + <input type="text" class="api_cred" required name="api_password" id="api_password" title="api_password" |
| 57 | + placeholder="01234567-9abc-def0-1234-56789abcdef0" pattern="^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" maxlength="36"/> |
28 | 58 | </div>
|
29 |
| - <div> |
30 |
| - <label for="ip-addresses">IP Addresses</label> |
31 |
| - <input type="textarea" class="ip-addresses" name="ip_addresses" id="ip-addresses"/> |
| 59 | + <div id="textarea"> |
| 60 | + <label for="ip_addresses">IP Addresses</label> |
| 61 | + <textarea class="ip_addresses" name="ip_addresses" id="ip_addresses"></textarea> |
| 62 | + </div> |
| 63 | + <div id="std_buttons"> |
| 64 | + <button id="submit" type="submit" form="the_form" value="submit">Submit</button> <button id="reset" type="reset" form="the_form" value="reset">Reset</button> |
| 65 | + </div> |
| 66 | + </form> |
| 67 | + <form id="stop_form"> |
| 68 | + <div id="stop_demo_button"> |
| 69 | + <button name="stop_demo" form="stop_form" onclick="warn_stop()">Stop Demo</button> |
32 | 70 | </div>
|
33 |
| - <script> |
34 |
| - $("the-form").validate(); |
35 |
| - |
36 |
| - |
37 |
| - </script> |
38 | 71 | </form>
|
39 | 72 | </div>
|
40 | 73 | </body>
|
|
0 commit comments