style: format web/src with oxfmt defaults (via vp fmt)
One-time mechanical sweep, isolated from any functional change. - oxfmt defaults: double quotes, semicolons, 2-space indent, LF, printWidth 100, trailing commas, bracket spacing, arrow parens. - vite.config.ts gains an fmt.ignorePatterns block for web/static: vendored/minified assets (htmx.min.js, compiled css) must never be reformatted. - Verified: rebuild after the sweep produces byte-identical JS/CSS bundles; only sourcemaps changed (they embed sourcesContent).
This commit is contained in:
1 parent
8aeecaa0ef
commit
77cd268f4e
37 files changed
+1151
-1853
No files matched your search
+18
-41
@@ -146,24 +146,14 @@ async function handleCreateRule(event: Event): Promise<void> {
|
||||
if (!token || !collectionId) return;
|
||||
|
||||
const fieldInput = document.getElementById("rule-field") as HTMLSelectElement;
|
||||
const operatorInput = document.getElementById(
|
||||
"rule-operator",
|
||||
) as HTMLSelectElement;
|
||||
const operatorInput = document.getElementById("rule-operator") as HTMLSelectElement;
|
||||
const valueInput = document.getElementById("rule-value") as HTMLInputElement;
|
||||
const enabledInput = document.getElementById(
|
||||
"rule-enabled",
|
||||
) as HTMLInputElement;
|
||||
const enabledInput = document.getElementById("rule-enabled") as HTMLInputElement;
|
||||
const priorityInput = document.querySelector(
|
||||
'input[name="priority"]:checked',
|
||||
) as HTMLInputElement;
|
||||
|
||||
if (
|
||||
!fieldInput ||
|
||||
!operatorInput ||
|
||||
!valueInput ||
|
||||
!enabledInput ||
|
||||
!priorityInput
|
||||
) {
|
||||
if (!fieldInput || !operatorInput || !valueInput || !enabledInput || !priorityInput) {
|
||||
showToast("Missing form fields", "error");
|
||||
return;
|
||||
}
|
||||
@@ -204,9 +194,7 @@ async function testRule(): Promise<void> {
|
||||
if (!token) return;
|
||||
|
||||
const fieldInput = document.getElementById("rule-field") as HTMLSelectElement;
|
||||
const operatorInput = document.getElementById(
|
||||
"rule-operator",
|
||||
) as HTMLSelectElement;
|
||||
const operatorInput = document.getElementById("rule-operator") as HTMLSelectElement;
|
||||
const valueInput = document.getElementById("rule-value") as HTMLInputElement;
|
||||
|
||||
if (!fieldInput || !operatorInput || !valueInput) {
|
||||
@@ -256,8 +244,7 @@ async function testRule(): Promise<void> {
|
||||
'<p style="color: var(--text-secondary); font-size: 0.875rem;">Found ' +
|
||||
result.matches.length +
|
||||
" matching books:</p>";
|
||||
html +=
|
||||
'<div style="display: flex; flex-direction: column; gap: 0.5rem;">';
|
||||
html += '<div style="display: flex; flex-direction: column; gap: 0.5rem;">';
|
||||
|
||||
result.matches.slice(0, 20).forEach((book: TestRuleMatch) => {
|
||||
html +=
|
||||
@@ -316,17 +303,14 @@ async function toggleRule(ruleId: string, enabled: boolean): Promise<void> {
|
||||
if (!token || !collectionId) return;
|
||||
|
||||
try {
|
||||
const response = await fetch(
|
||||
`/api/collections/${collectionId}/rules/${ruleId}`,
|
||||
{
|
||||
method: "PUT",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Authorization: `Bearer ${token}`,
|
||||
},
|
||||
body: JSON.stringify({ enabled }),
|
||||
const response = await fetch(`/api/collections/${collectionId}/rules/${ruleId}`, {
|
||||
method: "PUT",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Authorization: `Bearer ${token}`,
|
||||
},
|
||||
);
|
||||
body: JSON.stringify({ enabled }),
|
||||
});
|
||||
|
||||
if (response.ok) {
|
||||
showToast("Rule updated", "success");
|
||||
@@ -347,13 +331,10 @@ async function deleteRule(ruleId: string): Promise<void> {
|
||||
if (!token || !collectionId) return;
|
||||
|
||||
try {
|
||||
const response = await fetch(
|
||||
`/api/collections/${collectionId}/rules/${ruleId}`,
|
||||
{
|
||||
method: "DELETE",
|
||||
headers: { Authorization: `Bearer ${token}` },
|
||||
},
|
||||
);
|
||||
const response = await fetch(`/api/collections/${collectionId}/rules/${ruleId}`, {
|
||||
method: "DELETE",
|
||||
headers: { Authorization: `Bearer ${token}` },
|
||||
});
|
||||
|
||||
if (response.ok) {
|
||||
showToast("Rule deleted", "success");
|
||||
@@ -369,13 +350,9 @@ async function deleteRule(ruleId: string): Promise<void> {
|
||||
|
||||
function clearForm(): void {
|
||||
const fieldInput = document.getElementById("rule-field") as HTMLSelectElement;
|
||||
const operatorInput = document.getElementById(
|
||||
"rule-operator",
|
||||
) as HTMLSelectElement;
|
||||
const operatorInput = document.getElementById("rule-operator") as HTMLSelectElement;
|
||||
const valueInput = document.getElementById("rule-value") as HTMLInputElement;
|
||||
const enabledInput = document.getElementById(
|
||||
"rule-enabled",
|
||||
) as HTMLInputElement;
|
||||
const enabledInput = document.getElementById("rule-enabled") as HTMLInputElement;
|
||||
const priorityInput = document.querySelector(
|
||||
'input[name="priority"][value="2"]',
|
||||
) as HTMLInputElement;
|
||||
|
||||
Reference in new issue
Block a user