AppTab.vue 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <template>
  2. <div class="tab-content">
  3. <div class="layout-col">
  4. <DefinitionList title="Routing" class-name="tab-content-section border-none">
  5. <DefinitionListRow label="Controller">{{
  6. route.controllerAction
  7. }}</DefinitionListRow>
  8. <DefinitionListRow label="Route name">{{
  9. route.route || 'unknown'
  10. }}</DefinitionListRow>
  11. <DefinitionListRow label="Route parameters">
  12. <DefinitionList>
  13. <DefinitionListRow
  14. v-for="(parameter, key) in route.routeParameters || []"
  15. :label="key"
  16. :key="key"
  17. ><code class="code-inline"
  18. ><pre>{{ parameter }}</pre></code
  19. ></DefinitionListRow
  20. >
  21. </DefinitionList>
  22. </DefinitionListRow>
  23. <DefinitionListRow label="Middleware">
  24. <DefinitionList>
  25. <DefinitionListRow
  26. v-for="(middleware, i) in route.middleware || []"
  27. :key="i"
  28. >{{ middleware }}</DefinitionListRow
  29. >
  30. </DefinitionList>
  31. </DefinitionListRow>
  32. </DefinitionList>
  33. <DefinitionList title="View" class="tab-content-section">
  34. <DefinitionListRow label="View name">{{ view.view }}</DefinitionListRow>
  35. <DefinitionListRow label="View data">
  36. <DefinitionList>
  37. <DefinitionListRow
  38. v-for="(dump, key) in view.data || []"
  39. :key="key"
  40. :label="key"
  41. >
  42. <div v-html="dump"></div>
  43. </DefinitionListRow>
  44. </DefinitionList>
  45. </DefinitionListRow>
  46. </DefinitionList>
  47. </div>
  48. </div>
  49. </template>
  50. <script>
  51. import DefinitionList from '../Shared/DefinitionList';
  52. import DefinitionListRow from '../Shared/DefinitionListRow.js';
  53. export default {
  54. components: { DefinitionListRow, DefinitionList },
  55. inject: ['report'],
  56. computed: {
  57. route() {
  58. return this.report.context.route;
  59. },
  60. view() {
  61. return this.report.context.view || {};
  62. },
  63. viewData() {
  64. return Object.entries(this.view.data || []).map(([key, dump]) => ({ key, dump }));
  65. },
  66. },
  67. };
  68. </script>