mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-06-23 13:37:31 +00:00
perf: windows ad asset info
This commit is contained in:
parent
6795f036dd
commit
3b2ac101c8
@ -20,4 +20,5 @@ class HostGatheredInfoSerializer(serializers.Serializer):
|
|||||||
|
|
||||||
category_gathered_serializer_map = {
|
category_gathered_serializer_map = {
|
||||||
'host': HostGatheredInfoSerializer,
|
'host': HostGatheredInfoSerializer,
|
||||||
|
'ds': HostGatheredInfoSerializer,
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ from django.utils.translation import gettext_lazy as _
|
|||||||
from rest_framework import serializers
|
from rest_framework import serializers
|
||||||
|
|
||||||
from assets.const import FillType
|
from assets.const import FillType
|
||||||
from assets.models import Database, Web
|
from assets.models import Database, Web, DirectoryService
|
||||||
from common.serializers.fields import LabeledChoiceField
|
from common.serializers.fields import LabeledChoiceField
|
||||||
|
|
||||||
|
|
||||||
@ -28,7 +28,7 @@ class WebSpecSerializer(serializers.ModelSerializer):
|
|||||||
# 查看 Web 资产详情时
|
# 查看 Web 资产详情时
|
||||||
self.pop_fields_if_need(fields)
|
self.pop_fields_if_need(fields)
|
||||||
return fields
|
return fields
|
||||||
|
|
||||||
def is_retrieve(self):
|
def is_retrieve(self):
|
||||||
try:
|
try:
|
||||||
self.context.get('request').method and self.parent.instance.web
|
self.context.get('request').method and self.parent.instance.web
|
||||||
@ -51,9 +51,14 @@ class WebSpecSerializer(serializers.ModelSerializer):
|
|||||||
return fields
|
return fields
|
||||||
|
|
||||||
|
|
||||||
|
class DsSpecSerializer(serializers.ModelSerializer):
|
||||||
|
class Meta:
|
||||||
|
model = DirectoryService
|
||||||
|
fields = ['domain_name']
|
||||||
|
|
||||||
|
|
||||||
category_spec_serializer_map = {
|
category_spec_serializer_map = {
|
||||||
'database': DatabaseSpecSerializer,
|
'database': DatabaseSpecSerializer,
|
||||||
'web': WebSpecSerializer,
|
'web': WebSpecSerializer,
|
||||||
|
'ds': DsSpecSerializer,
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ import re
|
|||||||
import sys
|
import sys
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
|
||||||
import sys
|
|
||||||
from django.utils.translation import gettext as _
|
from django.utils.translation import gettext as _
|
||||||
|
|
||||||
__all__ = ['JMSInventory']
|
__all__ = ['JMSInventory']
|
||||||
@ -131,7 +130,7 @@ class JMSInventory:
|
|||||||
elif platform.su_enabled and not su_from and \
|
elif platform.su_enabled and not su_from and \
|
||||||
self.task_type in (AutomationTypes.change_secret, AutomationTypes.push_account):
|
self.task_type in (AutomationTypes.change_secret, AutomationTypes.push_account):
|
||||||
host.update(self.make_account_ansible_vars(account, path_dir))
|
host.update(self.make_account_ansible_vars(account, path_dir))
|
||||||
if ansible_config.get('ansible_shell_type') != 'powershell':
|
if platform.type not in ["windows", "windows_ad"]:
|
||||||
host['ansible_become'] = True
|
host['ansible_become'] = True
|
||||||
host['ansible_become_user'] = 'root'
|
host['ansible_become_user'] = 'root'
|
||||||
host['ansible_become_password'] = account.escape_jinja2_syntax(account.secret)
|
host['ansible_become_password'] = account.escape_jinja2_syntax(account.secret)
|
||||||
|
Loading…
Reference in New Issue
Block a user