From 206e037cf2b7d7c9f912377b9a2e96761521a672 Mon Sep 17 00:00:00 2001 From: ibuler Date: Fri, 27 Jul 2018 18:55:07 +0800 Subject: [PATCH] =?UTF-8?q?[Update]=20=E4=BC=98=E5=8C=96datatable=20?= =?UTF-8?q?=E5=92=8C=E6=98=BE=E7=A4=BA=E7=BB=84=E7=BB=87=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/jumpserver/urls.py | 12 +++---- apps/orgs/context_processor.py | 1 - apps/static/js/jumpserver.js | 6 ++++ apps/templates/_user_profile.html | 52 +++++++++++++++---------------- 4 files changed, 38 insertions(+), 33 deletions(-) diff --git a/apps/jumpserver/urls.py b/apps/jumpserver/urls.py index a6a365483..966c5b295 100644 --- a/apps/jumpserver/urls.py +++ b/apps/jumpserver/urls.py @@ -17,12 +17,12 @@ from .views import IndexView, LunaView schema_view = get_schema_view( openapi.Info( - title="Snippets API", + title="Jumpserver API Docs", default_version='v1', - description="Test description", - terms_of_service="https://www.google.com/policies/terms/", - contact=openapi.Contact(email="contact@snippets.local"), - license=openapi.License(name="BSD License"), + description="Jumpserver Restful api docs", + terms_of_service="https://www.jumpserver.org", + contact=openapi.Contact(email="support@fit2cloud.com"), + license=openapi.License(name="GPLv2 License"), ), public=True, permission_classes=(permissions.AllowAny,), @@ -80,7 +80,7 @@ urlpatterns = [ path('luna/', LunaView.as_view(), name='luna-error'), path('settings/', include('common.urls.view_urls', namespace='settings')), path('common/', include('common.urls.view_urls', namespace='common')), - re_path(r'^api/v1/.*', redirect_format_api), + path('api/v1/', redirect_format_api), path('api/', include(v1_api_patterns)), # Api url view map diff --git a/apps/orgs/context_processor.py b/apps/orgs/context_processor.py index 15285c99e..8a9111d05 100644 --- a/apps/orgs/context_processor.py +++ b/apps/orgs/context_processor.py @@ -6,7 +6,6 @@ from .models import Organization def org_processor(request): - print('Crernt Org', current_org.name) context = { 'ADMIN_ORGS': Organization.get_user_admin_orgs(request.user), 'CURRENT_ORG': get_current_org(), diff --git a/apps/static/js/jumpserver.js b/apps/static/js/jumpserver.js index d96c8c3d6..dfe696f36 100644 --- a/apps/static/js/jumpserver.js +++ b/apps/static/js/jumpserver.js @@ -253,6 +253,12 @@ jumpserver.selected = {}; jumpserver.language = { processing: "加载中", search: "搜索", + select: { + rows: { + _: "选中 %d 项", + 0: "" + } + }, lengthMenu: "每页 _MENU_", info: "显示第 _START_ 至 _END_ 项结果; 总共 _TOTAL_ 项", infoFiltered: "", diff --git a/apps/templates/_user_profile.html b/apps/templates/_user_profile.html index 7a0c3c900..365a4048c 100644 --- a/apps/templates/_user_profile.html +++ b/apps/templates/_user_profile.html @@ -6,35 +6,35 @@ logo -{#
#}
image
- {{ request.COOKIE.IN_ADMIN_PAGE }} - {% if ADMIN_ORGS and ADMIN_ORGS|length != 1 and request.COOKIES.IN_ADMIN_PAGE != 'No' %} -
- - -
+ {% if ADMIN_ORGS and request.COOKIES.IN_ADMIN_PAGE != 'No' %} + {% if ADMIN_ORGS|length > 1 or not CURRENT_ORG.is_default %} +
+ + +
+ {% endif %} {% endif %}