mirror of
https://github.com/ehang-io/nps.git
synced 2025-09-02 03:16:53 +00:00
Ip限制 npc代理连接
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"github.com/cnlh/nps/lib/beego"
|
||||
"github.com/cnlh/nps/lib/common"
|
||||
"github.com/cnlh/nps/server"
|
||||
"github.com/cnlh/nps/vender/github.com/astaxie/beego"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
@@ -90,7 +90,7 @@ func (s *BaseController) AjaxErr(str string) {
|
||||
}
|
||||
|
||||
//组装ajax
|
||||
func ajax(str string, status int) (map[string]interface{}) {
|
||||
func ajax(str string, status int) map[string]interface{} {
|
||||
json := make(map[string]interface{})
|
||||
json["status"] = status
|
||||
json["msg"] = str
|
||||
|
@@ -3,6 +3,7 @@ package controllers
|
||||
import (
|
||||
"github.com/cnlh/nps/lib/file"
|
||||
"github.com/cnlh/nps/server"
|
||||
"github.com/cnlh/nps/server/tool"
|
||||
)
|
||||
|
||||
type IndexController struct {
|
||||
@@ -81,6 +82,9 @@ func (s *IndexController) Add() {
|
||||
Remark: s.GetString("remark"),
|
||||
Flow: &file.Flow{},
|
||||
}
|
||||
if !tool.TestServerPort(t.Port, t.Mode) {
|
||||
s.AjaxErr("The port cannot be opened because it may has been occupied or is no longer allowed.")
|
||||
}
|
||||
var err error
|
||||
if t.Client, err = file.GetCsvDb().GetClient(s.GetIntNoErr("client_id")); err != nil {
|
||||
s.AjaxErr(err.Error())
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"github.com/cnlh/nps/lib/beego"
|
||||
"github.com/cnlh/nps/vender/github.com/astaxie/beego"
|
||||
)
|
||||
|
||||
type LoginController struct {
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package routers
|
||||
|
||||
import (
|
||||
"github.com/cnlh/nps/lib/beego"
|
||||
"github.com/cnlh/nps/vender/github.com/astaxie/beego"
|
||||
"github.com/cnlh/nps/web/controllers"
|
||||
)
|
||||
|
||||
|
@@ -9,6 +9,7 @@
|
||||
<th>客户端id</th>
|
||||
<th>备注</th>
|
||||
<th>host</th>
|
||||
<th>location</th>
|
||||
<th>内网目标</th>
|
||||
<th>host改写</th>
|
||||
<th>压缩方式</th>
|
||||
@@ -77,6 +78,7 @@
|
||||
{data: 'Remark'},
|
||||
{data: 'Remark'},
|
||||
{data: 'Host'},
|
||||
{data: 'Location'},
|
||||
{data: 'Target'},
|
||||
{data: 'HostChange'},
|
||||
{data: 'HostChange'},
|
||||
|
Reference in New Issue
Block a user