Browse Source

got dynamic table updating stuff

AETH-erial 10 months ago
parent
commit
617aff69c5
2 changed files with 8 additions and 6 deletions
  1. 4 2
      pkg/html/templates/home.html
  2. 4 4
      pkg/html/templates/ip_table.html

+ 4 - 2
pkg/html/templates/home.html

@@ -36,14 +36,16 @@
                     <th scope="col"><p style="font-family: monospace;">Listening Ports</p></th>
                 </tr>
             </thead>
-            <tbody>
+            <tbody id="response-div">
         {{ range . }}
+        <tr>
             {{ template "ip_table.html" . }}
+        </tr>
         {{ end }}
 
+
             </tbody>
         </table>
-        <div id="response-div"></div>
 
     
     

+ 4 - 4
pkg/html/templates/ip_table.html

@@ -1,8 +1,8 @@
 {{ define "ip_table.html" }}
-    <tr>
-        <th scope="row"><p style="font-family: monospace;">{{ .Fqdn }}</p></th>
+<tr>
+<th scope="row"><p style="font-family: monospace;">{{ .Fqdn }}</p></th>
         <td><p style="font-family: monospace;">{{ .IpAddress }}</p></td>
         <td><p style="font-family: monospace;">{{ .PingResponse }}</p></td>
         <td><p style="font-family: monospace;">{{ .PortString }}</p></td>
-    </tr>
-{{ end }}
+</tr>
+        {{ end }}