From 792fc3b0f0203017dd1629a07491c9376de59fb8 Mon Sep 17 00:00:00 2001 From: ibuler Date: Mon, 21 Oct 2019 15:29:26 +0800 Subject: [PATCH] =?UTF-8?q?[Update]=20=E6=B7=BB=E5=8A=A0koko=E8=AE=BF?= =?UTF-8?q?=E9=97=AE=E9=94=99=E8=AF=AF=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/jumpserver/settings.py | 2 +- apps/jumpserver/urls.py | 3 ++- apps/jumpserver/views.py | 7 +++++++ apps/static/js/jumpserver.js | 1 + 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/jumpserver/settings.py b/apps/jumpserver/settings.py index 3ac458065..a2e1fa011 100644 --- a/apps/jumpserver/settings.py +++ b/apps/jumpserver/settings.py @@ -331,7 +331,7 @@ LOCALE_PATHS = [ # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.10/howto/static-files/ -STATIC_URL = '/static/' +STATIC_URL = '{}/static/'.format(CONFIG.FORCE_SCRIPT_NAME) STATIC_ROOT = os.path.join(PROJECT_DIR, "data", "static") STATIC_DIR = os.path.join(BASE_DIR, "static") diff --git a/apps/jumpserver/urls.py b/apps/jumpserver/urls.py index 82773a51a..129368c47 100644 --- a/apps/jumpserver/urls.py +++ b/apps/jumpserver/urls.py @@ -65,7 +65,8 @@ urlpatterns = [ path('api/v2/', include(api_v2)), re_path('api/(?P\w+)/(?Pv\d)/.*', views.redirect_format_api), path('api/health/', views.HealthCheckView.as_view(), name="health"), - path('luna/', views.LunaView.as_view(), name='luna-view'), + re_path('luna/.*', views.LunaView.as_view(), name='luna-view'), + re_path('koko/.*', views.KokoView.as_view(), name='koko-view'), re_path('ws/.*', views.WsView.as_view(), name='ws-view'), path('i18n//', views.I18NView.as_view(), name='i18n-switch'), path('settings/', include('settings.urls.view_urls', namespace='settings')), diff --git a/apps/jumpserver/views.py b/apps/jumpserver/views.py index f8c8c1f02..1c5d2167a 100644 --- a/apps/jumpserver/views.py +++ b/apps/jumpserver/views.py @@ -234,3 +234,10 @@ class WsView(APIView): .format(self.ws_port)) return JsonResponse({"msg": msg}) + +class KokoView(View): + def get(self, request): + msg = _( + "
Koko is a separately deployed program, you need to deploy Koko, configure nginx for url distribution,
" + "If you see this page, prove that you are not accessing the nginx listening port. Good luck.") + return HttpResponse(msg) diff --git a/apps/static/js/jumpserver.js b/apps/static/js/jumpserver.js index 58ef8cf66..acff49939 100644 --- a/apps/static/js/jumpserver.js +++ b/apps/static/js/jumpserver.js @@ -141,6 +141,7 @@ function activeNav(prefix) { var path = document.location.pathname; if (prefix) { path = path.replace(prefix, ''); + console.log(path); } var urlArray = path.split("/"); var app = urlArray[1];