RequestTab.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <div class="tab-content">
  3. <div class="layout-col">
  4. <DefinitionList title="Request" class-name="tab-content-section border-none">
  5. <DefinitionListRow label="URL">{{ request.url }}</DefinitionListRow>
  6. <DefinitionListRow label="Method">{{ request.method }}</DefinitionListRow>
  7. </DefinitionList>
  8. <DefinitionList title="Headers" class-name="tab-content-section">
  9. <DefinitionListRow v-for="(key, value) in headers" :key="key" :label="value">{{
  10. key[0]
  11. }}</DefinitionListRow>
  12. </DefinitionList>
  13. <DefinitionList title="Query String" class-name="tab-content-section">
  14. <DefinitionListRow
  15. v-for="(key, value) in requestData.queryString"
  16. :key="key"
  17. :label="value"
  18. >{{ key }}</DefinitionListRow
  19. >
  20. </DefinitionList>
  21. <DefinitionList title="Body" class-name="tab-content-section">
  22. <DefinitionListRow
  23. v-for="(key, value) in requestData.body"
  24. :key="key"
  25. :label="value"
  26. >{{ key }}</DefinitionListRow
  27. >
  28. </DefinitionList>
  29. <DefinitionList title="Files" class-name="tab-content-section">
  30. <DefinitionListRow
  31. v-for="(key, value) in requestData.files"
  32. :key="key"
  33. :label="value"
  34. >{{ key }}</DefinitionListRow
  35. >
  36. </DefinitionList>
  37. <DefinitionList title="Session" class-name="tab-content-section">
  38. <DefinitionListRow v-for="(key, value) in session" :key="key" :label="value">
  39. <template v-if="typeof key === 'string'">
  40. {{ key }}
  41. </template>
  42. <code v-else class="code-inline">
  43. <pre>{{ key }}</pre>
  44. </code>
  45. </DefinitionListRow>
  46. </DefinitionList>
  47. <DefinitionList title="Cookies" class-name="tab-content-section">
  48. <DefinitionListRow v-for="(key, value) in cookies" :key="key" :label="value">{{
  49. key
  50. }}</DefinitionListRow>
  51. </DefinitionList>
  52. </div>
  53. </div>
  54. </template>
  55. <script>
  56. import DefinitionList from '../Shared/DefinitionList';
  57. import DefinitionListRow from '../Shared/DefinitionListRow.js';
  58. export default {
  59. components: { DefinitionListRow, DefinitionList },
  60. inject: ['report'],
  61. computed: {
  62. request() {
  63. return this.report.context.request;
  64. },
  65. requestData() {
  66. return this.report.context.request_data;
  67. },
  68. headers() {
  69. return this.report.context.headers;
  70. },
  71. session() {
  72. return this.report.context.session;
  73. },
  74. cookies() {
  75. return this.report.context.cookies;
  76. },
  77. },
  78. };
  79. </script>