10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-07-23 11:17:42 +02:00

Transform to one line with jsonify and JSON parse

This commit is contained in:
Mickaël Véril 2019-09-14 20:09:54 +02:00
parent d566394650
commit f690de40d3

View File

@ -1,10 +1,11 @@
<script>
{{- $files := readDir "/static/data" -}}
{{- $files := readDir "/static/data" }}
{{- $list := slice }}
function getDataFilesName(){
var files=[]
{{- range $files }}
files.push({{ .Name }})
{{- $list = $list | append .Name }}
{{- end }}
var files=JSON.parse({{ jsonify $list }})
return files
}
</script>