upnp.html 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <h3><i class="blue exchange icon"></i> Port Forward</h3>
  2. <p>Port forward using UPnP protocol</p>
  3. <div class="ui divider"></div>
  4. <div class="ui message">
  5. <h4><i class="ui loading spinner icon"></i> Checking Upnp State</h4>
  6. <p><i class="ui info circle icon"></i> If you are hosting this server under a home router which you have no access to, you can try port forward your services port and expose them to the internet via Upnp protocol.
  7. Note that not all router support this function, sometime this might be disabled by your ISP or administrator.</p>
  8. <button style="position: absolute; right: 0.6em; top: 0.6em;" class="ui circular basic icon button"><i class="ui green refresh icon"></i></button>
  9. </div>
  10. <div class="ui form">
  11. <div class="field">
  12. <div class="ui toggle checkbox">
  13. <input type="checkbox" name="upnp">
  14. <label>Enable UPnP</label>
  15. </div>
  16. </div>
  17. <div class="field">
  18. <label>Port to Forward</label>
  19. <div class="ui input">
  20. <input type="number" min="1" max="65535" name="forwardPort" placeholder="Forwardable Port">
  21. </div>
  22. </div>
  23. <div class="field">
  24. <label>Rule Name</label>
  25. <div class="ui input">
  26. <input type="text" name="ruleName" placeholder="Rule Name">
  27. </div>
  28. </div>
  29. <div class="field">
  30. <button class="ui teal button" type="button" name="addRule"><i class="ui add icon"></i> Add Rule</button>
  31. </div>
  32. </div>
  33. <div class="ui basic segment">
  34. <p>Forwarded Ports</p>
  35. <table class="ui basic table">
  36. <thead>
  37. <tr>
  38. <th>Port Forwarded</th>
  39. <th>Name of Rule</th>
  40. <th></th>
  41. </tr>
  42. </thead>
  43. <tbody>
  44. <tr>
  45. <td>80</td>
  46. <td>HTTP</td>
  47. <td><button class="ui button negative" type="button" name="deleteRule">Delete</button></td>
  48. </tr>
  49. <tr>
  50. <td>22</td>
  51. <td>SSH</td>
  52. <td><button class="ui button negative" type="button" name="deleteRule">Delete</button></td>
  53. </tr>
  54. </tbody>
  55. </table>
  56. </div>
  57. <script>
  58. //Get value of the form
  59. function getFormValues() {
  60. var formValues = {};
  61. formValues.upnp = $('input[name="upnp"]').prop('checked');
  62. formValues.forwardPort = $('input[name="forwardPort"]').val();
  63. formValues.ruleName = $('input[name="ruleName"]').val();
  64. return formValues;
  65. }
  66. </script>