mirror of https://github.com/jumpserver/jumpserver
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
640 B
22 lines
640 B
from django.utils.translation import gettext_lazy as _
|
|
|
|
from assets.models import Host
|
|
from .common import AssetSerializer
|
|
from .info.gathered import HostGatheredInfoSerializer
|
|
|
|
__all__ = ['HostSerializer']
|
|
|
|
|
|
class HostSerializer(AssetSerializer):
|
|
gathered_info = HostGatheredInfoSerializer(required=False, read_only=True, label=_("Gathered info"))
|
|
|
|
class Meta(AssetSerializer.Meta):
|
|
model = Host
|
|
fields = AssetSerializer.Meta.fields + ['gathered_info']
|
|
extra_kwargs = {
|
|
**AssetSerializer.Meta.extra_kwargs,
|
|
'address': {
|
|
'label': _("IP/Host")
|
|
},
|
|
}
|