mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-06-27 15:27:11 +00:00
fix: 修复获取类型为null的命令显示不支持的问题
fix: 修复获取类型为null的命令显示不支持的问题
This commit is contained in:
parent
55e04e8e9f
commit
ab737ae09b
@ -89,17 +89,21 @@ class CommandStorage(CommonStorageModelMixin, CommonModelMixin):
|
|||||||
return Terminal.objects.filter(command_storage=self.name, is_deleted=False).exists()
|
return Terminal.objects.filter(command_storage=self.name, is_deleted=False).exists()
|
||||||
|
|
||||||
def get_command_queryset(self):
|
def get_command_queryset(self):
|
||||||
if self.type_server:
|
if self.type_null:
|
||||||
qs = Command.objects.all()
|
|
||||||
else:
|
|
||||||
if self.type not in TYPE_ENGINE_MAPPING:
|
|
||||||
logger.error(f'Command storage `{self.type}` not support')
|
|
||||||
return Command.objects.none()
|
return Command.objects.none()
|
||||||
|
|
||||||
|
if self.type_server:
|
||||||
|
return Command.objects.all()
|
||||||
|
|
||||||
|
if self.type in TYPE_ENGINE_MAPPING:
|
||||||
engine_mod = import_module(TYPE_ENGINE_MAPPING[self.type])
|
engine_mod = import_module(TYPE_ENGINE_MAPPING[self.type])
|
||||||
qs = engine_mod.QuerySet(self.config)
|
qs = engine_mod.QuerySet(self.config)
|
||||||
qs.model = Command
|
qs.model = Command
|
||||||
return qs
|
return qs
|
||||||
|
|
||||||
|
logger.error(f'Command storage `{self.type}` not support')
|
||||||
|
return Command.objects.none()
|
||||||
|
|
||||||
def save(self, force_insert=False, force_update=False, using=None,
|
def save(self, force_insert=False, force_update=False, using=None,
|
||||||
update_fields=None):
|
update_fields=None):
|
||||||
super().save()
|
super().save()
|
||||||
|
Loading…
Reference in New Issue
Block a user