mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-04-19 21:42:24 +00:00
View Current Settings - show webBasePath
This commit is contained in:
parent
a2f6d3b8dc
commit
c0b5d5506f
1 changed files with 19 additions and 3 deletions
18
main.go
18
main.go
|
@ -127,20 +127,33 @@ func showSetting(show bool) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("get current port failed, error info:", err)
|
fmt.Println("get current port failed, error info:", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
webBasePath, err := settingService.GetBasePath()
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("get webBasePath failed, error info:", err)
|
||||||
|
}
|
||||||
|
|
||||||
userService := service.UserService{}
|
userService := service.UserService{}
|
||||||
userModel, err := userService.GetFirstUser()
|
userModel, err := userService.GetFirstUser()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("get current user info failed, error info:", err)
|
fmt.Println("get current user info failed, error info:", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
username := userModel.Username
|
username := userModel.Username
|
||||||
userpasswd := userModel.Password
|
userpasswd := userModel.Password
|
||||||
if (username == "") || (userpasswd == "") {
|
if username == "" || userpasswd == "" {
|
||||||
fmt.Println("current username or password is empty")
|
fmt.Println("current username or password is empty")
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println("current panel settings as follows:")
|
fmt.Println("current panel settings as follows:")
|
||||||
fmt.Println("username:", username)
|
fmt.Println("username:", username)
|
||||||
fmt.Println("userpasswd:", userpasswd)
|
fmt.Println("userpasswd:", userpasswd)
|
||||||
fmt.Println("port:", port)
|
fmt.Println("port:", port)
|
||||||
|
if webBasePath != "" {
|
||||||
|
fmt.Println("webBasePath:", webBasePath)
|
||||||
|
} else {
|
||||||
|
fmt.Println("webBasePath is not set")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -220,6 +233,7 @@ func updateSetting(port int, username string, password string) {
|
||||||
fmt.Printf("set port %v success", port)
|
fmt.Printf("set port %v success", port)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if username != "" || password != "" {
|
if username != "" || password != "" {
|
||||||
userService := service.UserService{}
|
userService := service.UserService{}
|
||||||
err := userService.UpdateFirstUser(username, password)
|
err := userService.UpdateFirstUser(username, password)
|
||||||
|
@ -288,6 +302,7 @@ func main() {
|
||||||
var port int
|
var port int
|
||||||
var username string
|
var username string
|
||||||
var password string
|
var password string
|
||||||
|
var webBasePath string
|
||||||
var tgbottoken string
|
var tgbottoken string
|
||||||
var tgbotchatid string
|
var tgbotchatid string
|
||||||
var enabletgbot bool
|
var enabletgbot bool
|
||||||
|
@ -301,6 +316,7 @@ func main() {
|
||||||
settingCmd.IntVar(&port, "port", 0, "set panel port")
|
settingCmd.IntVar(&port, "port", 0, "set panel port")
|
||||||
settingCmd.StringVar(&username, "username", "", "set login username")
|
settingCmd.StringVar(&username, "username", "", "set login username")
|
||||||
settingCmd.StringVar(&password, "password", "", "set login password")
|
settingCmd.StringVar(&password, "password", "", "set login password")
|
||||||
|
settingCmd.StringVar(&webBasePath, "webBasePath", "", "set web base path")
|
||||||
settingCmd.StringVar(&tgbottoken, "tgbottoken", "", "set telegram bot token")
|
settingCmd.StringVar(&tgbottoken, "tgbottoken", "", "set telegram bot token")
|
||||||
settingCmd.StringVar(&tgbotRuntime, "tgbotRuntime", "", "set telegram bot cron time")
|
settingCmd.StringVar(&tgbotRuntime, "tgbotRuntime", "", "set telegram bot cron time")
|
||||||
settingCmd.StringVar(&tgbotchatid, "tgbotchatid", "", "set telegram bot chat id")
|
settingCmd.StringVar(&tgbotchatid, "tgbotchatid", "", "set telegram bot chat id")
|
||||||
|
|
Loading…
Reference in a new issue