Skip to content

Commit

Permalink
1. web can load local image by http 2. fix machine subscribe 3. mac s…
Browse files Browse the repository at this point in the history
…ign on 2.0.0 push
  • Loading branch information
womendoushihaoyin committed Jan 13, 2025
1 parent a9b9c05 commit 6dec471
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_orca.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ jobs:
path: ${{ github.workspace }}/Snapmaker_Orca_Mac_${{inputs.arch}}_${{ env.ver }}.dmg

- name: Deploy Mac release
if: github.ref == 'refs/heads/main' && inputs.os == 'macos-14'
if: github.ref == 'refs/heads/main' && inputs.os == 'macos-14' || github.ref == 'refs/heads/2.0.0' && inputs.os == 'macos-14'
uses: WebFreak001/[email protected]
with:
upload_url: https://uploads.github.com/repos/Snapmaker/OrcaSlicer/releases/169912305/assets{?name,label}
Expand Down
4 changes: 2 additions & 2 deletions resources/web/flutter/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
This is a placeholder for base href that will be replaced by the value of
the `--base-href` argument provided to `flutter build`.
-->
<base href="/flutter/">
<base href="/web/flutter/">

<meta charset="UTF-8">
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
Expand Down Expand Up @@ -202,6 +202,6 @@
}

</script>

<img src="http://127.0.0.1:13619/profiles/Snapmaker/Snapmaker Artisan_cover.png" alt="Snapmaker Orca" style="width: 100px; height: 100px;">
</body>
</html>
2 changes: 1 addition & 1 deletion src/slic3r/GUI/HttpServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ std::string HttpServer::map_url_to_file_path(const std::string& url) {
trimmed_url = "/index.html"; // 默认首页
}

std::string base_path = resources_dir() + "/web"; // 根据你的需求定义
std::string base_path = resources_dir(); // 根据你的需求定义
return base_path + trimmed_url; // 拼接成新的路径
}

Expand Down
7 changes: 7 additions & 0 deletions src/slic3r/GUI/SSWCP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,13 @@ void SSWCP_MachineFind_Instance::onOneEngineEnd()
// SSWCP_MachineOption_Instance
void SSWCP_MachineOption_Instance::process()
{
if (m_event_id != "") {
json header;
send_to_js();

m_header.clear();
m_header["event_id"] = m_event_id;
}
if (m_cmd == "sw_SendGCodes") {
sw_SendGCodes();
}
Expand Down
2 changes: 1 addition & 1 deletion src/slic3r/GUI/WebDeviceDialog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class WebDeviceDialog : public wxDialog

wxWebView *m_browser;
wxString m_javascript;
wxString m_device_url = "http://localhost:13619/flutter/index.html";
wxString m_device_url = "http://localhost:13619/web/flutter/index.html";

DECLARE_EVENT_TABLE()
};
Expand Down
2 changes: 1 addition & 1 deletion src/slic3r/GUI/WebViewDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ WebViewPanel::WebViewPanel(wxWindow *parent)
url = wxString::Format("file://%s/web/homepage/index.html?lang=%s", from_u8(resources_dir()), strlang);

// test
// url = "http://localhost:13619/flutter/index.html";
// url = "http://localhost:13619/web/flutter/index.html";

wxBoxSizer* topsizer = new wxBoxSizer(wxVERTICAL);

Expand Down
9 changes: 8 additions & 1 deletion src/slic3r/Utils/MoonRaker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -828,12 +828,19 @@ void Moonraker_Mqtt::on_status_arrived(const std::string& payload)
try {
json body = json::parse(payload);

json data;
if (body.count("params")) {
data = body["params"];
} else {
return;
}

// 待修改
if (!m_status_cb) {
return;
}

m_status_cb(body);
m_status_cb(data);

} catch (std::exception& e) {}
}
Expand Down

0 comments on commit 6dec471

Please sign in to comment.