mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-07-14 15:14:43 +00:00
fix date change bug
This commit is contained in:
parent
61deed70ad
commit
c574bbcb96
@ -39,10 +39,12 @@ def log_list(request, offset):
|
|||||||
|
|
||||||
if host_list:
|
if host_list:
|
||||||
posts = posts.filter(host__in=host_list)
|
posts = posts.filter(host__in=host_list)
|
||||||
|
|
||||||
if cmd:
|
if cmd:
|
||||||
log_id_list = set([log.log_id for log in TtyLog.objects.filter(cmd__contains=cmd)])
|
log_id_list = set([log.log_id for log in TtyLog.objects.filter(cmd__contains=cmd)])
|
||||||
posts = posts.filter(id__in=log_id_list)
|
posts = posts.filter(id__in=log_id_list)
|
||||||
else:
|
|
||||||
|
if not date_seven_day:
|
||||||
date_now = datetime.datetime.now()
|
date_now = datetime.datetime.now()
|
||||||
date_now_str = date_now.strftime('%m/%d/%Y')
|
date_now_str = date_now.strftime('%m/%d/%Y')
|
||||||
date_seven_day = (date_now + datetime.timedelta(days=-7)).strftime('%m/%d/%Y')
|
date_seven_day = (date_now + datetime.timedelta(days=-7)).strftime('%m/%d/%Y')
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
{% block self_head_css_js %}
|
{% block self_head_css_js %}
|
||||||
<link href="/static/css/plugins/datapicker/datepicker3.css" rel="stylesheet">
|
<link href="/static/css/plugins/datepicker/datepicker3.css" rel="stylesheet">
|
||||||
<link href="/static/css/plugins/chosen/chosen.css" rel="stylesheet">
|
<link href="/static/css/plugins/chosen/chosen.css" rel="stylesheet">
|
||||||
<script src="/static/js/plugins/chosen/chosen.jquery.js"></script>
|
<script src="/static/js/plugins/chosen/chosen.jquery.js"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
{% block self_head_css_js %}
|
{% block self_head_css_js %}
|
||||||
<link href="/static/css/plugins/datapicker/datepicker3.css" rel="stylesheet">
|
<link href="/static/css/plugins/datepicker/datepicker3.css" rel="stylesheet">
|
||||||
<link href="/static/css/plugins/chosen/chosen.css" rel="stylesheet">
|
<link href="/static/css/plugins/chosen/chosen.css" rel="stylesheet">
|
||||||
<script src="/static/js/plugins/chosen/chosen.jquery.js"></script>
|
<script src="/static/js/plugins/chosen/chosen.jquery.js"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@ -54,18 +54,15 @@
|
|||||||
<ul class="nav nav-tabs">
|
<ul class="nav nav-tabs">
|
||||||
<li><a href="/jlog/log_list/online/" class="text-center"><i class="fa fa-laptop"></i> 在线 </a></li>
|
<li><a href="/jlog/log_list/online/" class="text-center"><i class="fa fa-laptop"></i> 在线 </a></li>
|
||||||
<li class="active"><a href="/jlog/log_list/offline/" class="text-center"><i class="fa fa-bar-chart-o"></i> 历史记录 </a></li>
|
<li class="active"><a href="/jlog/log_list/offline/" class="text-center"><i class="fa fa-bar-chart-o"></i> 历史记录 </a></li>
|
||||||
{# <li><a href="/jlog/search/" class="text-center"><i class="fa fa-bar-chart-o"></i> 详细搜索 </a></li>#}
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<br/>
|
<br/>
|
||||||
<form class="form-inline" action="" method="get">
|
<form class="form-inline" action="" method="get">
|
||||||
<div class="form-group" id="data_5">
|
<div class="form-group" id="date_5">
|
||||||
<div class="form-group" id="data_5">
|
|
||||||
<div class="input-daterange input-group" id="datepicker">
|
<div class="input-daterange input-group" id="datepicker">
|
||||||
<input type="text" class="input-sm form-control" style="width: 100px;" name="start" value="{{ date_seven_day }}">
|
<input type="text" class="input-sm form-control" style="width: 100px;" name="start" value="{{ date_seven_day }}">
|
||||||
<span class="input-group-addon">to</span>
|
<span class="input-group-addon">to</span>
|
||||||
<input type="text" class="input-sm form-control" style="width: 100px;" name="end" value="{{ date_now_str }}">
|
<input type="text" class="input-sm form-control" style="width: 100px;" name="end" value="{{ date_now_str }}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@ -89,7 +86,6 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input id="cmd" name="cmd" placeholder="命令" type="text" class="form-control" value="{{ cmd }}" style="width: 200px;">
|
<input id="cmd" name="cmd" placeholder="命令" type="text" class="form-control" value="{{ cmd }}" style="width: 200px;">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<button id='search_btn' type="submit" class="btn btn-sm btn-primary">
|
<button id='search_btn' type="submit" class="btn btn-sm btn-primary">
|
||||||
Search
|
Search
|
||||||
</button>
|
</button>
|
||||||
@ -116,7 +112,7 @@
|
|||||||
|
|
||||||
{% for post in contacts.object_list %}
|
{% for post in contacts.object_list %}
|
||||||
<tr class="gradeX">
|
<tr class="gradeX">
|
||||||
<td class="text-center username"> {{ post.id }} </td>
|
<td class="text-center"> {{ post.id }} </td>
|
||||||
<td class="text-center username"> {{ post.user }} </td>
|
<td class="text-center username"> {{ post.user }} </td>
|
||||||
<td class="text-center ip"> {{ post.host }} </td>
|
<td class="text-center ip"> {{ post.host }} </td>
|
||||||
<td class="text-center remote_ip"> {{ post.remote_ip }} </td>
|
<td class="text-center remote_ip"> {{ post.remote_ip }} </td>
|
||||||
@ -201,8 +197,8 @@
|
|||||||
{# }#}
|
{# }#}
|
||||||
{# });#}
|
{# });#}
|
||||||
|
|
||||||
$('#data_5 .input-daterange').datepicker({
|
$('#date_5 .input-daterange').datepicker({
|
||||||
dateFormat: 'yy-mm-dd',
|
dateFormat: 'mm/dd/yy',
|
||||||
keyboardNavigation: false,
|
keyboardNavigation: false,
|
||||||
forceParse: false,
|
forceParse: false,
|
||||||
autoclose: true
|
autoclose: true
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
{% block self_head_css_js %}
|
{% block self_head_css_js %}
|
||||||
<link href="/static/css/plugins/datapicker/datepicker3.css" rel="stylesheet">
|
<link href="/static/css/plugins/datepicker/datepicker3.css" rel="stylesheet">
|
||||||
<link href="/static/css/plugins/chosen/chosen.css" rel="stylesheet">
|
<link href="/static/css/plugins/chosen/chosen.css" rel="stylesheet">
|
||||||
<script src="/static/js/plugins/chosen/chosen.jquery.js"></script>
|
<script src="/static/js/plugins/chosen/chosen.jquery.js"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
{% block self_head_css_js %}
|
{% block self_head_css_js %}
|
||||||
<link href="/static/css/plugins/datapicker/datepicker3.css" rel="stylesheet">
|
<link href="/static/css/plugins/datepicker/datepicker3.css" rel="stylesheet">
|
||||||
<link href="/static/css/plugins/chosen/chosen.css" rel="stylesheet">
|
<link href="/static/css/plugins/chosen/chosen.css" rel="stylesheet">
|
||||||
<script src="/static/js/plugins/chosen/chosen.jquery.js"></script>
|
<script src="/static/js/plugins/chosen/chosen.jquery.js"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
{% block self_head_css_js %}
|
{% block self_head_css_js %}
|
||||||
<link href="/static/css/plugins/datapicker/datepicker3.css" rel="stylesheet">
|
<link href="/static/css/plugins/datepicker/datepicker3.css" rel="stylesheet">
|
||||||
<link href="/static/css/plugins/chosen/chosen.css" rel="stylesheet">
|
<link href="/static/css/plugins/chosen/chosen.css" rel="stylesheet">
|
||||||
<script src="/static/js/plugins/chosen/chosen.jquery.js"></script>
|
<script src="/static/js/plugins/chosen/chosen.jquery.js"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
{% block self_head_css_js %}
|
{% block self_head_css_js %}
|
||||||
<link href="/static/css/plugins/datapicker/datepicker3.css" rel="stylesheet">
|
<link href="/static/css/plugins/datepicker/datepicker3.css" rel="stylesheet">
|
||||||
<link href="/static/css/plugins/chosen/chosen.css" rel="stylesheet">
|
<link href="/static/css/plugins/chosen/chosen.css" rel="stylesheet">
|
||||||
<script src="/static/js/plugins/chosen/chosen.jquery.js"></script>
|
<script src="/static/js/plugins/chosen/chosen.jquery.js"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
{% block self_head_css_js %}
|
{% block self_head_css_js %}
|
||||||
<link href="/static/css/plugins/datapicker/datepicker3.css" rel="stylesheet">
|
<link href="/static/css/plugins/datepicker/datepicker3.css" rel="stylesheet">
|
||||||
<link href="/static/css/plugins/chosen/chosen.css" rel="stylesheet">
|
<link href="/static/css/plugins/chosen/chosen.css" rel="stylesheet">
|
||||||
<script src="/static/js/plugins/chosen/chosen.jquery.js"></script>
|
<script src="/static/js/plugins/chosen/chosen.jquery.js"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -69,7 +69,7 @@
|
|||||||
{% block self_head_css_js %}
|
{% block self_head_css_js %}
|
||||||
{% load staticfiles %}
|
{% load staticfiles %}
|
||||||
<script src="{% static 'js/jquery.shiftcheckbox.js' %}"></script>
|
<script src="{% static 'js/jquery.shiftcheckbox.js' %}"></script>
|
||||||
<link href="/static/css/plugins/datapicker/datepicker3.css" rel="stylesheet">
|
<link href="/static/css/plugins/datepicker/datepicker3.css" rel="stylesheet">
|
||||||
<link href="/static/css/plugins/chosen/chosen.css" rel="stylesheet">
|
<link href="/static/css/plugins/chosen/chosen.css" rel="stylesheet">
|
||||||
<script src="/static/js/plugins/chosen/chosen.jquery.js"></script>
|
<script src="/static/js/plugins/chosen/chosen.jquery.js"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Loading…
Reference in New Issue
Block a user