mirror of
				https://github.com/TeaOSLab/EdgeAdmin.git
				synced 2025-11-04 13:10:26 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			33 lines
		
	
	
		
			602 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
		
			602 B
		
	
	
	
		
			Go
		
	
	
	
	
	
package setup
 | 
						|
 | 
						|
import (
 | 
						|
	"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
 | 
						|
	"net"
 | 
						|
	"strings"
 | 
						|
)
 | 
						|
 | 
						|
type IndexAction struct {
 | 
						|
	actionutils.ParentAction
 | 
						|
}
 | 
						|
 | 
						|
func (this *IndexAction) Init() {
 | 
						|
	this.Nav("", "", "")
 | 
						|
}
 | 
						|
 | 
						|
func (this *IndexAction) RunGet(params struct{}) {
 | 
						|
	var currentHost = this.Request.Host
 | 
						|
	if strings.Contains(this.Request.Host, ":") {
 | 
						|
		host, _, err := net.SplitHostPort(this.Request.Host)
 | 
						|
		if err == nil {
 | 
						|
			currentHost = host
 | 
						|
		}
 | 
						|
	}
 | 
						|
	if net.ParseIP(currentHost) != nil {
 | 
						|
		this.Data["currentHost"] = currentHost
 | 
						|
	} else {
 | 
						|
		this.Data["currentHost"] = ""
 | 
						|
	}
 | 
						|
 | 
						|
	this.Show()
 | 
						|
}
 |