diff --git a/distributed/deploy/spec.py b/distributed/deploy/spec.py index 1052b5a1f1d..99ad49cfc22 100644 --- a/distributed/deploy/spec.py +++ b/distributed/deploy/spec.py @@ -97,7 +97,53 @@ async def finished(self): await self._event_finished.wait() def __repr__(self): - return f"<{type(self).__name__}: status={self.status}>" + return f"<{dask.utils.typename(type(self))}: status={self.status.name}>" + + def _repr_html_(self): + if self.status == Status.created: + status = "Created" + bg_color = "#caf0f8" + border_color = "#48cae4" + elif self.status == Status.running: + status = "Running" + bg_color = "#c7f9cc" + border_color = "#78c6a3" + elif self.status == Status.closed: + status = "Closed" + bg_color = "#ffbfad" + border_color = "#ff6132" + + html = f""" +
Status: {status}
++
Address | +{self.address} | +
---|---|
External Address | +{self.external_address} | +