Frontend for HTML tools implemented
This commit is contained in:
13
Frontend/src/assets/sampleHtml.html
Normal file
13
Frontend/src/assets/sampleHtml.html
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Example Page</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Hello World!</h1>
|
||||||
|
<p>That's paragraph</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -4,7 +4,7 @@ import sampleXML from "@/assets/sampleXml.xml?raw"
|
|||||||
import sampleXSLT from "@/assets/sampleXslt.xml?raw"
|
import sampleXSLT from "@/assets/sampleXslt.xml?raw"
|
||||||
import sampleXSD from "@/assets/sampleXsd.xml?raw"
|
import sampleXSD from "@/assets/sampleXsd.xml?raw"
|
||||||
import sampleXQuery from "@/assets/sampleXQuery.xquery?raw"
|
import sampleXQuery from "@/assets/sampleXQuery.xquery?raw"
|
||||||
|
import sampleHTML from "@assets/sampleHtml.html?raw"
|
||||||
|
|
||||||
const props = defineProps(
|
const props = defineProps(
|
||||||
{
|
{
|
||||||
@@ -32,7 +32,9 @@ function setDefault() {
|
|||||||
case "xquery":
|
case "xquery":
|
||||||
emit(emitName, sampleXQuery)
|
emit(emitName, sampleXQuery)
|
||||||
break;
|
break;
|
||||||
|
case "html":
|
||||||
|
emit(emitName,sampleHTML);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
emit(emitName, sampleXML)
|
emit(emitName, sampleXML)
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
const props = defineProps(
|
||||||
|
{
|
||||||
|
formatType: {type:String,required:true},
|
||||||
|
code: {type:String,required:true},
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
const emit = defineEmits([
|
||||||
|
'update:result'
|
||||||
|
])
|
||||||
|
|
||||||
|
function process(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<button class="tool-button" @click="process()">{{ formatType }}</button>
|
||||||
|
</template>
|
||||||
@@ -5,6 +5,7 @@ const restMock = import("@views/RestMockView.vue")
|
|||||||
|
|
||||||
const jsonFormatter = import("@views/JsonFormatterView.vue")
|
const jsonFormatter = import("@views/JsonFormatterView.vue")
|
||||||
const xmlFormatter = import("@views/XmlFormatterView.vue")
|
const xmlFormatter = import("@views/XmlFormatterView.vue")
|
||||||
|
const HtmlFormatterView = import("@views/HtmlFormatterView.vue")
|
||||||
|
|
||||||
const xsltTool = import("@views/XSLTView.vue")
|
const xsltTool = import("@views/XSLTView.vue")
|
||||||
const xsdTool = import("@views/XSDView.vue")
|
const xsdTool = import("@views/XSDView.vue")
|
||||||
@@ -27,6 +28,11 @@ const routes = [
|
|||||||
name: 'jsonFormatter',
|
name: 'jsonFormatter',
|
||||||
component: () => jsonFormatter
|
component: () => jsonFormatter
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/format/html',
|
||||||
|
name: 'htmlFormatter',
|
||||||
|
component: () => HtmlFormatterView
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/xml/xpath',
|
path: '/xml/xpath',
|
||||||
name: 'xpath',
|
name: 'xpath',
|
||||||
|
|||||||
30
Frontend/src/views/HtmlFormatterView.vue
Normal file
30
Frontend/src/views/HtmlFormatterView.vue
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import InsertTemplateComponent from '@components/common/InsertTemplateComponent.vue';
|
||||||
|
import CodeEditorComponent from '@/components/CodeEditorComponent.vue';
|
||||||
|
import { ref } from 'vue';
|
||||||
|
|
||||||
|
|
||||||
|
const html = ref('');
|
||||||
|
|
||||||
|
function clear() {
|
||||||
|
html.value = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
function setTextFieldValue(data: string) {
|
||||||
|
html.value = data
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div id="layout" class="flex flex-col w-full h-full gap-4">
|
||||||
|
<div id="toolbar" class="flex flex-col gap-4 items-center lg:flex-row place-content-between">
|
||||||
|
<span class="dark:text-slate-100">HTML Formatter</span>
|
||||||
|
<div class="flex flex-wrap gap-2 justify-center">
|
||||||
|
<InsertTemplateComponent stylized-name="HTML" @update:defaultData="(data: string) => setTextFieldValue(data)"></InsertTemplateComponent>
|
||||||
|
<button class="tool-button" @click="clear()">Clear</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<CodeEditorComponent @update:updated-code="setTextFieldValue" :code="html" :config="{disabled:false,language:'html'}" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
Reference in New Issue
Block a user