| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <!doctype html>
- <html lang="zh-CN">
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <title><%= title %></title>
- <link rel="stylesheet" href="/styles.css">
- </head>
- <body>
- <%- include('partials/nav') %>
- <main>
- <section class="hero tile-light compact page-intro">
- <p class="eyebrow">Settings</p>
- <h1>系统设置</h1>
- <p class="lead">设备 ID 可单独配置,Topic 会自动生成。</p>
- </section>
- <% if (message) { %><div class="notice"><%= message %></div><% } %>
- <% if (error) { %><div class="notice notice-error"><%= error %></div><% } %>
- <section class="tile-parchment compact">
- <article class="utility-card wide">
- <form method="post" action="/settings" class="form-grid">
- <label>MQTT 地址<input name="mqtt_url" value="<%= config.mqtt_url %>" required></label>
- <label>Topic 版本<input name="topic_version" value="<%= config.topic_version %>" required></label>
- <label>产品标识<input name="product_key" value="<%= config.product_key %>" required></label>
- <label>设备 ID<input name="device_id" value="<%= config.device_id %>" required></label>
- <label>Web 端口<input name="server_port" type="number" value="<%= config.server_port %>" required></label>
- <label>日志保留天数<input name="log_retention_days" type="number" min="1" value="<%= config.log_retention_days %>" required></label>
- <% states.forEach((state) => { %>
- <label>灯<%= state.channel %> 名称<input name="channel_<%= state.channel %>_name" value="<%= state.name %>" required></label>
- <% }) %>
- <div class="form-actions">
- <button class="button-primary">保存设置</button>
- </div>
- </form>
- </article>
- <article class="utility-card wide topic-preview">
- <h2>当前 Topic</h2>
- <p>查询/控制:<code><%= topicConfig.commandPrefix %>/Power0</code></p>
- <p>状态回执:<code><%= topicConfig.statusTopic %></code></p>
- <p>设备上报:<code><%= topicConfig.telemetryTopic %></code></p>
- </article>
- </section>
- </main>
- </body>
- </html>
|