trying a fix
This commit is contained in:
@@ -1,8 +1,15 @@
|
||||
"use strict";
|
||||
|
||||
const entityMap = {
|
||||
"&": "&", "<": "<", ">": ">", '"': """, "'": "'",
|
||||
"/": "/", "`": "`", "=": "=" };
|
||||
"&": "&",
|
||||
"<": "<",
|
||||
">": ">",
|
||||
'"': """,
|
||||
"'": "'",
|
||||
"/": "/",
|
||||
"`": "`",
|
||||
"=": "=",
|
||||
};
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user