logging repsonse text
This commit is contained in:
@@ -39,13 +39,18 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
load: async function () {
|
load: async function () {
|
||||||
const file = this.state.selected;
|
const file = this.state.selected;
|
||||||
|
if(this.state.selected!='default'){
|
||||||
const response = await fetch(`/api/file/${file}`, { cache: "no-cache" });
|
const response = await fetch(`/api/file/${file}`, { cache: "no-cache" });
|
||||||
const text = await response.text();
|
const text = await response.text();
|
||||||
|
console.log(text);
|
||||||
if (text.length > 20e6) {
|
if (text.length > 20e6) {
|
||||||
this.newGcode[this.tab - 1] = "File is large - gcode view disabled";
|
this.newGcode[this.tab - 1] = "File is large - gcode view disabled";
|
||||||
} else {
|
} else {
|
||||||
this.newGcode[this.tab - 1] = text;
|
this.newGcode[this.tab - 1] = text;
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
this.newGcode='';
|
||||||
|
}
|
||||||
},
|
},
|
||||||
upload: function (e) {
|
upload: function (e) {
|
||||||
const files = e.target.files || e.dataTransfer.files;
|
const files = e.target.files || e.dataTransfer.files;
|
||||||
@@ -197,4 +202,7 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
printState: function (){
|
||||||
|
console.log(this.state);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user