修改部份ui

This commit is contained in:
Azmat@qq.com
2026-08-18 18:32:19 +08:00
parent dfe94a923e
commit 18b3927817
19 changed files with 2151 additions and 681 deletions
+23
View File
@@ -0,0 +1,23 @@
import { chromium } from "playwright";
import { mkdirSync } from "node:fs";
const BASE = process.env.BASE || "http://127.0.0.1:5173";
const API = process.env.API || "http://127.0.0.1:8010";
const OUT = process.argv[2] || "shots-proj-yz";
mkdirSync(OUT, { recursive: true });
const login = await (await fetch(`${API}/api/auth/login/`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ username: "airshelf", password: "Restraint2026" })
})).json();
const browser = await chromium.launch();
const ctx = await browser.newContext({ viewport: { width: 1440, height: 900 }, deviceScaleFactor: 2 });
await ctx.addInitScript((t) => localStorage.setItem("airshelf_token", t), login.token);
const page = await ctx.newPage();
await page.goto(`${BASE}/projects`, { waitUntil: "networkidle", timeout: 40000 });
await page.waitForTimeout(2000);
await page.screenshot({ path: `${OUT}/projects-yz-preview.png`, fullPage: false });
console.log("shot projects-yz-preview");
await browser.close();