diff --git a/ogcp/static/js/ogcp.js b/ogcp/static/js/ogcp.js index 548122b..af95dde 100644 --- a/ogcp/static/js/ogcp.js +++ b/ogcp/static/js/ogcp.js @@ -10,7 +10,7 @@ async function show_client_mac(pill_id) { return } - const ip = pill.html().split('
')[1] + const ip = $('[name="ip"]', pill).html() if (!macs.get(ip)) { const resp = await fetch('/client/mac?ip=' + ip); @@ -19,7 +19,7 @@ async function show_client_mac(pill_id) { } const mac = macs.get(ip) - pill.append('
' + mac); + pill.append('
' + mac + '
'); } function showSelectedClient(client_checkbox) { @@ -33,8 +33,10 @@ function showSelectedClient(client_checkbox) { if (client_checkbox.checked) { if (!($('#' + pill_id).length)) { $(container).append('
' + client_name + - '
' + client_checkbox.value + '
'); + 'id="'+ pill_id + '">' + + '
' + client_name + '
' + + '
' + client_checkbox.value + '
'+ + ''); show_client_mac(pill_id); } diff --git a/ogcp/templates/base.html b/ogcp/templates/base.html index fad931a..b6fcb94 100644 --- a/ogcp/templates/base.html +++ b/ogcp/templates/base.html @@ -108,7 +108,7 @@ - +