mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-08-05 17:17:42 +00:00
CrealityPrint: remove hardcoded :4408 from Device WebView URL (#14326)
* CrealityPrint: use printhost_port for WebView URL instead of hardcoded :4408 Fixes #4408 — when printhost_port is configured, use that port in the Device WebView URL instead of always defaulting to :4408. * CrealityPrint: remove hardcoded :4408 from Device WebView URL Drop the CrealityPrint-specific get_print_host_webui override that unconditionally appended :4408. The generic fallback in PrintHost already uses print_host_webui/print_host config — users who need Mainsail on port 4408 should set print_host_webui explicitly. Fixes #4408
This commit is contained in:
@@ -298,36 +298,6 @@ std::string CrealityPrint::query_boxes_info() const
|
||||
}
|
||||
}
|
||||
|
||||
std::string CrealityPrint::get_print_host_webui(DynamicPrintConfig* config)
|
||||
{
|
||||
// K-series printers (K2 / K2 Plus / K2 Pro) ship with Mainsail on port 4408.
|
||||
// Port 80 hosts only the Creality control / upload API, which returns 404
|
||||
// for unknown paths and therefore renders as a blank/404 page in Orca's
|
||||
// Device WebView. Default to the Mainsail URL when the user hasn't
|
||||
// explicitly set print_host_webui.
|
||||
if (config == nullptr)
|
||||
return {};
|
||||
|
||||
std::string explicit_url = config->opt_string("print_host_webui");
|
||||
if (!explicit_url.empty())
|
||||
return explicit_url;
|
||||
|
||||
std::string host = config->opt_string("print_host");
|
||||
if (host.empty())
|
||||
return {};
|
||||
|
||||
if (boost::algorithm::istarts_with(host, "http://"))
|
||||
host = host.substr(7);
|
||||
else if (boost::algorithm::istarts_with(host, "https://"))
|
||||
host = host.substr(8);
|
||||
if (auto slash = host.find('/'); slash != std::string::npos)
|
||||
host = host.substr(0, slash);
|
||||
if (auto colon = host.find(':'); colon != std::string::npos)
|
||||
host = host.substr(0, colon);
|
||||
|
||||
return "http://" + host + ":4408/";
|
||||
}
|
||||
|
||||
bool CrealityPrint::start_print(wxString &msg, const std::string &filename, const std::map<std::string, std::string>& extended_info) const
|
||||
{
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user