mirror of https://github.com/jumpserver/jumpserver
Merge branch 'dev' of https://github.com/jumpserver/jumpserver into dev
commit
a16b3260ba
|
@ -10,7 +10,6 @@
|
|||
<title>{{ title }}</title>
|
||||
{% include '_head_css_js.html' %}
|
||||
<link href="{% static "css/jumpserver.css" %}" rel="stylesheet">
|
||||
<script type="text/javascript" src="{% url 'javascript-catalog' %}"></script>
|
||||
<script src="{% static "js/jumpserver.js" %}"></script>
|
||||
|
||||
</head>
|
||||
|
|
|
@ -1,12 +1,9 @@
|
|||
# ~*~ coding: utf-8 ~*~
|
||||
from __future__ import unicode_literals
|
||||
import os
|
||||
|
||||
from django.urls import path, include, re_path
|
||||
from django.conf import settings
|
||||
from django.conf.urls.static import static
|
||||
from django.conf.urls.i18n import i18n_patterns
|
||||
from django.views.i18n import JavaScriptCatalog
|
||||
|
||||
from . import views, api
|
||||
|
||||
|
@ -45,10 +42,6 @@ if settings.XPACK_ENABLED:
|
|||
path('xpack/', include('xpack.urls.api_urls', namespace='api-xpack'))
|
||||
)
|
||||
|
||||
js_i18n_patterns = i18n_patterns(
|
||||
path('jsi18n/', JavaScriptCatalog.as_view(), name='javascript-catalog'),
|
||||
)
|
||||
|
||||
|
||||
apps = [
|
||||
'users', 'assets', 'perms', 'terminal', 'ops', 'audits', 'orgs', 'auth',
|
||||
|
@ -71,7 +64,7 @@ urlpatterns = [
|
|||
|
||||
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) \
|
||||
+ static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
|
||||
urlpatterns += js_i18n_patterns
|
||||
# urlpatterns += js_i18n_patterns
|
||||
|
||||
handler404 = 'jumpserver.views.handler404'
|
||||
handler500 = 'jumpserver.views.handler500'
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
//此函数用于checkbox的全选和反选
|
||||
var checked = false;
|
||||
|
||||
function gettext(s) {
|
||||
return s
|
||||
}
|
||||
|
||||
function check_all(form) {
|
||||
var checkboxes = document.getElementById(form);
|
||||
if (checked === false) {
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
|
||||
{% include '_head_css_js.html' %}
|
||||
<link href="{% static "css/jumpserver.css" %}" rel="stylesheet">
|
||||
<script type="text/javascript" src="{% url 'javascript-catalog' %}"></script>
|
||||
<script src="{% static "js/jumpserver.js" %}"></script>
|
||||
<style>
|
||||
.passwordBox {
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
<link rel="shortcut icon" href="{{ FAVICON_URL }}" type="image/x-icon">
|
||||
{% include '_head_css_js.html' %}
|
||||
<link href="{% static "css/jumpserver.css" %}" rel="stylesheet">
|
||||
<script type="text/javascript" src="{% url 'javascript-catalog' %}"></script>
|
||||
<script src="{% static "js/jumpserver.js" %}"></script>
|
||||
<style>
|
||||
.captcha {
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
<!-- Custom and plugin javascript -->
|
||||
<script src="{% static "js/plugins/toastr/toastr.min.js" %}"></script>
|
||||
<script src="{% static "js/inspinia.js" %}"></script>
|
||||
<script type="text/javascript" src="{% url 'javascript-catalog' %}"></script>
|
||||
<script src="{% static "js/jumpserver.js" %}?v=8"></script>
|
||||
<script src="{% static 'js/plugins/select2/select2.full.min.js' %}"></script>
|
||||
<script src="{% static 'js/plugins/select2/i18n/zh-CN.js' %}"></script>
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
<link rel="stylesheet" href="{% static 'css/otp.css' %}" />
|
||||
<script src="{% static 'js/jquery-3.1.1.min.js' %}"></script>
|
||||
<script src="{% static "js/plugins/qrcode/qrcode.min.js" %}"></script>
|
||||
<script type="text/javascript" src="{% url 'javascript-catalog' %}"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
|
|
@ -5,6 +5,7 @@ from django.utils import timezone
|
|||
from django.shortcuts import HttpResponse
|
||||
from rest_framework import viewsets
|
||||
from rest_framework import generics
|
||||
from rest_framework.fields import DateTimeField
|
||||
from rest_framework.response import Response
|
||||
from django.template import loader
|
||||
|
||||
|
@ -71,12 +72,21 @@ class CommandQueryMixin:
|
|||
def get_date_range(self):
|
||||
now = timezone.now()
|
||||
days_ago = now - timezone.timedelta(days=self.default_days_ago)
|
||||
default_start_st = days_ago.timestamp()
|
||||
default_end_st = now.timestamp()
|
||||
date_from_st = days_ago.timestamp()
|
||||
date_to_st = now.timestamp()
|
||||
|
||||
query_params = self.request.query_params
|
||||
date_from_st = query_params.get("date_from") or default_start_st
|
||||
date_to_st = query_params.get("date_to") or default_end_st
|
||||
return float(date_from_st), float(date_to_st)
|
||||
date_from_q = query_params.get("date_from")
|
||||
date_to_q = query_params.get("date_to")
|
||||
|
||||
dt_parser = DateTimeField().to_internal_value
|
||||
|
||||
if date_from_q:
|
||||
date_from_st = dt_parser(date_from_q).timestamp()
|
||||
|
||||
if date_to_q:
|
||||
date_to_st = dt_parser(date_to_q).timestamp()
|
||||
return date_from_st, date_to_st
|
||||
|
||||
|
||||
class CommandViewSet(CommandQueryMixin, viewsets.ModelViewSet):
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
<link href="{% static "css/plugins/sweetalert/sweetalert.css" %}" rel="stylesheet">
|
||||
<script src="{% static "js/plugins/sweetalert/sweetalert.min.js" %}"></script>
|
||||
<script type="text/javascript" src="{% static 'js/pwstrength-bootstrap.js' %}"></script>
|
||||
<script type="text/javascript" src="{% url 'javascript-catalog' %}"></script>
|
||||
<script src="{% static "js/jumpserver.js" %}"></script>
|
||||
|
||||
<style>
|
||||
|
|
Loading…
Reference in New Issue