You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

100 lines
2.6 KiB

  1. ::use 'admin/design.mtt'::
  2. <div class="span12">
  3. <div class="article">
  4. <h1>Errors</h1>
  5. <div class="box">
  6. <form action="/admin/errors" method="GET">
  7. User :
  8. <input type="text" name="user" class="tid_userSearch" tid_optional="1" ::attr tid_value if(u!=null) u.name+"/"+u.id::/><br/>
  9. Error :
  10. <input type="text" name="like" value="::like::" /><br/>
  11. <input type="submit" value="Search" class="btn btn-default btn-sm"/>
  12. </form>
  13. </div>
  14. <div class="box">
  15. Date serveur : ::now::<br/>
  16. <a href="/admin/errors?empty=1" class="btn btn-default btn-sm" $$confirm()>Vider la table</a>
  17. </div>
  18. <script type="text/javascript" src="/js/rgraph/RGraph.common.core.js" ></script>
  19. <script type="text/javascript" src="/js/rgraph/RGraph.bar.js" ></script>
  20. <canvas id="graph" width="900" height="150">[No canvas support]</canvas>
  21. <script>
  22. window.onload = function ()
  23. {
  24. var datas = [];
  25. var labels = [];
  26. ::foreach e errorsStats::
  27. datas.push(::e.c::);
  28. labels.push( '::e.day::' );
  29. ::end::
  30. var bar = new RGraph.Bar('graph', datas);
  31. bar.Set('chart.labels', labels);
  32. bar.Set('chart.colors', ['#C00']);
  33. bar.Set('chart.title', 'Last errors');
  34. bar.Set('chart.labels.above', true);
  35. bar.Set('chart.background.barcolor1', 'white');
  36. bar.Set('chart.background.barcolor2', 'white');
  37. bar.Set('chart.background.grid', true);
  38. bar.Set('chart.gutter.left', 60);
  39. bar.Set('chart.gutter.bottom', 40);
  40. bar.Set('chart.text.angle', 45);
  41. bar.Draw();
  42. }
  43. </script>
  44. ::set url = "/admin/errors"::
  45. $$browse(::browser::,::url::)
  46. <table class="table table-bordered table-striped table-condensed table-hover">
  47. <tr>
  48. <th>id</th>
  49. <th>date</th>
  50. <th>Error</th>
  51. <th>infos</th>
  52. <th>user id</th>
  53. <th>URL</th>
  54. </tr>
  55. <tr ::repeat r browser.current()::>
  56. <td>::r.id::</td>
  57. <td>::r.date::</td>
  58. ::set e = r.error.split('Called')::
  59. <td>
  60. ::e.shift()::
  61. ::if e.length > 0::
  62. <a href="#" onclick="$(this).next().toggle(); return false;">[stack]</a>
  63. <div style="display:none;">
  64. <pre>Called::e.join("Called")::</pre>
  65. </div>
  66. ::end::
  67. </td>
  68. <td>
  69. <a href="#" onclick="$(this).next().toggle(); return false;">[infos]</a>
  70. <div style="display:none;">
  71. <b>IP: </b>::r.ip::<br/>
  72. <b>User-Agent: </b>::r.userAgent::
  73. </div>
  74. </td>
  75. <td>
  76. <span ::cond r.uid!=null::>
  77. <a href="/p/hosted/user/::r.uid::">::r._user.getName()::</a>
  78. </span>
  79. </td>
  80. <td>::r.url::</td>
  81. </tr>
  82. </table>
  83. $$browse(::browser::,::url::)
  84. </div>
  85. </div>
  86. ::end::