-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
simplified the ports html for better readability
- Loading branch information
Showing
2 changed files
with
71 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,89 @@ | ||
|
||
{% if port_forwarding is not none %} | ||
{% if edit %} | ||
<tr> | ||
|
||
{{ form.csrf_token }} | ||
<td> | ||
<input type="number" min="1" id="source_port" name="port" hx-post="/control/port" hx-trigger="change" hx-target="next .error-label" hx-swap="innerHTML" value="{{ port_forwarding[0] }}"> | ||
<input type="number" min="1" name="source_port" hx-post="/control/port" hx-trigger="change" hx-target="next .error-label" hx-swap="innerHTML" value="{{ port_forwarding[0] }}"> | ||
<label class='error-label' for="source_port"></label> | ||
</td> | ||
<td> | ||
<input type="number" min="1" id="dest_port" name="port" hx-post="/control/port" hx-indicator="#ind" hx-target="next .error-label" hx-swap="innerHTML" value="{{ port_forwarding[1] }}"> | ||
<input type="number" min="1" name="dest_port" hx-post="/control/port" hx-indicator="#ind" hx-target="next .error-label" hx-swap="innerHTML" value="{{ port_forwarding[1] }}"> | ||
<label class='error-label' for="dest_port"></label> | ||
</td> | ||
<td><input type="text" id="source ip" placeholder="source ip" hx-post="/control/ip" value="{{ port_forwarding[2] }}"></td> | ||
<td><input type="text" name="ip_address" placeholder="source ip" hx-post="/control/ip" value="{{ port_forwarding[2] }}"></td> | ||
<td> | ||
<label for="udp">UDP</label> | ||
<input type="radio" name="prot" id="udp" {% if port_forwarding[3] =="UDP" %}selected{% endif %}> | ||
<input type="radio" name="port" value="udp" {% if port_forwarding[3] =="UDP" %}checked{% endif %}> | ||
<label for="tcp">TCP</label> | ||
<input type="radio" name="prot" id="tcp" {% if port_forwarding[3] =="TCP" %}selected{% endif %}> | ||
<input type="radio" name="port" value="tcp" {% if port_forwarding[3] =="TCP" %}checked{% endif %}> | ||
</td> | ||
<td><button class="edit-button success" hx-put="/usersuite/port-forward-edit/{{ port_index }}" hx-include="closest tr" hx-swap="outerHTML swap:1s"> | ||
<span class="glyphicon glyphicon-floppy-disk"></span> | ||
</button> | ||
<button class="edit-button error-label" type="submit"> | ||
<span class=" glyphicon glyphicon-remove"></span> | ||
</button> | ||
</td> | ||
<td><button type="submit">apply</button></td> | ||
</tr > | ||
{% else %} | ||
<tr> | ||
<tr > | ||
|
||
<td> | ||
<label>{{ port_forwarding[0] }}</label> | ||
</td> | ||
<td> | ||
<label >{{ port_forwarding[1] }}</label> | ||
</td> | ||
<td><label >{{ port_forwarding[2] }}</label></td> | ||
<td> | ||
<label>{{ port_forwarding[3] }}</label> | ||
</td> | ||
<td> | ||
<button class="edit-button edit-pen" aria-label="edit" hx-get="/usersuite/get_row/{{ port_index }}" hx-target="closest tr" > | ||
<span class="glyphicon glyphicon-pencil pull-left"></span> | ||
</button> | ||
<button class="edit-button error-label" hx-confirm="{{ _("wollen sie die port Weiterleitung wirklich löschen?") }}" hx-delete="/usersuite/port_forward/{{ port_index }}" hx-target="closest tr"> | ||
<span class="glyphicon glyphicon-trash pull-right"></span> | ||
</button> | ||
</td> | ||
</tr> | ||
{% endif %} | ||
{% else %} | ||
|
||
<tr> | ||
<form > | ||
{{ form.csrf_token }} | ||
<td> | ||
<input type="number" min="1" id="source_port" name="port" hx-post="/control/port" hx-trigger="keyup delay:500ms" hx-target="next .error-label" hx-swap="innerHTML"> | ||
<label class='error-label' for="source_port"></label> | ||
<input type="number" min="1" name="source_port" hx-post="/control/port" hx-trigger="keyup delay:500ms" hx-target="next .error-label" hx-swap="innerHTML"> | ||
<label class='error-label'></label> | ||
</td> | ||
<td> | ||
<input type="number" min="1" id="dest_port" name="port" hx-post="/control/port" hx-trigger="keyup delay:500ms" hx-indicator="#ind" hx-target="next .error-label" hx-swap="innerHTML"> | ||
<input type="number" min="1" id="dest_port" name="dest_port" hx-post="/control/port" hx-trigger="keyup delay:500ms" hx-indicator="#ind" hx-target="next .error-label" hx-swap="innerHTML"> | ||
<label class='error-label' for="dest_port"></label> | ||
</td> | ||
<td> | ||
<input type="text" name="source_ip" placeholder="source ip" hx-post="/control/ip" hx-trigger="keyup delay:500ms" hx-target="next .error-label" hx-swap="innerHTML"> | ||
<input type="text" name="ip_address" placeholder="{{ _("Ziel IP") }}" hx-post="/control/ip" hx-trigger="keyup delay:500ms" hx-target="next .error-label" hx-swap="innerHTML"> | ||
<label class='error-label'></label> | ||
</td> | ||
<td> | ||
<fieldset> | ||
<label for="udp">UDP</label> | ||
<input type="radio" name="prot" id="udp" checked> | ||
<input type="radio" name="prot" value="udp" checked> | ||
<label for="tcp">TCP</label> | ||
<input type="radio" name="prot" id="tcp"> | ||
<input type="radio" name="prot" value="tcp"> | ||
</fieldset> | ||
</td> | ||
<td><button type="submit">apply</button></td> | ||
</form> | ||
<td> | ||
<button class="edit-button success" type="submit" hx-post="/usersuite/add-port-forward" hx-traget="closest tr" hx-include="closest tr" hx-trigger="click, next name=save_button" hx-swap="outerHTML swap:500ms"> | ||
<span class="glyphicon glyphicon-floppy-disk"></span> | ||
</button> | ||
<button class="edit-button error-label" type="submit" hx-delete="/control/delete" hx-traget="closest tr" hx-swap="outerHTML swap:500ms"> | ||
<span class=" glyphicon glyphicon-remove"></span> | ||
</button> | ||
</td> | ||
|
||
</tr > | ||
{% endif %} | ||
|
||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters