xiaohongshufabu/extension/popup/popup.html
2026-07-21 21:17:20 +08:00

150 lines
4.0 KiB
HTML

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
width: 340px;
font-family: -apple-system, "Microsoft YaHei", sans-serif;
background: #f8f9fa;
color: #333;
}
.header {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 16px;
text-align: center;
}
.header h1 { font-size: 16px; margin-bottom: 4px; }
.header p { font-size: 11px; opacity: 0.85; }
.status-bar {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px 16px;
background: white;
border-bottom: 1px solid #eee;
}
.status-bar .label { font-size: 13px; color: #666; }
.status-bar .value { font-size: 14px; font-weight: 600; }
.dot {
display: inline-block;
width: 8px; height: 8px;
border-radius: 50%;
margin-right: 6px;
}
.dot-green { background: #22c55e; }
.dot-red { background: #ef4444; }
.dot-gray { background: #9ca3af; }
.stats {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
gap: 8px;
padding: 12px 16px;
}
.stat-card {
background: white;
border-radius: 8px;
padding: 10px;
text-align: center;
box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.stat-card .num { font-size: 22px; font-weight: 700; color: #333; }
.stat-card .lbl { font-size: 11px; color: #999; margin-top: 2px; }
.config-section {
padding: 12px 16px;
background: white;
border-top: 1px solid #eee;
}
.config-section label {
display: block;
font-size: 12px;
color: #666;
margin-bottom: 4px;
margin-top: 8px;
}
.config-section label:first-child { margin-top: 0; }
.config-section input {
width: 100%;
padding: 6px 10px;
border: 1px solid #ddd;
border-radius: 6px;
font-size: 13px;
}
.actions {
padding: 12px 16px;
display: flex;
gap: 8px;
}
.btn {
flex: 1;
padding: 10px;
border: none;
border-radius: 8px;
font-size: 13px;
font-weight: 600;
cursor: pointer;
transition: opacity 0.2s;
}
.btn:hover { opacity: 0.85; }
.btn-primary { background: #667eea; color: white; }
.btn-danger { background: #ef4444; color: white; }
.btn-secondary { background: #e5e7eb; color: #333; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.connection-test {
padding: 8px 16px;
font-size: 11px;
text-align: center;
}
.connection-test .ok { color: #22c55e; }
.connection-test .fail { color: #ef4444; }
</style>
</head>
<body>
<div class="header">
<h1>🚀 千帆发布助手</h1>
<p>小红书千帆店铺矩阵发布工具</p>
</div>
<div class="status-bar">
<span class="label">
<span class="dot" id="statusDot"></span>
<span id="statusText">未运行</span>
</span>
<span class="value" id="todayCount">0 / 0</span>
</div>
<div class="stats">
<div class="stat-card">
<div class="num" id="statToday">0</div>
<div class="lbl">今日已发布</div>
</div>
<div class="stat-card">
<div class="num" id="statPending">0</div>
<div class="lbl">待发布</div>
</div>
<div class="stat-card">
<div class="num" id="statFails">0</div>
<div class="lbl">连续失败</div>
</div>
</div>
<div class="config-section">
<label>店铺 ID</label>
<input type="text" id="shopId" placeholder="小红书千帆店铺ID" />
<label>本地服务地址</label>
<input type="text" id="serverUrl" placeholder="http://localhost:3000" />
</div>
<div class="connection-test" id="connTest"></div>
<div class="actions">
<button class="btn btn-primary" id="btnToggle">启动</button>
<button class="btn btn-secondary" id="btnTest">测试连接</button>
</div>
<script src="popup.js"></script>
</body>
</html>