,
+ },
+ ...
+ }
+ """
+ handlers_loggers_level = dict()
+ for handler_name in handlers_name:
+ handler_logger = self._get_iot_handler_logger(handler_name, iot_handler_folder_name)
+ if not handler_logger:
+ # Might happen if the file didn't define a logger (or not init yet)
+ handlers_loggers_level[handler_name] = False
+ _logger.debug('Unable to find logger for handler %s', handler_name)
+ continue
+ logger_parent = handler_logger.parent
+ handlers_loggers_level[handler_name] = {
+ 'level': self._get_logger_effective_level_str(handler_logger),
+ 'is_using_parent_level': handler_logger.level == logging.NOTSET,
+ 'parent_name': logger_parent.name,
+ 'parent_level': self._get_logger_effective_level_str(logger_parent),
+ }
+ return handlers_loggers_level
diff --git a/views/configure_wizard.html b/views/configure_wizard.html
new file mode 100644
index 0000000..d492a50
--- /dev/null
+++ b/views/configure_wizard.html
@@ -0,0 +1,180 @@
+{% extends "layout.html" %}
+{% from "loading.html" import loading_block_ui %}
+{% block head %}
+
+
+{% endblock %}
+{% block content %}
+ Configure IoT Box
+
+ Connect to Odoo
+ Connect to Internet
+ Done
+
+
+{% endblock %}
diff --git a/views/handler_list.html b/views/handler_list.html
new file mode 100644
index 0000000..7ebdaae
--- /dev/null
+++ b/views/handler_list.html
@@ -0,0 +1,126 @@
+{% extends "layout.html" %}
+{% from "loading.html" import loading_block_ui %}
+{% block head %}
+
+{% endblock %}
+{% block content %}
+ Logging
+
+ {% if server %}
+
+ You can clear the handlers configuration
+
+
+ {% endif %}
+ {{ loading_block_ui('Loading Handlers') }}
+{% endblock %}
diff --git a/views/homepage.html b/views/homepage.html
new file mode 100644
index 0000000..504109e
--- /dev/null
+++ b/views/homepage.html
@@ -0,0 +1,263 @@
+{% extends "layout.html" %}
+{% from "loading.html" import loading_block_ui %}
+{% block head %}
+
+
+{% endblock %}
+{% block content %}
+
+
+
Restart
+
+
+ {% if system == "Linux" %}
+ Reboot the IoT Box
+ {% endif %}
+ Restart Odoo service
+
+
+
+
+ Your IoT Box is up and running
+
+
+ Name
+ {{ hostname }} {% if system == "Linux" %}configure {% endif %}
+
+
+ Version
+ {{ version }} {% if system == "Linux" %}update {% endif %}
+
+
+ IP Address
+ {{ ip }}
+
+
+ Mac Address
+ {{ mac }}
+
+
+ Network
+ {{ network_status }} {% if system == "Linux" %}configure wifi {% endif %}
+
+
+ Server
+ {{ server_status }} configure
+
+
+ HTTPS certificate
+
+ {% if is_certificate_ok %}
+
+ OK
+ {{ certificate_details }}
+
+ {% else %}
+ Error code:
+ {% set error_code = certificate_details.split(' ') | first | replace("_", "-") | lower %}
+ {% set doc_url = 'https://www.odoo.com/documentation/17.0/applications/productivity/iot/config/https_certificate_iot.html#' ~ error_code %}
+ help
+
+ {{ certificate_details }}
+ {% endif %}
+
+
+ {% if server_status != "Not Configured" %}
+
+ Six payment terminal
+ {{ six_terminal }} configure
+
+ {% endif %}
+ {% if pairing_code %}
+
+ Pairing code
+ {{ pairing_code }}
+
+ {% endif %}
+
+ IOT Device
+
+
+ {% if iot_device_status|length == 0 %}
+ No Device Found
+ {% endif %}
+ {% for iot_devices in iot_device_status|groupby('type') %}
+
+
{{ iot_devices.grouper|capitalize }}s
+
+ {% for device in iot_devices.list %}
+
+
{{ device['name'] }}
+
{{ device['identifier'] }}
+
+ {% endfor %}
+
+
+ {% endfor %}
+
+ handlers list
+
+
+
+
+
POS Display
+ {% if system == "Linux" %}
+
Remote Debug
+
Printers server
+ {% endif %}
+ {% if server_status != "Not Configured" %}
+
Credential
+ {% endif %}
+
+ {{ loading_block_ui(loading_message) }}
+{% endblock %}
diff --git a/views/layout.html b/views/layout.html
new file mode 100644
index 0000000..b64a812
--- /dev/null
+++ b/views/layout.html
@@ -0,0 +1,143 @@
+
+
+
+
+
+ {{ title or "Odoo's IoT Box" }}
+
+
+ {% block head %}{% endblock %}
+
+
+ {%if breadcrumb %}
+
+ {% endif %}
+
+ {% block content %}{% endblock %}
+
+
+
+
+
diff --git a/views/list_credential.html b/views/list_credential.html
new file mode 100644
index 0000000..87a8f09
--- /dev/null
+++ b/views/list_credential.html
@@ -0,0 +1,68 @@
+{% extends "layout.html" %}
+{% from "loading.html" import loading_block_ui %}
+{% block head %}
+
+{% endblock %}
+{% block content %}
+ List Credential
+
+ Set the DB UUID and your Contract Number you want to use.
+
+
+ {% if db_uuid or enterprise_code %}
+
+ Current DB uuid: {{ db_uuid }}
+
+
+ Current Contract Number: {{ enterprise_code }}
+
+
+ You can clear the credential configuration
+
+
+ {% endif %}
+{% endblock %}
diff --git a/views/loading.html b/views/loading.html
new file mode 100644
index 0000000..7d65146
--- /dev/null
+++ b/views/loading.html
@@ -0,0 +1,14 @@
+{% macro loading_block_ui(message) %}
+
+
+
+
+
+
+
+ Please wait..
+ {{ message }}
+
+
+
+{% endmacro %}
diff --git a/views/remote_connect.html b/views/remote_connect.html
new file mode 100644
index 0000000..1967918
--- /dev/null
+++ b/views/remote_connect.html
@@ -0,0 +1,56 @@
+{% extends "layout.html" %}
+{% block head %}
+
+{% endblock %}
+{% block content %}
+ Remote Debugging
+
+ This allows someone who give a ngrok authtoken to gain remote access to your IoT Box, and
+ thus your entire local network. Only enable this for someone
+ you trust.
+
+
+{% endblock %}
diff --git a/views/server_config.html b/views/server_config.html
new file mode 100644
index 0000000..6824ee6
--- /dev/null
+++ b/views/server_config.html
@@ -0,0 +1,60 @@
+{% extends "layout.html" %}
+{% from "loading.html" import loading_block_ui %}
+{% block head %}
+
+{% endblock %}
+{% block content %}
+ Configure Odoo Server
+
+ Paste the token from the Connect wizard in your Odoo instance in the Server Token field. If you change the IoT Box Name,
+ your IoT Box will need a reboot.
+
+
+
+ You can clear the server configuration
+
+
+{% endblock %}
diff --git a/views/six_payment_terminal.html b/views/six_payment_terminal.html
new file mode 100644
index 0000000..89a2e69
--- /dev/null
+++ b/views/six_payment_terminal.html
@@ -0,0 +1,61 @@
+{% extends "layout.html" %}
+{% from "loading.html" import loading_block_ui %}
+{% block head %}
+
+{% endblock %}
+{% block content %}
+ Six Payment Terminal
+
+ Set the Terminal ID (TID) of the terminal you want to use.
+
+
+ {% if terminalId %}
+
+ Current Terminal Id: {{ terminalId }}
+
+
+ You can clear the terminal configuration
+
+
+ {% endif %}
+{% endblock %}
diff --git a/views/upgrade_page.html b/views/upgrade_page.html
new file mode 100644
index 0000000..0c5d7a9
--- /dev/null
+++ b/views/upgrade_page.html
@@ -0,0 +1,95 @@
+{% extends "layout.html" %}
+{% from "loading.html" import loading_block_ui %}
+{% block head %}
+
+
+
+{% endblock %}
+{% block content %}
+ IoT Box Software Upgrade
+
+ This tool will help you perform an upgrade of the IoTBox's software over the internet.
+ However the preferred method to upgrade the IoTBox is to flash the sd-card with
+ the latest image . The upgrade
+ procedure is explained into to the
+ IoTBox manual
+
+
+ To upgrade the IoTBox, click on the upgrade button. The upgrade will take a few minutes. Do not reboot the IoTBox during the upgrade.
+
+
+
+ Latest patch:
+
+
{{ commit|safe }}
+
+
+ {% if flashToVersion %}
+
Upgrade to {{ flashToVersion }}
+ {% else %}
+
Upgrade
+ {% endif %}
+
+ {{ loading_block_ui(loading_message) }}
+{% endblock %}
diff --git a/views/wifi_config.html b/views/wifi_config.html
new file mode 100644
index 0000000..94e0579
--- /dev/null
+++ b/views/wifi_config.html
@@ -0,0 +1,71 @@
+{% extends "layout.html" %}
+{% from "loading.html" import loading_block_ui %}
+{% block head %}
+
+{% endblock %}
+{% block content %}
+ Configure Wifi
+
+ Here you can configure how the iotbox should connect to wireless networks.
+ Currently only Open and WPA networks are supported. When enabling the persistent checkbox,
+ the chosen network will be saved and the iotbox will attempt to connect to it every time it boots.
+
+
+
+ You can clear the persistent configuration
+
+
+ {{ loading_block_ui(loading_message) }}
+{% endblock %}