file_path = 'core/templates/core/settings.html' with open(file_path, 'r') as f: content = f.read() # 1. Add Nav Tab if 'id="devices-tab"' not in content: whatsapp_tab_end = 'id="whatsapp-tab" data-bs-toggle="pill" data-bs-target="#whatsapp" type="button" role="tab">\n {% trans "WhatsApp Gateway" %}\n \n li>' insert_str = """
| {% trans "Device Name" %} | {% trans "Type" %} | {% trans "Connection" %} | {% trans "IP / Port" %} | {% trans "Status" %} | {% trans "Actions" %} |
|---|---|---|---|---|---|
| {{ device.name }} | {{ device.get_device_type_display }} | {{ device.get_connection_type_display }} | {% if device.ip_address %} {{ device.ip_address }}{% if device.port %}:{{ device.port }}{% endif %} {% else %} - {% endif %} | {% if device.is_active %} {% trans "Active" %} {% else %} {% trans "Inactive" %} {% endif %} | |
|
{% trans "No devices configured." %}
|
|||||