Skip to content

Commit

Permalink
Div style
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbourbeau committed Oct 24, 2022
1 parent 0811fec commit 8d8f5f3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 27 deletions.
30 changes: 17 additions & 13 deletions distributed/dashboard/components/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -4044,6 +4044,22 @@ def update(self):
self.disk_memory.x_range.end = limit


_STYLES = {
"width": "100%",
"height": "100%",
"max-width": "1920px",
"max-height": "1080px",
"padding": "12px",
"border": "1px solid lightgray",
"box-shadow": "inset 1px 0 8px 0 lightgray",
"overflow": "auto",
}
if BOKEH_VERSION.major < 3:
_BOKEH_STYLES_KWARGS = {"style": _STYLES}
else:
_BOKEH_STYLES_KWARGS = {"styles": _STYLES}


class SchedulerLogs:
def __init__(self, scheduler, start=None):
logs = scheduler.get_logs(start=start, timestamps=True)
Expand All @@ -4061,19 +4077,7 @@ def __init__(self, scheduler, start=None):
)
)._repr_html_()

self.root = Div(
text=logs_html,
# **{
# "width": "100%",
# "height": "100%",
# "max-width": "1920px",
# "max-height": "1080px",
# "padding": "12px",
# "border": "1px solid lightgray",
# "box-shadow": "inset 1px 0 8px 0 lightgray",
# "overflow": "auto",
# },
)
self.root = Div(text=logs_html, **_BOKEH_STYLES_KWARGS)


@log_errors
Expand Down
19 changes: 5 additions & 14 deletions distributed/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -7489,7 +7489,10 @@ def profile_to_figure(state):
sysmon.update()

# Scheduler logs
from distributed.dashboard.components.scheduler import SchedulerLogs
from distributed.dashboard.components.scheduler import (
_BOKEH_STYLES_KWARGS,
SchedulerLogs,
)

logs = SchedulerLogs(self, start=start)

Expand Down Expand Up @@ -7538,19 +7541,7 @@ def profile_to_figure(state):
dask_version=dask.__version__,
distributed_version=distributed.__version__,
)
html = Div(
text=html,
# **{
# "width": "100%",
# "height": "100%",
# "max-width": "1920px",
# "max-height": "1080px",
# "padding": "12px",
# "border": "1px solid lightgray",
# "box-shadow": "inset 1px 0 8px 0 lightgray",
# "overflow": "auto",
# },
)
html = Div(text=html, **_BOKEH_STYLES_KWARGS)

html = TabPanel(child=html, title="Summary")
compute = TabPanel(child=compute, title="Worker Profile (compute)")
Expand Down

0 comments on commit 8d8f5f3

Please sign in to comment.