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.

77 lines
3.4 KiB

5 years ago
  1. <template>
  2. <div v-if="errorLogs.length>0">
  3. <el-badge :is-dot="true" style="line-height: 30px;" @click.native="dialogTableVisible=true">
  4. <el-button size="small" type="danger" class="bug-btn">
  5. <svg t="1492682037685" class="bug-svg" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1863"
  6. xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128">
  7. <path d="M969.142857 548.571429q0 14.848-10.861714 25.709714t-25.709714 10.861714l-128 0q0 97.718857-38.290286 165.705143l118.857143 119.442286q10.861714 10.861714 10.861714 25.709714t-10.861714 25.709714q-10.276571 10.861714-25.709714 10.861714t-25.709714-10.861714l-113.152-112.566857q-2.852571 2.852571-8.557714 7.424t-23.990857 16.274286-37.156571 20.845714-46.848 16.566857-55.442286 7.424l0-512-73.142857 0 0 512q-29.147429 0-58.002286-7.716571t-49.700571-18.870857-37.705143-22.272-24.868571-18.578286l-8.557714-8.009143-104.557714 118.272q-11.446857 11.995429-27.428571 11.995429-13.714286 0-24.576-9.142857-10.861714-10.276571-11.702857-25.417143t8.850286-26.587429l115.419429-129.718857q-33.133714-65.133714-33.133714-156.562286l-128 0q-14.848 0-25.709714-10.861714t-10.861714-25.709714 10.861714-25.709714 25.709714-10.861714l128 0 0-168.009143-98.852571-98.852571q-10.861714-10.861714-10.861714-25.709714t10.861714-25.709714 25.709714-10.861714 25.709714 10.861714l98.852571 98.852571 482.304 0 98.852571-98.852571q10.861714-10.861714 25.709714-10.861714t25.709714 10.861714 10.861714 25.709714-10.861714 25.709714l-98.852571 98.852571 0 168.009143 128 0q14.848 0 25.709714 10.861714t10.861714 25.709714zM694.857143 219.428571l-365.714286 0q0-75.995429 53.430857-129.426286t129.426286-53.430857 129.426286 53.430857 53.430857 129.426286z"
  8. p-id="1864"></path>
  9. </svg>
  10. </el-button>
  11. </el-badge>
  12. <el-dialog title="Error Log" :visible.sync="dialogTableVisible" width="80%">
  13. <el-table :data="errorLogs" border>
  14. <el-table-column label="Message">
  15. <template slot-scope="scope">
  16. <div>
  17. <span class="message-title">Msg:</span>
  18. <el-tag type="danger">{{ scope.row.err.message }}</el-tag>
  19. </div>
  20. <br/>
  21. <div>
  22. <span class="message-title" style="padding-right: 10px;">Info: </span>
  23. <el-tag type="warning">{{scope.row.vm.$vnode.tag}} error in {{scope.row.info}}</el-tag>
  24. </div>
  25. <br/>
  26. <div>
  27. <span class="message-title" style="padding-right: 16px;">Url: </span>
  28. <el-tag type="success">{{scope.row.url}}</el-tag>
  29. </div>
  30. </template>
  31. </el-table-column>
  32. <el-table-column label="Stack">
  33. <template slot-scope="scope">
  34. {{ scope.row.err.stack}}
  35. </template>
  36. </el-table-column>
  37. </el-table>
  38. </el-dialog>
  39. </div>
  40. </template>
  41. <script>
  42. export default {
  43. name: 'errorLog',
  44. data() {
  45. return {
  46. dialogTableVisible: false
  47. }
  48. },
  49. computed: {
  50. errorLogs() {
  51. return this.$store.getters.errorLogs
  52. }
  53. }
  54. }
  55. </script>
  56. <style scoped>
  57. .bug-btn.el-button--small {
  58. padding: 9px 10px;
  59. }
  60. .bug-svg {
  61. width: 1em;
  62. height: 1em;
  63. vertical-align: -0.15em;
  64. fill: currentColor;
  65. overflow: hidden;
  66. }
  67. .message-title {
  68. font-size: 16px;
  69. color: #333;
  70. font-weight: bold;
  71. padding-right: 8px;
  72. }
  73. </style>