Add proxy parameter filters for URLTest and Priority
This commit is contained in:
@@ -11,6 +11,8 @@ fail() {
|
||||
|
||||
wrapper_styles="$(sed -n '/^\.fkp-button-add-dynlist > \.add-item {$/,/^}$/p' "$SECTION_JS")"
|
||||
button_styles="$(sed -n '/^\.fkp-button-add-dynlist > \.add-item > \.cbi-button-add {$/,/^}$/p' "$SECTION_JS")"
|
||||
urltest_options="$(sed -n '/^function addUrlTestItemOptions(/,/^function priorityLevelSettingsForValidation(/p' "$SECTION_JS")"
|
||||
priority_options="$(sed -n '/^function addPriorityLevelItemOptions(/,/^function addPriorityGroupItemOptions(/p' "$SECTION_JS")"
|
||||
|
||||
grep -Fq 'display: flex;' <<<"$wrapper_styles" ||
|
||||
fail "button-only DynamicList add rows must use a content-sized flex wrapper"
|
||||
@@ -30,4 +32,22 @@ grep -Fq 'max-width: 100% !important;' <<<"$button_styles" ||
|
||||
grep -Fq 'text-overflow: ellipsis !important;' <<<"$button_styles" ||
|
||||
fail "button-only DynamicList labels must truncate instead of overflowing"
|
||||
|
||||
grep -Fq 'if (key === "include_regex") {' <<<"$urltest_options" ||
|
||||
fail "URLTest include proxy parameters must follow the include regex option"
|
||||
grep -Fq 'else if (key === "exclude_regex") {' <<<"$urltest_options" ||
|
||||
fail "URLTest exclude proxy parameters must follow the exclude regex option"
|
||||
grep -Fq 'if (key === "regex") {' <<<"$priority_options" ||
|
||||
fail "Priority include proxy parameters must follow the include regex option"
|
||||
grep -Fq 'else if (key === "exclude_regex") {' <<<"$priority_options" ||
|
||||
fail "Priority exclude proxy parameters must follow the exclude regex option"
|
||||
grep -Fq '["direct", "Direct"]' "$SECTION_JS" ||
|
||||
fail "proxy protocol choices must keep Direct untranslated"
|
||||
grep -Fq '["none", "None"]' "$SECTION_JS" ||
|
||||
fail "proxy security choices must keep None untranslated"
|
||||
grep -Fq '_("Security")' "$SECTION_JS" ||
|
||||
fail "proxy parameter filters must use the short Security label"
|
||||
if grep -Fq 'Connection security' "$SECTION_JS"; then
|
||||
fail "proxy parameter filter copy must not mention connection security"
|
||||
fi
|
||||
|
||||
printf 'LuCI DynamicList layout checks passed\n'
|
||||
|
||||
Reference in New Issue
Block a user