Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

Commit

Permalink
wip! Upgrade Datasette
Browse files Browse the repository at this point in the history
Unpins Datasette and upgrades to the latest version.  Adjusts custom
page styles and command-line options for upstream changes.  Removes the
link-fixing JS hack now that base_url is properly supported.

XXX FIXME pending <simonw/datasette#1238>
  • Loading branch information
tsibley committed Feb 22, 2021
1 parent aabf450 commit a83fe51
Show file tree
Hide file tree
Showing 8 changed files with 93 additions and 63 deletions.
2 changes: 1 addition & 1 deletion bin/reverse-proxy
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ use Plack::App::Proxy;

builder {
mount "/switchboard" =>
Plack::App::Proxy->new(remote => "http://127.0.0.1:3002")->to_app;
Plack::App::Proxy->new(remote => "http://127.0.0.1:3002/switchboard")->to_app;
};
2 changes: 1 addition & 1 deletion bin/serve
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ exec datasette serve \
--static static:"$base/static" \
--template-dir "$base/templates" \
--port "$PORT" \
--config sql_time_limit_ms:10000 \
--setting sql_time_limit_ms 10000 \
"$base/data/sfs-redcap.sqlite" \
"$@"
1 change: 0 additions & 1 deletion constraints.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Constraints to avoid upgrading these in the switch from Pipenv → pip-tools.
# ID3C is constrained directly in requirements.in via the git commit id.
datasette ==0.45
sqlite-utils ==2.11
4 changes: 0 additions & 4 deletions datasette.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,3 @@ databases:
record_id
extra_css_urls:
- /static/styles.css
- /switchboard/static/styles.css
extra_js_urls:
- /static/fix-links.js
- /switchboard/static/fix-links.js
2 changes: 1 addition & 1 deletion requirements.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-c constraints.txt

id3c @ https://github.com/seattleflu/id3c/archive/31a711e62c9a9e1516efb0a32d463275fa65ad5e.tar.gz
datasette >=0.41
datasette >=0.55
sqlite-utils >=2.11
57 changes: 51 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ asgi-csrf==0.7.1 \
--hash=sha256:77bfb2a3311643fd2304d0f11f72160559acbbd1a35730a54208135ded3f21a3 \
--hash=sha256:c6c862b4d9d78bb0297524c5e5447d26b210bef85c4304ace87d8ae1917f0efa
# via datasette
asgiref==3.3.1 \
--hash=sha256:5ee950735509d04eb673bd7f7120f8fa1c9e2df495394992c73234d526907e17 \
--hash=sha256:7162a3cb30ab0609f1a4c95938fd73e8604f63bdba516a7f7d64b83ff09478f0
# via datasette
async-timeout==3.0.1 \
--hash=sha256:0c3c816a028d47f659d6ff5c745cb2acf1f966da1fe5c19c77a70282b25f4c5f \
--hash=sha256:4291ca197d287d274d0b6cb5d6f8f8f82d434ed288f962539ff18cc9012f9ea3
Expand All @@ -84,6 +88,7 @@ certifi==2020.11.8 \
--hash=sha256:f05def092c44fbf25834a51509ef6e631dc19765ab8a57b4e7ab85531f0a9cf4
# via
# fiona
# httpx
# requests
chardet==3.0.4 \
--hash=sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae \
Expand Down Expand Up @@ -121,11 +126,13 @@ colorama==0.4.4 \
--hash=sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b \
--hash=sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2
# via id3c
datasette==0.45 \
--hash=sha256:a6491e7a9fd1d2fa1b9999d31b1f210b9a845960c1905e3fdfc2783071143980
# via
# -c constraints.txt
# -r requirements.in
contextvars==2.4 \
--hash=sha256:f38c908aaa59c14335eeea12abea5f443646216c4e29380d7bf34d2018e2c39e
# via sniffio
datasette==0.55 \
--hash=sha256:524c2efd20d3ed1a033e8b347f7462adbe3e8ebf0c1b1750df61ed27c717a4c4 \
--hash=sha256:f7196e2ac672b4852e21a32b575aa81652dabce6bfc9fd52d410dd5740b87011
# via -r requirements.in
deepdiff==5.0.2 \
--hash=sha256:273b18d32bb9b956548290b2e3ddf79c515def2dd5738965f4348ae813e710c5 \
--hash=sha256:e2b74af4da0ef9cd338bb6e8c97242c1ec9d81fcb28298d7bb24acdc19ea79d7
Expand Down Expand Up @@ -188,14 +195,24 @@ googleapis-common-protos==1.52.0 \
h11==0.11.0 \
--hash=sha256:3c6c61d69c6f13d41f1b80ab0322f1872702a3ba26e12aa864c928f6a43fbaab \
--hash=sha256:ab6c335e1b6ef34b205d5ca3e228c9299cc7218b049819ec84a388c2525e5d87
# via uvicorn
# via
# httpcore
# uvicorn
httpcore==0.12.3 \
--hash=sha256:37ae835fb370049b2030c3290e12ed298bf1473c41bb72ca4aa78681eba9b7c9 \
--hash=sha256:93e822cd16c32016b414b789aeff4e855d0ccbfc51df563ee34d4dbadbb3bcdc
# via httpx
httplib2==0.18.1 \
--hash=sha256:8af66c1c52c7ffe1aa5dc4bcd7c769885254b0756e6e69f953c7f0ab49a70ba3 \
--hash=sha256:ca2914b015b6247791c4866782fa6042f495b94401a0f0bd3e1d6e0ba2236782
# via
# google-api-python-client
# google-auth-httplib2
# oauth2client
httpx==0.16.1 \
--hash=sha256:126424c279c842738805974687e0518a94c7ae8d140cd65b9c4f77ac46ffa537 \
--hash=sha256:9cffb8ba31fac6536f2c8cde30df859013f59e4bcc5b8d43901cb3654a8e0a5b
# via datasette
hupper==1.10.2 \
--hash=sha256:3818f53dabc24da66f65cf4878c1c7a9b5df0c46b813e014abdd7c569eb9a02a \
--hash=sha256:5de835f3b58324af2a8a16f52270c4d1a3d1734c45eed94b77fd622aea737f29
Expand All @@ -212,7 +229,25 @@ idna==2.10 \
# via
# idna-ssl
# requests
# rfc3986
# yarl
immutables==0.15 \
--hash=sha256:141c2e9ea515a3a815007a429f0b47a578ebeb42c831edaec882a245a35fffca \
--hash=sha256:2283a93c151566e6830aee0e5bee55fc273455503b43aa004356b50f9182092b \
--hash=sha256:3035849accee4f4e510ed7c94366a40e0f5fef9069fbe04a35f4787b13610a4a \
--hash=sha256:3713ab1ebbb6946b7ce1387bb9d1d7f5e09c45add58c2a2ee65f963c171e746b \
--hash=sha256:3b15c08c71c59e5b7c2470ef949d49ff9f4263bb77f488422eaa157da84d6999 \
--hash=sha256:6728f4392e3e8e64b593a5a0cd910a1278f07f879795517e09f308daed138631 \
--hash=sha256:6f117d9206165b9dab8fd81c5129db757d1a044953f438654236ed9a7a4224ae \
--hash=sha256:8703d8abfd8687932f2a05f38e7de270c3a6ca3bd1c1efb3c938656b3f2f985a \
--hash=sha256:a0a4e4417d5ef4812d7f99470cd39347b58cb927365dd2b8da9161040d260db0 \
--hash=sha256:b04fa69174e0c8f815f9c55f2a43fc9e5a68452fab459a08e904a74e8471639f \
--hash=sha256:b75ade826920c4e490b1bb14cf967ac14e61eb7c5562161c5d7337d61962c226 \
--hash=sha256:b7e13c061785e34f73c4f659861f1b3e4a5fd918e4395c84b21c4e3d449ebe27 \
--hash=sha256:b8ad986f9b532c026f19585289384b0769188fcb68b37c7f0bd0df9092a6ca54 \
--hash=sha256:cbe8c64640637faa5535d539421b293327f119c31507c33ca880bd4f16035eb6 \
--hash=sha256:f0836cd3bdc37c8a77b192bbe5f41dbcc3ce654db048ebbba89bdfe6db7a1c7a
# via contextvars
importlib-metadata==3.1.0 \
--hash=sha256:590690d61efdd716ff82c39ca9a9d4209252adfe288a4b5721181050acbd4175 \
--hash=sha256:d9b8a46a0885337627a6430db287176970fff18ad421becec1d64cfc763c2099
Expand Down Expand Up @@ -514,6 +549,10 @@ requests==2.25.0 \
# google-api-core
# id3c
# smartystreets-python-sdk
rfc3986[idna2008]==1.4.0 \
--hash=sha256:112398da31a3344dc25dbf477d8df6cb34f9278a94fee2625d89e4514be8bb9d \
--hash=sha256:af9147e9aceda37c91a05f4deb128d4b4b49d6b199775fd2d2927768abdc8f50
# via httpx
rsa==4.7 \
--hash=sha256:69805d6b69f56eb05b62daea3a7dbd7aa44324ad1306445e05da8060232d00f4 \
--hash=sha256:a8774e55b59fd9fc893b0d05e9bfc6f47081f46ff5b46f39ccf24631b7be356b
Expand Down Expand Up @@ -542,6 +581,12 @@ six==1.15.0 \
smartystreets-python-sdk==4.7.2 \
--hash=sha256:1f36fa1971b83631477c4d7f995c084919f728f223d04f431a6605d07f90197d
# via id3c
sniffio==1.2.0 \
--hash=sha256:471b71698eac1c2112a40ce2752bb2f4a4814c22a54a3eed3676bc0f5ca9f663 \
--hash=sha256:c4666eecec1d3f50960c6bdf61ab7bc350648da6c126e3cf6898d8cd4ddcd3de
# via
# httpcore
# httpx
sqlite-utils==2.11 \
--hash=sha256:688ef44fdbb1a4c9a188d87c976562f659d8b29dc6dcc872d1cd7748d1c99ec9
# via
Expand Down
37 changes: 0 additions & 37 deletions static/fix-links.js

This file was deleted.

51 changes: 39 additions & 12 deletions templates/pages/dial.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@
body {
margin: 0;
padding: 0;
border: 0;
font-family: "Helvetica Neue", sans-serif;
font-size: 1rem;
font-weight: 400;
line-height: 1.5;
color: #212529;
color: #111A35;
text-align: left;
background-color: #fff;
background-color: #F8FAFB;
}

/* Styles for the dialer */
Expand All @@ -35,24 +36,50 @@
color: red;
}

/* Copied from Datasette's default styles for .hd */
nav {
border-bottom: 2px solid #ccc;
padding: 0.2em 1em;
background-color: #eee;
/* Copied from Datasette's default styles for <header> */
header {
padding: 0.6rem 1rem 0.5rem 1rem;
background-color: #276890;
color: rgba(255,255,244,0.9);
overflow: hidden;
box-sizing: border-box;
min-height: 2rem;
min-height: 2.6rem;
}
nav :link {
header p {
margin: 0;
padding: 0;
}
header .crumbs {
float: left;
}

header a:link,
header a:visited,
header a:hover,
header a:focus,
header a:active,
header button.button-as-link {
color: rgba(255,255,244,0.8);
text-decoration: none;
}

header a:hover,
header a:focus,
header a:active,
button.button-as-link:hover,
button.button-as-link:focus {
color: rgba(255,255,244,1);
}
</style>
</head>
<body>
<nav>
<a href=".">home</a>
</nav>
<header>
<nav>
<p class="crumbs">
<a href=".">home</a>
</p>
</nav>
</header>
<main>
<h1>SFS Switchboard</h1>

Expand Down

0 comments on commit a83fe51

Please sign in to comment.