mirror of
https://github.com/ehang-io/nps.git
synced 2025-09-01 10:56:53 +00:00
Ip limit
This commit is contained in:
@@ -12,7 +12,7 @@ import (
|
||||
func GetRunPath() string {
|
||||
var path string
|
||||
if path = GetInstallPath(); !FileExists(path) {
|
||||
return "./"
|
||||
return GetAppPath()
|
||||
}
|
||||
return path
|
||||
}
|
||||
@@ -48,7 +48,7 @@ func IsWindows() bool {
|
||||
func GetLogPath() string {
|
||||
var path string
|
||||
if IsWindows() {
|
||||
path = "./"
|
||||
path = GetAppPath()
|
||||
} else {
|
||||
path = "/tmp"
|
||||
}
|
||||
@@ -59,7 +59,7 @@ func GetLogPath() string {
|
||||
func GetTmpPath() string {
|
||||
var path string
|
||||
if IsWindows() {
|
||||
path = GetRunPath()
|
||||
path = GetAppPath()
|
||||
} else {
|
||||
path = "/tmp"
|
||||
}
|
||||
|
@@ -307,6 +307,7 @@ func (s *Conn) GetHostInfo() (h *file.Host, err error) {
|
||||
} else {
|
||||
arr := strings.Split(string(b), common.CONN_DATA_SEQ)
|
||||
h = new(file.Host)
|
||||
h.Id = file.GetCsvDb().GetHostId()
|
||||
h.Host = arr[0]
|
||||
h.Target = arr[1]
|
||||
h.HeaderChange = arr[2]
|
||||
|
@@ -51,7 +51,6 @@ func (s *Csv) StoreTasksToCsv() {
|
||||
if task.NoStore {
|
||||
continue
|
||||
}
|
||||
lg.Println(task)
|
||||
record := []string{
|
||||
strconv.Itoa(task.Port),
|
||||
task.Mode,
|
||||
|
@@ -26,12 +26,12 @@ func InitLogFile(f string, isStdout bool, logPath string) {
|
||||
}
|
||||
|
||||
func Println(v ...interface{}) {
|
||||
Log.Println(v ...)
|
||||
Log.Println(v...)
|
||||
}
|
||||
|
||||
func Fatalln(v ...interface{}) {
|
||||
Log.SetPrefix("error ")
|
||||
Log.Fatalln(v ...)
|
||||
Log.Fatalln(v...)
|
||||
Log.SetPrefix("")
|
||||
}
|
||||
func Fatalf(format string, v ...interface{}) {
|
||||
|
Reference in New Issue
Block a user