From ed967dcba9e8260ed6433046b618519629c1b6ee Mon Sep 17 00:00:00 2001 From: ibuler Date: Wed, 1 Mar 2023 10:05:40 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/assets/const/cloud.py | 8 +++++--- apps/assets/const/host.py | 4 +++- apps/jumpserver/utils.py | 7 ++++--- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/apps/assets/const/cloud.py b/apps/assets/const/cloud.py index be2637ddf..12c4f09dd 100644 --- a/apps/assets/const/cloud.py +++ b/apps/assets/const/cloud.py @@ -1,10 +1,12 @@ +from django.utils.translation import gettext_lazy as _ + from .base import BaseType class CloudTypes(BaseType): - PUBLIC = 'public', 'Public cloud' - PRIVATE = 'private', 'Private cloud' - K8S = 'k8s', 'Kubernetes' + PUBLIC = 'public', _('Public cloud') + PRIVATE = 'private', _('Private cloud') + K8S = 'k8s', _('Kubernetes') @classmethod def _get_base_constrains(cls) -> dict: diff --git a/apps/assets/const/host.py b/apps/assets/const/host.py index e7abba3fc..eb7930b09 100644 --- a/apps/assets/const/host.py +++ b/apps/assets/const/host.py @@ -1,3 +1,5 @@ +from django.utils.translation import gettext_lazy as _ + from .base import BaseType GATEWAY_NAME = 'Gateway' @@ -7,7 +9,7 @@ class HostTypes(BaseType): LINUX = 'linux', 'Linux' WINDOWS = 'windows', 'Windows' UNIX = 'unix', 'Unix' - OTHER_HOST = 'other', "Other" + OTHER_HOST = 'other', _("Other") @classmethod def _get_base_constrains(cls) -> dict: diff --git a/apps/jumpserver/utils.py b/apps/jumpserver/utils.py index 7e29b17fd..24f2b10d7 100644 --- a/apps/jumpserver/utils.py +++ b/apps/jumpserver/utils.py @@ -1,10 +1,11 @@ # -*- coding: utf-8 -*- # -from functools import partial -from werkzeug.local import LocalProxy from datetime import datetime +from functools import partial from django.conf import settings +from werkzeug.local import LocalProxy + from common.local import thread_local @@ -34,7 +35,7 @@ def get_xpack_license_info() -> dict: corporation = info.get('corporation', '') else: current_year = datetime.now().year - corporation = f'Copyright - FIT2CLOUD 飞致云 © 2014-{current_year}' + corporation = f'FIT2CLOUD 飞致云 © 2014-{current_year}' info = { 'corporation': corporation }