165 lines
8.6 KiB
HTML
165 lines
8.6 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}账号详情 - 微博超话签到{% endblock %}
|
|
|
|
{% block extra_css %}
|
|
<style>
|
|
.detail-header {
|
|
display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px;
|
|
}
|
|
.detail-header h1 { font-size: 24px; font-weight: 700; color: #1e293b; }
|
|
.info-grid {
|
|
display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 24px;
|
|
}
|
|
@media (max-width: 768px) { .info-grid { grid-template-columns: 1fr; } }
|
|
.info-table td { padding: 12px 0; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
|
|
.info-table td:first-child { font-weight: 600; color: #64748b; width: 30%; }
|
|
.action-btn {
|
|
width: 100%; padding: 12px; border-radius: 14px; border: none;
|
|
font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s;
|
|
text-align: center; text-decoration: none; display: block;
|
|
}
|
|
.action-btn-primary {
|
|
background: linear-gradient(135deg, #6366f1, #818cf8); color: white;
|
|
box-shadow: 0 2px 8px rgba(99,102,241,0.25);
|
|
}
|
|
.action-btn-primary:hover { box-shadow: 0 4px 16px rgba(99,102,241,0.35); transform: translateY(-1px); }
|
|
.action-btn-secondary { background: #f1f5f9; color: #475569; }
|
|
.action-btn-secondary:hover { background: #e2e8f0; }
|
|
.task-row {
|
|
display: flex; align-items: center; justify-content: space-between;
|
|
padding: 14px 0; border-bottom: 1px solid #f1f5f9;
|
|
}
|
|
.task-row:last-child { border-bottom: none; }
|
|
.task-cron {
|
|
font-family: 'SF Mono', Monaco, monospace; background: #eef2ff; color: #6366f1;
|
|
padding: 4px 12px; border-radius: 10px; font-size: 13px; font-weight: 600;
|
|
}
|
|
.task-actions { display: flex; gap: 8px; }
|
|
.task-actions .btn { padding: 6px 14px; font-size: 12px; border-radius: 10px; }
|
|
.log-row {
|
|
display: grid; grid-template-columns: 1fr auto auto auto; gap: 16px;
|
|
align-items: center; padding: 12px 0; border-bottom: 1px solid #f1f5f9; font-size: 14px;
|
|
}
|
|
.log-row:last-child { border-bottom: none; }
|
|
</style>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<div style="max-width: 960px; margin: 0 auto;">
|
|
<div class="detail-header">
|
|
<div>
|
|
<h1>{{ account.remark or account.weibo_user_id }}</h1>
|
|
<div style="color:#94a3b8; font-size:14px; margin-top:4px;">UID: {{ account.weibo_user_id }}</div>
|
|
</div>
|
|
<div style="display:flex; gap:10px;">
|
|
<a href="{{ url_for('edit_account', account_id=account.id) }}" class="btn btn-secondary">✏️ 编辑</a>
|
|
<form method="POST" action="{{ url_for('delete_account', account_id=account.id) }}" style="display:inline;" onsubmit="return confirm('确定要删除此账号吗?');">
|
|
<button type="submit" class="btn btn-danger">删除</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="info-grid">
|
|
<div class="card">
|
|
<div class="card-header">📋 账号信息</div>
|
|
<table class="info-table" style="width:100%;">
|
|
<tr>
|
|
<td>状态</td>
|
|
<td>
|
|
{% if account.status == 'active' %}<span class="badge badge-success">正常</span>
|
|
{% elif account.status == 'pending' %}<span class="badge badge-warning">待验证</span>
|
|
{% elif account.status == 'invalid_cookie' %}<span class="badge badge-danger">Cookie 失效</span>
|
|
{% elif account.status == 'banned' %}<span class="badge badge-danger">已封禁</span>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
<tr><td>备注</td><td>{{ account.remark or '-' }}</td></tr>
|
|
<tr><td>添加时间</td><td>{{ account.created_at[:10] }}</td></tr>
|
|
<tr><td>上次检查</td><td>{{ account.last_checked_at[:10] if account.last_checked_at else '-' }}</td></tr>
|
|
</table>
|
|
</div>
|
|
<div class="card">
|
|
<div class="card-header">⚡ 快捷操作</div>
|
|
<div style="display:flex; flex-direction:column; gap:10px;">
|
|
<form method="POST" action="{{ url_for('verify_account', account_id=account.id) }}">
|
|
<button type="submit" class="action-btn action-btn-secondary">🔍 验证 Cookie</button>
|
|
</form>
|
|
<form method="POST" action="{{ url_for('manual_signin', account_id=account.id) }}" onsubmit="this.querySelector('button').disabled=true; this.querySelector('button').textContent='⏳ 签到中...';">
|
|
<button type="submit" class="action-btn action-btn-primary">🚀 立即签到</button>
|
|
</form>
|
|
<a href="{{ url_for('add_task', account_id=account.id) }}" class="action-btn action-btn-secondary">⏰ 添加定时任务</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<div class="card-header">⏰ 定时任务</div>
|
|
{% if tasks %}
|
|
{% for task in tasks %}
|
|
<div class="task-row">
|
|
<div style="display:flex; align-items:center; gap:12px;">
|
|
<span class="task-cron">{{ task.cron_expression }}</span>
|
|
{% if task.is_enabled %}<span class="badge badge-success">已启用</span>
|
|
{% else %}<span class="badge badge-warning">已禁用</span>{% endif %}
|
|
</div>
|
|
<div class="task-actions">
|
|
<form method="POST" action="{{ url_for('toggle_task', task_id=task.id) }}" style="display:inline;">
|
|
<input type="hidden" name="account_id" value="{{ account.id }}">
|
|
<input type="hidden" name="is_enabled" value="{{ task.is_enabled|lower }}">
|
|
<button type="submit" class="btn btn-secondary">{% if task.is_enabled %}禁用{% else %}启用{% endif %}</button>
|
|
</form>
|
|
<form method="POST" action="{{ url_for('delete_task', task_id=task.id) }}" style="display:inline;" onsubmit="return confirm('确定要删除此任务吗?');">
|
|
<input type="hidden" name="account_id" value="{{ account.id }}">
|
|
<button type="submit" class="btn btn-danger">删除</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
{% else %}
|
|
<p style="color:#94a3b8; text-align:center; padding:24px; font-size:14px;">暂无定时任务</p>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="card">
|
|
<div class="card-header">📝 签到记录</div>
|
|
{% if logs['items'] %}
|
|
{% for log in logs['items'] %}
|
|
<div class="log-row">
|
|
<div style="font-weight:500; color:#1e293b;">{{ log.topic_title or '-' }}</div>
|
|
<div>
|
|
{% if log.status == 'success' %}<span class="badge badge-success">签到成功</span>
|
|
{% elif log.status == 'failed_already_signed' %}<span class="badge badge-info">今日已签</span>
|
|
{% elif log.status == 'failed_network' %}<span class="badge badge-warning">网络错误</span>
|
|
{% elif log.status == 'failed_banned' %}<span class="badge badge-danger">已封禁</span>
|
|
{% endif %}
|
|
</div>
|
|
<div style="font-size:13px; color:#64748b;">
|
|
{% if log.reward_info %}{{ log.reward_info.get('points', '-') }} 经验{% else %}-{% endif %}
|
|
</div>
|
|
<div style="color:#94a3b8; font-size:13px;">{{ log.signed_at[:10] }}</div>
|
|
</div>
|
|
{% endfor %}
|
|
{% if logs['total'] > logs['size'] %}
|
|
<div class="pagination">
|
|
{% if logs['page'] > 1 %}
|
|
<a href="?page=1">首页</a>
|
|
<a href="?page={{ logs['page'] - 1 }}">上一页</a>
|
|
{% endif %}
|
|
{% for p in range(max(1, logs['page'] - 2), min(logs['total'] // logs['size'] + 2, logs['page'] + 3)) %}
|
|
{% if p == logs['page'] %}<span class="active">{{ p }}</span>
|
|
{% else %}<a href="?page={{ p }}">{{ p }}</a>{% endif %}
|
|
{% endfor %}
|
|
{% if logs['page'] < logs['total'] // logs['size'] + 1 %}
|
|
<a href="?page={{ logs['page'] + 1 }}">下一页</a>
|
|
<a href="?page={{ logs['total'] // logs['size'] + 1 }}">末页</a>
|
|
{% endif %}
|
|
</div>
|
|
{% endif %}
|
|
{% else %}
|
|
<p style="color:#94a3b8; text-align:center; padding:24px; font-size:14px;">暂无签到记录</p>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|