Improved legibility of REST Mock interface and various fixes (#266)

Reviewed-on: #266
Reviewed-by: Mikolaj Widla <widlam@noreply.example.com>
Co-authored-by: Adam Bem <adam.bem@zoho.eu>
Co-committed-by: Adam Bem <adam.bem@zoho.eu>
This commit is contained in:
2023-11-15 07:54:14 +01:00
committed by Adam Bem
parent 5febb10d22
commit 252cadea16
21 changed files with 193 additions and 71 deletions

View File

@@ -3,7 +3,7 @@
const props = defineProps(
{
encodeType: {type:String,required:true},
operationType: {type:String,required:true},
code: {type: String, required: true}
}
)
@@ -15,16 +15,16 @@ const emit = defineEmits([
function convert(){
console.log("works")
switch(props.encodeType.toLowerCase()){
case "base64":{
switch(props.operationType.toLowerCase()){
case "encode":{
emit('update:result', btoa(props.code) )
break;
}
case "text":{
case "decode":{
emit('update:result', atob(props.code) )
break;
}
case "image":{
case "show image":{
emit('image:show', props.code )
break;
}
@@ -35,5 +35,5 @@ function convert(){
</script>
<template>
<button @click="convert()" class="tool-button">{{ props.encodeType }}</button>
<button @click="convert()" class="tool-button">{{ props.operationType }}</button>
</template>