mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 09:13:49 +08:00
chore: update dependences
This commit is contained in:
@@ -142,7 +142,7 @@ func (p *Parser) Set(key string, directives []*config.Directive) error {
|
||||
}
|
||||
|
||||
for _, directive := range directives {
|
||||
directive.SetParent(block)
|
||||
directive.SetParent(block.GetParent())
|
||||
block.Directives = append(block.Directives, directive)
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ func (p *Parser) sortDirectives(directives []config.IDirective, orderIndex map[s
|
||||
if orderIndex[a.GetName()] != orderIndex[b.GetName()] {
|
||||
return orderIndex[a.GetName()] - orderIndex[b.GetName()]
|
||||
}
|
||||
return slices.Compare(a.GetParameters(), b.GetParameters())
|
||||
return slices.Compare(p.parameters2Slices(a.GetParameters()), p.parameters2Slices(b.GetParameters()))
|
||||
})
|
||||
|
||||
for _, directive := range directives {
|
||||
@@ -172,3 +172,19 @@ func (p *Parser) sortDirectives(directives []config.IDirective, orderIndex map[s
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (p *Parser) slices2Parameters(slices []string) []config.Parameter {
|
||||
var parameters []config.Parameter
|
||||
for _, slice := range slices {
|
||||
parameters = append(parameters, config.Parameter{Value: slice})
|
||||
}
|
||||
return parameters
|
||||
}
|
||||
|
||||
func (p *Parser) parameters2Slices(parameters []config.Parameter) []string {
|
||||
var s []string
|
||||
for _, parameter := range parameters {
|
||||
s = append(s, parameter.Value)
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user