updateRuleParamsSection function
Last updated: 2026-03-04T23:21:38.433Z
Location
Metrics
LOC: 32
Complexity: 10
Params: 1
Signature
updateRuleParamsSection(existingParams?: GeneratorParams): : void
Source Code
function updateRuleParamsSection(existingParams?: GeneratorParams): void {
const container = document.getElementById("rule-params-container");
const fieldsDiv = document.getElementById("rule-params-fields");
if (!container || !fieldsDiv) return;
const generatorValue = ruleGeneratorSelect?.getValue() ?? "";
if (
!generatorValue ||
generatorValue === "auto" ||
generatorValue === "ai" ||
generatorValue === "tensorflow"
) {
container.style.display = "none";
fieldsDiv.innerHTML = "";
return;
}
const generatorKey = getGeneratorKey(generatorValue as FieldType);
const paramDefs = generatorKey ? getGeneratorParamDefs(generatorKey) : [];
if (paramDefs.length === 0) {
container.style.display = "none";
fieldsDiv.innerHTML = "";
return;
}
fieldsDiv.innerHTML = paramDefs
.map((def) => renderOptionParamField(def, existingParams))
.join("");
container.style.display = "block";
}
Dependencies (Outgoing)
| Target | Type |
|---|---|
| renderOptionParamField | calls |
Impact (Incoming)
| Source | Type |
|---|---|
| editRule | calls |
| cancelEditRule | calls |
| bindRulesEvents | calls |