From c1f7a81e4ba36118d7c9c3f695713773a9d79398 Mon Sep 17 00:00:00 2001 From: zhaojun <873019219@qq.com> Date: Wed, 13 Nov 2024 14:56:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8D=90=E8=B5=A0=E7=89=88=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- component/ComputeCommandNew.js | 49 ++++++++++++++ docs/changelog/pro.mdx | 35 ++++++++++ docs/install/pro-baota.mdx | 78 ++++++++++++++-------- docs/install/pro-docker.mdx | 16 +++-- docs/install/pro-linux.mdx | 89 ++++++++++++-------------- docs/install/pro-windows.mdx | 30 ++------- static/img/2024/11/09/pro-baota-1.png | Bin 0 -> 132616 bytes static/img/2024/11/09/pro-baota-2.png | Bin 0 -> 60076 bytes static/img/2024/support/img.png | Bin 0 -> 131042 bytes 9 files changed, 192 insertions(+), 105 deletions(-) create mode 100644 component/ComputeCommandNew.js create mode 100644 static/img/2024/11/09/pro-baota-1.png create mode 100644 static/img/2024/11/09/pro-baota-2.png create mode 100644 static/img/2024/support/img.png diff --git a/component/ComputeCommandNew.js b/component/ComputeCommandNew.js new file mode 100644 index 0000000..f87a3f2 --- /dev/null +++ b/component/ComputeCommandNew.js @@ -0,0 +1,49 @@ +import React, {useState, useRef, useEffect} from 'react'; + +function ComputeCommand() { + const [value, setValue] = useState('/www/wwwroot/demo.zfile.vip'); + const [result, setResult] = useState(''); + + const inputRef = useRef(null); + + useEffect(() => { + handleCalculate(); + }, []); + + const handleCalculate = () => { + // 如果 value 尾缀包含 /zfile-launch 则去除 + let path = value.trim(); + if (value.endsWith('/zfile-launch')) { + path = value.substring(0, value.length - 13); + } + path = path || '/www/wwwroot/demo.zfile.vip'; // 如果输入框为空,则使用默认值 + const command = `${path}/zfile/zfile-pro --spring.config.location=${path}/application.properties`; // 根据路径计算命令 + setResult(command); // 将计算出的命令设置为计算结果 + }; + + + const handleCopy = () => { + inputRef.current.select(); + document.execCommand('copy'); + }; + + return ( +
+
+ setValue(e.target.value)} + className={'z-input'} + placeholder="请输入解压路径"/> + +
+
+