error-log.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <view class="uni-table">
  3. <uni-table border stripe>
  4. <uni-tr>
  5. <uni-th align="center">错误信息</uni-th>
  6. <uni-th width="100" align="center">路由</uni-th>
  7. <uni-th width="100" align="center">时间</uni-th>
  8. <uni-th width="100" align="center">搜索</uni-th>
  9. </uni-tr>
  10. <uni-tr v-for="(log,index) in logs" :key="index">
  11. <uni-td>
  12. <text class="err-msg">Error in {{log.info}}: `{{log.err}}`</text>
  13. </uni-td>
  14. <uni-td>
  15. <navigator class="err-route" :url="log.route">{{log.route}}</navigator>
  16. </uni-td>
  17. <uni-td>
  18. <text>{{log.time}}</text>
  19. </uni-td>
  20. <uni-td>
  21. <!-- #ifdef H5 -->
  22. <a v-for="engine in engines" :href="engine.url.replace('ERR_MSG',encodeURIComponent(log.err))"
  23. target="_blank" class="err-search">{{engine.name}}</a>
  24. <!-- #endif -->
  25. </uni-td>
  26. </uni-tr>
  27. </uni-table>
  28. </view>
  29. </template>
  30. <script>
  31. import {
  32. mapState
  33. } from 'vuex'
  34. import config from '@/admin.config.js'
  35. const debugOptions = config.navBar.debug || {}
  36. export default {
  37. data() {
  38. return {
  39. engines: debugOptions.engine || []
  40. };
  41. },
  42. computed: {
  43. ...mapState('error', ['logs'])
  44. },
  45. methods: {
  46. search(engine, log) {
  47. }
  48. }
  49. }
  50. </script>
  51. <style>
  52. .err-msg {
  53. color: #FF0000;
  54. }
  55. .err-search {
  56. margin-right: 10px;
  57. }
  58. </style>