10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-12-25 22:03:49 +01: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> <script>
{{- $files := readDir "/static/data" -}} {{- $files := readDir "/static/data" }}
{{- $list := slice }}
function getDataFilesName(){ function getDataFilesName(){
var files=[]
{{- range $files }} {{- range $files }}
files.push({{ .Name }}) {{- $list = $list | append .Name }}
{{- end }} {{- end }}
var files=JSON.parse({{ jsonify $list }})
return files return files
} }
</script> </script>