diff --git a/apps/jumpserver/views/other.py b/apps/jumpserver/views/other.py index 32b35ab1e..0d38a4f87 100644 --- a/apps/jumpserver/views/other.py +++ b/apps/jumpserver/views/other.py @@ -12,6 +12,7 @@ from django.views.decorators.csrf import csrf_exempt from django.views.generic import View, TemplateView from rest_framework.views import APIView +from common.utils import lazyproperty from common.views.http import HttpResponseTemporaryRedirect __all__ = [ @@ -94,6 +95,34 @@ class KokoView(View): class ResourceDownload(TemplateView): template_name = 'resource_download.html' + @lazyproperty + def versions_content(self): + return """ + MRD_VERSION=10.6.7 + OPENSSH_VERSION=v9.4.0.0 + TINKER_VERSION=v0.1.6 + VIDEO_PLAYER_VERSION=0.1.9 + CLIENT_VERSION=v2.1.3 + """ + + def get_meta_json(self): + content = self.versions_content + lines = content.splitlines() + meta = {} + for line in lines: + line = line.strip() + if not line or line.startswith('#') or '=' not in line: + continue + key, value = line.split('=') + meta[key] = value + return meta + + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + meta = self.get_meta_json() + context.update(meta) + return context + def csrf_failure(request, reason=""): from django.shortcuts import reverse diff --git a/apps/templates/resource_download.html b/apps/templates/resource_download.html index 50d3f7594..808b32d59 100644 --- a/apps/templates/resource_download.html +++ b/apps/templates/resource_download.html @@ -1,31 +1,33 @@ {% extends '_without_nav_base.html' %} {% load i18n %} {% block body %} - -
+
@@ -35,33 +37,32 @@ p { {% trans 'macOS needs to download the client to connect RDP asset, which comes with Windows' %}

- -
-

{% trans 'Windows Remote application publisher tools' %}

-

{% trans 'OpenSSH is a program used to connect remote applications in the Windows Remote Application Publisher' %}

- -
- +
+

{% trans 'Windows Remote application publisher tools' %}

+

{% trans 'OpenSSH is a program used to connect remote applications in the Windows Remote Application Publisher' %}

+ +

JumpServer {% trans 'Offline video player' %} v0.1.9

-