mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-05-09 08:36:28 +00:00
* perf: 支持自定义类型资产 * perf: 改名前 * perf: 优化支持 choices * perf: 优化自定义资产 * perf: 优化资产的详情 * perf: 修改完成自定义平台和资产 --------- Co-authored-by: ibuler <ibuler@qq.com> Co-authored-by: Jiangjie.Bai <bugatti_it@163.com>
22 lines
640 B
Python
22 lines
640 B
Python
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")
|
|
},
|
|
}
|