mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-23 02:35:17 +01:00
rename key about JS compression.
This commit is contained in:
parent
ef13c94cd2
commit
18a609976d
@ -13,7 +13,7 @@ LDAP_URL=$ldap_url
|
||||
LDAP_BASE_DN=$ldap_basedn
|
||||
UI_SECRET=$ui_secret
|
||||
SELF_REGISTRATION=$self_registration
|
||||
PRODUCTION=$use_compressed_js
|
||||
USE_COMPRESSED_JS=$use_compressed_js
|
||||
LOG_LEVEL=debug
|
||||
GODEBUG=netdns=cgo
|
||||
EXT_ENDPOINT=$ui_url
|
||||
|
@ -21,7 +21,7 @@ type BaseController struct {
|
||||
SelfRegistration bool
|
||||
IsAdmin bool
|
||||
AuthMode string
|
||||
Production bool
|
||||
UseCompressedJS bool
|
||||
}
|
||||
|
||||
type langType struct {
|
||||
@ -99,13 +99,13 @@ func (b *BaseController) Prepare() {
|
||||
b.AuthMode = authMode
|
||||
b.Data["AuthMode"] = b.AuthMode
|
||||
|
||||
production := os.Getenv("PRODUCTION")
|
||||
if production == "on" {
|
||||
b.Production = true
|
||||
useCompressedJS := os.Getenv("USE_COMPRESSED_JS")
|
||||
if useCompressedJS == "on" {
|
||||
b.UseCompressedJS = true
|
||||
}
|
||||
|
||||
if _, err := os.Stat(filepath.Join("static", "resources", "js", "harbor.app.min.js")); os.IsNotExist(err) {
|
||||
b.Production = false
|
||||
b.UseCompressedJS = false
|
||||
}
|
||||
}
|
||||
|
||||
@ -117,7 +117,7 @@ func (b *BaseController) Forward(title, templateName string) {
|
||||
b.LayoutSections = make(map[string]string)
|
||||
b.LayoutSections["HeaderInclude"] = filepath.Join(prefixNg, viewPath, "header-include.htm")
|
||||
|
||||
if b.Production {
|
||||
if b.UseCompressedJS {
|
||||
b.LayoutSections["HeaderScriptInclude"] = filepath.Join(prefixNg, viewPath, "script-min-include.htm")
|
||||
} else {
|
||||
b.LayoutSections["HeaderScriptInclude"] = filepath.Join(prefixNg, viewPath, "script-include.htm")
|
||||
|
Loading…
Reference in New Issue
Block a user