page.html 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <html>
  2. <head>
  3. <title>ngrok</title>
  4. <link href="/static/highlight.min.css" rel="stylesheet">
  5. <link href="/static/bootstrap.min.css" rel="stylesheet">
  6. <script src="/static/highlight.min.js"></script>
  7. <script src="/static/vkbeautify.js"></script>
  8. <script src="/static/jquery-1.9.1.min.js"></script>
  9. <script>hljs.initHighlightingOnLoad();</script>
  10. <script type="text/javascript">
  11. $(function() {
  12. $("ul.request.nav a").click(function() {
  13. $(this).closest("div").find(".raw, .headers, .summary").hide();
  14. $(this).closest("div").find("." + $(this).attr("target")).show();
  15. $(this).closest("ul").find("li.active").removeClass("active");
  16. $(this).parent().addClass("active");
  17. return false;
  18. });
  19. $(".replay").click(function() {
  20. $.ajax({
  21. type: "POST",
  22. url: "/http/in/replay",
  23. data: { txnid: $(this).closest(".txn").attr("txnid") }
  24. });
  25. return false;
  26. });
  27. $("code.xml").each(function() {
  28. $(this).text(vkbeautify.xml($(this).text()));
  29. });
  30. });
  31. </script>
  32. <style type="text/css">
  33. body { margin-top: 50px; }
  34. ul.history > li { none; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid #ccc; }
  35. .headers, .raw { display: none; }
  36. table.params { font-family: Courier, monospace; }
  37. </style>
  38. </head>
  39. <body>
  40. <div class="container">
  41. <div class="navbar navbar-inverse navbar-fixed-top">
  42. <div class="navbar-inner">
  43. <div class="container">
  44. <a class="brand" href="#">ngrok</a>
  45. <ul class="nav">
  46. <li class="active"><a href="#">Inbound Requests</a></li>
  47. <li><a href="#">Outbound Requests</a></li>
  48. <li><a href="#">Configuration</a></li>
  49. </ul>
  50. </div>
  51. </div>
  52. </div>
  53. <ul class="history unstyled">
  54. {{ range .HttpRequests.Slice }}
  55. <li class="txn" txnid="{{ .Id }}">
  56. <div class="row">
  57. <!-- Request -->
  58. <div class="span6">
  59. {{ with .Req }}
  60. <h3>{{ .Method }} {{ .URL.Path }}</h3>
  61. <ul class="request nav nav-pills">
  62. <li class="active"><a target="summary" href="#">Summary</a></li>
  63. <li><a href="#" target="headers">Headers</a></li>
  64. <li><a href="#" target="raw">Raw</a></li>
  65. <li class="pull-right"><button class="replay btn btn-primary">Replay</button></li>
  66. </ul>
  67. <div class="raw">
  68. {{ with $raw := dumpRequest . }}
  69. <pre><code class="http">{{ $raw }}</code></pre>
  70. {{ end }}
  71. </div>
  72. <div class="headers">
  73. {{ with .Header }}
  74. <h6>Headers</h6>
  75. <table class="table params">
  76. {{ range $key, $value := .}}
  77. <tr>
  78. <th> {{ $key }} </th>
  79. <td> {{ $value }} </td>
  80. </tr>
  81. {{ end }}
  82. </table>
  83. {{ end }}
  84. </div>
  85. <div class="summary">
  86. {{ with .URL.Query }}
  87. <h6>Query Params</h6>
  88. <table class="table params">
  89. {{ range $key, $value := .}}
  90. <tr>
  91. <th> {{ $key }} </th>
  92. <td> {{ $value }} </td>
  93. </tr>
  94. {{ end }}
  95. </table>
  96. {{ end }}
  97. {{ template "body" . }}
  98. </div>
  99. {{ end }}
  100. </div>
  101. <!-- Response -->
  102. <div class="span6">
  103. {{ with .Resp }}
  104. <h3 class="{{ classForStatus .Status }}">{{ .Status }}</h3>
  105. <ul class="request nav nav-pills">
  106. <li class="active"><a target="summary" href="#">Summary</a></li>
  107. <li><a href="#" target="headers">Headers</a></li>
  108. <li><a href="#" target="raw">Raw</a></li>
  109. </ul>
  110. <div class="raw">
  111. {{ with $raw := dumpResponse . }}
  112. <pre><code class="http">{{ $raw }}</code></pre>
  113. {{ end }}
  114. </div>
  115. <div class="headers">
  116. {{ with .Header }}
  117. <h6>Headers</h6>
  118. <table class="table params">
  119. {{ range $key, $value := .}}
  120. <tr>
  121. <th> {{ $key }} </th>
  122. <td> {{ $value }} </td>
  123. </tr>
  124. {{ end }}
  125. </table>
  126. {{ end }}
  127. </div>
  128. <div class="summary">
  129. {{ template "body" . }}
  130. </div>
  131. {{ end }}
  132. </div>
  133. </div>
  134. </li>
  135. {{ end }}
  136. </ul>
  137. </div>
  138. </body>
  139. </html>