Skip to content

Commit

Permalink
chore: fix admin issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Ehco1996 committed Aug 25, 2024
1 parent 4099cfb commit cc27e7a
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
3 changes: 0 additions & 3 deletions apps/proxy/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,6 @@ def get_config(self):
for proxy_node in nodes:
if not proxy_node.enable:
continue

if not proxy_node.enable_ehco_tunnel:
tcp_remote = f"{proxy_node.server}:{proxy_node.get_user_port()}"
else:
Expand All @@ -702,8 +701,6 @@ def get_config(self):
tcp_remote = f"ws://{tcp_remote}"
elif rule.transport_type == c.TRANSPORT_WSS:
tcp_remote = f"wss://{tcp_remote}"
else:
raise Exception("not support transport type")
tcp_remotes.append(tcp_remote)
rule_cfg = {
"label": rule.name,
Expand Down
33 changes: 33 additions & 0 deletions templates/admin/includes/fieldset.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{% comment %} https://github.com/newpanjing/simpleui/pull/506/files {% endcomment %}
{% load simpletags %}
<fieldset class="module aligned {{ fieldset.classes }}">
{% if fieldset.name %}<h2>{{ fieldset.name }}</h2>{% endif %}
{% if fieldset.description %}<div class="description">{{ fieldset.description|safe }}</div>{% endif %}
{% for line in fieldset %}
<div class="form-row{% if line.fields|length == 1 and line.errors %} errors{% endif %}{% if not line.has_visible_field %} hidden{% endif %}{% for field in line %}{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% endfor %}">
{% if line.fields|length == 1 %}{{ line.errors }}{% endif %}
{% for field in line %}
<div {% if not line.fields|length == 1 %} class="fieldBox{% if field.field.name %} field-{{ field.field.name }}{% endif %}
{% if not field.is_readonly and field.errors %}errors{% endif %}
{% if field.field.is_hidden %}hidden{% endif %}
"
{% elif field.is_checkbox %}
class="checkbox-row"
{% endif %}>
{% if not line.fields|length == 1 and not field.is_readonly %}{{ field.errors }}{% endif %}
{% if field.is_checkbox %}
{{ field.field }}{{ field.label_tag }}
{% else %}
{{ field.label_tag }}
{% if field.is_readonly %}
<div class="readonly">{{ field.contents }}</div>
{% else %}
{{ field.field|get_value }}
{% endif %}
{% endif %}
{% if field.field.help_text %}<div class="help">{{ field.field.help_text|safe }}</div>{% endif %}
</div>
{% endfor %}
</div>
{% endfor %}
</fieldset>

0 comments on commit cc27e7a

Please sign in to comment.