modify 3 pages
This commit is contained in:
@ -2,6 +2,8 @@
|
||||
{% block title %}View{% endblock %}
|
||||
{% block body %}
|
||||
<h1>IP登陆地统计</h1>
|
||||
<p>请选择日期(默认为当日)</p>
|
||||
<input id='inputDate' type="date" value=""/>
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
@ -9,8 +11,8 @@
|
||||
<th scope="col">上次登录IP</th>
|
||||
<th scope="col">上次登陆地</th>
|
||||
<th scope="col">运营商</th>
|
||||
<th scope="col">登录IP地址统计(省)</th>
|
||||
<th scope="col">登陆地统计(省)</th>
|
||||
<!-- <th scope="col">登录IP地址统计(省)</th>
|
||||
<th scope="col">登陆地统计(省)</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -20,10 +22,43 @@
|
||||
<td>{{ contact['ip'] }}</td>
|
||||
<td>{{ contact['location'] }}</td>
|
||||
<td>{{ contact['isp'] }}</td>
|
||||
<td>{{ contact['cnt1'] }}</td>
|
||||
<td>{{ contact['cnt2'] }}</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 %}
|
||||
|
Reference in New Issue
Block a user