mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-03-14 01:34:47 +08:00
feat: 修改端口检测规则 (#1591)
This commit is contained in:
parent
c0c1d519bf
commit
4de99f66a8
@ -271,7 +271,7 @@ func (a AppService) Install(ctx context.Context, req request.AppInstallCreate) (
|
|||||||
app model.App
|
app model.App
|
||||||
)
|
)
|
||||||
for key := range req.Params {
|
for key := range req.Params {
|
||||||
if !strings.Contains(key, "PORT") {
|
if !strings.Contains(key, "PANEL_APP_PORT") {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
var port int
|
var port int
|
||||||
|
@ -48,7 +48,20 @@ var (
|
|||||||
func checkPort(key string, params map[string]interface{}) (int, error) {
|
func checkPort(key string, params map[string]interface{}) (int, error) {
|
||||||
port, ok := params[key]
|
port, ok := params[key]
|
||||||
if ok {
|
if ok {
|
||||||
portN := int(math.Ceil(port.(float64)))
|
portN := 0
|
||||||
|
var err error
|
||||||
|
switch p := port.(type) {
|
||||||
|
case string:
|
||||||
|
portN, err = strconv.Atoi(p)
|
||||||
|
if err != nil {
|
||||||
|
return portN, nil
|
||||||
|
}
|
||||||
|
case float64:
|
||||||
|
portN = int(math.Ceil(p))
|
||||||
|
case int:
|
||||||
|
portN = p
|
||||||
|
}
|
||||||
|
|
||||||
oldInstalled, _ := appInstallRepo.ListBy(appInstallRepo.WithPort(portN))
|
oldInstalled, _ := appInstallRepo.ListBy(appInstallRepo.WithPort(portN))
|
||||||
if len(oldInstalled) > 0 {
|
if len(oldInstalled) > 0 {
|
||||||
var apps []string
|
var apps []string
|
||||||
|
@ -166,7 +166,6 @@ const onMessage = (message: any) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const filterByStatus = () => {
|
const filterByStatus = () => {
|
||||||
console.log(sortConfig.filters);
|
|
||||||
if (sortConfig.filters.length > 0) {
|
if (sortConfig.filters.length > 0) {
|
||||||
const newData = oldData.value.filter((re: any) => {
|
const newData = oldData.value.filter((re: any) => {
|
||||||
return (sortConfig.filters as string[]).indexOf(re.status) > -1;
|
return (sortConfig.filters as string[]).indexOf(re.status) > -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user