From a063c33d4c864d1e552ae570f5457c81dfa185d0 Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Thu, 8 Aug 2019 22:47:07 +0200 Subject: [PATCH] Fix target URL for cloud links in monitor page --- .../UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py index 5f9748c36d..259770857d 100644 --- a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py +++ b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py @@ -258,11 +258,11 @@ class CloudOutputDevice(UltimakerNetworkedPrinterOutputDevice): @pyqtSlot(name="openPrintJobControlPanel") def openPrintJobControlPanel(self) -> None: - QDesktopServices.openUrl(QUrl("https://mycloud.ultimaker.com")) + QDesktopServices.openUrl(QUrl(self.clusterCloudUrl)) @pyqtSlot(name="openPrinterControlPanel") def openPrinterControlPanel(self) -> None: - QDesktopServices.openUrl(QUrl("https://mycloud.ultimaker.com")) + QDesktopServices.openUrl(QUrl(self.clusterCloudUrl)) ## Gets the cluster response from which this device was created. @property @@ -273,3 +273,9 @@ class CloudOutputDevice(UltimakerNetworkedPrinterOutputDevice): @clusterData.setter def clusterData(self, value: CloudClusterResponse) -> None: self._cluster = value + + ## Gets the URL on which to monitor the cluster via the cloud. + @property + def clusterCloudUrl(self) -> str: + root_url_prefix = "-staging" if self._account.is_staging else "" + return "https://mycloud{}.ultimaker.com/app/jobs/{}".format(root_url_prefix, self.clusterData.cluster_id)