mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-02 07:55:16 +00:00
pref: 修改使用的消息内容 (#7061)
* perf: 再次优化通知 * pref: 修改使用的消息内容 * perf: 修复url地址 Co-authored-by: ibuler <ibuler@qq.com>
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
from rest_framework import generics
|
||||
from rest_framework.permissions import AllowAny
|
||||
from django.conf import settings
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.templatetags.static import static
|
||||
|
||||
from jumpserver.utils import has_valid_xpack_license
|
||||
from common.utils import get_logger
|
||||
from .. import serializers
|
||||
from ..utils import get_interface_setting
|
||||
|
||||
logger = get_logger(__name__)
|
||||
|
||||
@@ -19,30 +18,14 @@ class PublicSettingApi(generics.RetrieveAPIView):
|
||||
|
||||
@staticmethod
|
||||
def get_logo_urls():
|
||||
logo_urls = {
|
||||
'logo_logout': static('img/logo.png'),
|
||||
'logo_index': static('img/logo_text.png'),
|
||||
'login_image': static('img/login_image.jpg'),
|
||||
'favicon': static('img/facio.ico')
|
||||
}
|
||||
if not settings.XPACK_ENABLED:
|
||||
return logo_urls
|
||||
from xpack.plugins.interface.models import Interface
|
||||
obj = Interface.interface()
|
||||
if not obj:
|
||||
return logo_urls
|
||||
for attr in ['logo_logout', 'logo_index', 'login_image', 'favicon']:
|
||||
if getattr(obj, attr, '') and getattr(obj, attr).url:
|
||||
logo_urls.update({attr: getattr(obj, attr).url})
|
||||
return logo_urls
|
||||
interface = get_interface_setting()
|
||||
keys = ['logo_logout', 'logo_index', 'login_image', 'favicon']
|
||||
return {k: interface[k] for k in keys}
|
||||
|
||||
@staticmethod
|
||||
def get_login_title():
|
||||
default_title = _('Welcome to the JumpServer open source Bastion Host')
|
||||
if not settings.XPACK_ENABLED:
|
||||
return default_title
|
||||
from xpack.plugins.interface.models import Interface
|
||||
return Interface.get_login_title()
|
||||
interface = get_interface_setting()
|
||||
return interface['login_title']
|
||||
|
||||
def get_object(self):
|
||||
instance = {
|
||||
|
Reference in New Issue
Block a user