Merge branch 'master' of gitea.release11.com:R11/release11-tools into widlam/dev/implement_rest_mock
This commit is contained in:
@@ -1,52 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, type Ref } from 'vue';
|
||||
|
||||
interface historyRecord {
|
||||
clientUUID : String,
|
||||
dateTimeStamp: String,
|
||||
headers : Object,
|
||||
httpMethod: String,
|
||||
requestBody: String
|
||||
}
|
||||
|
||||
|
||||
const clientUUID = localStorage.getItem("clientUUID")
|
||||
const fetchLink = window.location.protocol + "//" + window.location.hostname + "/mock/api/event";
|
||||
const historyRecords : Ref<Array<historyRecord>> = ref([])
|
||||
fetch(fetchLink+"/"+clientUUID).then(response => response.json()).then(data => { historyRecords.value = data });
|
||||
|
||||
function parseTimeStamp(timestamp : String){
|
||||
return timestamp.substring(10,19).replace("T"," ");
|
||||
}
|
||||
|
||||
function showHeaders(headers:Object){
|
||||
|
||||
}
|
||||
|
||||
function showBody(body : String){
|
||||
|
||||
}
|
||||
|
||||
import HistoryRecords from './HistoryRecords.vue';
|
||||
</script>
|
||||
|
||||
|
||||
<template>
|
||||
<div class="w-full xl:w-5/12">
|
||||
<table class="text-white h-28 w-full text-center">
|
||||
<tr>
|
||||
<th>Time</th>
|
||||
<th>HTTP Method</th>
|
||||
<th>HTTP Headers</th>
|
||||
<th>Request Body</th>
|
||||
</tr>
|
||||
<tr v-for="(item , index) in historyRecords" :key="index">
|
||||
<td> {{ parseTimeStamp(item.dateTimeStamp) }} </td>
|
||||
<td> {{ item.httpMethod }} </td>
|
||||
<td> <button @click="showHeaders(item.headers);">Show Headers</button> </td>
|
||||
<td> <button @click="showBody(item.requestBody)">Show Body</button> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<HistoryRecords></HistoryRecords>
|
||||
</template>
|
||||
Reference in New Issue
Block a user