mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Fix Vite issues (#2038)
* Fix environment vars in Vite * Add types, remove process.env override * Temporarily Remove Statigz / gzip * Update ui/v2.5/src/core/createClient.ts Co-authored-by: peolic <66393006+peolic@users.noreply.github.com> * Update ui/v2.5/src/serviceWorker.ts Co-authored-by: peolic <66393006+peolic@users.noreply.github.com> * Ignore case rules in types * Add windows js workaround Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
0687cd2ef0
commit
8d94392cfb
@@ -30,7 +30,6 @@ import (
|
||||
"github.com/stashapp/stash/pkg/manager/config"
|
||||
"github.com/stashapp/stash/pkg/models"
|
||||
"github.com/stashapp/stash/pkg/utils"
|
||||
"github.com/vearutop/statigz"
|
||||
)
|
||||
|
||||
var version string
|
||||
@@ -190,6 +189,12 @@ func Start(uiBox embed.FS, loginUIBox embed.FS) {
|
||||
|
||||
ext := path.Ext(r.URL.Path)
|
||||
|
||||
// workaround for Windows systems where js files are set to plaintext in
|
||||
// the registry.
|
||||
if ext == ".js" {
|
||||
w.Header().Set("Content-Type", "application/javascript")
|
||||
}
|
||||
|
||||
if customUILocation != "" {
|
||||
if r.URL.Path == "index.html" || ext == "" {
|
||||
r.URL.Path = "/"
|
||||
@@ -215,7 +220,9 @@ func Start(uiBox embed.FS, loginUIBox embed.FS) {
|
||||
w.Header().Add("Cache-Control", "max-age=604800000")
|
||||
}
|
||||
r.URL.Path = uiRootDir + r.URL.Path
|
||||
statigz.FileServer(uiBox).ServeHTTP(w, r)
|
||||
|
||||
http.FileServer(http.FS(uiBox)).ServeHTTP(w, r)
|
||||
// statigz.FileServer(uiBox).ServeHTTP(w, r)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user