migrate the conn table to a general table
- rename the template file - get headline from table description
This commit is contained in:
@@ -48,6 +48,7 @@ def _get_row(inv: InverterBase):
|
|||||||
def get_table_data():
|
def get_table_data():
|
||||||
'''build the connection table'''
|
'''build the connection table'''
|
||||||
table = {
|
table = {
|
||||||
|
"headline": _('Connections'),
|
||||||
"col_classes": [
|
"col_classes": [
|
||||||
"w3-hide-small w3-hide-medium", "w3-hide-large",
|
"w3-hide-small w3-hide-medium", "w3-hide-large",
|
||||||
"",
|
"",
|
||||||
@@ -75,7 +76,7 @@ async def data_fetch():
|
|||||||
"proxy-cnt": f"<h3>{Infos.get_counter('ProxyMode_Cnt')}</h3>",
|
"proxy-cnt": f"<h3>{Infos.get_counter('ProxyMode_Cnt')}</h3>",
|
||||||
"emulation-cnt": f"<h3>{Infos.get_counter('EmuMode_Cnt')}</h3>",
|
"emulation-cnt": f"<h3>{Infos.get_counter('EmuMode_Cnt')}</h3>",
|
||||||
}
|
}
|
||||||
data["conn-table"] = await render_template('templ_conn_table.html.j2',
|
data["conn-table"] = await render_template('templ_table.html.j2',
|
||||||
table=get_table_data())
|
table=get_table_data())
|
||||||
|
|
||||||
data["notes-list"] = await render_template('templ_notes_list.html.j2')
|
data["notes-list"] = await render_template('templ_notes_list.html.j2')
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
from inverter_base import InverterBase
|
from inverter_base import InverterBase
|
||||||
from quart import render_template
|
from quart import render_template
|
||||||
from quart_babel import format_datetime, _
|
from quart_babel import format_datetime, _
|
||||||
from infos import Infos
|
|
||||||
from mqtt import Mqtt
|
from mqtt import Mqtt
|
||||||
|
|
||||||
from . import web
|
from . import web
|
||||||
@@ -49,6 +48,7 @@ def _get_row(inv: InverterBase):
|
|||||||
def get_table_data():
|
def get_table_data():
|
||||||
'''build the connection table'''
|
'''build the connection table'''
|
||||||
table = {
|
table = {
|
||||||
|
"headline": _('MQTT devices'),
|
||||||
"col_classes": [
|
"col_classes": [
|
||||||
"w3-hide-small w3-hide-medium", "w3-hide-large",
|
"w3-hide-small w3-hide-medium", "w3-hide-large",
|
||||||
"",
|
"",
|
||||||
@@ -77,7 +77,7 @@ async def mqtt_fetch():
|
|||||||
"mqtt-tx": f"<h3>{mqtt.published}</h3>",
|
"mqtt-tx": f"<h3>{mqtt.published}</h3>",
|
||||||
"mqtt-rx": f"<h3>{mqtt.received}</h3>",
|
"mqtt-rx": f"<h3>{mqtt.received}</h3>",
|
||||||
}
|
}
|
||||||
# data["conn-table"] = await render_template('templ_conn_table.html.j2',
|
data["mqtt-table"] = await render_template('templ_table.html.j2',
|
||||||
# table=get_table_data())
|
table=get_table_data())
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="mqtt-table"></div>
|
||||||
{% endblock content%}
|
{% endblock content%}
|
||||||
|
|
||||||
{% block footer %}{% endblock footer %}
|
{% block footer %}{% endblock footer %}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
{%- endmacro%}
|
{%- endmacro%}
|
||||||
|
|
||||||
<div class="w3-container w3-margin-bottom">
|
<div class="w3-container w3-margin-bottom">
|
||||||
<h5>{{_('Connections')}}</h5>
|
<h5>{{table.headline}}</h5>
|
||||||
<div class="w3-card-4">
|
<div class="w3-card-4">
|
||||||
|
|
||||||
<table class="w3-table w3-striped w3-bordered w3-border w3-hoverable w3-white">
|
<table class="w3-table w3-striped w3-bordered w3-border w3-hoverable w3-white">
|
||||||
Reference in New Issue
Block a user