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

@@ -570,6 +570,21 @@ Http& Http::header(std::string name, const std::string &value)
return *this;
}
Http& Http::headers_reset()
{
if (!p) { return *this; }
::curl_slist_free_all(p->headerlist);
p->headerlist = nullptr;
p->headerlist = curl_slist_append(p->headerlist, "Expect:");
std::lock_guard<std::mutex> l(g_mutex);
for (auto it = extra_headers.begin(); it != extra_headers.end(); ++it)
this->header(it->first, it->second);
return *this;
}
Http& Http::remove_header(std::string name)
{
if (p) {