<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2026, Jiri Eischmann <jiri@eischmann.cz> and the meshy contributors -->
<!-- SPDX-License-Identifier: GPL-3.0-or-later -->
<interface>
  <requires lib="gtk" version="4.0"/>
  <requires lib="libadwaita" version="1.0"/>
  <template class="MeshyDeviceView" parent="GtkBox">
    <property name="orientation">vertical</property>
    <child>
      <object class="GtkScrolledWindow" id="scroll">
        <property name="vexpand">true</property>
        <child>
          <object class="AdwClamp">
            <property name="maximum-size">600</property>
            <child>
              <object class="GtkBox">
                <property name="orientation">vertical</property>
                <property name="spacing">12</property>
                <property name="margin-start">12</property>
                <property name="margin-end">12</property>
                <property name="margin-top">12</property>
                <property name="margin-bottom">12</property>

                <!-- Connection status -->
                <child>
                  <object class="AdwPreferencesGroup" id="status_group">
                    <child>
                      <object class="AdwActionRow" id="status_row">
                        <property name="title" translatable="yes">Status</property>
                        <property name="subtitle" translatable="yes">Disconnected</property>
                        <child type="prefix">
                          <object class="GtkImage" id="status_icon">
                            <property name="icon-name">network-offline-symbolic</property>
                          </object>
                        </child>
                      </object>
                    </child>
                  </object>
                </child>

                <!-- Device Information -->
                <child>
                  <object class="AdwPreferencesGroup" id="info_group">
                    <property name="title" translatable="yes">Device Information</property>
                    <child>
                      <object class="AdwActionRow" id="name_row">
                        <property name="title" translatable="yes">Node Name</property>
                        <property name="subtitle">--</property>
                      </object>
                    </child>
                    <child>
                      <object class="AdwActionRow" id="board_row">
                        <property name="title" translatable="yes">Board</property>
                        <property name="subtitle">--</property>
                      </object>
                    </child>
                    <child>
                      <object class="AdwActionRow" id="fw_row">
                        <property name="title" translatable="yes">Firmware</property>
                        <property name="subtitle">--</property>
                        <child type="suffix">
                          <object class="GtkButton" id="fw_update_btn">
                            <property name="label" translatable="yes">Update</property>
                            <property name="valign">center</property>
                            <property name="visible">false</property>
                            <property name="tooltip-text" translatable="yes">Open firmware flasher</property>
                            <style>
                              <class name="suggested-action"/>
                              <class name="pill"/>
                            </style>
                          </object>
                        </child>
                      </object>
                    </child>
                    <child>
                      <object class="AdwActionRow" id="key_row">
                        <property name="title" translatable="yes">Public Key</property>
                        <property name="subtitle">--</property>
                        <property name="subtitle-selectable">true</property>
                        <child type="suffix">
                          <object class="GtkButton" id="copy_key_btn">
                            <property name="icon-name">edit-copy-symbolic</property>
                            <property name="valign">center</property>
                          </object>
                        </child>
                      </object>
                    </child>
                    <child>
                      <object class="AdwActionRow" id="telemetry_row">
                        <property name="title" translatable="yes">Telemetry</property>
                        <property name="subtitle">--</property>
                        <child type="suffix">
                          <object class="GtkButton" id="telemetry_btn">
                            <property name="icon-name">view-refresh-symbolic</property>
                            <property name="valign">center</property>
                            <property name="tooltip-text" translatable="yes">Request telemetry</property>
                            <style>
                              <class name="flat"/>
                            </style>
                          </object>
                        </child>
                      </object>
                    </child>
                    <child>
                      <object class="AdwActionRow" id="location_row">
                        <property name="title" translatable="yes">Location</property>
                        <property name="subtitle" translatable="yes">Syncing…</property>
                        <child type="suffix">
                          <object class="GtkButton" id="location_map_btn">
                            <property name="icon-name">map-symbolic</property>
                            <property name="valign">center</property>
                            <property name="tooltip-text" translatable="yes">Show on map</property>
                            <property name="visible">false</property>
                            <style>
                              <class name="flat"/>
                            </style>
                          </object>
                        </child>
                      </object>
                    </child>
                  </object>
                </child>

                <!-- Battery & Storage -->
                <child>
                  <object class="AdwPreferencesGroup" id="batt_group">
                    <property name="title" translatable="yes">Battery &amp;amp; Storage</property>
                    <child>
                      <object class="AdwActionRow" id="batt_row">
                        <property name="title" translatable="yes">Battery</property>
                        <property name="subtitle">--</property>
                        <child type="prefix">
                          <object class="GtkImage">
                            <property name="icon-name">battery-symbolic</property>
                          </object>
                        </child>
                        <child type="suffix">
                          <object class="GtkLevelBar" id="batt_bar">
                            <property name="min-value">0</property>
                            <property name="max-value">100</property>
                            <property name="valign">center</property>
                            <property name="width-request">150</property>
                          </object>
                        </child>
                      </object>
                    </child>
                    <child>
                      <object class="AdwActionRow" id="storage_row">
                        <property name="title" translatable="yes">Storage</property>
                        <property name="subtitle">--</property>
                        <child type="prefix">
                          <object class="GtkImage">
                            <property name="icon-name">drive-harddisk-symbolic</property>
                          </object>
                        </child>
                        <child type="suffix">
                          <object class="GtkLevelBar" id="storage_bar">
                            <property name="min-value">0</property>
                            <property name="max-value">100</property>
                            <property name="valign">center</property>
                            <property name="width-request">150</property>
                          </object>
                        </child>
                      </object>
                    </child>
                  </object>
                </child>

                <!-- Radio Configuration -->
                <child>
                  <object class="AdwPreferencesGroup" id="radio_group">
                    <property name="title" translatable="yes">Radio Configuration</property>
                    <child>
                      <object class="AdwActionRow" id="freq_row">
                        <property name="title" translatable="yes">Frequency</property>
                        <property name="subtitle">--</property>
                      </object>
                    </child>
                    <child>
                      <object class="AdwActionRow" id="bw_row">
                        <property name="title" translatable="yes">Bandwidth</property>
                        <property name="subtitle">--</property>
                      </object>
                    </child>
                    <child>
                      <object class="AdwActionRow" id="sf_row">
                        <property name="title" translatable="yes">Spreading Factor</property>
                        <property name="subtitle">--</property>
                      </object>
                    </child>
                    <child>
                      <object class="AdwActionRow" id="cr_row">
                        <property name="title" translatable="yes">Coding Rate</property>
                        <property name="subtitle">--</property>
                      </object>
                    </child>
                    <child>
                      <object class="AdwActionRow" id="tx_row">
                        <property name="title" translatable="yes">TX Power</property>
                        <property name="subtitle">--</property>
                      </object>
                    </child>
                    <child>
                      <object class="AdwActionRow" id="path_hash_row">
                        <property name="title" translatable="yes">Default Path Hash Size</property>
                        <property name="subtitle">--</property>
                      </object>
                    </child>
                  </object>
                </child>

                <!-- Statistics -->
                <child>
                  <object class="AdwPreferencesGroup" id="stats_group">
                    <property name="title" translatable="yes">Statistics</property>
                    <child>
                      <object class="AdwActionRow" id="uptime_row">
                        <property name="title" translatable="yes">Uptime</property>
                        <property name="subtitle">--</property>
                      </object>
                    </child>
                    <child>
                      <object class="AdwActionRow" id="queue_row">
                        <property name="title" translatable="yes">Message Queue</property>
                        <property name="subtitle">--</property>
                      </object>
                    </child>
                    <child>
                      <object class="AdwActionRow" id="noise_row">
                        <property name="title" translatable="yes">Noise Floor</property>
                        <property name="subtitle">--</property>
                      </object>
                    </child>
                    <child>
                      <object class="AdwActionRow" id="rssi_row">
                        <property name="title" translatable="yes">Last RSSI</property>
                        <property name="subtitle">--</property>
                      </object>
                    </child>
                    <child>
                      <object class="AdwActionRow" id="snr_row">
                        <property name="title" translatable="yes">Last SNR</property>
                        <property name="subtitle">--</property>
                      </object>
                    </child>
                    <child>
                      <object class="AdwActionRow" id="airtime_row">
                        <property name="title" translatable="yes">Airtime</property>
                        <property name="subtitle">--</property>
                      </object>
                    </child>
                    <child>
                      <object class="AdwActionRow" id="pkt_row">
                        <property name="title" translatable="yes">Packets</property>
                        <property name="subtitle">--</property>
                      </object>
                    </child>
                    <child>
                      <object class="AdwActionRow" id="pkt_flood_row">
                        <property name="title" translatable="yes">Flood</property>
                        <property name="subtitle">--</property>
                      </object>
                    </child>
                    <child>
                      <object class="AdwActionRow" id="pkt_direct_row">
                        <property name="title" translatable="yes">Direct</property>
                        <property name="subtitle">--</property>
                      </object>
                    </child>
                    <child>
                      <object class="AdwActionRow" id="refresh_stats_row">
                        <property name="title" translatable="yes">Refresh Statistics</property>
                        <property name="activatable-widget">refresh_stats_btn</property>
                        <child type="suffix">
                          <object class="GtkButton" id="refresh_stats_btn">
                            <property name="icon-name">view-refresh-symbolic</property>
                            <property name="valign">center</property>
                          </object>
                        </child>
                      </object>
                    </child>
                  </object>
                </child>

              </object>
            </child>
          </object>
        </child>
      </object>
    </child>
  </template>
</interface>
