feat: set placeholder values in preset scripts

This commit is contained in:
Fu Diwei 2025-04-03 21:12:21 +08:00
parent ecff16c89d
commit 2899aa1b19
2 changed files with 10 additions and 10 deletions

View File

@ -142,8 +142,8 @@ const DeployNodeConfigFormLocalConfig = ({ form: formInst, formName, disabled, i
formInst.setFieldValue(
"preCommand",
`# 请将以下路径替换为实际值
cp "${formInst.getFieldValue("certPath")}" "${formInst.getFieldValue("certPath")}.bak" 2>/dev/null || :
cp "${formInst.getFieldValue("keyPath")}" "${formInst.getFieldValue("keyPath")}.bak" 2>/dev/null || :
cp "${formInst.getFieldValue("certPath") || "<your-cert-path>"}" "${formInst.getFieldValue("certPath") || "<your-cert-path>"}.bak" 2>/dev/null || :
cp "${formInst.getFieldValue("keyPath") || "<your-key-path>"}" "${formInst.getFieldValue("keyPath") || "<your-key-path>"}.bak" 2>/dev/null || :
`.trim()
);
}
@ -166,8 +166,8 @@ cp "${formInst.getFieldValue("keyPath")}" "${formInst.getFieldValue("keyPath")}.
formInst.setFieldValue(
"postCommand",
`# 请将以下变量替换为实际值
$pfxPath = "${formInst.getFieldValue("certPath")}" # PFX
$pfxPassword = "${formInst.getFieldValue("pfxPassword")}" # PFX
$pfxPath = "${formInst.getFieldValue("certPath") || "<your-cert-path>"}" # PFX
$pfxPassword = "${formInst.getFieldValue("pfxPassword") || "<your-pfx-password>"}" # PFX
$siteName = "<your-site-name>" # IIS
$domain = "<your-domain-name>" #
$ipaddr = "<your-binding-ip>" # IP* IP
@ -203,8 +203,8 @@ Remove-Item -Path "$pfxPath" -Force
formInst.setFieldValue(
"postCommand",
`# 请将以下变量替换为实际值
$pfxPath = "${formInst.getFieldValue("certPath")}" # PFX
$pfxPassword = "${formInst.getFieldValue("pfxPassword")}" # PFX
$pfxPath = "${formInst.getFieldValue("certPath") || "<your-cert-path>"}" # PFX
$pfxPassword = "${formInst.getFieldValue("pfxPassword") || "<your-pfx-password>"}" # PFX
$ipaddr = "<your-binding-ip>" # IP0.0.0.0 IP
$port = "<your-binding-port>" #
@ -232,8 +232,8 @@ Remove-Item -Path "$pfxPath" -Force
formInst.setFieldValue(
"postCommand",
`# 请将以下变量替换为实际值
$pfxPath = "${formInst.getFieldValue("certPath")}" # PFX
$pfxPassword = "${formInst.getFieldValue("pfxPassword")}" # PFX
$pfxPath = "${formInst.getFieldValue("certPath") || "<your-cert-path>"}" # PFX
$pfxPassword = "${formInst.getFieldValue("pfxPassword") || "<your-pfx-password>"}" # PFX
#
$cert = Import-PfxCertificate -FilePath "$pfxPath" -CertStoreLocation Cert:\\LocalMachine\\My -Password (ConvertTo-SecureString -String "$pfxPassword" -AsPlainText -Force) -Exportable

View File

@ -134,8 +134,8 @@ const DeployNodeConfigFormSSHConfig = ({ form: formInst, formName, disabled, ini
formInst.setFieldValue(
"preCommand",
`# 请将以下路径替换为实际值
cp "${formInst.getFieldValue("certPath")}" "${formInst.getFieldValue("certPath")}.bak" 2>/dev/null || :
cp "${formInst.getFieldValue("keyPath")}" "${formInst.getFieldValue("keyPath")}.bak" 2>/dev/null || :
cp "${formInst.getFieldValue("certPath") || "<your-cert-path>"}" "${formInst.getFieldValue("certPath") || "<your-cert-path>"}.bak" 2>/dev/null || :
cp "${formInst.getFieldValue("keyPath") || "<your-key-path>"}" "${formInst.getFieldValue("keyPath") || "<your-key-path>"}.bak" 2>/dev/null || :
`.trim()
);
}