diff --git a/src/start_webui_dev_mode.sh b/src/start_webui_dev_mode.sh index 32cf9c7f131ced88c4b496c26ab6890f571aa2f2..2947e7af64c5cd2b94af63b475e6809a3f92997e 100755 --- a/src/start_webui_dev_mode.sh +++ b/src/start_webui_dev_mode.sh @@ -1,15 +1,17 @@ # for development purposes only -export CONTEXT_SERVICE_ADDRESS=`kubectl get service/contextservice -n tf-dev -o jsonpath='{.spec.clusterIP}'` +export CONTEXTSERVICE_SERVICE_HOST=`kubectl get service/contextservice -n tf-dev -o jsonpath='{.spec.clusterIP}'` -echo $CONTEXT_SERVICE_ADDRESS +echo Context IP: $CONTEXTSERVICE_SERVICE_HOST -export DEVICE_SERVICE_ADDRESS=`kubectl get service/deviceservice -n tf-dev -o jsonpath='{.spec.clusterIP}'` +export DEVICESERVICE_SERVICE_HOST=`kubectl get service/deviceservice -n tf-dev -o jsonpath='{.spec.clusterIP}'` -echo $DEVICE_SERVICE_ADDRESS +echo Device IP: $DEVICESERVICE_SERVICE_HOST +export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION='python' export HOST="127.0.0.1" - export FLASK_ENV="development" +# python3 -m webbrowser http://${HOST}:8004 + python -m webui.service diff --git a/src/webui/service/templates/base.html b/src/webui/service/templates/base.html index 6ada3c8502d26f9ff8e2ac289bbcdd822d7a4a32..1dace757cb187afa87c130f9d251e9f1afe3ff4a 100644 --- a/src/webui/service/templates/base.html +++ b/src/webui/service/templates/base.html @@ -91,9 +91,11 @@ {% endwith %} </div> </div> - <div class="bg-light p-5 rounded"> + <div class="row"> + <div class="col-xxl-12"> {% block content %}{% endblock %} </div> + </div> </main> <footer class="footer" style="background-color: darkgrey;"> diff --git a/src/webui/service/templates/device/home.html b/src/webui/service/templates/device/home.html index 6010ed6a91c583dc352d14fc4e4b2543ee7e7eef..28318f4ca39222ffa57e1cce6f7c0543b0c0abb4 100644 --- a/src/webui/service/templates/device/home.html +++ b/src/webui/service/templates/device/home.html @@ -4,12 +4,12 @@ <h1>Devices</h1> <div class="row"> - <!-- <div class="col"> + <div class="col"> <a href="{{ url_for('device.add') }}" class="btn btn-primary" style="margin-bottom: 10px;"> <i class="bi bi-plus"></i> Add New Device </a> - </div> --> + </div> <div class="col"> {{ devices | length }} devices found in context <i>{{ session['context_uuid'] }}</i> </div> @@ -32,7 +32,7 @@ <th scope="col">Drivers</th> <th scope="col">Status</th> <th scope="col">Configuration</th> - <!-- <th scope="col"></th> --> + <th scope="col"></th> </tr> </thead> <tbody> @@ -57,11 +57,11 @@ <td> <ul> {% for driver in device.device_drivers %} - <li>{{ dde.Name(driver) }}</li> + <li>{{ dde.Name(driver).replace('DEVICEDRIVER_', '') }}</li> {% endfor %} </ul> </td> - <td>{{ dose.Name(device.device_operational_status) }}</td> + <td>{{ dose.Name(device.device_operational_status).replace('DEVICEOPERATIONALSTATUS_', '') }}</td> <td> <ul> {% for config in device.device_config.config_rules %} @@ -72,14 +72,14 @@ {% endfor %} </ul> </td> - <!-- <td> + <td> <a href="{{ url_for('device.detail', device_uuid=device.device_id.device_uuid.uuid) }}"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye" viewBox="0 0 16 16"> <path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/> <path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/> </svg> </a> - </td> --> + </td> </tr> {% endfor %} {% else %} diff --git a/src/webui/service/templates/service/home.html b/src/webui/service/templates/service/home.html index 648ce99bd9276dd12986f644977520a980f6be79..69283b5447a6ad9189ab08a6901df675e547f80b 100644 --- a/src/webui/service/templates/service/home.html +++ b/src/webui/service/templates/service/home.html @@ -46,7 +46,7 @@ <!-- </a> --> </td> <td> - {{ ste.Name(service.service_type) }} + {{ ste.Name(service.service_type).replace('SERVICETYPE_', '') }} </td> <td> <ul> @@ -62,7 +62,7 @@ {% endfor %} </ul> </td> - <td>{{ sse.Name(service.service_status.service_status) }}</td> + <td>{{ sse.Name(service.service_status.service_status).replace('SERVICESTATUS_', '') }}</td> <td> <ul> {% for rule in service.service_config.config_rules %} @@ -75,7 +75,7 @@ </ul> </td> <!-- <td> - <a href="{{ url_for('service.detail', service_uuid=service.service_id.service_uuid.uuid) }}"> + <a href="{{ url_for('service.detail', service_uuid=service.service_id.service_uuid.uuid.replace('/', '_')) }}"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye" viewBox="0 0 16 16"> <path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/> <path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/>