Fetch client local IP
This commit is contained in:
parent
1a0c3ef70b
commit
9029226adc
|
@ -174,7 +174,7 @@ func getClient(conn net.Conn) (int, error) {
|
|||
for i, v := range clientList {
|
||||
sameClient := basicC.Username == v.ClientBasicInfo.Username &&
|
||||
basicC.PublicIP == v.ClientBasicInfo.PublicIP &&
|
||||
basicC.Hostname == v.ClientBasicInfo.Hostname
|
||||
basicC.Hostname == v.ClientBasicInfo.Hostname && basicC.LocalIP == v.ClientBasicInfo.LocalIP
|
||||
|
||||
if sameClient == true {
|
||||
clientList[i].IsOnline = true
|
||||
|
|
|
@ -24,6 +24,7 @@ type ClientBasicInfo struct {
|
|||
OperatingSystem string
|
||||
Hostname string
|
||||
PublicIP string
|
||||
LocalIP string
|
||||
}
|
||||
|
||||
type Instructions struct {
|
||||
|
|
|
@ -35,7 +35,8 @@
|
|||
<tr>
|
||||
<td>ID</td>
|
||||
<td>Status</td>
|
||||
<td>IP</td>
|
||||
<td>Remote IP</td>
|
||||
<td>Local IP</td>
|
||||
<td>Username</td>
|
||||
<td>Hostname</td>
|
||||
<td>Operating System</td>
|
||||
|
@ -60,6 +61,7 @@
|
|||
{{ end }}
|
||||
</td>
|
||||
<td>{{ .ClientBasicInfo.PublicIP }}</td>
|
||||
<td>{{ .ClientBasicInfo.LocalIP }}</td>
|
||||
<td>{{ .ClientBasicInfo.Username }}</td>
|
||||
<td>{{ .ClientBasicInfo.Hostname }}</td>
|
||||
<td>{{ .ClientBasicInfo.OperatingSystem }}</td>
|
||||
|
|
Loading…
Reference in New Issue