Skip to content

Commit

Permalink
Allow removing of options and comments from webui
Browse files Browse the repository at this point in the history
  • Loading branch information
Erwan Le Gall committed Dec 3, 2021
1 parent 85f9855 commit 201cefb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion passhweb/app/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class TargetForm(FlaskForm):
login = StringField('login', validators=[])
port = IntegerField('port', validators=[NumberRange(min=0, max=7200)])
sessiondur = IntegerField('sesssiondur', validators=[NumberRange(min=0, max=7200)])
options = StringField('options', validators=[])
sshoptions = StringField('sshoptions', validators=[])
comment = StringField('comment', validators=[])
changepwd = BooleanField('changepwd', default=False)

Expand Down
6 changes: 3 additions & 3 deletions passhweb/app/templates/boxes/target_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ <h3 class="card-title">Infos</h3>
<div class="input-group-prepend"><span class="input-group-text"><i class="fa fa-lock"></i></span></div>
{%if elt%}
{% if superadmin %}
{{ form.options(size=80, class_="form-control", placeholder="Options", value=elt[0]['SSH options']) }}
{{ form.sshoptions(size=80, class_="form-control", placeholder="Options", value=elt[0]['SSH options']) }}
{% else %}
{{ form.options(size=80, class_="form-control", placeholder="Options", value=elt[0]['SSH options'], disabled="") }}
{{ form.sshoptions(size=80, class_="form-control", placeholder="Options", value=elt[0]['SSH options'], disabled="") }}
{% endif %}
{%else%}
{{ form.options(size=80, class_="form-control", placeholder="Options") }}
{{ form.sshoptions(size=80, class_="form-control", placeholder="Options") }}
{%endif%}
</div>
<br>
Expand Down
6 changes: 3 additions & 3 deletions passhweb/app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def edit_form(element, form, name=None):
if name:
formated = {"name" : name,
"new_name" : form.name.data,
"new_comment" : form.comment.data}
"new_comment" : form.comment.data+ " "}
else:
formated = {"name" : form.name.data,
"comment" : form.comment.data}
Expand All @@ -31,15 +31,15 @@ def edit_form(element, form, name=None):
formated["new_hostname"] = form.hostname.data
formated["new_login"] = form.login.data
formated["new_port"] = form.port.data
formated["new_sshoptions"] = form.options.data
formated["new_sshoptions"] = form.sshoptions.data + " "
formated["new_targettype"] = form.targettype.data
formated["new_changepwd"] = form.changepwd.data
formated["new_sessiondur"] = form.sessiondur.data
else:
formated["hostname"] = form.hostname.data
formated["login"] = form.login.data
formated["port"] = form.port.data
formated["sshoptions"] = form.options.data
formated["sshoptions"] = form.sshoptions.data
formated["targettype"] = form.targettype.data
formated["changepwd"] = form.changepwd.data
formated["sessiondur"] = form.sessiondur.data
Expand Down

0 comments on commit 201cefb

Please sign in to comment.