65 lines
1.6 KiB
HTML
Raw Normal View History

2021-02-28 08:21:57 +00:00
{% extends 'layouts/master.html' %}
{% block title %}View{% endblock %}
{% block body %}
2021-03-02 15:56:00 +00:00
<h1>IP登陆地统计</h1>
2021-03-03 06:38:15 +00:00
<p>请选择日期(默认为当日)</p>
<input id='inputDate' type="date" value=""/>
2021-02-28 08:21:57 +00:00
<table class="table table-hover">
<thead>
<tr>
2021-03-02 15:56:00 +00:00
<th scope="col">账号</th>
<th scope="col">上次登录IP</th>
<th scope="col">上次登陆地</th>
<th scope="col">运营商</th>
2021-03-03 06:38:15 +00:00
<!-- <th scope="col">登录IP地址统计</th>
<th scope="col">登陆地统计(省)</th> -->
2021-02-28 08:21:57 +00:00
</tr>
</thead>
<tbody>
{% for contact in contacts %}
<tr>
2021-03-02 15:56:00 +00:00
<td>{{ contact['account'] }}</td>
<td>{{ contact['ip'] }}</td>
<td>{{ contact['location'] }}</td>
<td>{{ contact['isp'] }}</td>
2021-03-03 06:38:15 +00:00
<!-- <td>{{ contact['cnt1'] }}</td>
<td>{{ contact['cnt2'] }}</td> -->
2021-02-28 08:21:57 +00:00
</tr>
{% endfor %}
</tbody>
</table>
2021-03-03 06:38:15 +00:00
<script type='text/javascript'>
window.onload=function(){
var inputDate = document.getElementById("inputDate");
inputDate.onchange = function(){
var selectedDate = inputDate.value;
setCookie('selectedDate', selectedDate, 1);
location.reload();
};
inputDate.value = getCookie('selectedDate');
}
function setCookie(cname,cvalue,exdays)
{
var d = new Date();
d.setTime(d.getTime()+(exdays*24*60*60*1000));
var expires = "expires="+d.toGMTString();
document.cookie = cname + "=" + cvalue + "; " + expires;
}
function getCookie(cname)
{
var name = cname + "=";
var ca = document.cookie.split(';');
for(var i=0; i<ca.length; i++)
{
var c = ca[i].trim();
if (c.indexOf(name)==0) return c.substring(name.length,c.length);
}
return "";
}
</script>
2021-02-28 08:21:57 +00:00
{% endblock %}