diff --git a/.gitignore b/.gitignore index c07ba1a..131f700 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ data/static/*.css data/static/*.js data/static/*.js.map data/static/ts/ +data/static/modules/ !data/static/setup.js data/config-base.json data/config-default.ini diff --git a/Makefile b/Makefile index 42f69ea..d126cfb 100644 --- a/Makefile +++ b/Makefile @@ -18,12 +18,15 @@ email: typescript: $(info Compiling typescript) - npx esbuild ts/* --outdir=data/static --minify + npx esbuild ts/*.ts ts/modules/*.ts --outdir=data/static --minify -rm -r data/static/ts + -rm -r data/static/typings -rm data/static/*.map ts-debug: -npx tsc -p ts/ --sourceMap + -rm -r data/static/ts + -rm -r data/static/typings cp -r ts data/static/ swagger: @@ -51,3 +54,4 @@ install: cp -r build $(DESTDIR)/jfa-go all: configuration sass email version typescript swagger compile copy +debug: configuration sass email version ts-debug swagger compile copy diff --git a/api.go b/api.go index d9e361b..0c40db8 100644 --- a/api.go +++ b/api.go @@ -626,12 +626,12 @@ func (app *appContext) DeleteProfile(gc *gin.Context) { // @tags Invites func (app *appContext) GetInvites(gc *gin.Context) { app.debug.Println("Invites requested") - current_time := time.Now() + currentTime := time.Now() app.storage.loadInvites() app.checkInvites() var invites []inviteDTO for code, inv := range app.storage.invites { - _, _, days, hours, minutes, _ := timeDiff(inv.ValidTill, current_time) + _, _, days, hours, minutes, _ := timeDiff(inv.ValidTill, currentTime) invite := inviteDTO{ Code: code, Days: days, diff --git a/data/templates/admin.html b/data/templates/admin.html index 6860a79..6633b1a 100644 --- a/data/templates/admin.html +++ b/data/templates/admin.html @@ -31,11 +31,11 @@ return ""; } {{ if .bs5 }} - var bsVersion = 5; + window.bsVersion = 5; {{ else }} - var bsVersion = 4; + window.bsVersion = 4; {{ end }} - var cssFile = "{{ .cssFile }}"; + window.cssFile = "{{ .cssFile }}"; var css = document.createElement('link'); css.setAttribute('rel', 'stylesheet'); css.setAttribute('type', 'text/css'); @@ -465,27 +465,19 @@
{{ .contactMessage }}
- - - {{ if .bs5 }} - - {{ else }} - - {{ end }} - - - - - + + {{ if .ombiEnabled }} - + {{ end }}