mirror of
https://github.com/yhl452493373/frpc-panel.git
synced 2026-04-04 14:27:01 +08:00
remove unused sturct;
add new user popup
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"frps-panel/pkg/server"
|
||||
"frps-panel/pkg/server/controller"
|
||||
"github.com/BurntSushi/toml"
|
||||
@@ -72,21 +71,11 @@ func Execute() {
|
||||
|
||||
func parseConfigFile(configFile, tokensFile string) (controller.HandleController, server.TLS, error) {
|
||||
var common controller.Common
|
||||
var tokens controller.Tokens
|
||||
_, err := toml.DecodeFile(configFile, &common)
|
||||
if err != nil {
|
||||
log.Fatalf("decode config file %v error: %v", configFile, err)
|
||||
}
|
||||
|
||||
_, err = toml.DecodeFile(tokensFile, &tokens)
|
||||
if err != nil {
|
||||
if errors.Is(err, os.ErrNotExist) {
|
||||
tokens = controller.Tokens{Tokens: make(map[string]controller.TokenInfo)}
|
||||
} else {
|
||||
log.Fatalf("decode token file %v error: %v", tokensFile, err)
|
||||
}
|
||||
}
|
||||
|
||||
common.Common.DashboardTls = strings.HasPrefix("https://", strings.ToLower(common.Common.DashboardAddr))
|
||||
|
||||
tls := server.TLS{
|
||||
@@ -108,7 +97,6 @@ func parseConfigFile(configFile, tokensFile string) (controller.HandleController
|
||||
|
||||
return controller.HandleController{
|
||||
CommonInfo: common.Common,
|
||||
Tokens: tokens.Tokens,
|
||||
Version: version,
|
||||
ConfigFile: configFile,
|
||||
TokensFile: tokensFile,
|
||||
|
||||
Reference in New Issue
Block a user