[Update] 修改terminal表单获取storage, 删除无用代码

pull/1945/head
BaiJiangJie 6 years ago
parent cc0cf8ed1c
commit 1bfef829f3

@ -147,18 +147,6 @@ class TerminalSettingForm(BaseForm):
TERMINAL_ASSET_LIST_SORT_BY = forms.ChoiceField( TERMINAL_ASSET_LIST_SORT_BY = forms.ChoiceField(
choices=SORT_BY_CHOICES, initial='hostname', label=_("List sort by") choices=SORT_BY_CHOICES, initial='hostname', label=_("List sort by")
) )
# TERMINAL_COMMAND_STORAGE = FormEncryptDictField(
# label=_("Command storage"), help_text=_(
# "Set terminal storage setting, `default` is the using as default,"
# "You can set other storage and some terminal using"
# )
# )
# TERMINAL_REPLAY_STORAGE = FormEncryptDictField(
# label=_("Replay storage"), help_text=_(
# "Set replay storage setting, `default` is the using as default,"
# "You can set other storage and some terminal using"
# )
# )
class TerminalCommandStorage(BaseForm): class TerminalCommandStorage(BaseForm):

@ -10,21 +10,15 @@ from .models import Terminal
def get_all_command_storage(): def get_all_command_storage():
from common import utils from common import utils
command_storage = utils.get_command_storage_or_create_default_storage() command_storage = utils.get_command_storage_or_create_default_storage()
command_storage_choice = []
for k, v in command_storage.items(): for k, v in command_storage.items():
command_storage_choice.append((k, k)) yield (k, k)
return command_storage_choice
def get_all_replay_storage(): def get_all_replay_storage():
from common import utils from common import utils
replay_storage = utils.get_replay_storage_or_create_default_storage() replay_storage = utils.get_replay_storage_or_create_default_storage()
replay_storage_choice = []
for k, v in replay_storage.items(): for k, v in replay_storage.items():
replay_storage_choice.append((k, k)) yield (k, k)
return replay_storage_choice
class TerminalForm(forms.ModelForm): class TerminalForm(forms.ModelForm):

Loading…
Cancel
Save