diff --git a/apps/assets/api/mixin.py b/apps/assets/api/mixin.py index 89555324b..4374f399a 100644 --- a/apps/assets/api/mixin.py +++ b/apps/assets/api/mixin.py @@ -60,6 +60,7 @@ class SerializeToTreeNodeMixin: 'isParent': False, 'open': False, 'iconSkin': self.get_platform(asset), + 'chkDisabled': not asset.is_active, 'meta': { 'type': 'asset', 'asset': { diff --git a/apps/perms/serializers/user_permission.py b/apps/perms/serializers/user_permission.py index 40334786f..bfc273775 100644 --- a/apps/perms/serializers/user_permission.py +++ b/apps/perms/serializers/user_permission.py @@ -75,7 +75,7 @@ class AssetGrantedSerializer(serializers.ModelSerializer): model = Asset only_fields = [ "id", "hostname", "ip", "protocols", "os", 'domain', - "platform", "comment", "org_id", + "platform", "comment", "org_id", "is_active" ] fields = only_fields + ['org_name'] read_only_fields = fields