From 36dfdd3d412405da5601dba5137f81111f87b91b Mon Sep 17 00:00:00 2001 From: Stefan Allius Date: Thu, 1 May 2025 17:02:38 +0200 Subject: [PATCH] rename template files --- app/src/web/conn_table.py | 4 +- app/src/web/templates/index.html.j2 | 57 ------------------- ...table.html.j2 => templ_conn_table.html.j2} | 2 +- .../templates/templ_log_files_list.html.j2 | 31 ++++++++++ ..._list.html.j2 => templ_notes_list.html.j2} | 0 5 files changed, 34 insertions(+), 60 deletions(-) delete mode 100644 app/src/web/templates/index.html.j2 rename app/src/web/templates/{conn_table.html.j2 => templ_conn_table.html.j2} (97%) create mode 100644 app/src/web/templates/templ_log_files_list.html.j2 rename app/src/web/templates/{notes_list.html.j2 => templ_notes_list.html.j2} (100%) diff --git a/app/src/web/conn_table.py b/app/src/web/conn_table.py index 278227b..62c52f7 100644 --- a/app/src/web/conn_table.py +++ b/app/src/web/conn_table.py @@ -75,8 +75,8 @@ async def data_fetch(): "proxy-cnt": f"

{Infos.get_counter('ProxyMode_Cnt')}

", "emulation-cnt": f"

{Infos.get_counter('EmuMode_Cnt')}

", } - data["conn-table"] = await render_template('conn_table.html.j2', + data["conn-table"] = await render_template('templ_conn_table.html.j2', table=get_table_data()) - data["notes-list"] = await render_template('notes_list.html.j2') + data["notes-list"] = await render_template('templ_notes_list.html.j2') return data diff --git a/app/src/web/templates/index.html.j2 b/app/src/web/templates/index.html.j2 deleted file mode 100644 index 67238c0..0000000 --- a/app/src/web/templates/index.html.j2 +++ /dev/null @@ -1,57 +0,0 @@ -{% extends 'base.html.j2' %} - -{% block title %} TSUN Proxy - Connections {% endblock title%} -{% block menu1_class %}w3-blue{% endblock %} -{% block headline %}  {{_('Proxy Connection Overview')}}{% endblock headline %} - -{% block content %} -
-
-
-
-
-

-

-
-
-

{{_('Server Mode')}}

-
{{_('Established from device to proxy')}}
-
-
-
-
-
-
-

-

-
-
-

{{_('Client Mode')}}

-
{{_('Established from proxy to device')}}
-
-
-
-
-
-
-

-

-
-
-

{{_('Proxy Mode')}}

-
{{_('Forwarding data to cloud')}}
-
-
-
-
-
-
-

-

-
-
-

{{_('Emu Mode')}}

-
{{_('Emulation sends data to cloud')}}
-
-
-
- -
-
-{% endblock content%} diff --git a/app/src/web/templates/conn_table.html.j2 b/app/src/web/templates/templ_conn_table.html.j2 similarity index 97% rename from app/src/web/templates/conn_table.html.j2 rename to app/src/web/templates/templ_conn_table.html.j2 index c6c5f62..6dd69b1 100644 --- a/app/src/web/templates/conn_table.html.j2 +++ b/app/src/web/templates/templ_conn_table.html.j2 @@ -12,7 +12,7 @@ {% endif %} {%- endmacro%} -
Connections
+
{{_('Connections')}}
{% if table.thead is defined%} diff --git a/app/src/web/templates/templ_log_files_list.html.j2 b/app/src/web/templates/templ_log_files_list.html.j2 new file mode 100644 index 0000000..9df7ee5 --- /dev/null +++ b/app/src/web/templates/templ_log_files_list.html.j2 @@ -0,0 +1,31 @@ +
+{% for file in dir_list %} +
+ +
+
+

{{file.name}}

+
+ +
+ {% for idx, name in [('created',_('Created')), ('modified', _('Modified')), ('size', _('Size'))]%} + + + + + {% endfor %} +
{{_(name)}}:{{file[idx]}}
+ + + + + +{% if 0 == (loop.index%4) and not last %} + +
+{% endif %} +{% endfor %} +
+ diff --git a/app/src/web/templates/notes_list.html.j2 b/app/src/web/templates/templ_notes_list.html.j2 similarity index 100% rename from app/src/web/templates/notes_list.html.j2 rename to app/src/web/templates/templ_notes_list.html.j2