add proxy rewrite / replace multiline input

Signed-off-by: Ronni Skansing <rskansing@gmail.com>
This commit is contained in:
Ronni Skansing
2026-02-04 21:47:18 +01:00
parent 59ba815aa8
commit c7b48e520c
2 changed files with 12 additions and 14 deletions
@@ -449,7 +449,7 @@
// serialize to YAML with js-yaml
return jsyaml.dump(output, {
indent: 2,
lineWidth: -1, // don't wrap long lines
lineWidth: 120, // allow block scalars for multiline strings
quotingType: "'", // prefer single quotes
forceQuotes: false, // only quote when necessary
noRefs: true // don't use YAML references
@@ -1060,7 +1060,7 @@
// serialize to YAML
const yamlContent = jsyaml.dump(output, {
indent: 2,
lineWidth: -1,
lineWidth: 120, // allow block scalars for multiline strings
quotingType: "'",
forceQuotes: false,
noRefs: true
@@ -1985,8 +1985,8 @@
{/if}
</div>
<div class="field-wrapper full">
<TextField
width="full"
<TextareaField
fullWidth
bind:value={rule.replace}
placeholder={rule.engine === 'dom'
? rule.action === 'setAttr'
@@ -1995,9 +1995,7 @@
? ''
: 'New content'
: 'phishing.com'}
error={hasError(
`hosts.${expandedHostIndex}.rewrite.${ruleIndex}.replace`
)}
height="medium"
>
{#if rule.engine === 'dom' && rule.action === 'setAttr'}
Value (attr:value)
@@ -2006,7 +2004,7 @@
{:else}
Replace
{/if}
</TextField>
</TextareaField>
{#if hasError(`hosts.${expandedHostIndex}.rewrite.${ruleIndex}.replace`)}
<span class="field-error"
>{getError(
@@ -2772,8 +2770,8 @@
{/if}
</div>
<div class="field-wrapper full">
<TextField
width="full"
<TextareaField
fullWidth
bind:value={rule.replace}
placeholder={rule.engine === 'dom'
? rule.action === 'setAttr'
@@ -2782,7 +2780,7 @@
? ''
: 'New content'
: 'phishing.com'}
error={hasError(`global.rewrite.${i}.replace`)}
height="medium"
>
{#if rule.engine === 'dom' && rule.action === 'setAttr'}
Value (attr:value)
@@ -2791,7 +2789,7 @@
{:else}
Replace
{/if}
</TextField>
</TextareaField>
{#if hasError(`global.rewrite.${i}.replace`)}
<span class="field-error"
>{getError(`global.rewrite.${i}.replace`)}</span
+2 -2
View File
@@ -107,7 +107,7 @@
// serialize back to YAML without _meta for the config
const cleanYaml = jsyaml.default.dump(parsed, {
indent: 2,
lineWidth: -1,
lineWidth: 120,
quotingType: "'",
forceQuotes: false,
noRefs: true
@@ -149,7 +149,7 @@
// serialize to YAML
const yamlContent = jsyaml.default.dump(output, {
indent: 2,
lineWidth: -1,
lineWidth: 120,
quotingType: "'",
forceQuotes: false,
noRefs: true