1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

Merge remote-tracking branch 'origin/master'

This commit is contained in:
Ferdinand Mütsch 2022-01-08 13:33:55 +01:00
commit 1033343702
3 changed files with 30 additions and 5 deletions

26
Caddyfile Normal file
View File

@ -0,0 +1,26 @@
wakapi.yourdomain.tld {
encode zstd gzip
header {
Strict-Transport-Security "max-age=2592000; includeSubDomains"
}
log {
output file /var/log/caddy/wakapi.dev.access.log
format single_field common_log
}
reverse_proxy http://[::1]:3000
@api path_regexp "^/api.*"
@notapi not path_regexp "^/api.*"
push @notapi /assets/vendor/source-sans-3.css
push @notapi /assets/css/app.dist.css
push @notapi /assets/vendor/petite-vue.min.js
push @notapi /assets/vendor/chart.min.js
push @notapi /assets/vendor/iconify.basic.min.js
push @notapi /assets/js/icons.dist.js
push @notapi /assets/js/base.js
push @notapi /assets/images/logo.svg
}

View File

@ -1,4 +1,3 @@
const LEGEND_MAX_ENTRIES = 9
// dirty hack to vertically align legends across multiple charts
// however, without monospace font, it's still not perfectly aligned
// waiting for https://github.com/chartjs/Chart.js/discussions/9890
@ -31,8 +30,8 @@ let topNPickers = [...document.getElementsByClassName('top-picker')]
topNPickers.sort(((a, b) => parseInt(a.attributes['data-entity'].value) - parseInt(b.attributes['data-entity'].value)))
topNPickers.forEach(e => {
const idx = parseInt(e.attributes['data-entity'].value)
e.max = Math.min(data[idx].length, 10)
e.value = e.max
e.max = data[idx].length
e.value = Math.min(e.max, 9)
})
let charts = []
@ -77,7 +76,7 @@ function draw(subselection) {
function filterLegendItem(item) {
item.text = item.text.length > LEGEND_CHARACTERS ? item.text.slice(0, LEGEND_CHARACTERS - 3).padEnd(LEGEND_CHARACTERS, '.') : item.text
item.text = item.text.padEnd(LEGEND_CHARACTERS + 3)
return item.index < LEGEND_MAX_ENTRIES
return true
}
function shouldUpdate(index) {

View File

@ -1 +1 @@
2.0.0-RC1
2.0.0