Add version information and set header to host
This commit is contained in:
parent
0caad70a5e
commit
9e3166b3e5
5 changed files with 26 additions and 4 deletions
1
frontend/VERSION
Normal file
1
frontend/VERSION
Normal file
|
@ -0,0 +1 @@
|
|||
1.1.0
|
|
@ -39,6 +39,7 @@ main {
|
|||
'tpaths wmap' auto
|
||||
'tpaths . ' 1fr /* Ensures that map container doesn't stretch */
|
||||
'csess csess' auto
|
||||
'foot foot' auto
|
||||
/ auto auto;
|
||||
gap: 10px;
|
||||
|
||||
|
@ -47,7 +48,7 @@ main {
|
|||
}
|
||||
|
||||
h1 {
|
||||
font-size: 3rem;
|
||||
font-size: 2.5rem;
|
||||
grid-area: title;
|
||||
margin: 5px 0;
|
||||
}
|
||||
|
@ -105,3 +106,9 @@ table td {
|
|||
color: var(--heading-color);
|
||||
filter: brightness(125%);
|
||||
}
|
||||
|
||||
#footer {
|
||||
grid-area: foot;
|
||||
font-size: 0.75rem;
|
||||
text-align: right;
|
||||
}
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
set -eux
|
||||
set -o pipefail
|
||||
|
||||
VERSION=$(cat ./VERSION)
|
||||
|
||||
case "$OSTYPE" in
|
||||
darwin*) PLATFORM="OSX" ;;
|
||||
linux*) PLATFORM="LINUX" ;;
|
||||
|
@ -11,13 +13,16 @@ case "$OSTYPE" in
|
|||
esac
|
||||
|
||||
replace() {
|
||||
RE=$1
|
||||
shift
|
||||
if [[ "${PLATFORM}" == "OSX" || "${PLATFORM}" == "BSD" ]]; then
|
||||
sed -i "" "$1" "$2"
|
||||
sed -i "" "$RE" $*
|
||||
elif [ "${PLATFORM}" == "LINUX" ]; then
|
||||
sed -i "$1" "$2"
|
||||
sed -i "$RE" $*
|
||||
fi
|
||||
}
|
||||
|
||||
tsc
|
||||
replace "s#<%= SERVER_PATH %>#${SERVER_PATH}#g" build/*.js
|
||||
replace "s#<%= VERSION %>#${VERSION}#g" build/*.js
|
||||
tar -czvf dist.tgz index.html assets/ build/
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
<body>
|
||||
<main>
|
||||
<h1>Tilastokeskus</h1>
|
||||
<h1 id="title">Tilastokeskus</h1>
|
||||
|
||||
<section id="currently-live">
|
||||
<div id="currently-live-counter">?</div>
|
||||
|
@ -27,6 +27,12 @@
|
|||
<h2>Latest pageviews</h2>
|
||||
<div id="current-sessions-data"></div>
|
||||
</section>
|
||||
|
||||
<footer id="footer">
|
||||
<a href="https://gitlab.com/Nicd/tilastokeskus" target="_blank">
|
||||
Tilastokeskus <span id="version"></span>
|
||||
</a>
|
||||
</footer>
|
||||
</main>
|
||||
|
||||
<script type="module" src="build/index.js" async></script>
|
||||
|
|
|
@ -55,6 +55,9 @@ function main() {
|
|||
throw new Error("Missing host.");
|
||||
}
|
||||
|
||||
document.getElementById("title")!.textContent = hostParam;
|
||||
document.getElementById("version")!.textContent = "v<%= VERSION %>";
|
||||
|
||||
host = hostParam;
|
||||
initConnection();
|
||||
|
||||
|
|
Loading…
Reference in a new issue