mirror of https://github.com/jumpserver/jumpserver
perf: 修改 platforms
parent
f633a50f8e
commit
e9bb5223eb
|
@ -10,7 +10,7 @@ __all__ = ['Account', 'AccountTemplate']
|
|||
|
||||
|
||||
class Account(BaseAccount):
|
||||
asset = models.ForeignKey('assets.Asset', on_delete=models.CASCADE, verbose_name=_('Asset'))
|
||||
asset = models.ForeignKey('assets.Asset', related_name='accounts', on_delete=models.CASCADE, verbose_name=_('Asset'))
|
||||
version = models.IntegerField(default=0, verbose_name=_('Version'))
|
||||
history = HistoricalRecords()
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ from django.db.models import F
|
|||
from common.drf.serializers import JMSWritableNestedModelSerializer
|
||||
from common.drf.fields import LabeledChoiceField, ObjectRelatedField
|
||||
from ..account import AccountSerializer
|
||||
from ...models import Asset, Node, Platform, Protocol, Label, Domain
|
||||
from ...models import Asset, Node, Platform, Protocol, Label, Domain, Account
|
||||
from ...const import Category, AllTypes
|
||||
|
||||
__all__ = [
|
||||
|
@ -88,11 +88,6 @@ class AssetSerializer(JMSWritableNestedModelSerializer):
|
|||
'admin_user_display': {'label': _('Admin user display'), 'read_only': True},
|
||||
}
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
data = kwargs.get('data', {})
|
||||
self.accounts_data = data.pop('accounts', [])
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
@classmethod
|
||||
def setup_eager_loading(cls, queryset):
|
||||
""" Perform necessary eager loading of data. """
|
||||
|
|
|
@ -19,6 +19,7 @@ class ProtocolSettingSerializer(serializers.Serializer):
|
|||
]
|
||||
# Common
|
||||
required = serializers.BooleanField(required=True, initial=False, label=_("Required"))
|
||||
|
||||
# RDP
|
||||
console = serializers.BooleanField(required=False)
|
||||
security = serializers.ChoiceField(choices=SECURITY_CHOICES, default='any', required=False)
|
||||
|
|
Loading…
Reference in New Issue