670948f113
- CRITICAL: Change DNS zones endpoint from GET to POST to avoid leaking API token in URL query parameters - HIGH: Add sync.RWMutex to protect dnsProvider field in Server, Deployer, and proxy Manager against concurrent read/write races - HIGH: Capture old DNS provider reference synchronously before launching background cleanup goroutine - HIGH: Use getDNS()/getDNSProviderLocked() accessors instead of direct field reads in all DNS operations
61 lines
2.8 KiB
JavaScript
61 lines
2.8 KiB
JavaScript
import { a as attr, e as escape_html, b as attr_class, k as bind_props, g as stringify } from "./index.js";
|
|
function FormField($$renderer, $$props) {
|
|
$$renderer.component(($$renderer2) => {
|
|
let {
|
|
label,
|
|
name,
|
|
type = "text",
|
|
value = "",
|
|
placeholder = "",
|
|
required = false,
|
|
disabled = false,
|
|
error = "",
|
|
helpText = "",
|
|
oninput
|
|
} = $$props;
|
|
const inputBase = "w-full rounded-lg border px-3 py-2 text-sm transition-all duration-150 focus:outline-none focus:ring-2 bg-[var(--surface-input)] text-[var(--text-primary)] placeholder:text-[var(--text-tertiary)]";
|
|
const inputNormal = "border-[var(--border-input)] focus:ring-[var(--color-brand-500)] focus:border-[var(--color-brand-500)]";
|
|
const inputError = "border-[var(--color-danger)] focus:ring-[var(--color-danger)]";
|
|
const inputDisabled = "opacity-60 cursor-not-allowed bg-[var(--surface-card-hover)]";
|
|
$$renderer2.push(`<div class="flex flex-col gap-1.5"><label${attr("for", name)} class="text-sm font-medium text-[var(--text-primary)]">${escape_html(label)} `);
|
|
if (required) {
|
|
$$renderer2.push("<!--[0-->");
|
|
$$renderer2.push(`<span class="text-[var(--color-danger)]">*</span>`);
|
|
} else {
|
|
$$renderer2.push("<!--[-1-->");
|
|
}
|
|
$$renderer2.push(`<!--]--></label> `);
|
|
if (type === "textarea") {
|
|
$$renderer2.push("<!--[0-->");
|
|
$$renderer2.push(`<textarea${attr("id", name)}${attr("name", name)}${attr("placeholder", placeholder)}${attr("required", required, true)}${attr("disabled", disabled, true)}${attr_class(`${stringify(inputBase)} ${stringify(error ? inputError : inputNormal)} ${stringify(disabled ? inputDisabled : "")}`)} rows="3">`);
|
|
const $$body = escape_html(value);
|
|
if ($$body) {
|
|
$$renderer2.push(`${$$body}`);
|
|
}
|
|
$$renderer2.push(`</textarea>`);
|
|
} else {
|
|
$$renderer2.push("<!--[-1-->");
|
|
$$renderer2.push(`<input${attr("id", name)}${attr("name", name)}${attr("type", type)}${attr("value", value)}${attr("placeholder", placeholder)}${attr("required", required, true)}${attr("disabled", disabled, true)}${attr_class(`${stringify(inputBase)} ${stringify(error ? inputError : inputNormal)} ${stringify(disabled ? inputDisabled : "")}`)}/>`);
|
|
}
|
|
$$renderer2.push(`<!--]--> `);
|
|
if (error) {
|
|
$$renderer2.push("<!--[0-->");
|
|
$$renderer2.push(`<p class="text-xs text-[var(--color-danger)]">${escape_html(error)}</p>`);
|
|
} else {
|
|
$$renderer2.push("<!--[-1-->");
|
|
}
|
|
$$renderer2.push(`<!--]--> `);
|
|
if (helpText && !error) {
|
|
$$renderer2.push("<!--[0-->");
|
|
$$renderer2.push(`<p class="text-xs text-[var(--text-tertiary)]">${escape_html(helpText)}</p>`);
|
|
} else {
|
|
$$renderer2.push("<!--[-1-->");
|
|
}
|
|
$$renderer2.push(`<!--]--></div>`);
|
|
bind_props($$props, { value });
|
|
});
|
|
}
|
|
export {
|
|
FormField as F
|
|
};
|