fix: 首页去掉地市分布
This commit is contained in:
+1
-1
@@ -29,7 +29,7 @@ Vue 3、TypeScript、Naive UI。Node.js 只用于安装依赖、本地开发和
|
||||
## Capabilities and Constraints
|
||||
|
||||
- 用户功能:提交任务,取得结果文件。多个任务可以并行,也可以排队。
|
||||
- 管理功能:首页运行面板查看大数据账号池指标(总数、新增、有效、失效、未退出、地市分布)。选择登录方式,管理用户,管理大数据账号池,设置凭证刷新间隔和并行数量,手动添加账号。大数据账号池里的账号只有用户级别,不能设为管理员。并行数量范围是 1 到 32,采集和导出共用。调大后马上多领任务。调小后不中断正在运行的任务,等它们结束后再降到新的数量。用户管理可为用户角色改密;管理员账号只能由本人修改。
|
||||
- 管理功能:首页运行面板查看大数据账号池指标(总数、新增、有效、失效、未退出)。选择登录方式,管理用户,管理大数据账号池,设置凭证刷新间隔和并行数量,手动添加账号。大数据账号池里的账号只有用户级别,不能设为管理员。并行数量范围是 1 到 32,采集和导出共用。调大后马上多领任务。调小后不中断正在运行的任务,等它们结束后再降到新的数量。用户管理可为用户角色改密;管理员账号只能由本人修改。
|
||||
- 登录先看账号名。账号名与本系统管理员一致时,只校验本系统密码,不处理图形验证码,也不交给大数据平台。密码不正确就停在这里。
|
||||
- 其余账号只启用一种登录方式。大数据平台登录时,登录页直接显示图形验证码,登录失败后更换验证码;登录成功后该账号进入账号池。自有账号由管理员添加,不能自行注册,登录不显示验证码,也不发送手机验证码。
|
||||
- 操作结果用 toast 提示。最短显示 2.5 秒;超过 6 个字后,每多一个字加 0.3 秒;最长 8 秒。每条可以单独关闭。
|
||||
|
||||
@@ -530,7 +530,6 @@ def _pool_dashboard(rows: list[NqiAccount]) -> dict:
|
||||
today = utcnow().date()
|
||||
week_start = today - timedelta(days=6)
|
||||
daily = {(today - timedelta(days=offset)).isoformat(): 0 for offset in range(13, -1, -1)}
|
||||
cities: dict[str, int] = {}
|
||||
added_today = 0
|
||||
added_week = 0
|
||||
for row in rows:
|
||||
@@ -544,8 +543,6 @@ def _pool_dashboard(rows: list[NqiAccount]) -> dict:
|
||||
added_today += 1
|
||||
if week_start <= day <= today:
|
||||
added_week += 1
|
||||
city = str(row.city_name or "").strip() or "未填写"
|
||||
cities[city] = cities.get(city, 0) + 1
|
||||
return {
|
||||
"total": len(rows),
|
||||
"valid": sum(1 for row in rows if row.credential_valid),
|
||||
@@ -555,7 +552,6 @@ def _pool_dashboard(rows: list[NqiAccount]) -> dict:
|
||||
"addedToday": added_today,
|
||||
"addedWeek": added_week,
|
||||
"dailyAdded": [{"date": date, "count": count} for date, count in daily.items()],
|
||||
"cities": [{"name": name, "count": count} for name, count in sorted(cities.items(), key=lambda item: (-item[1], item[0]))],
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ interface PoolDash {
|
||||
addedToday: number;
|
||||
addedWeek: number;
|
||||
dailyAdded: { date: string; count: number }[];
|
||||
cities: { name: string; count: number }[];
|
||||
}
|
||||
|
||||
function emptyPool(): PoolDash {
|
||||
@@ -29,7 +28,6 @@ function emptyPool(): PoolDash {
|
||||
addedToday: 0,
|
||||
addedWeek: 0,
|
||||
dailyAdded: [],
|
||||
cities: [],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -43,7 +41,6 @@ function readPool(result: unknown): PoolDash | null {
|
||||
...blank,
|
||||
...source,
|
||||
dailyAdded: Array.isArray(source.dailyAdded) ? source.dailyAdded : blank.dailyAdded,
|
||||
cities: Array.isArray(source.cities) ? source.cities : blank.cities,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -127,31 +124,6 @@ const statusOption = computed<EChartsCoreOption>(() => {
|
||||
};
|
||||
});
|
||||
|
||||
const cityOption = computed<EChartsCoreOption>(() => {
|
||||
const colors = theme();
|
||||
void isDark.value;
|
||||
const rows = stats.value.cities.slice(0, 8);
|
||||
return {
|
||||
color: [colors.accent],
|
||||
tooltip: { trigger: "axis" },
|
||||
grid: { left: 56, right: 16, top: 16, bottom: 28 },
|
||||
xAxis: { type: "value", minInterval: 1, ...axis(colors) },
|
||||
yAxis: {
|
||||
type: "category",
|
||||
data: rows.map((item) => item.name),
|
||||
inverse: true,
|
||||
...axis(colors),
|
||||
},
|
||||
series: [{
|
||||
type: "bar",
|
||||
name: "账号",
|
||||
barMaxWidth: 16,
|
||||
data: rows.map((item) => item.count),
|
||||
itemStyle: { borderRadius: [0, 3, 3, 0] },
|
||||
}],
|
||||
};
|
||||
});
|
||||
|
||||
async function load() {
|
||||
try {
|
||||
const next = readPool(await api<unknown>("/api/admin/dashboard"));
|
||||
@@ -187,10 +159,6 @@ onMounted(load);
|
||||
<h3>凭证状态</h3>
|
||||
<ChartPane :option="statusOption" />
|
||||
</section>
|
||||
<section class="surface dash-card dash-wide">
|
||||
<h3>地市分布</h3>
|
||||
<ChartPane :option="cityOption" />
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
@@ -175,7 +175,6 @@ button, input, select { font: inherit; }
|
||||
font-size: 13px;
|
||||
font-weight: 650;
|
||||
}
|
||||
.dash-wide { grid-column: 1 / -1; }
|
||||
.dash-chart { height: 260px; }
|
||||
|
||||
@media (max-width: 1100px) {
|
||||
|
||||
Reference in New Issue
Block a user