mirror of
https://github.com/xiaoxinpro/nginx-proxy-manager-zh.git
synced 2025-03-14 17:48:14 -04:00
Remove cache from filters, was duplicating incorrect data
This commit is contained in:
parent
c4db4a2647
commit
0a18a565c7
@ -16,10 +16,6 @@ import (
|
|||||||
|
|
||||||
func GetFilterMap(m interface{}, globalTablePrefix string) map[string]model.FilterMapValue {
|
func GetFilterMap(m interface{}, globalTablePrefix string) map[string]model.FilterMapValue {
|
||||||
name := getName(m)
|
name := getName(m)
|
||||||
if val, exists := getCache(name); exists {
|
|
||||||
return val
|
|
||||||
}
|
|
||||||
|
|
||||||
filterMap := make(map[string]model.FilterMapValue)
|
filterMap := make(map[string]model.FilterMapValue)
|
||||||
|
|
||||||
// TypeOf returns the reflection Type that represents the dynamic type of variable.
|
// TypeOf returns the reflection Type that represents the dynamic type of variable.
|
||||||
@ -60,12 +56,13 @@ func GetFilterMap(m interface{}, globalTablePrefix string) map[string]model.Filt
|
|||||||
// Get the field tag value
|
// Get the field tag value
|
||||||
filterTag := field.Tag.Get("filter")
|
filterTag := field.Tag.Get("filter")
|
||||||
dbTag := field.Tag.Get("gorm")
|
dbTag := field.Tag.Get("gorm")
|
||||||
|
|
||||||
|
// Filter -> Schema mapping
|
||||||
|
if filterTag != "" && filterTag != "-" {
|
||||||
f := model.FilterMapValue{
|
f := model.FilterMapValue{
|
||||||
Model: name,
|
Model: name,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Filter -> Schema mapping
|
|
||||||
if filterTag != "" && filterTag != "-" {
|
|
||||||
f.Schema = getFilterTagSchema(filterTag)
|
f.Schema = getFilterTagSchema(filterTag)
|
||||||
parts := strings.Split(filterTag, ",")
|
parts := strings.Split(filterTag, ",")
|
||||||
|
|
||||||
@ -89,11 +86,11 @@ func GetFilterMap(m interface{}, globalTablePrefix string) map[string]model.Filt
|
|||||||
f.Field = fmt.Sprintf("%s%s", tablePrefix, database.QuoteTableName(matches[1]))
|
f.Field = fmt.Sprintf("%s%s", tablePrefix, database.QuoteTableName(matches[1]))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
filterMap[parts[0]] = f
|
filterMap[parts[0]] = f
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setCache(name, filterMap)
|
|
||||||
return filterMap
|
return filterMap
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user