Made expandable man in REST Mock #269
38
Frontend/src/components/man/ManTooltipComponent.vue
Normal file
38
Frontend/src/components/man/ManTooltipComponent.vue
Normal file
@@ -0,0 +1,38 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
|
||||
|
||||
// const props = defineProps({
|
||||
// version: {
|
||||
// type: String,
|
||||
// required: true
|
||||
// },
|
||||
// toolType: {
|
||||
// type: String,
|
||||
// required: true
|
||||
// }
|
||||
// })
|
||||
|
||||
const emit = defineEmits([
|
||||
"update:visible"
|
||||
])
|
||||
|
||||
const areTooltipsHidden = ref(true)
|
||||
|
||||
function toggleTooltips() {
|
||||
areTooltipsHidden.value = !areTooltipsHidden.value;
|
||||
emit("update:visible", !areTooltipsHidden.value)
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div :class="areTooltipsHidden ? 'w-fit' : 'w-5/12'" class="hidden xl:flex items-stretch p-2 flex-row rounded-xl shadow-lg bg-gradient-to-r from-blue-400 to-blue-300 dark:from-sky-600 dark:to-sky-800 ">
|
||||
<button :class="{'mr-2' : !areTooltipsHidden }" class="text-xl w-6 dark:text-slate-100" @click="toggleTooltips()">
|
||||
T<br/>o<br/>o<br/>l<br/>t<br/>i<br/>p<br/>s
|
||||
</button>
|
||||
<div id="content" :class="{'hidden' : areTooltipsHidden}" class="w-full flex flex-col gap-4 p-2 overflow-auto rounded-xl dark:text-white bg-indigo-50 dark:bg-gray-700" >
|
||||
<slot></slot>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -10,10 +10,7 @@ import headerSectionImg from '@assets/man/rest-mock/Header_section.png';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex flex-col h-full gap-4">
|
||||
<div class="flex flex-row">
|
||||
<a href="/rest/mock" class="tool-button">Back to REST Mock</a>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col dark:text-slate-100 w-full h-full text-justify overflow-auto px-2">
|
||||
<h2 class="text-2xl font-bold mt-4 mb-2">Description</h2>
|
||||
<p><span class="font-medium">REST Mock</span> is a tool allowing to create temporary REST endpoint called REST Mock, that allows to test REST clients.</p>
|
||||
@@ -66,7 +63,6 @@ priority urgent
|
||||
|
||||
<ImgMan :imgPath="headerSectionImg" label='Screenshot of Headers Section with added custom headers.'></ImgMan>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ const props = defineProps(
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="w-full text-center dark:text-white mt-2 flex flex-col gap-4 ">
|
||||
<div class="w-full h-2/3 text-center dark:text-white mt-2 flex flex-col gap-4 overflow-auto">
|
||||
<div class="flex flex-row gap-4">
|
||||
<div class="w-full font-bold">Name</div>
|
||||
<div class="w-full font-bold">Value</div>
|
||||
|
||||
@@ -52,7 +52,6 @@ function showUpdatedCode(newCode : string){
|
||||
<a class="underline" :href="mockMessageLink">{{ mockMessageLink }}</a>
|
||||
</div>
|
||||
</div>
|
||||
<a class="tool-button" href="/man/rest-mock">Help</a>
|
||||
<SaveComponent v-bind:message-data="messageData"></SaveComponent>
|
||||
</div>
|
||||
<div class="flex flex-col md:flex-row w-full gap-4">
|
||||
|
||||
@@ -15,7 +15,7 @@ const visible = ref('hidden');
|
||||
const fetchLink = window.location.protocol + "//" + window.location.hostname + "/mock/api/mock";
|
||||
|
||||
function prepareAndSendData(){
|
||||
if (props.messageData != null|| props.messageData != undefined ){
|
||||
if (props.messageData != null || props.messageData != undefined ){
|
||||
fetch(fetchLink, { method: "put", body:JSON.stringify(props.messageData), headers: { "Content-Type" : "application/json" }})
|
||||
.then( response => response.text() )
|
||||
.then( data => {message.value = data} )
|
||||
|
||||
@@ -1,14 +1,29 @@
|
||||
<script setup lang="ts">
|
||||
import RestMockMessageComponent from '@components/mock/RestMockMessageComponent.vue'
|
||||
import HistoryComponent from '@components/mock/HistoryComponent.vue'
|
||||
import ManTooltipComponent from '@/components/man/ManTooltipComponent.vue';
|
||||
import RestMockManComponent from '@/components/man/RestMockManComponent.vue';
|
||||
import { ref } from 'vue';
|
||||
|
||||
|
||||
const historyVisibility = ref(true);
|
||||
|
||||
function setHistoryVisibility(visibility : boolean) {
|
||||
historyVisibility.value = !visibility;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<template>
|
||||
<div class="flex flex-col xl:flex-row gap-6 w-full overflow-y-auto overflow-x-hidden h-full">
|
||||
<RestMockMessageComponent></RestMockMessageComponent>
|
||||
<HistoryComponent></HistoryComponent>
|
||||
<HistoryComponent :class="{'hidden': !historyVisibility}"></HistoryComponent>
|
||||
<ManTooltipComponent @update:visible="setHistoryVisibility">
|
||||
<div class="mt-2">
|
||||
<a class="tool-button" href="/man/rest-mock">Expand</a>
|
||||
</div>
|
||||
<RestMockManComponent></RestMockManComponent>
|
||||
</ManTooltipComponent>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -10,6 +10,11 @@ export default {
|
||||
|
||||
|
||||
<template>
|
||||
<div class="flex flex-col h-full gap-4">
|
||||
<div class="flex flex-row">
|
||||
<a href="/rest/mock" class="tool-button">Back to REST Mock</a>
|
||||
</div>
|
||||
<RestMockManComponent></RestMockManComponent>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user