mirror of
https://github.com/Moepchi/webspeak3.git
synced 2026-12-01 00:42:49 +08:00
Design Store: moderation queue and stricter CSS check (S4, S13)
New submissions are "pending" until approved by the STORE_ADMIN_TOKEN holder via the new /api/store/admin review page (CSS shown as text only). Theme CSS is normalized (comments, escapes, case) before checking and may no longer load anything: no @import/@font-face, no image-set()/src()/etc., url() only for inline data: images. Already-approved themes failing the new check are hidden. Store file is written atomically. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
This commit is contained in:
1 parent
b87eb0f4b7
commit
57447fdd11
8 files changed
+179
-34
No files matched your search
+4
-2
@@ -5487,7 +5487,7 @@ function DesignStorePanel({
|
||||
() => localStorage.getItem(STORE_ADMIN_TOKEN_KEY) ?? ""
|
||||
);
|
||||
const [publishing, setPublishing] = useState(false);
|
||||
const [publishResult, setPublishResult] = useState<"ok" | "error" | null>(null);
|
||||
const [publishResult, setPublishResult] = useState<"ok" | "pending" | "error" | null>(null);
|
||||
const [ratedIds, setRatedIds] = useState<Set<string>>(new Set());
|
||||
|
||||
const refreshThemes = () =>
|
||||
@@ -5567,7 +5567,8 @@ function DesignStorePanel({
|
||||
}),
|
||||
});
|
||||
if (!res.ok) throw new Error(String(res.status));
|
||||
setPublishResult("ok");
|
||||
const body = (await res.json().catch(() => ({}))) as { status?: string };
|
||||
setPublishResult(body.status === "pending" ? "pending" : "ok");
|
||||
setPublishAuthor("");
|
||||
setPublishDescription("");
|
||||
setPublishScreenshot(null);
|
||||
@@ -5715,6 +5716,7 @@ function DesignStorePanel({
|
||||
{t("design.store.publish.submit")}
|
||||
</button>
|
||||
{publishResult === "ok" && <p className="ts-options-subtitle">{t("design.store.publish.success")}</p>}
|
||||
{publishResult === "pending" && <p className="ts-options-subtitle">{t("design.store.publish.pending")}</p>}
|
||||
{publishResult === "error" && <p className="ts-options-subtitle">{t("design.store.publish.error")}</p>}
|
||||
</>
|
||||
)}
|
||||
|
||||
Reference in new issue
Block a user