trying a fix

This commit is contained in:
sanjayk03-dev
2024-03-29 02:57:49 +05:30
parent 1904919c80
commit 074533b17b

View File

@@ -1,8 +1,15 @@
"use strict";
const entityMap = {
"&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;",
"/": "&#x2F;", "`": "&#x60;", "=": "&#x3D;" };
"&": "&amp;",
"<": "&lt;",
">": "&gt;",
'"': "&quot;",
"'": "&#39;",
"/": "&#x2F;",
"`": "&#x60;",
"=": "&#x3D;",
};
function escapeHTML(s) {
return s.replace(/[&<>"'`=\\/]/g, function (c) {
@@ -17,7 +24,7 @@ module.exports = {
return {
empty: true,
file: "",
line: -1
line: -1,
};
},
@@ -33,7 +40,7 @@ module.exports = {
},
"gcode-line": function (line) {
this.update_line(line);
}
},
},
ready: function () {
@@ -42,7 +49,7 @@ module.exports = {
scrollElem: this.$el.querySelector(".clusterize-scroll"),
contentElem: this.$el.querySelector(".clusterize-content"),
no_data_text: "GCode view...",
callbacks: { clusterChanged: this.highlight }
callbacks: { clusterChanged: this.highlight },
});
},
@@ -65,6 +72,9 @@ module.exports = {
}
const response = await fetch(`/api/file/${file}`, { cache: "no-cache" });
if (response.status == 400) {
return;
}
const text = await response.text();
if (text.length > 20e6) {
@@ -147,6 +157,6 @@ module.exports = {
scroll.scrollTop = target * lineHeight;
Vue.nextTick(this.highlight);
}
}
},
},
};