fix: device.class possible null

This commit is contained in:
wznln
2025-04-29 22:48:25 +08:00
parent 5038219fe6
commit 4dbb6649b4

View File

@@ -333,7 +333,12 @@
<tr id="device-info-{{ loop.index }}" class="detail-row" style="display: none;"> <tr id="device-info-{{ loop.index }}" class="detail-row" style="display: none;">
<td colspan="5"> <td colspan="5">
<div class="content-full"> <div class="content-full">
{% if device.class %}
<pre>{{ device.class | tojson(indent=4) }}</pre> <pre>{{ device.class | tojson(indent=4) }}</pre>
{% else %}
<!-- 这里可以放占位内容,比如 -->
<pre>// No data</pre>
{% endif %}
{% if device.is_online %} {% if device.is_online %}
<div class="status-badge"><span class="online-status">在线</span></div> <div class="status-badge"><span class="online-status">在线</span></div>
@@ -366,7 +371,12 @@
<button class="copy-btn" onclick="copyToClipboard(this.previousElementSibling.textContent, event)">复制</button> <button class="copy-btn" onclick="copyToClipboard(this.previousElementSibling.textContent, event)">复制</button>
<button class="debug-btn" onclick="toggleDebugInfo(this, event)">调试</button> <button class="debug-btn" onclick="toggleDebugInfo(this, event)">调试</button>
<div class="debug-info" style="display:none;"> <div class="debug-info" style="display:none;">
<pre>{{ action_info|tojson(indent=2) }}</pre> {% if action_info %}
<pre>{{ action_info | tojson(indent=4) }}</pre>
{% else %}
<!-- 这里可以放占位内容,比如 -->
<pre>// No data</pre>
{% endif %}
</div> </div>
</div> </div>