Support file uploads and the device details page for Elegoo Centauri Carbon 2 (#13212)

* Support file uploads and the device details page for CC2 printers.

* Resolved build issues for Linux and macOS.

* 1. Added `ElegooPrinterWebViewHandler` to handle WebUI messages for Elegoo printers. Other printers will keep the current behavior.
2. Added a static `get_print_host_webui` method in `PrintHost` to retrieve the printer WebUI URL.

* Improved timeout handling for CC2 file upload and SN info APIs.

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
anjis
2026-05-16 15:22:31 +08:00
committed by GitHub
parent 5a136a25d1
commit 427d0f7a9f
16 changed files with 1248 additions and 56 deletions

View File

@@ -46,6 +46,7 @@
#include "Widgets/ProgressDialog.hpp"
#include "BindDialog.hpp"
#include "../Utils/MacDarkMode.hpp"
#include "../Utils/PrintHost.hpp"
#include <fstream>
#include <string_view>
@@ -4162,15 +4163,12 @@ void MainFrame::load_printer_url()
return;
auto cfg = preset_bundle.printers.get_edited_preset().config;
wxString url = cfg.opt_string("print_host_webui").empty() ? cfg.opt_string("print_host") : cfg.opt_string("print_host_webui");
wxString url = from_u8(PrintHost::get_print_host_webui(&cfg));
wxString apikey;
const auto host_type = cfg.option<ConfigOptionEnum<PrintHostType>>("host_type")->value;
if (cfg.has("printhost_apikey") && (host_type == htPrusaLink || host_type == htPrusaConnect))
apikey = cfg.opt_string("printhost_apikey");
if (!url.empty()) {
if (!url.Lower().starts_with("http"))
url = wxString::Format("http://%s", url);
load_printer_url(url, apikey);
}
}