subd.html 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <table class="ui celled sortable unstackable compact table">
  2. <thead>
  3. <tr>
  4. <th>Matching Domain</th>
  5. <th>Proxy To</th>
  6. <th class="no-sort">Remove</th>
  7. </tr>
  8. </thead>
  9. <tbody id="subdList">
  10. </tbody>
  11. </table>
  12. <button class="ui icon green basic button" onclick="listSubd();"><i class="refresh icon"></i> Refresh</button>
  13. <script>
  14. listSubd();
  15. function listSubd(){
  16. $("#subdList").html(``);
  17. $.get("/api/proxy/list?type=subd", function(data){
  18. if (data.error !== undefined){
  19. $("#subdList").append(`<tr>
  20. <td data-label="" colspan="3"><i class="remove icon"></i> ${data.error}</td>
  21. </tr>`);
  22. }else if (data.length == 0){
  23. $("#subdList").append(`<tr>
  24. <td data-label="" colspan="3"><i class="checkmark icon"></i> No Subdomain Proxy Record</td>
  25. </tr>`);
  26. }else{
  27. data.forEach(subd => {
  28. let tlsIcon = "";
  29. if (subd.RequireTLS){
  30. tlsIcon = `<i class="lock icon"></i>`;
  31. }
  32. $("#subdList").append(`<tr>
  33. <td data-label="">${subd.MatchingDomain}</td>
  34. <td data-label="">${subd.Domain} ${tlsIcon}</td>
  35. <td data-label=""><button class="ui circular mini red basic button" onclick='deleteEndpoint("subd","${subd.MatchingDomain}")'><i class="remove icon"></i> Delete</button></td>
  36. </tr>`);
  37. });
  38. }
  39. });
  40. }
  41. </script>