Browse Source

Added new fields in tables and restyled services strings

Change-Id: I668538c1b0d45d0cabd85f0a7042d6143222bb1c
Carmelo Romeo 2 months ago
parent
commit
b0324c020b

+ 2
- 1
iotronic_ui/iot/boards/tables.py View File

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

+ 8
- 2
iotronic_ui/iot/boards/templates/boards/_detail_overview.html View File

@@ -13,6 +13,10 @@
13 13
       <dd>{{ board.type }}</dd>
14 14
       <dt>{% trans "ID" %}</dt>
15 15
       <dd>{{ board.uuid }}</dd>
16
+      <dt>{% trans "MAC" %}</dt>
17
+      <dd>{{ board.mac_addr }}</dd>
18
+      <dt>{% trans "LR version" %}</dt>
19
+      <dd>{{ board.lr_version }}</dd>
16 20
       <dt>{% trans "Code" %}</dt>
17 21
       <dd>{{ board.code }}</dd>
18 22
       <dt>{% trans "Creation data" %}</dt>
@@ -49,8 +53,10 @@
49 53
     <dl class="dl-horizontal">
50 54
       {% if services %}
51 55
         {% for service in services %}
52
-            <dt>{{ service.name }} [{{ service.protocol }}] {{ service.port }}</dt>
53
-            <dd>{{ service.public_port }}</dd>
56
+            <!--<dt>{{ service.name }} [{{ service.protocol }}] {{ service.port }}</dt>-->
57
+            <!--<dd>{{ service.public_port }}</dd>-->
58
+            <dt>{{ service.name }}</dt>
59
+            <dd>[{{ service.protocol }}] L: {{ service.port }}; P: {{ service.public_port }}</dd>
54 60
         {% endfor %}
55 61
       {% else %}
56 62
         <dd>--</dd>

+ 2
- 1
iotronic_ui/iot/webservices/forms.py View File

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

+ 1
- 1
iotronic_ui/iot/webservices/templates/webservices/_cell_webservices.html View File

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

+ 4
- 3
iotronic_ui/iot/webservices/views.py View File

@@ -86,8 +86,10 @@ class IndexView(tables.DataTableView):
86 86
             for ws in webservices:
87 87
                 if ws_en.board_uuid == ws.board_uuid:
88 88
 
89
-                    service_url = "https://" + ws.name + "." + ws_en.dns + "." + ws_en.zone
90
-                    ws_list.append({"service_url": service_url})
89
+                    service_url = "https://" + ws.name + "." + ws_en.dns +\
90
+                                  "." + ws_en.zone
91
+                    ws_list.append({"local_port": ws.port,
92
+                                    "service_url": service_url})
91 93
 
92 94
                     ws_en.uuid = ws.uuid
93 95
 
@@ -95,7 +97,6 @@ class IndexView(tables.DataTableView):
95 97
             ws_en.name = board.name
96 98
             ws_en._info.update(dict(webservices=ws_list))
97 99
 
98
-        # LOG.debug('WS: %s', en_webservices)
99 100
         return en_webservices
100 101
 
101 102
 

Loading…
Cancel
Save