subd.html 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <div class="standardContainer">
  2. <div class="ui basic segment">
  3. <h2>Subdomain</h2>
  4. <p>Subdomains are a way to organize and identify different sections of a website or domain. They are essentially a prefix to the main domain name, separated by a dot. <br>For example, in the domain "blog.example.com," "blog" is the subdomain.</p>
  5. </div>
  6. <div style="width: 100%; overflow-x: auto; margin-bottom: 1em;">
  7. <table class="ui celled sortable unstackable compact table">
  8. <thead>
  9. <tr>
  10. <th>Matching Domain</th>
  11. <th>Proxy To</th>
  12. <th class="no-sort">Remove</th>
  13. </tr>
  14. </thead>
  15. <tbody id="subdList">
  16. </tbody>
  17. </table>
  18. </div>
  19. <button class="ui icon right floated basic button" onclick="listSubd();"><i class="green refresh icon"></i> Refresh</button>
  20. <br><br>
  21. </div>
  22. <script>
  23. function listSubd(){
  24. $("#subdList").html(``);
  25. $.get("/api/proxy/list?type=subd", function(data){
  26. if (data.error !== undefined){
  27. $("#subdList").append(`<tr>
  28. <td data-label="" colspan="3"><i class="remove icon"></i> ${data.error}</td>
  29. </tr>`);
  30. }else if (data.length == 0){
  31. $("#subdList").append(`<tr>
  32. <td data-label="" colspan="3"><i class="checkmark icon"></i> No Subdomain Proxy Record</td>
  33. </tr>`);
  34. }else{
  35. data.forEach(subd => {
  36. let tlsIcon = "";
  37. if (subd.RequireTLS){
  38. tlsIcon = `<i class="lock icon"></i>`;
  39. }
  40. $("#subdList").append(`<tr>
  41. <td data-label="">${subd.MatchingDomain}</td>
  42. <td data-label="">${subd.Domain} ${tlsIcon}</td>
  43. <td class="center aligned" data-label=""><button class="ui circular mini red basic icon button" onclick='deleteEndpoint("subd","${subd.MatchingDomain}")'><i class="trash icon"></i></button></td>
  44. </tr>`);
  45. });
  46. }
  47. });
  48. }
  49. //Bind on tab switch events
  50. tabSwitchEventBind["subd"] = function(){
  51. listSubd();
  52. }
  53. </script>