feat: Add HTTP POST for calculation logs with error display
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
@@ -617,6 +617,22 @@ function buttonPress(val) {
|
||||
logStr = results ? results.toString() : "0";
|
||||
}
|
||||
console.log(logStr);
|
||||
if (Bangle.http){
|
||||
const options = {timeout:3000, method: "post", body: logStr};
|
||||
Bangle.http("https://tbot.tannercollin.com/scratchpad", options).then(event => {
|
||||
console.log("Successfully sent");
|
||||
}).catch((e)=>{
|
||||
g.setBgColor(0).clearRect(0, 0, g.getWidth(), RESULT_HEIGHT-1);
|
||||
g.setColor(-1);
|
||||
g.setFont('Dylex7x13', 2);
|
||||
g.setFontAlign(1,0);
|
||||
g.drawString('ERROR', g.getWidth()-20, RESULT_HEIGHT/2);
|
||||
if (operator) {
|
||||
g.setFont('Dylex7x13', 2).setFontAlign(1,0);
|
||||
g.drawString(operator, g.getWidth()-1, RESULT_HEIGHT/2);
|
||||
}
|
||||
});
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
specials.R.val = 'C';
|
||||
|
||||
Reference in New Issue
Block a user