diff --git a/README.md b/README.md index 76a94d6b..095c296e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@

- +

diff --git a/back/services/cron.ts b/back/services/cron.ts index b2f76d5b..f9d49f61 100644 --- a/back/services/cron.ts +++ b/back/services/cron.ts @@ -159,7 +159,9 @@ export default class CronService { public async crontabs(searchText?: string): Promise { let query = {}; if (searchText) { - const reg = new RegExp(searchText, 'i'); + const encodeText = encodeURIComponent(searchText); + const reg = new RegExp(`${searchText}|${encodeText}`, 'i'); + query = { $or: [ { diff --git a/back/services/env.ts b/back/services/env.ts index ada8cede..44bc48bb 100644 --- a/back/services/env.ts +++ b/back/services/env.ts @@ -113,7 +113,9 @@ export default class EnvService { ): Promise { let condition = { ...query }; if (searchText) { - const reg = new RegExp(searchText); + const encodeText = encodeURIComponent(searchText); + const reg = new RegExp(`${searchText}|${encodeText}`, 'i'); + condition = { $or: [ { diff --git a/back/services/open.ts b/back/services/open.ts index 5b59c398..6e69a08f 100644 --- a/back/services/open.ts +++ b/back/services/open.ts @@ -97,7 +97,9 @@ export default class OpenService { ): Promise { let condition = { ...query }; if (searchText) { - const reg = new RegExp(searchText); + const encodeText = encodeURIComponent(searchText); + const reg = new RegExp(`${searchText}|${encodeText}`, 'i'); + condition = { $or: [ { diff --git a/cli/index.ts b/cli/index.ts new file mode 100644 index 00000000..8c7bb817 --- /dev/null +++ b/cli/index.ts @@ -0,0 +1,3 @@ +import * as yargs from 'yargs'; + +yargs.help('h').alias('h', 'help').help().argv; diff --git a/package.json b/package.json index d8586cae..1b2a31f6 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,8 @@ "sockjs": "^0.3.21", "typedi": "^0.8.0", "uuid": "^8.3.2", - "winston": "^3.3.3" + "winston": "^3.3.3", + "yargs": "^17.2.1" }, "devDependencies": { "@ant-design/icons": "^4.6.2", diff --git a/src/layouts/index.tsx b/src/layouts/index.tsx index f76228e9..ac6295f3 100644 --- a/src/layouts/index.tsx +++ b/src/layouts/index.tsx @@ -235,7 +235,7 @@ export default function (props: any) { logo={ } title={ diff --git a/src/pages/env/modal.tsx b/src/pages/env/modal.tsx index 504d55da..15f07a1b 100644 --- a/src/pages/env/modal.tsx +++ b/src/pages/env/modal.tsx @@ -77,7 +77,7 @@ const EnvModal = ({ rules={[ { required: true, message: '请输入环境变量名称', whitespace: true }, { - pattern: /^[a-zA-Z_][0-9a-zA-Z_]+$/, + pattern: /^[a-zA-Z_][0-9a-zA-Z_]*$/, message: '只能输入字母数字下划线,且不能以数字开头', }, ]} diff --git a/src/pages/initialization/index.tsx b/src/pages/initialization/index.tsx index 14f9caa1..2a66989c 100644 --- a/src/pages/initialization/index.tsx +++ b/src/pages/initialization/index.tsx @@ -228,7 +228,7 @@ const Initialization = () => { logo 初始化配置 diff --git a/src/pages/login/index.less b/src/pages/login/index.less index 8ab159a6..0ec532b5 100644 --- a/src/pages/login/index.less +++ b/src/pages/login/index.less @@ -32,6 +32,7 @@ .logo { width: 48px; + height: 48px; display: block; margin-bottom: 24px; } diff --git a/src/pages/login/index.tsx b/src/pages/login/index.tsx index 0eba38ec..f9c1d363 100644 --- a/src/pages/login/index.tsx +++ b/src/pages/login/index.tsx @@ -127,7 +127,7 @@ const Login = () => { logo {twoFactor ? '两步验证' : config.siteName} diff --git a/yarn.lock b/yarn.lock index 84b74cc0..fc71be3e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2995,6 +2995,15 @@ cliui@^6.0.0: strip-ansi "^6.0.0" wrap-ansi "^6.2.0" +cliui@^7.0.2: + version "7.0.4" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" + clone-response@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b" @@ -4446,7 +4455,7 @@ gensync@^1.0.0-beta.1, gensync@^1.0.0-beta.2: resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== -get-caller-file@^2.0.1: +get-caller-file@^2.0.1, get-caller-file@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== @@ -10819,6 +10828,11 @@ y18n@^4.0.0: resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.3.tgz#b5f259c82cd6e336921efd7bfd8bf560de9eeedf" integrity sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ== +y18n@^5.0.5: + version "5.0.8" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== + yallist@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" @@ -10842,6 +10856,11 @@ yargs-parser@^18.1.2: camelcase "^5.0.0" decamelize "^1.2.0" +yargs-parser@^20.2.2: + version "20.2.9" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== + yargs@^15.4.1: version "15.4.1" resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" @@ -10859,6 +10878,19 @@ yargs@^15.4.1: y18n "^4.0.0" yargs-parser "^18.1.2" +yargs@^17.2.1: + version "17.2.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.2.1.tgz#e2c95b9796a0e1f7f3bf4427863b42e0418191ea" + integrity sha512-XfR8du6ua4K6uLGm5S6fA+FIJom/MdJcFNVY8geLlp2v8GYbOXD4EB1tPNZsRn4vBzKGMgb5DRZMeWuFc2GO8Q== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2" + yn@3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50"