Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assets/css/style.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/style.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions assets/js/workflows/web.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,11 @@ class WebWorkflow extends Workflow {
} else {
return Error("You are connected with localhost, but didn't supply the device hostname.");
}
} else if (isMdns()) {
this.host = location.hostname;
} else if (isIp()) {
} else if (isMdns() || isIp()) {
this.host = location.hostname;
if (location.port != 80) {
this.host += ":" + location.port;
}
}

if (this.host != null) {
Expand Down
28 changes: 15 additions & 13 deletions assets/js/workflows/workflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,22 +205,24 @@ class Workflow {

if (path == "/code.py") {
await this.serialTransmit(CHAR_CTRL_D);
}
} else {

let extension = path.split('.').pop();
if (extension === null) {
console.log("Extension not found");
return false;
}
if (String(extension).toLowerCase() != "py") {
console.log("Extension not py, twas " + String(extension).toLowerCase());
return false;
}
path = path.slice(0, -3);
path = path.replace(/\//g, ".");
let extension = path.split('.').pop();
if (extension === null) {
console.log("Extension not found");
return false;
}
if (String(extension).toLowerCase() != "py") {
console.log("Extension not py, it was " + String(extension).toLowerCase());
return false;
}

path = path.slice(1, -3);
path = path.replace(/\//g, ".");

await this.serialTransmit(CHAR_CTRL_C + "import " + path + CHAR_CRLF);
}
await this._changeMode(MODE_SERIAL);
await this.serialTransmit(CHAR_CTRL_C + "import " + path + CHAR_CRLF);
}

async checkSaved() {
Expand Down