trying a fix
This commit is contained in:
@@ -1,8 +1,15 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const entityMap = {
|
const entityMap = {
|
||||||
"&": "&", "<": "<", ">": ">", '"': """, "'": "'",
|
"&": "&",
|
||||||
"/": "/", "`": "`", "=": "=" };
|
"<": "<",
|
||||||
|
">": ">",
|
||||||
|
'"': """,
|
||||||
|
"'": "'",
|
||||||
|
"/": "/",
|
||||||
|
"`": "`",
|
||||||
|
"=": "=",
|
||||||
|
};
|
||||||
|
|
||||||
function escapeHTML(s) {
|
function escapeHTML(s) {
|
||||||
return s.replace(/[&<>"'`=\\/]/g, function (c) {
|
return s.replace(/[&<>"'`=\\/]/g, function (c) {
|
||||||
@@ -17,7 +24,7 @@ module.exports = {
|
|||||||
return {
|
return {
|
||||||
empty: true,
|
empty: true,
|
||||||
file: "",
|
file: "",
|
||||||
line: -1
|
line: -1,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -33,7 +40,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
"gcode-line": function (line) {
|
"gcode-line": function (line) {
|
||||||
this.update_line(line);
|
this.update_line(line);
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
ready: function () {
|
ready: function () {
|
||||||
@@ -42,7 +49,7 @@ module.exports = {
|
|||||||
scrollElem: this.$el.querySelector(".clusterize-scroll"),
|
scrollElem: this.$el.querySelector(".clusterize-scroll"),
|
||||||
contentElem: this.$el.querySelector(".clusterize-content"),
|
contentElem: this.$el.querySelector(".clusterize-content"),
|
||||||
no_data_text: "GCode view...",
|
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" });
|
const response = await fetch(`/api/file/${file}`, { cache: "no-cache" });
|
||||||
|
if (response.status == 400) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const text = await response.text();
|
const text = await response.text();
|
||||||
|
|
||||||
if (text.length > 20e6) {
|
if (text.length > 20e6) {
|
||||||
@@ -147,6 +157,6 @@ module.exports = {
|
|||||||
scroll.scrollTop = target * lineHeight;
|
scroll.scrollTop = target * lineHeight;
|
||||||
|
|
||||||
Vue.nextTick(this.highlight);
|
Vue.nextTick(this.highlight);
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user