debug.tpl 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. include_once dirname(__FILE__) . '/../../../App/Services/AppServer.php';
  3. include_once dirname(__FILE__) . '/../../../App/Services/TestServer.php';
  4. ?>
  5. <html>
  6. <?php require_once dirname(__FILE__) . '/head.inc.tpl'; ?>
  7. <script type="text/javascript">
  8. function updateCallDialog(class_Name, method, params) {
  9. $("#className").text(method + " methond on " + class_Name);
  10. $("#myform").attr("action", "?go=index.php&do=call&className=" + class_Name + "&method=" + method);
  11. $("#args").empty();
  12. for (arg in params) {
  13. $("#args").append('<tr><td>' + params[arg].name + '</td><td><input name="' + params[arg].name + '"></td></tr>');
  14. }
  15. $("#result").empty();
  16. // $("#myform").one("submit",null,null,postCallParams);
  17. }
  18. ;
  19. function postCallParams() {
  20. var form = $("#myform");
  21. var url = form.attr("action");
  22. var data = form.serialize();
  23. $.ajax({
  24. type: "post",
  25. url: url,
  26. data: data,
  27. success: function (resp) {
  28. $("#result").html(resp);
  29. },
  30. error: function () {
  31. alert("err");
  32. }
  33. });
  34. return false; // 阻止表单自动提交事件
  35. }
  36. ;
  37. </script>
  38. <body>
  39. <?php require_once __DIR__ . '/header.tpl'; ?>
  40. <div id='main'>
  41. <div class="left">
  42. <b> 测试</b>
  43. <div class="menu">
  44. <?php
  45. ob_start();
  46. Debug::listMethod('loyalsof\AppServer');
  47. Debug::listMethod('loyalsoft\TestServer');
  48. ob_end_flush();
  49. ?>
  50. </div>
  51. </div>
  52. <div style="position: relative; top: 0px;clear: right;" class="userInput" id="callDialog">
  53. <h3><b id="className">api method on AppServer service</b></h3>
  54. 复杂参数, 请使用RequestVo的JSON编码格式.
  55. <form id="myform" action="?go=index.php&do=call" method="POST">
  56. <table>
  57. <tbody id="args">
  58. <tr><td>request</td><td><input name="request" /></td></tr>
  59. </tbody>
  60. </table>
  61. <input type="button" value="Call method »" onclick="postCallParams();" />
  62. </form>
  63. <div style="position: relative; top: 0px;display: inline-block;float: none;" id="result" >
  64. </div>
  65. </div>
  66. </div>
  67. <?php require_once __DIR__ . '/footer.tpl'; ?>
  68. </body>
  69. </html>