Skip to content
Snippets Groups Projects
Commit dfda4917 authored by Austin Anderson's avatar Austin Anderson
Browse files

Add favicon, date helper, tooltips

parent aa52c239
No related branches found
No related tags found
No related merge requests found
...@@ -70,7 +70,7 @@ jobs: ...@@ -70,7 +70,7 @@ jobs:
uses: actions/configure-pages@v3 uses: actions/configure-pages@v3
- name: Move dashboard around - name: Move dashboard around
run: cd tf_oss_dashboard; mkdir _site; mv dashboard.html ./_site/index.html run: cd tf_oss_dashboard; mkdir _site; mv dashboard.html ./_site/index.html; mv favicon.png ./_site/favicon.png
- name: Upload artifact - name: Upload artifact
uses: actions/upload-pages-artifact@v1 uses: actions/upload-pages-artifact@v1
......
...@@ -39,6 +39,8 @@ for d in data["data"]["repository"]["defaultBranchRef"]["target"]["history"]["no ...@@ -39,6 +39,8 @@ for d in data["data"]["repository"]["defaultBranchRef"]["target"]["history"]["no
if has_cl: if has_cl:
record["cl"] = has_cl.group(1) record["cl"] = has_cl.group(1)
record["cl_url"] = f"http://cl/{record['cl']}" record["cl_url"] = f"http://cl/{record['cl']}"
if d["statusCheckRollup"] is None:
continue
for item in d["statusCheckRollup"]["contexts"]["nodes"]: for item in d["statusCheckRollup"]["contexts"]["nodes"]:
if "context" in item: if "context" in item:
sub = { sub = {
...@@ -119,4 +121,5 @@ env = Environment( ...@@ -119,4 +121,5 @@ env = Environment(
) )
template = env.get_template('template.html.pug') template = env.get_template('template.html.pug')
now = arrow.now().to('US/Pacific').format("ddd, MMM D [at] h:mma ZZZ") now = arrow.now().to('US/Pacific').format("ddd, MMM D [at] h:mma ZZZ")
print(template.render(records=by_name, by_group=by_group, by_commit=by_commit, css=css, js=js, helptext=helptext, now=now)) isonow = arrow.now().to('US/Pacific').isoformat()
print(template.render(records=by_name, by_group=by_group, by_commit=by_commit, css=css, js=js, helptext=helptext, now=now, isonow=isonow))
...@@ -29,3 +29,11 @@ $('.favorite').each(function() { ...@@ -29,3 +29,11 @@ $('.favorite').each(function() {
} }
}) })
reorder() reorder()
function setTimer() {
str = moment($('#tf-now').attr("data-isonow"), moment.ISO_8601).fromNow()
$('#tf-ago').text("(" + str + ")")
}
setInterval(setTimer, 300000) // 5 minutes in ms
setTimer()
...@@ -3,16 +3,19 @@ html(lang="en") ...@@ -3,16 +3,19 @@ html(lang="en")
head head
title TensorFlow GitHub Status title TensorFlow GitHub Status
meta(charset="UTF-8") meta(charset="UTF-8")
link(rel="icon" href="favicon.png")
link(href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous") link(href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous")
script(src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js" integrity="sha384-w76AqPfDkMBDXo30jS1Sgez6pr3x5MlQ1ZAGC+nuZB+EYdgRZgiwxhTBTkF7CXvN" crossorigin="anonymous") script(src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js" integrity="sha384-w76AqPfDkMBDXo30jS1Sgez6pr3x5MlQ1ZAGC+nuZB+EYdgRZgiwxhTBTkF7CXvN" crossorigin="anonymous")
script(src="https://code.jquery.com/jquery-3.6.4.slim.min.js" integrity="sha256-a2yjHM4jnF9f54xUQakjZGaqYs/V1CYvWpoqZzC2/Bw=" crossorigin="anonymous") script(src="https://code.jquery.com/jquery-3.6.4.slim.min.js" integrity="sha256-a2yjHM4jnF9f54xUQakjZGaqYs/V1CYvWpoqZzC2/Bw=" crossorigin="anonymous")
script(src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.3/moment.min.js" crossorigin="anonymous" referrerpolicy="no-referrer")
style= css style= css
body body
nav.navbar.navbar-dark.navbar-expand-lg.py-0.mb-2 nav.navbar.navbar-dark.navbar-expand-lg.py-0.mb-2
.container-fluid.py-0 .container-fluid.py-0
.d-flex.flex-row .d-flex.flex-row
a.navbar-brand TensorFlow GitHub CI a.navbar-brand TensorFlow GitHub CI
.navbar-text Last updated on #{now} .navbar-text#tf-now(data-isonow=isonow) Last updated on #{now}
span#tf-ago
ul.navbar-nav ul.navbar-nav
li.nav-item li.nav-item
a.nav-link(role="button" data-bs-toggle="modal" data-bs-target="#help-modal") Help a.nav-link(role="button" data-bs-toggle="modal" data-bs-target="#help-modal") Help
...@@ -29,14 +32,14 @@ html(lang="en") ...@@ -29,14 +32,14 @@ html(lang="en")
.d-flex.flex-row.flex-wrap.gap-1 .d-flex.flex-row.flex-wrap.gap-1
.badge.tf-dot.p-2.pe-1.ps-1.favorite 🟊 .badge.tf-dot.p-2.pe-1.ps-1.favorite 🟊
if tests[0]["is_public"] if tests[0]["is_public"]
.badge.p-2.tf-dot.tf-public Public .badge.p-2.tf-dot.tf-public(title="This job has publicly-visible results pages.") Public
else else
.badge.p-2.tf-dot.tf-internal Internal .badge.p-2.tf-dot.tf-internal(title="This job only has private, Googler-restricted results pages.") Internal
each test in tests each test in tests
if "date_tag" in test: if "date_tag" in test:
.badge.p-2.tf-dot.tf-date= test["date_tag"] .badge.p-2.tf-dot.tf-date= test["date_tag"]
else else
.badge.p-2(class=test["state"] data-bs-toggle='modal' data-bs-target=test["commit_id"]) a.badge.p-2(title="#{test['date_human']} - #{test['commit_summary']}" class=test["state"] data-bs-toggle='modal' data-bs-target=test["commit_id"])
each commit, jobs in by_commit.items() each commit, jobs in by_commit.items()
...@@ -60,9 +63,9 @@ html(lang="en") ...@@ -60,9 +63,9 @@ html(lang="en")
tr tr
td.text-center.py-1.px-1.m-0.align-middle td.text-center.py-1.px-1.m-0.align-middle
if job["is_public"] if job["is_public"]
span.badge.tf-ispublic Public span.badge.tf-ispublic(title="This job has publicly-visible results pages.") Public
else else
span.badge.tf-isinternal Internal span.badge.tf-isinternal(title="This job only has private, Googler-restricted results pages.") Internal
td.text-center.py-1.px-1.m-0.align-middle td.text-center.py-1.px-1.m-0.align-middle
if job["result_url"] if job["result_url"]
a.badge.tf-state(href=job["result_url"] class=job["state"])= job["state"] a.badge.tf-state(href=job["result_url"] class=job["state"])= job["state"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment