mirror of https://github.com/jumpserver/jumpserver
feat: update app setting
parent
459d0668a8
commit
ea27d05c58
|
@ -16,13 +16,23 @@ def get_all_command_storage():
|
||||||
yield (k, k)
|
yield (k, k)
|
||||||
|
|
||||||
|
|
||||||
|
def get_all_replay_storage():
|
||||||
|
# storage_choices = []
|
||||||
|
from common.models import Setting
|
||||||
|
Setting.refresh_all_settings()
|
||||||
|
for k, v in settings.TERMINAL_REPLAY_STORAGE.items():
|
||||||
|
yield (k, k)
|
||||||
|
|
||||||
|
|
||||||
class TerminalForm(forms.ModelForm):
|
class TerminalForm(forms.ModelForm):
|
||||||
command_storage = forms.ChoiceField(choices=get_all_command_storage(),
|
command_storage = forms.ChoiceField(choices=get_all_command_storage(),
|
||||||
label=_("Command storage"))
|
label=_("Command storage"))
|
||||||
|
replay_storage = forms.ChoiceField(choices=get_all_replay_storage(),
|
||||||
|
label=_("Replay storage"))
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Terminal
|
model = Terminal
|
||||||
fields = ['name', 'remote_addr', 'ssh_port', 'http_port', 'comment', 'command_storage']
|
fields = ['name', 'remote_addr', 'ssh_port', 'http_port', 'comment', 'command_storage', 'replay_storage']
|
||||||
help_texts = {
|
help_texts = {
|
||||||
'ssh_port': _("Coco ssh listen port"),
|
'ssh_port': _("Coco ssh listen port"),
|
||||||
'http_port': _("Coco http/ws listen port"),
|
'http_port': _("Coco http/ws listen port"),
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
{% bootstrap_field form.ssh_port layout="horizontal" %}
|
{% bootstrap_field form.ssh_port layout="horizontal" %}
|
||||||
{% bootstrap_field form.http_port layout="horizontal" %}
|
{% bootstrap_field form.http_port layout="horizontal" %}
|
||||||
{% bootstrap_field form.command_storage layout="horizontal" %}
|
{% bootstrap_field form.command_storage layout="horizontal" %}
|
||||||
|
{% bootstrap_field form.replay_storage layout="horizontal" %}
|
||||||
{% bootstrap_field form.comment layout="horizontal" %}
|
{% bootstrap_field form.comment layout="horizontal" %}
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
{% bootstrap_field form.ssh_port layout="horizontal" %}
|
{% bootstrap_field form.ssh_port layout="horizontal" %}
|
||||||
{% bootstrap_field form.http_port layout="horizontal" %}
|
{% bootstrap_field form.http_port layout="horizontal" %}
|
||||||
{% bootstrap_field form.command_storage layout="horizontal" %}
|
{% bootstrap_field form.command_storage layout="horizontal" %}
|
||||||
|
{% bootstrap_field form.replay_storage layout="horizontal" %}
|
||||||
|
|
||||||
<div class="hr-line-dashed"></div>
|
<div class="hr-line-dashed"></div>
|
||||||
<h3>{% trans 'Other' %}</h3>
|
<h3>{% trans 'Other' %}</h3>
|
||||||
|
|
Loading…
Reference in New Issue