mirror of
https://github.com/yhl452493373/frpc-panel.git
synced 2026-04-04 06:17:00 +08:00
fixed: current show info in Proxies
This commit is contained in:
@@ -86,7 +86,7 @@ func (c *HandleController) MakeIndexFunc() func(context *gin.Context) {
|
||||
"Basic": ginI18n.MustGetMessage(context, "Basic"),
|
||||
"Extra": ginI18n.MustGetMessage(context, "Extra"),
|
||||
"ProxyName": ginI18n.MustGetMessage(context, "Proxy Name"),
|
||||
"LocalIp": ginI18n.MustGetMessage(context, "Local Ip"),
|
||||
"LocalIP": ginI18n.MustGetMessage(context, "Local IP"),
|
||||
"LocalPort": ginI18n.MustGetMessage(context, "Local Port"),
|
||||
"RemotePort": ginI18n.MustGetMessage(context, "Remote Port"),
|
||||
"CustomDomains": ginI18n.MustGetMessage(context, "Custom Domains"),
|
||||
@@ -116,7 +116,7 @@ func (c *HandleController) MakeLangFunc() func(context *gin.Context) {
|
||||
"running": ginI18n.MustGetMessage(context, "running"),
|
||||
"start error": ginI18n.MustGetMessage(context, "start error"),
|
||||
"new": ginI18n.MustGetMessage(context, "new"),
|
||||
"LocalIp": ginI18n.MustGetMessage(context, "Local Ip"),
|
||||
"LocalIP": ginI18n.MustGetMessage(context, "Local IP"),
|
||||
"LocalPort": ginI18n.MustGetMessage(context, "Local Port"),
|
||||
"RemotePort": ginI18n.MustGetMessage(context, "Remote Port"),
|
||||
"UseEncryption": ginI18n.MustGetMessage(context, "Use Encryption"),
|
||||
|
||||
@@ -18,6 +18,10 @@ func trimString(str string) string {
|
||||
return strings.TrimSpace(str)
|
||||
}
|
||||
|
||||
func equalIgnoreCase(source string, target string) bool {
|
||||
return strings.ToUpper(source) == strings.ToUpper(target)
|
||||
}
|
||||
|
||||
func sortSectionKeys(object ini.Section) []string {
|
||||
var keys []string
|
||||
for key := range object {
|
||||
@@ -139,5 +143,18 @@ func (c *HandleController) parseConfigure(content, proxyType string) (interface{
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return clientConfig, nil
|
||||
|
||||
if proxyType == "none" {
|
||||
return clientConfig, nil
|
||||
}
|
||||
|
||||
allProxies := clientConfig.Proxies
|
||||
var filterProxies = make([]v1.ProxyConfigurer, 0)
|
||||
for i := range allProxies {
|
||||
if equalIgnoreCase(allProxies[i].Type, proxyType) {
|
||||
filterProxies = append(filterProxies, allProxies[i].ProxyConfigurer)
|
||||
}
|
||||
}
|
||||
|
||||
return filterProxies, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user