mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-18 00:08:31 +00:00
perf: 优化 custom info
This commit is contained in:
@@ -4,7 +4,11 @@ from .base import BaseType
|
||||
class CustomTypes(BaseType):
|
||||
@classmethod
|
||||
def get_choices(cls):
|
||||
types = cls.get_custom_platforms().values_list('type', flat=True).distinct()
|
||||
try:
|
||||
platforms = list(cls.get_custom_platforms())
|
||||
except Exception:
|
||||
return []
|
||||
types = [p.type for p in platforms]
|
||||
return [(t, t) for t in types]
|
||||
|
||||
@classmethod
|
||||
|
@@ -32,14 +32,13 @@ class Migration(migrations.Migration):
|
||||
name='custom_info',
|
||||
field=models.JSONField(default=dict, verbose_name='Custom info'),
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name='asset',
|
||||
old_name='info',
|
||||
new_name='gathered_info',
|
||||
),
|
||||
migrations.AlterField(
|
||||
migrations.AddField(
|
||||
model_name='asset',
|
||||
name='gathered_info',
|
||||
field=models.JSONField(blank=True, default=dict, verbose_name='Gathered info'),
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='asset',
|
||||
name='info',
|
||||
),
|
||||
]
|
||||
|
Reference in New Issue
Block a user