Browse Source

Added new fields in tables and restyled services strings

Change-Id: I668538c1b0d45d0cabd85f0a7042d6143222bb1c
changes/74/635474/1 0.4.3
Carmelo Romeo 4 years ago
parent
commit
b0324c020b
  1. 3
      iotronic_ui/iot/boards/tables.py
  2. 10
      iotronic_ui/iot/boards/templates/boards/_detail_overview.html
  3. 3
      iotronic_ui/iot/webservices/forms.py
  4. 2
      iotronic_ui/iot/webservices/templates/webservices/_cell_webservices.html
  5. 7
      iotronic_ui/iot/webservices/views.py

3
iotronic_ui/iot/boards/tables.py

@ -181,11 +181,12 @@ class BoardsTable(tables.DataTable):
verbose_name=_('Board Name'))
type = tables.Column('type', verbose_name=_('Type'))
# mobile = tables.Column('mobile', verbose_name=_('Mobile'))
uuid = tables.Column('uuid', verbose_name=_('Board ID'))
lr_version = tables.Column('lr_version', verbose_name=_('LR version'))
# fleet = tables.Column('fleet', verbose_name=_('Fleet ID'))
fleet_name = tables.Column('fleet_name', verbose_name=_('Fleet Name'))
# code = tables.Column('code', verbose_name=_('Code'))
status = tables.Column('status', verbose_name=_('Status'))
uuid = tables.Column('uuid', verbose_name=_('Board ID'))
# location = tables.Column('location', verbose_name=_('Geo'))
services = tables.Column(show_services, verbose_name=_('Services'))
# extra = tables.Column('extra', verbose_name=_('Extra'))

10
iotronic_ui/iot/boards/templates/boards/_detail_overview.html

@ -13,6 +13,10 @@
<dd>{{ board.type }}</dd>
<dt>{% trans "ID" %}</dt>
<dd>{{ board.uuid }}</dd>
<dt>{% trans "MAC" %}</dt>
<dd>{{ board.mac_addr }}</dd>
<dt>{% trans "LR version" %}</dt>
<dd>{{ board.lr_version }}</dd>
<dt>{% trans "Code" %}</dt>
<dd>{{ board.code }}</dd>
<dt>{% trans "Creation data" %}</dt>
@ -49,8 +53,10 @@
<dl class="dl-horizontal">
{% if services %}
{% for service in services %}
<dt>{{ service.name }} [{{ service.protocol }}] {{ service.port }}</dt>
<dd>{{ service.public_port }}</dd>
<!--<dt>{{ service.name }} [{{ service.protocol }}] {{ service.port }}</dt>-->
<!--<dd>{{ service.public_port }}</dd>-->
<dt>{{ service.name }}</dt>
<dd>[{{ service.protocol }}] L: {{ service.port }}; P: {{ service.public_port }}</dd>
{% endfor %}
{% else %}
<dd>--</dd>

3
iotronic_ui/iot/webservices/forms.py

@ -44,7 +44,8 @@ class ExposeWebserviceForm(forms.SelfHandlingForm):
help_text=_("The local port used by the service")
)
secure = forms.BooleanField(label=_("Secure"), initial=True)
secure = forms.BooleanField(label=_("Secure"), initial=True,
widget=forms.HiddenInput)
def __init__(self, *args, **kwargs):
super(ExposeWebserviceForm, self).__init__(*args, **kwargs)

2
iotronic_ui/iot/webservices/templates/webservices/_cell_webservices.html

@ -1,7 +1,7 @@
{% load i18n %}
{% if webservices %}
{% for ws in webservices %}
<dd><a target="_blank" href="{{ ws.service_url}}">{{ ws.service_url}}</a></dd>
<dd>[ {{ ws.local_port }} ] - <a target="_blank" href="{{ ws.service_url }}">{{ ws.service_url }}</a></dd>
{% endfor %}
{% else %}
<dd>--</dd>

7
iotronic_ui/iot/webservices/views.py

@ -86,8 +86,10 @@ class IndexView(tables.DataTableView):
for ws in webservices:
if ws_en.board_uuid == ws.board_uuid:
service_url = "https://" + ws.name + "." + ws_en.dns + "." + ws_en.zone
ws_list.append({"service_url": service_url})
service_url = "https://" + ws.name + "." + ws_en.dns +\
"." + ws_en.zone
ws_list.append({"local_port": ws.port,
"service_url": service_url})
ws_en.uuid = ws.uuid
@ -95,7 +97,6 @@ class IndexView(tables.DataTableView):
ws_en.name = board.name
ws_en._info.update(dict(webservices=ws_list))
# LOG.debug('WS: %s', en_webservices)
return en_webservices

Loading…
Cancel
Save