Skip to content

Commit

Permalink
Updated link display
Browse files Browse the repository at this point in the history
  • Loading branch information
Vebop committed Jan 23, 2025
1 parent c44bf14 commit 377d894
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 8 deletions.
35 changes: 27 additions & 8 deletions notebooks_tsqr/NightLog.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,19 @@
]
},
{
"cell_type": "markdown",
"cell_type": "code",
"execution_count": null,
"id": "13",
"metadata": {},
"outputs": [],
"source": [
"Also see: [2024-12-09 Commissioning Plan](https://rubinobs.atlassian.net/projects/BLOCK?selectedItem=com.atlassian.plugins.atlassian-connect-plugin:com.kanoah.test-manager__main-project-page#!/testCycle/BLOCK-R164)\n",
"*(we need a general way to refer to plan for the a specific night)*"
"commissioning_plan = \"https://rubinobs.atlassian.net/projects/BLOCK?selectedItem=com.atlassian.plugins.atlassian-connect-plugin:com.kanoah.test-manager__main-project-page#!/testCycle/BLOCK-R164\"\n",
"md(\n",
" f\"\"\"\n",
"Also see: {ut.link_new_tab(commissioning_plan, \"2024-12-09 Commissioning Plan\")}\n",
"*(we need a general way to refer to plan for the a specific night)*\n",
"\"\"\"\n",
")"
]
},
{
Expand Down Expand Up @@ -343,11 +350,21 @@
" if \"summit\" in server\n",
" else f\"{server}/rubintv/ddv/index.html\"\n",
")\n",
"\n",
"nightsum_link_url = f\"{server}/times-square/github/lsst/schedview_notebooks/nightly/scheduler-nightsum?day_obs={min_date.date()}&visit_origin=lsstcomcam\"\n",
"nightsum_link_string = f\"link to nightsum for day_obs = {min_date.date()}\"\n",
"\n",
"md(\n",
" f\"\"\"\n",
"- Access DDV part of RubinTV: {DDV}\n",
"- [Chronograph]({server}/chronograf)\n",
"- [nightsum]({server}/times-square/github/lsst/schedview_notebooks/nightly/scheduler-nightsum?day_obs={min_date.date()}&visit_origin=lsstcomcam)\n",
"#### DDV part of RubinTV\n",
" {ut.link_new_tab(DDV, 'RubinTV Visualization')}\n",
"\n",
"#### Chronograf links\n",
"{ut.link_new_tab(f'{server}/chronograf','Chronograph main page on {server}')}\n",
"\n",
"#### Scheduler Analysis Nightly Summary\n",
"{ut.link_new_tab(link_url,link_string)}\n",
"\n",
"\"\"\"\n",
")"
]
Expand Down Expand Up @@ -491,7 +508,9 @@
" md(mdstr)\n",
"else:\n",
" endpoint_url = allsrc.nig_src.status[\"reports\"][\"endpoint_url\"]\n",
" md(f\"No tickets found using: [API Data]({endpoint_url}) in `confluence_url`.\")"
" md(\n",
" f\"No tickets found using: {disp_link(endpoint_url,'API Data')} in `confluence_url`.\"\n",
" )"
]
},
{
Expand Down Expand Up @@ -963,7 +982,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.10"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
7 changes: 7 additions & 0 deletions python/lsst/ts/logging_and_reporting/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,13 @@ def hhmmss(decimal_hours):
return f"{hours:d}:{minutes:02d}:{seconds:02d}"


def link_new_tab(url, string=None):
"""Wrap links in html to open all links in new tab, must be used in md()"""
string = url if string is None else string
html = f'<a href="{url}" target="_blank" rel="noreferrer noopener">{string}</a>'
return html


def tic():
"""Start timer."""
tic.start = time.perf_counter()
Expand Down

0 comments on commit 377d894

Please sign in to comment.