Merge branch 'master' of gitea.release11.com:R11/release11-tools into release
This commit is contained in:
@@ -5,12 +5,24 @@ const props = defineProps({
|
||||
isMinimizer: {type: Boolean}
|
||||
})
|
||||
|
||||
<<<<<<< HEAD
|
||||
const emit = defineEmits(["update:result"])
|
||||
|
||||
function process() {
|
||||
var request:Request = prepareRequest();
|
||||
fetchRequest(request).then((data) => {
|
||||
sendProcessedData(data);
|
||||
=======
|
||||
const emit = defineEmits([
|
||||
'update:result',
|
||||
'update:error'
|
||||
])
|
||||
|
||||
function process() {
|
||||
var request:Request = prepareRequest()
|
||||
fetchRequest(request).then((data) => {
|
||||
sendProcessedData(data)
|
||||
>>>>>>> 307e732608fca31b60027b417412691ff0e1c2f0
|
||||
})
|
||||
}
|
||||
|
||||
@@ -18,36 +30,67 @@ function prepareRequest():Request {
|
||||
var request = new Request(prepareURL(), {
|
||||
body: prepareRequestBody(),
|
||||
method: "POST"
|
||||
<<<<<<< HEAD
|
||||
});
|
||||
=======
|
||||
})
|
||||
>>>>>>> 307e732608fca31b60027b417412691ff0e1c2f0
|
||||
return request
|
||||
}
|
||||
|
||||
function prepareURL(): string {
|
||||
<<<<<<< HEAD
|
||||
var mode = "prettify";
|
||||
if (props.isMinimizer)
|
||||
mode = "minimize";
|
||||
return document.location.protocol + "//" + document.location.hostname + "/libxml/" + mode;
|
||||
=======
|
||||
var mode = "prettify"
|
||||
if (props.isMinimizer)
|
||||
mode = "minimize"
|
||||
return document.location.protocol + "//" + document.location.hostname + "/libxml/" + mode
|
||||
>>>>>>> 307e732608fca31b60027b417412691ff0e1c2f0
|
||||
}
|
||||
|
||||
function prepareRequestBody():string {
|
||||
var requestBody = JSON.stringify({
|
||||
"data": props.xml,
|
||||
<<<<<<< HEAD
|
||||
"process": "N/A",
|
||||
"processor": "libxml",
|
||||
"version": "1.0"
|
||||
});
|
||||
return requestBody;
|
||||
=======
|
||||
"processorData": "N/A",
|
||||
"processor": "libxml",
|
||||
"version": "1.0"
|
||||
})
|
||||
return requestBody
|
||||
>>>>>>> 307e732608fca31b60027b417412691ff0e1c2f0
|
||||
}
|
||||
|
||||
async function fetchRequest(request: Request):Promise<JSON> {
|
||||
var responseBody = await fetch(request)
|
||||
.then(response => response.json())
|
||||
<<<<<<< HEAD
|
||||
.then((body) => body);
|
||||
return responseBody;
|
||||
}
|
||||
|
||||
function sendProcessedData(data: JSON) {
|
||||
emit("update:result", data);
|
||||
=======
|
||||
.then((body) => {
|
||||
emit("update:error", body.status == "ERR")
|
||||
return body
|
||||
})
|
||||
return responseBody
|
||||
}
|
||||
|
||||
function sendProcessedData(data: JSON) {
|
||||
emit("update:result", data)
|
||||
>>>>>>> 307e732608fca31b60027b417412691ff0e1c2f0
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user