65 lines
1.6 KiB
HTML
65 lines
1.6 KiB
HTML
{% extends 'layouts/master.html' %}
|
||
{% block title %}View{% endblock %}
|
||
{% block body %}
|
||
<h1>IP登陆地统计</h1>
|
||
<p>请选择日期(默认为当日)</p>
|
||
<input id='inputDate' type="date" value=""/>
|
||
<table class="table table-hover">
|
||
<thead>
|
||
<tr>
|
||
<th scope="col">账号</th>
|
||
<th scope="col">上次登录IP</th>
|
||
<th scope="col">上次登陆地</th>
|
||
<th scope="col">运营商</th>
|
||
<!-- <th scope="col">登录IP地址统计(省)</th>
|
||
<th scope="col">登陆地统计(省)</th> -->
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
{% for contact in contacts %}
|
||
<tr>
|
||
<td>{{ contact['account'] }}</td>
|
||
<td>{{ contact['ip'] }}</td>
|
||
<td>{{ contact['location'] }}</td>
|
||
<td>{{ contact['isp'] }}</td>
|
||
<!-- <td>{{ contact['cnt1'] }}</td>
|
||
<td>{{ contact['cnt2'] }}</td> -->
|
||
</tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
</table>
|
||
|
||
<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>
|
||
|
||
{% endblock %}
|