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];