From 0511a4af0d77540bc01ac6d84a17bb343d436540 Mon Sep 17 00:00:00 2001 From: whyour Date: Fri, 15 Sep 2023 17:57:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20QlPort=20=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E5=8F=98=E9=87=8F=EF=BC=8C=E6=94=AF=E6=8C=81=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E6=9C=8D=E5=8A=A1=E5=90=AF=E5=8A=A8=E7=9A=84=E7=AB=AF?= =?UTF-8?q?=E5=8F=A3=EF=BC=8C=E4=BF=AE=E5=A4=8D=E5=AE=9A=E6=97=B6=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E8=A7=86=E5=9B=BE=E6=93=8D=E4=BD=9C=E7=AC=A6=E7=AD=9B?= =?UTF-8?q?=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README-en.md | 10 +++++++++ README.md | 6 ++++++ docker/front.conf | 2 +- shell/share.sh | 10 ++++++--- src/locales/en-US.json | 3 ++- src/locales/zh-CN.json | 3 ++- src/pages/crontab/viewCreateModal.tsx | 31 ++++++++++++++++----------- 7 files changed, 46 insertions(+), 19 deletions(-) diff --git a/README-en.md b/README-en.md index 67c2acaf..fc8dace7 100644 --- a/README-en.md +++ b/README-en.md @@ -61,7 +61,12 @@ npm i @whyour/qinglong # curl -sSL get.docker.com | sh docker run -dit \ -v $PWD/ql/data:/ql/data \ + # The 5700 after the colon is the default port, if QlPort is set, it needs to be the same as QlPort. -p 5700:5700 \ + # Deployment paths are not required and begin and end with a slash, e.g. /test/. + -e QlBaseUrl="/" \ + # Deployment port is not required, when using host mode, you can set the port after service startup, default 5700 + -e QlPort="5700" \ --name qinglong \ --hostname qinglong \ --restart unless-stopped \ @@ -88,7 +93,12 @@ docker-compose down podman run -dit \ --network bridge \ -v $PWD/ql/data:/ql/data \ + # The 5700 after the colon is the default port, if QlPort is set, it needs to be the same as QlPort. -p 5700:5700 \ + # Deployment paths are not required and begin and end with a slash, e.g. /test/. + -e QlBaseUrl="/" \ + # Deployment port is not required, when using host mode, you can set the port after service startup, default 5700 + -e QlPort="5700" \ --name qinglong \ --hostname qinglong \ docker.io/whyour/qinglong:latest diff --git a/README.md b/README.md index 48252498..697ae4e0 100644 --- a/README.md +++ b/README.md @@ -63,9 +63,12 @@ npm i @whyour/qinglong # curl -sSL get.docker.com | sh docker run -dit \ -v $PWD/ql/data:/ql/data \ + # 冒号后面的 5700 为默认端口,如果设置了 QlPort, 需要跟 QlPort 保持一致 -p 5700:5700 \ # 部署路径非必须,以斜杠开头和结尾,比如 /test/ -e QlBaseUrl="/" \ + # 部署端口非必须,当使用 host 模式时,可以设置服务启动后的端口,默认 5700 + -e QlPort="5700" \ --name qinglong \ --hostname qinglong \ --restart unless-stopped \ @@ -92,9 +95,12 @@ docker-compose down podman run -dit \ --network bridge \ -v $PWD/ql/data:/ql/data \ + # 冒号后面的 5700 为默认端口,如果设置了 QlPort, 需要跟 QlPort 保持一致 -p 5700:5700 \ # 部署路径非必须,以斜杠开头和结尾,比如 /test/ -e QlBaseUrl="/" \ + # 部署端口非必须,当使用 host 模式时,可以设置服务启动后的端口,默认 5700 + -e QlPort="5700" \ --name qinglong \ --hostname qinglong \ docker.io/whyour/qinglong:latest diff --git a/docker/front.conf b/docker/front.conf index b528beb8..a467ccb5 100644 --- a/docker/front.conf +++ b/docker/front.conf @@ -12,7 +12,7 @@ map $http_upgrade $connection_upgrade { } server { - listen 5700; + IPV4_CONFIG IPV6_CONFIG ssl_session_timeout 5m; diff --git a/shell/share.sh b/shell/share.sh index 22e9d9d7..c879dd81 100755 --- a/shell/share.sh +++ b/shell/share.sh @@ -69,6 +69,7 @@ import_config() { [[ -f $file_env ]] && . $file_env ql_base_url=${QlBaseUrl:-"/"} + ql_port=${QlPort:-"5700"} command_timeout_time=${CommandTimeoutTime:-""} proxy_url=${ProxyUrl:-""} file_extensions=${RepoFileExtensions:-"js py"} @@ -416,12 +417,15 @@ init_nginx() { sed -i "s,QL_BASE_URL_LOCATION,${location_url},g" /etc/nginx/conf.d/front.conf sed -i "s,QL_BASE_URL,${ql_base_url},g" /etc/nginx/conf.d/front.conf - ipv6=$(ip a | grep inet6) - ipv6Str="" + local ipv6=$(ip a | grep inet6) + local ipv6Str="" if [[ $ipv6 ]]; then - ipv6Str="listen [::]:5700 ipv6only=on;" + ipv6Str="listen [::]:${ql_port} ipv6only=on;" fi + + local ipv4Str="listen ${ql_port};" sed -i "s,IPV6_CONFIG,${ipv6Str},g" /etc/nginx/conf.d/front.conf + sed -i "s,IPV4_CONFIG,${ipv4Str},g" /etc/nginx/conf.d/front.conf } handle_task_before() { diff --git a/src/locales/en-US.json b/src/locales/en-US.json index e2ffe6c8..dfef43dc 100644 --- a/src/locales/en-US.json +++ b/src/locales/en-US.json @@ -452,5 +452,6 @@ "系统日志": "System Logs", "主题": "Theme", "语言": "Language", - "中...": "ing..." + "中...": "ing...", + "请选择操作符": "Please select operator" } diff --git a/src/locales/zh-CN.json b/src/locales/zh-CN.json index 44bd65a6..fe0330e9 100644 --- a/src/locales/zh-CN.json +++ b/src/locales/zh-CN.json @@ -452,5 +452,6 @@ "系统日志": "系统日志", "主题": "主题", "语言": "语言", - "中...": "中..." + "中...": "中...", + "请选择操作符": "请选择操作符" } diff --git a/src/pages/crontab/viewCreateModal.tsx b/src/pages/crontab/viewCreateModal.tsx index d5d4687d..e12f427d 100644 --- a/src/pages/crontab/viewCreateModal.tsx +++ b/src/pages/crontab/viewCreateModal.tsx @@ -107,20 +107,25 @@ const ViewCreateModal = ({ } form.setFieldsValue( view || { - filters: [{ property: 'command', operation: 'Reg' }], + filters: [{ property: 'command' }], }, ); }, [view, visible]); - const operationElement = ( - - ); + const OperationElement = ({ name }: { name: number }) => { + const property = form.getFieldValue(['filters', name, 'property']); + return ( + + ); + }; const propertyElement = (props: any, style: React.CSSProperties = {}) => { return ( @@ -135,7 +140,7 @@ const ViewCreateModal = ({ }; const typeElement = ( - {SORTTYPES.map((x) => ( {x.name} @@ -256,9 +261,9 @@ const ViewCreateModal = ({ - {operationElement} +