logging repsonse text
This commit is contained in:
@@ -39,12 +39,17 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
load: async function () {
|
load: async function () {
|
||||||
const file = this.state.selected;
|
const file = this.state.selected;
|
||||||
const response = await fetch(`/api/file/${file}`, { cache: "no-cache" });
|
if(this.state.selected!='default'){
|
||||||
const text = await response.text();
|
const response = await fetch(`/api/file/${file}`, { cache: "no-cache" });
|
||||||
if (text.length > 20e6) {
|
const text = await response.text();
|
||||||
this.newGcode[this.tab - 1] = "File is large - gcode view disabled";
|
console.log(text);
|
||||||
} else {
|
if (text.length > 20e6) {
|
||||||
this.newGcode[this.tab - 1] = text;
|
this.newGcode[this.tab - 1] = "File is large - gcode view disabled";
|
||||||
|
} else {
|
||||||
|
this.newGcode[this.tab - 1] = text;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
this.newGcode='';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
upload: function (e) {
|
upload: function (e) {
|
||||||
@@ -197,4 +202,7 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
printState: function (){
|
||||||
|
console.log(this.state);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -146,10 +146,10 @@ class State(object):
|
|||||||
files.append(filename)
|
files.append(filename)
|
||||||
files.sort()
|
files.sort()
|
||||||
self.set('files', files)
|
self.set('files', files)
|
||||||
self.log.info('===================')
|
self.log.info('===================')
|
||||||
for i in files:
|
for i in files:
|
||||||
self.log.info(i)
|
self.log.info(i)
|
||||||
self.log.info('===================')
|
self.log.info('===================')
|
||||||
|
|
||||||
self.select_file(filename)
|
self.select_file(filename)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user