Fix target URL for cloud links in monitor page

This commit is contained in:
ChrisTerBeke 2019-08-08 22:47:07 +02:00
parent 9a29c77228
commit a063c33d4c
No known key found for this signature in database
GPG Key ID: A49F1AB9D7E0C263

View File

@ -258,11 +258,11 @@ class CloudOutputDevice(UltimakerNetworkedPrinterOutputDevice):
@pyqtSlot(name="openPrintJobControlPanel") @pyqtSlot(name="openPrintJobControlPanel")
def openPrintJobControlPanel(self) -> None: def openPrintJobControlPanel(self) -> None:
QDesktopServices.openUrl(QUrl("https://mycloud.ultimaker.com")) QDesktopServices.openUrl(QUrl(self.clusterCloudUrl))
@pyqtSlot(name="openPrinterControlPanel") @pyqtSlot(name="openPrinterControlPanel")
def openPrinterControlPanel(self) -> None: 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. ## Gets the cluster response from which this device was created.
@property @property
@ -273,3 +273,9 @@ class CloudOutputDevice(UltimakerNetworkedPrinterOutputDevice):
@clusterData.setter @clusterData.setter
def clusterData(self, value: CloudClusterResponse) -> None: def clusterData(self, value: CloudClusterResponse) -> None:
self._cluster = value 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)