From 1c30baffcfae84f9178e046b33e189f4280395a7 Mon Sep 17 00:00:00 2001 From: chenos Date: Wed, 8 Sep 2021 15:11:35 +0800 Subject: [PATCH 1/6] feat: improve stying --- packages/client/src/schemas/form/index.tsx | 8 +- packages/client/src/schemas/kanban/style.less | 81 +++++++++++-------- 2 files changed, 56 insertions(+), 33 deletions(-) diff --git a/packages/client/src/schemas/form/index.tsx b/packages/client/src/schemas/form/index.tsx index 57c214eda..deef76c5d 100644 --- a/packages/client/src/schemas/form/index.tsx +++ b/packages/client/src/schemas/form/index.tsx @@ -98,7 +98,13 @@ const FormMain = (props: any) => { const content = ( {schema['x-decorator'] === 'Form' ? ( - + + + ) : ( .nb-block-item { - padding: 12px; - min-height: 50px; + .nb-block-item { + &:last-child { + .ant-formily-item { + margin-bottom: 0 !important; + } + } } .nb-grid-block, .ant-formily-item { - margin-bottom: 0 !important; + margin-bottom: 12px !important; } - &:hover { + + .ant-formily-layout { + &:hover { + > .designable-bar { + display: block; + } + } > .designable-bar { - display: block; - } - } - > .designable-bar { - pointer-events: none; - display: none; - position: absolute; - top: -1px; - right: -1px; - left: -1px; - bottom: -1px; - border-radius: 2px; - background: none !important; - border: 2px solid rgba(241, 139, 98, 0.3) !important; - &.active { - display: block; - } - .designable-bar-actions { - pointer-events: all; + pointer-events: none; + display: none; position: absolute; - right: 0; - line-height: 1rem; - background-color: #1890ff; - color: #fff; - z-index: 10; - padding: 0 3px; - .anticon { - font-size: 10px; + top: -1px; + right: -1px; + left: -1px; + bottom: -1px; + border-radius: 2px; + background: none !important; + border: 2px solid rgba(241, 139, 98, 0.3) !important; + &.active { + display: block; + } + .designable-bar-actions { + pointer-events: all; + position: absolute; + right: 0; + line-height: 1rem; + background-color: #1890ff; + color: #fff; + z-index: 10; + padding: 0 3px; + .anticon { + font-size: 10px; + } } } } From e82139cfc8fd418071429f8f553cd4a60777f853 Mon Sep 17 00:00:00 2001 From: chenos Date: Wed, 8 Sep 2021 15:40:53 +0800 Subject: [PATCH 2/6] feat: improve styling --- packages/client/src/schemas/display/index.tsx | 34 +++++++++---------- packages/client/src/schemas/kanban/style.less | 7 ++++ 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/packages/client/src/schemas/display/index.tsx b/packages/client/src/schemas/display/index.tsx index ff59874ca..3937fbdd0 100644 --- a/packages/client/src/schemas/display/index.tsx +++ b/packages/client/src/schemas/display/index.tsx @@ -30,52 +30,52 @@ const usePlaceholder = (value?: any) => { }; const Input: React.FC = (props) => { - const prefixCls = usePrefixCls('description-text', props); + const prefixCls = usePrefixCls('description-input', props); return ( - +
{props.addonBefore} {props.prefix} {usePlaceholder(props.value)} {props.suffix} {props.addonAfter} - +
); }; const URL: React.FC = (props) => { - const prefixCls = usePrefixCls('description-text', props); + const prefixCls = usePrefixCls('description-url', props); const content = props.value && ( {props.value} ); return ( - +
{props.addonBefore} {props.prefix} {content} {props.suffix} {props.addonAfter} - +
); }; const InputNumber: React.FC = (props) => { - const prefixCls = usePrefixCls('description-text', props); + const prefixCls = usePrefixCls('description-input-number', props); const value = usePlaceholder(props.value); return ( - +
{props.addonBefore} {props.prefix} {props.formatter ? props.formatter(value) : value} {props.suffix} {props.addonAfter} - +
); }; const TextArea: React.FC = (props) => { - const prefixCls = usePrefixCls('description-text', props); + const prefixCls = usePrefixCls('description-textarea', props); const ellipsis = props.ellipsis === true ? {} : props.ellipsis; const content = props.ellipsis ? (
@@ -100,19 +100,19 @@ const TextArea: React.FC = (props) => { usePlaceholder(props.value) ); return ( - +
{props.addonBefore} {props.prefix} {content} {props.suffix} {props.addonAfter} - +
); }; const Select: React.FC> = observer((props) => { const field = useField(); - const prefixCls = usePrefixCls('description-text', props); + const prefixCls = usePrefixCls('description-select', props); const dataSource: any[] = field?.dataSource?.length ? field.dataSource : props?.options?.length @@ -156,7 +156,7 @@ const Select: React.FC> = observer((props) => { const ObjectSelect: React.FC> = observer((props) => { const field = useField(); - const prefixCls = usePrefixCls('description-text', props); + const prefixCls = usePrefixCls('description-select', props); const dataSource: any[] = field?.dataSource?.length ? field.dataSource : props?.options?.length @@ -201,7 +201,7 @@ const ObjectSelect: React.FC> = observer((props) => { const TreeSelect: React.FC> = observer((props) => { const field = useField(); const placeholder = usePlaceholder(); - const prefixCls = usePrefixCls('description-text', props); + const prefixCls = usePrefixCls('description-tree-select', props); const dataSource = field?.dataSource?.length ? field.dataSource : props?.options?.length @@ -259,7 +259,7 @@ const TreeSelect: React.FC> = observer((props) => { const Cascader: React.FC = observer((props) => { const field = useField(); const placeholder = usePlaceholder(); - const prefixCls = usePrefixCls('description-text', props); + const prefixCls = usePrefixCls('description-cascader', props); const dataSource: any[] = field?.dataSource?.length ? field.dataSource : props?.options?.length @@ -302,7 +302,7 @@ const DatePicker: React.FC = (props: any) => { return
; } const placeholder = usePlaceholder(); - const prefixCls = usePrefixCls('description-text', props); + const prefixCls = usePrefixCls('description-date-picker', props); const getDefaultFormat = () => { const { dateFormat, showTime, timeFormat } = props; let format = dateFormat; diff --git a/packages/client/src/schemas/kanban/style.less b/packages/client/src/schemas/kanban/style.less index d455a5dea..d3de60804 100644 --- a/packages/client/src/schemas/kanban/style.less +++ b/packages/client/src/schemas/kanban/style.less @@ -39,6 +39,13 @@ .ant-formily-item-label { min-height: 0 !important; } + + .ant-description-input { + width: 100%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } } .nb-kanban-drag-overlay { From 63ecfaa2ea52a15b0004a2bee79a9aa3dccf9ac6 Mon Sep 17 00:00:00 2001 From: chenos Date: Mon, 13 Sep 2021 15:04:09 +0800 Subject: [PATCH 3/6] feat: improve code --- package.json | 3 + packages/api/src/app.ts | 6 + yarn.lock | 495 +++++++++++++++++++++++++++++++++++++--- 3 files changed, 477 insertions(+), 27 deletions(-) diff --git a/package.json b/package.json index 54d269d2c..fb1a14406 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,8 @@ "build-father-build": "cd packages/father-build && npm run build", "db-migrate": "ts-node -r dotenv/config ./packages/api/src/migrate.ts", "lint": "eslint --ext .ts,.tsx,.js \"packages/*/src/**.@(ts|tsx|js)\" --fix", + "start-prod": "concurrently \"npx pm2-runtime start packages/api/lib/index.js\" \"cd packages/app && npm run start-client\"", + "pm2-start": "npx pm2-runtime start packages/api/lib/index.js", "test": "npm run lint && jest" }, "resolutions": { @@ -52,6 +54,7 @@ "nodemon": "^2.0.12", "pg": "^8.6.0", "pg-hstore": "^2.3.3", + "pm2": "^5.1.1", "prettier": "^2.3.0", "react": "^17.0.1", "react-dom": "^17.0.2", diff --git a/packages/api/src/app.ts b/packages/api/src/app.ts index fb7ff8ef3..bf060fb48 100644 --- a/packages/api/src/app.ts +++ b/packages/api/src/app.ts @@ -1,4 +1,6 @@ import Api from '@nocobase/server'; +import dotenv from 'dotenv'; +import path from 'path'; // @ts-ignore const sync = global.sync || { @@ -8,6 +10,10 @@ const sync = global.sync || { }, }; +dotenv.config({ + path: path.resolve(__dirname, '../../../.env'), +}); + console.log('process.env.NOCOBASE_ENV', process.env.NOCOBASE_ENV); const api = Api.create({ diff --git a/yarn.lock b/yarn.lock index e53871d51..9f266a281 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3271,6 +3271,89 @@ dependencies: "@octokit/openapi-types" "^9.5.0" +"@opencensus/core@0.0.9": + version "0.0.9" + resolved "https://registry.npmjs.org/@opencensus/core/-/core-0.0.9.tgz#b16f775435ee309433e4126af194d37313fc93b3" + integrity sha512-31Q4VWtbzXpVUd2m9JS6HEaPjlKvNMOiF7lWKNmXF84yUcgfAFL5re7/hjDmdyQbOp32oGc+RFV78jXIldVz6Q== + dependencies: + continuation-local-storage "^3.2.1" + log-driver "^1.2.7" + semver "^5.5.0" + shimmer "^1.2.0" + uuid "^3.2.1" + +"@opencensus/core@^0.0.8": + version "0.0.8" + resolved "https://registry.npmjs.org/@opencensus/core/-/core-0.0.8.tgz#df01f200c2d2fbfe14dae129a1a86fb87286db92" + integrity sha512-yUFT59SFhGMYQgX0PhoTR0LBff2BEhPrD9io1jWfF/VDbakRfs6Pq60rjv0Z7iaTav5gQlttJCX2+VPxFWCuoQ== + dependencies: + continuation-local-storage "^3.2.1" + log-driver "^1.2.7" + semver "^5.5.0" + shimmer "^1.2.0" + uuid "^3.2.1" + +"@opencensus/propagation-b3@0.0.8": + version "0.0.8" + resolved "https://registry.npmjs.org/@opencensus/propagation-b3/-/propagation-b3-0.0.8.tgz#0751e6fd75f09400d9d3c419001e9e15a0df68e9" + integrity sha512-PffXX2AL8Sh0VHQ52jJC4u3T0H6wDK6N/4bg7xh4ngMYOIi13aR1kzVvX1sVDBgfGwDOkMbl4c54Xm3tlPx/+A== + dependencies: + "@opencensus/core" "^0.0.8" + uuid "^3.2.1" + +"@pm2/agent@~2.0.0": + version "2.0.0" + resolved "https://registry.npmjs.org/@pm2/agent/-/agent-2.0.0.tgz#b3ab77cd12d85187dd155c59a9771b04e7e345a3" + integrity sha512-W1LvdyF1tGaVU5f/hV8DjpI5joI7MEgXiQMLZnTwZlFwDVP00O9s86571Q8xSiweTcFZFyye0F4wORN/PjSgGA== + dependencies: + async "~3.2.0" + chalk "~3.0.0" + dayjs "~1.8.24" + debug "~4.3.1" + eventemitter2 "~5.0.1" + fast-json-patch "^3.0.0-1" + fclone "~1.0.11" + nssocket "0.6.0" + pm2-axon "~4.0.1" + pm2-axon-rpc "~0.7.0" + proxy-agent "~4.0.1" + semver "~7.2.0" + ws "~7.4.0" + +"@pm2/io@~5.0.0": + version "5.0.0" + resolved "https://registry.npmjs.org/@pm2/io/-/io-5.0.0.tgz#623cbcaf6fe39375f20ac2e75497477a1b1ec5c5" + integrity sha512-3rToDVJaRoob5Lq8+7Q2TZFruoEkdORxwzFpZaqF4bmH6Bkd7kAbdPrI/z8X6k1Meq5rTtScM7MmDgppH6aLlw== + dependencies: + "@opencensus/core" "0.0.9" + "@opencensus/propagation-b3" "0.0.8" + async "~2.6.1" + debug "~4.3.1" + eventemitter2 "^6.3.1" + require-in-the-middle "^5.0.0" + semver "6.3.0" + shimmer "^1.2.0" + signal-exit "^3.0.3" + tslib "1.9.3" + +"@pm2/js-api@~0.6.7": + version "0.6.7" + resolved "https://registry.npmjs.org/@pm2/js-api/-/js-api-0.6.7.tgz#ed28c3b7b6d26f03f826318754fdc5468afa589f" + integrity sha512-jiJUhbdsK+5C4zhPZNnyA3wRI01dEc6a2GhcQ9qI38DyIk+S+C8iC3fGjcjUbt/viLYKPjlAaE+hcT2/JMQPXw== + dependencies: + async "^2.6.3" + axios "^0.21.0" + debug "~4.3.1" + eventemitter2 "^6.3.1" + ws "^7.0.0" + +"@pm2/pm2-version-check@latest": + version "1.0.4" + resolved "https://registry.npmjs.org/@pm2/pm2-version-check/-/pm2-version-check-1.0.4.tgz#cf97fbb14b0eca95430ca05eedccbd2683806e43" + integrity sha512-SXsM27SGH3yTWKc2fKR4SYNxsmnvuBQ9dd6QHtEWmiZ/VqaOYPAIlS8+vMcn27YLtAEBGvNRSh3TPNvtjZgfqA== + dependencies: + debug "^4.3.1" + "@popperjs/core@^2.5.3": version "2.9.3" resolved "https://registry.npmjs.org/@popperjs/core/-/core-2.9.3.tgz#8b68da1ebd7fc603999cf6ebee34a4899a14b88e" @@ -4746,6 +4829,18 @@ alphanum-sort@^1.0.0: resolved "https://registry.npmjs.org/alphanum-sort/-/alphanum-sort-1.0.2.tgz#97a1119649b211ad33691d9f9f486a8ec9fbe0a3" integrity sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM= +amp-message@~0.1.1: + version "0.1.2" + resolved "https://registry.npmjs.org/amp-message/-/amp-message-0.1.2.tgz#a78f1c98995087ad36192a41298e4db49e3dfc45" + integrity sha1-p48cmJlQh602GSpBKY5NtJ49/EU= + dependencies: + amp "0.3.1" + +amp@0.3.1, amp@~0.3.1: + version "0.3.1" + resolved "https://registry.npmjs.org/amp/-/amp-0.3.1.tgz#6adf8d58a74f361e82c1fa8d389c079e139fc47d" + integrity sha1-at+NWKdPNh6CwfqNOJwHnhOfxH0= + ansi-align@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.0.tgz#b536b371cf687caaef236c18d3e21fe3797467cb" @@ -5202,11 +5297,31 @@ async-limiter@~1.0.0: resolved "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd" integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ== +async-listener@^0.6.0: + version "0.6.10" + resolved "https://registry.npmjs.org/async-listener/-/async-listener-0.6.10.tgz#a7c97abe570ba602d782273c0de60a51e3e17cbc" + integrity sha512-gpuo6xOyF4D5DE5WvyqZdPA3NGhiT6Qf07l7DCB0wwDEsLvDIbCr6j9S5aj5Ch96dLace5tXVzWBZkxU/c5ohw== + dependencies: + semver "^5.3.0" + shimmer "^1.1.0" + async-validator@^3.0.3: version "3.5.2" resolved "https://registry.npmjs.org/async-validator/-/async-validator-3.5.2.tgz#68e866a96824e8b2694ff7a831c1a25c44d5e500" integrity sha512-8eLCg00W9pIRZSB781UUX/H6Oskmm8xloZfr09lz5bikRpBVDlJ3hRVuxxP1SxcwsEYfJ4IU8Q19Y8/893r3rQ== +async@^2.6.3, async@~2.6.1: + version "2.6.3" + resolved "https://registry.npmjs.org/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff" + integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg== + dependencies: + lodash "^4.17.14" + +async@^3.2.0, async@~3.2.0: + version "3.2.1" + resolved "https://registry.npmjs.org/async/-/async-3.2.1.tgz#d3274ec66d107a47476a4c49136aacdb00665fc8" + integrity sha512-XdD5lRO/87udXCMC9meWdYiR+Nq6ZjUfXidViUZGu2F1MO4T3XwZ1et0hb2++BgLfhyJwy44BGB/yx80ABx8hg== + asynckit@^0.4.0: version "0.4.0" resolved "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -5258,6 +5373,13 @@ aws4@^1.8.0: resolved "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== +axios@^0.21.0: + version "0.21.4" + resolved "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575" + integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg== + dependencies: + follow-redirects "^1.14.0" + axios@^0.21.1: version "0.21.1" resolved "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz#22563481962f4d6bde9a76d516ef0e5d3c09b2b8" @@ -5554,6 +5676,11 @@ bindings@^1.5.0: dependencies: file-uri-to-path "1.0.0" +blessed@0.1.81: + version "0.1.81" + resolved "https://registry.npmjs.org/blessed/-/blessed-0.1.81.tgz#f962d687ec2c369570ae71af843256e6d0ca1129" + integrity sha1-+WLWh+wsNpVwrnGvhDJW5tDKESk= + bluebird@^3.5.1, bluebird@^3.5.3, bluebird@^3.5.5: version "3.7.2" resolved "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" @@ -5569,6 +5696,11 @@ bn.js@^5.0.0, bn.js@^5.1.1: resolved "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz#358860674396c6997771a9d051fcc1b57d4ae002" integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw== +bodec@^0.1.0: + version "0.1.0" + resolved "https://registry.npmjs.org/bodec/-/bodec-0.1.0.tgz#bc851555430f23c9f7650a75ef64c6a94c3418cc" + integrity sha1-vIUVVUMPI8n3ZQp172TGqUw0GMw= + boolbase@^1.0.0, boolbase@~1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" @@ -6029,6 +6161,14 @@ chalk@2.4.2, chalk@^2.0.0, chalk@^2.0.1, chalk@^2.3.1, chalk@^2.3.2, chalk@^2.4. escape-string-regexp "^1.0.5" supports-color "^5.3.0" +chalk@3.0.0, chalk@^3.0.0, chalk@~3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4" + integrity sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + chalk@^1.1.3: version "1.1.3" resolved "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" @@ -6040,14 +6180,6 @@ chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4" - integrity sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - chalk@^4.0.0, chalk@^4.1.0: version "4.1.2" resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" @@ -6086,6 +6218,11 @@ chardet@^0.7.0: resolved "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== +charm@~0.1.1: + version "0.1.2" + resolved "https://registry.npmjs.org/charm/-/charm-0.1.2.tgz#06c21eed1a1b06aeb67553cdc53e23274bac2296" + integrity sha1-BsIe7RobBq62dVPNxT4jJ0usIpY= + cheerio-select@^1.5.0: version "1.5.0" resolved "https://registry.npmjs.org/cheerio-select/-/cheerio-select-1.5.0.tgz#faf3daeb31b17c5e1a9dabcee288aaf8aafa5823" @@ -6149,7 +6286,7 @@ chokidar@^2.0.4: optionalDependencies: fsevents "^1.2.7" -chokidar@^3.0.2, chokidar@^3.2.2: +chokidar@^3.0.2, chokidar@^3.2.2, chokidar@^3.5.1: version "3.5.2" resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75" integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ== @@ -6224,6 +6361,13 @@ cli-cursor@^2.1.0: dependencies: restore-cursor "^2.0.0" +cli-tableau@^2.0.0: + version "2.0.1" + resolved "https://registry.npmjs.org/cli-tableau/-/cli-tableau-2.0.1.tgz#baa78d83e08a2d7ab79b7dad9406f0254977053f" + integrity sha512-he+WTicka9cl0Fg/y+YyxcN6/bfQ/1O3QmgxRXDhABKqLzvoOSM4fMzp39uMyLBulAFuywD2N7UaoQE7WaADxQ== + dependencies: + chalk "3.0.0" + cli-width@^2.0.0: version "2.2.1" resolved "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz#b0433d0b4e9c847ef18868a4ef16fd5fc8271c48" @@ -6445,6 +6589,11 @@ commander@*, commander@>=7.0.0: resolved "https://registry.npmjs.org/commander/-/commander-8.1.0.tgz#db36e3e66edf24ff591d639862c6ab2c52664362" integrity sha512-mf45ldcuHSYShkplHHGKWb4TrmwQadxOn7v4WuhDJy0ZVoY5JFajaRDKD0PNe5qXzBX0rhovjTnP6Kz9LETcuA== +commander@2.15.1: + version "2.15.1" + resolved "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" + integrity sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag== + commander@^2.19.0, commander@^2.20.0: version "2.20.3" resolved "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" @@ -6615,6 +6764,14 @@ content-type@^1.0.2, content-type@^1.0.4: resolved "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== +continuation-local-storage@^3.2.1: + version "3.2.1" + resolved "https://registry.npmjs.org/continuation-local-storage/-/continuation-local-storage-3.2.1.tgz#11f613f74e914fe9b34c92ad2d28fe6ae1db7ffb" + integrity sha512-jx44cconVqkCEEyLSKWwkvUXwO561jXMa3LPjTPsm5QR22PA0/mhe33FT4Xb5y74JDvt/Cq+5lm8S8rskLv9ZA== + dependencies: + async-listener "^0.6.0" + emitter-listener "^1.1.1" + conventional-changelog-angular@^5.0.3: version "5.0.12" resolved "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.12.tgz#c979b8b921cbfe26402eb3da5bbfda02d865a2b9" @@ -6883,6 +7040,13 @@ cron-parser@^3.1.0: is-nan "^1.3.2" luxon "^1.26.0" +cron@1.8.2: + version "1.8.2" + resolved "https://registry.npmjs.org/cron/-/cron-1.8.2.tgz#4ac5e3c55ba8c163d84f3407bde94632da8370ce" + integrity sha512-Gk2c4y6xKEO8FSAUTklqtfSr7oTq0CiPQeLBG5Fl0qoXpZyMcj1SG59YL+hqq04bu6/IuEA7lMkYDAplQNKkyg== + dependencies: + moment-timezone "^0.5.x" + cross-spawn@^5.0.1: version "5.1.0" resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" @@ -7190,6 +7354,11 @@ csstype@^3.0.2: resolved "https://registry.npmjs.org/csstype/-/csstype-3.0.8.tgz#d2266a792729fb227cd216fb572f43728e1ad340" integrity sha512-jXKhWqXPmlUeoQnF/EhTtTl4C9SnrxSH/jZUih3jmO6lBKr99rP3/+FmrMj4EFpOXzMtXHAZkd3x0E6h6Fgflw== +culvert@^0.1.2: + version "0.1.2" + resolved "https://registry.npmjs.org/culvert/-/culvert-0.1.2.tgz#9502f5f0154a2d5a22a023e79f71cc936fa6ef6f" + integrity sha1-lQL18BVKLVoioCPnn3HMk2+m728= + currently-unhandled@^0.4.1: version "0.4.1" resolved "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" @@ -7304,6 +7473,11 @@ dayjs@1.x, dayjs@^1.9.1: resolved "https://registry.npmjs.org/dayjs/-/dayjs-1.10.6.tgz#288b2aa82f2d8418a6c9d4df5898c0737ad02a63" integrity sha512-AztC/IOW4L1Q41A86phW5Thhcrco3xuAA+YX/BLpLWWjRcTj5TOt/QImBLmCKlrF7u7k47arTnOyL6GnbG8Hvw== +dayjs@~1.8.24, dayjs@~1.8.25: + version "1.8.36" + resolved "https://registry.npmjs.org/dayjs/-/dayjs-1.8.36.tgz#be36e248467afabf8f5a86bae0de0cdceecced50" + integrity sha512-3VmRXEtw7RZKAf+4Tv1Ym9AGeo8r8+CjDi26x+7SYQil1UqtqdaokhzoEJohqlzt0m5kacJSDhJQkG/LWhpRBw== + debug-fabulous@1.X: version "1.1.0" resolved "https://registry.npmjs.org/debug-fabulous/-/debug-fabulous-1.1.0.tgz#af8a08632465224ef4174a9f06308c3c2a1ebc8e" @@ -7327,7 +7501,7 @@ debug@3.X, debug@^3.1.0, debug@^3.2.6, debug@^3.2.7: dependencies: ms "^2.1.1" -debug@4, debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1: +debug@4, debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@~4.3.1: version "4.3.2" resolved "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== @@ -7877,6 +8051,13 @@ elliptic@^6.5.3: minimalistic-assert "^1.0.1" minimalistic-crypto-utils "^1.0.1" +emitter-listener@^1.1.1: + version "1.1.2" + resolved "https://registry.npmjs.org/emitter-listener/-/emitter-listener-1.1.2.tgz#56b140e8f6992375b3d7cb2cab1cc7432d9632e8" + integrity sha512-Bt1sBAGFHY9DKY+4/2cV6izcKJUf5T7/gkdmkxzX/qv9CcGH8xSwVRW5mtX03SWJtRTWSOpzCuWN9rBFYZepZQ== + dependencies: + shimmer "^1.2.0" + emittery@^0.7.1: version "0.7.2" resolved "https://registry.npmjs.org/emittery/-/emittery-0.7.2.tgz#25595908e13af0f5674ab419396e2fb394cdfa82" @@ -7935,7 +8116,7 @@ enhanced-resolve@^4.0.0, enhanced-resolve@^4.1.1: memory-fs "^0.5.0" tapable "^1.0.0" -enquirer@^2.3.5: +enquirer@2.3.6, enquirer@^2.3.5: version "2.3.6" resolved "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== @@ -8435,6 +8616,21 @@ event-emitter@^0.3.5: d "1" es5-ext "~0.10.14" +eventemitter2@5.0.1, eventemitter2@~5.0.1: + version "5.0.1" + resolved "https://registry.npmjs.org/eventemitter2/-/eventemitter2-5.0.1.tgz#6197a095d5fb6b57e8942f6fd7eaad63a09c9452" + integrity sha1-YZegldX7a1folC9v1+qtY6CclFI= + +eventemitter2@^6.3.1: + version "6.4.4" + resolved "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.4.tgz#aa96e8275c4dbeb017a5d0e03780c65612a1202b" + integrity sha512-HLU3NDY6wARrLCEwyGKRBvuWYyvW6mHYv72SJJAH3iJN3a6eVUvkjFkcxah1bcTgGVBBrFdIopBJPhCQFMLyXw== + +eventemitter2@~0.4.14: + version "0.4.14" + resolved "https://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.14.tgz#8f61b75cde012b2e9eb284d4545583b5643b61ab" + integrity sha1-j2G3XN4BKy6esoTUVFWDtWQ7Yas= + eventemitter3@^3.1.0: version "3.1.2" resolved "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.2.tgz#2d3d48f9c346698fce83a85d7d664e98535df6e7" @@ -8684,6 +8880,11 @@ fast-glob@^3.1.1: merge2 "^1.3.0" micromatch "^4.0.4" +fast-json-patch@^3.0.0-1: + version "3.1.0" + resolved "https://registry.npmjs.org/fast-json-patch/-/fast-json-patch-3.1.0.tgz#ec8cd9b9c4c564250ec8b9140ef7a55f70acaee6" + integrity sha512-IhpytlsVTRndz0hU5t0/MGzS/etxLlfrpG5V5M9mVbuj9TrJLWaMfsox9REM5rkuGX0T+5qjpe8XA1o0gZ42nA== + fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0: version "2.1.0" resolved "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" @@ -8738,6 +8939,11 @@ fbjs@^0.8.3: setimmediate "^1.0.5" ua-parser-js "^0.7.18" +fclone@1.0.11, fclone@~1.0.11: + version "1.0.11" + resolved "https://registry.npmjs.org/fclone/-/fclone-1.0.11.tgz#10e85da38bfea7fc599341c296ee1d77266ee640" + integrity sha1-EOhdo4v+p/xZk0HClu4ddyZu5kA= + fecha@~4.2.0: version "4.2.1" resolved "https://registry.npmjs.org/fecha/-/fecha-4.2.1.tgz#0a83ad8f86ef62a091e22bb5a039cd03d23eecce" @@ -8901,6 +9107,11 @@ follow-redirects@^1.10.0: resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.1.tgz#d9114ded0a1cfdd334e164e6662ad02bfd91ff43" integrity sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg== +follow-redirects@^1.14.0: + version "1.14.3" + resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.3.tgz#6ada78118d8d24caee595595accdc0ac6abd022e" + integrity sha512-3MkHxknWMUtb23apkgz/83fDoe+y+qr0TdgacGIA7bew+QLBo3vdgEN2xEsuXNivpFy4CyDhBBZnNZOtalmenw== + for-each@^0.3.3: version "0.3.3" resolved "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" @@ -9213,6 +9424,11 @@ getpass@^0.1.1: dependencies: assert-plus "^1.0.0" +git-node-fs@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/git-node-fs/-/git-node-fs-1.0.0.tgz#49b215e242ebe43aa4c7561bbba499521752080f" + integrity sha1-SbIV4kLr5Dqkx1Ybu6SZUhdSCA8= + git-raw-commits@2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.0.tgz#d92addf74440c14bcc5c83ecce3fb7f8a79118b5" @@ -9240,6 +9456,11 @@ git-semver-tags@^2.0.3: meow "^4.0.0" semver "^6.0.0" +git-sha1@^0.1.2: + version "0.1.2" + resolved "https://registry.npmjs.org/git-sha1/-/git-sha1-0.1.2.tgz#599ac192b71875825e13a445f3a6e05118c2f745" + integrity sha1-WZrBkrcYdYJeE6RF86bgURjC90U= + git-up@^4.0.0: version "4.0.5" resolved "https://registry.npmjs.org/git-up/-/git-up-4.0.5.tgz#e7bb70981a37ea2fb8fe049669800a1f9a01d759" @@ -9992,7 +10213,7 @@ humanize-ms@^1.2.0, humanize-ms@^1.2.1: dependencies: ms "^2.0.0" -iconv-lite@0.4.24, iconv-lite@^0.4.15, iconv-lite@^0.4.24: +iconv-lite@0.4.24, iconv-lite@^0.4.15, iconv-lite@^0.4.24, iconv-lite@^0.4.4: version "0.4.24" resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== @@ -10205,7 +10426,7 @@ ini@1.3.7: resolved "https://registry.npmjs.org/ini/-/ini-1.3.7.tgz#a09363e1911972ea16d7a8851005d84cf09a9a84" integrity sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ== -ini@^1.3.2, ini@^1.3.4, ini@~1.3.0: +ini@^1.3.2, ini@^1.3.4, ini@^1.3.5, ini@~1.3.0: version "1.3.8" resolved "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== @@ -11695,6 +11916,16 @@ js-cookie@^2.2.1: resolved "https://registry.npmjs.org/js-cookie/-/js-cookie-2.2.1.tgz#69e106dc5d5806894562902aa5baec3744e9b2b8" integrity sha512-HvdH2LzI/EAZcUwA8+0nKNtWHqS+ZmijLA30RwZA0bo7ToCckjK5MkGhjED9KoRcXO6BaGI3I9UIzSA1FKFPOQ== +js-git@^0.7.8: + version "0.7.8" + resolved "https://registry.npmjs.org/js-git/-/js-git-0.7.8.tgz#52fa655ab61877d6f1079efc6534b554f31e5444" + integrity sha1-UvplWrYYd9bxB578ZTS1VPMeVEQ= + dependencies: + bodec "^0.1.0" + culvert "^0.1.2" + git-sha1 "^0.1.2" + pako "^0.2.5" + js-levenshtein@^1.1.3: version "1.1.6" resolved "https://registry.npmjs.org/js-levenshtein/-/js-levenshtein-1.1.6.tgz#c6cee58eb3550372df8deb85fad5ce66ce01d59d" @@ -12100,6 +12331,11 @@ lazy-cache@^1.0.3: resolved "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" integrity sha1-odePw6UEdMuAhF07O24dpJpEbo4= +lazy@~1.0.11: + version "1.0.11" + resolved "https://registry.npmjs.org/lazy/-/lazy-1.0.11.tgz#daa068206282542c088288e975c297c1ae77b690" + integrity sha1-2qBoIGKCVCwIgojpdcKXwa53tpA= + lazystream@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/lazystream/-/lazystream-1.0.0.tgz#f6995fe0f820392f61396be89462407bb77168e4" @@ -12412,11 +12648,16 @@ lodash@4.17.19: resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b" integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ== -lodash@4.x, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.2.1, lodash@^4.7.0: +lodash@4.x, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.2.1, lodash@^4.7.0: version "4.17.21" resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== +log-driver@^1.2.7: + version "1.2.7" + resolved "https://registry.npmjs.org/log-driver/-/log-driver-1.2.7.tgz#63b95021f0702fedfa2c9bb0a24e7797d71871d8" + integrity sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg== + long-timeout@0.1.1: version "0.1.1" resolved "https://registry.npmjs.org/long-timeout/-/long-timeout-0.1.1.tgz#9721d788b47e0bcb5a24c2e2bee1a0da55dab514" @@ -13144,7 +13385,7 @@ mkdirp-promise@^5.0.1: dependencies: mkdirp "*" -mkdirp@*, mkdirp@1.x, mkdirp@^1.0.3: +mkdirp@*, mkdirp@1.0.4, mkdirp@1.x, mkdirp@^1.0.3: version "1.0.4" resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== @@ -13168,7 +13409,12 @@ modify-values@^1.0.0: resolved "https://registry.npmjs.org/modify-values/-/modify-values-1.0.1.tgz#b3939fa605546474e3e3e3c63d64bd43b4ee6022" integrity sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw== -moment-timezone@^0.5.31: +module-details-from-path@^1.0.3: + version "1.0.3" + resolved "https://registry.npmjs.org/module-details-from-path/-/module-details-from-path-1.0.3.tgz#114c949673e2a8a35e9d35788527aa37b679da2b" + integrity sha1-EUyUlnPiqKNenTV4hSeqN7Z52is= + +moment-timezone@^0.5.31, moment-timezone@^0.5.x: version "0.5.33" resolved "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.33.tgz#b252fd6bb57f341c9b59a5ab61a8e51a73bbd22c" integrity sha512-PTc2vcT8K9J5/9rDEPe5czSIKgLoGsH8UNpA4qZTVw0Vd/Uz19geE9abbIOQKaAQFcnQ3v5YEXrbSc5BpshH+w== @@ -13334,6 +13580,15 @@ nearley@^2.7.10: railroad-diagrams "^1.0.0" randexp "0.4.6" +needle@2.4.0: + version "2.4.0" + resolved "https://registry.npmjs.org/needle/-/needle-2.4.0.tgz#6833e74975c444642590e15a750288c5f939b57c" + integrity sha512-4Hnwzr3mi5L97hMYeNl8wRW/Onhy4nUKR/lVemJ8gJedxxUyBLm9kkrDColJvoSfwi0jCNhD+xCdOtiGDQiRZg== + dependencies: + debug "^3.2.6" + iconv-lite "^0.4.4" + sax "^1.2.4" + negotiator@0.6.2: version "0.6.2" resolved "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" @@ -13701,6 +13956,14 @@ npmlog@^4.1.2: gauge "~2.7.3" set-blocking "~2.0.0" +nssocket@0.6.0: + version "0.6.0" + resolved "https://registry.npmjs.org/nssocket/-/nssocket-0.6.0.tgz#59f96f6ff321566f33c70f7dbeeecdfdc07154fa" + integrity sha1-Wflvb/MhVm8zxw99vu7N/cBxVPo= + dependencies: + eventemitter2 "~0.4.14" + lazy "~1.0.11" + nth-check@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz#b2bd295c37e3dd58a3bf0700376663ba4d9cf05c" @@ -14110,6 +14373,11 @@ packet-reader@1.0.0: resolved "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz#9238e5480dedabacfe1fe3f2771063f164157d74" integrity sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ== +pako@^0.2.5: + version "0.2.9" + resolved "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz#f3f7522f4ef782348da8161bad9ecfd51bf83a75" + integrity sha1-8/dSL073gjSNqBYbrZ7P1Rv4OnU= + pako@~1.0.5: version "1.0.11" resolved "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf" @@ -14433,6 +14701,13 @@ picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.2, picomatch@^2.2.3: resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== +pidusage@2.0.21, pidusage@^2.0.21: + version "2.0.21" + resolved "https://registry.npmjs.org/pidusage/-/pidusage-2.0.21.tgz#7068967b3d952baea73e57668c98b9eaa876894e" + integrity sha512-cv3xAQos+pugVX+BfXpHsbyz/dLzX+lr44zNMsYiGxUw+kV5sgQCIcLd1z+0vq+KyC7dJ+/ts2PsfgWfSC3WXA== + dependencies: + safe-buffer "^5.2.1" + pify@^2.0.0, pify@^2.3.0: version "2.3.0" resolved "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" @@ -14534,6 +14809,86 @@ plugin-error@^1.0.1: arr-union "^3.1.0" extend-shallow "^3.0.2" +pm2-axon-rpc@~0.7.0, pm2-axon-rpc@~0.7.1: + version "0.7.1" + resolved "https://registry.npmjs.org/pm2-axon-rpc/-/pm2-axon-rpc-0.7.1.tgz#2daec5383a63135b3f18babb70266dacdcbc429a" + integrity sha512-FbLvW60w+vEyvMjP/xom2UPhUN/2bVpdtLfKJeYM3gwzYhoTEEChCOICfFzxkxuoEleOlnpjie+n1nue91bDQw== + dependencies: + debug "^4.3.1" + +pm2-axon@~4.0.1: + version "4.0.1" + resolved "https://registry.npmjs.org/pm2-axon/-/pm2-axon-4.0.1.tgz#a7b4bb586e9aeb35b1042b488cde15b60cabafd2" + integrity sha512-kES/PeSLS8orT8dR5jMlNl+Yu4Ty3nbvZRmaAtROuVm9nYYGiaoXqqKQqQYzWQzMYWUKHMQTvBlirjE5GIIxqg== + dependencies: + amp "~0.3.1" + amp-message "~0.1.1" + debug "^4.3.1" + escape-string-regexp "^4.0.0" + +pm2-deploy@~1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/pm2-deploy/-/pm2-deploy-1.0.2.tgz#98d8385553a3a4dca11c7b3116deb519bc5961a7" + integrity sha512-YJx6RXKrVrWaphEYf++EdOOx9EH18vM8RSZN/P1Y+NokTKqYAca/ejXwVLyiEpNju4HPZEk3Y2uZouwMqUlcgg== + dependencies: + run-series "^1.1.8" + tv4 "^1.3.0" + +pm2-multimeter@^0.1.2: + version "0.1.2" + resolved "https://registry.npmjs.org/pm2-multimeter/-/pm2-multimeter-0.1.2.tgz#1a1e55153d41a05534cea23cfe860abaa0eb4ace" + integrity sha1-Gh5VFT1BoFU0zqI8/oYKuqDrSs4= + dependencies: + charm "~0.1.1" + +pm2-sysmonit@^1.2.8: + version "1.2.8" + resolved "https://registry.npmjs.org/pm2-sysmonit/-/pm2-sysmonit-1.2.8.tgz#eddea34a53fd8c8d7c3efb73b97a3c548686e24d" + integrity sha512-ACOhlONEXdCTVwKieBIQLSi2tQZ8eKinhcr9JpZSUAL8Qy0ajIgRtsLxG/lwPOW3JEKqPyw/UaHmTWhUzpP4kA== + dependencies: + async "^3.2.0" + debug "^4.3.1" + pidusage "^2.0.21" + systeminformation "^5.7" + tx2 "~1.0.4" + +pm2@^5.1.1: + version "5.1.1" + resolved "https://registry.npmjs.org/pm2/-/pm2-5.1.1.tgz#cca589a471712bdcac18b8467cef048f7267997a" + integrity sha512-2Agpn2IVXOKu8kP+qaxKOvMLNtbZ6lY4bzKcEW2d2tw7O0lpNO7QvDayY4af+8U1+WCn90UjPK4q2wPFVHt/sA== + dependencies: + "@pm2/agent" "~2.0.0" + "@pm2/io" "~5.0.0" + "@pm2/js-api" "~0.6.7" + "@pm2/pm2-version-check" latest + async "~3.2.0" + blessed "0.1.81" + chalk "3.0.0" + chokidar "^3.5.1" + cli-tableau "^2.0.0" + commander "2.15.1" + cron "1.8.2" + dayjs "~1.8.25" + debug "^4.3.1" + enquirer "2.3.6" + eventemitter2 "5.0.1" + fclone "1.0.11" + mkdirp "1.0.4" + needle "2.4.0" + pidusage "2.0.21" + pm2-axon "~4.0.1" + pm2-axon-rpc "~0.7.1" + pm2-deploy "~1.0.2" + pm2-multimeter "^0.1.2" + promptly "^2" + semver "^7.2" + source-map-support "0.5.19" + sprintf-js "1.1.2" + vizion "~2.2.1" + yamljs "0.3.0" + optionalDependencies: + pm2-sysmonit "^1.2.8" + pn@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" @@ -15369,6 +15724,13 @@ promise@~7.0.1: dependencies: asap "~2.0.3" +promptly@^2: + version "2.2.0" + resolved "https://registry.npmjs.org/promptly/-/promptly-2.2.0.tgz#2a13fa063688a2a5983b161fff0108a07d26fc74" + integrity sha1-KhP6BjaIoqWYOxYf/wEIoH0m/HQ= + dependencies: + read "^1.0.4" + prompts@^2.0.1: version "2.4.1" resolved "https://registry.npmjs.org/prompts/-/prompts-2.4.1.tgz#befd3b1195ba052f9fd2fde8a486c4e82ee77f61" @@ -15426,7 +15788,7 @@ protoduck@^5.0.1: dependencies: genfun "^5.0.0" -proxy-agent@^4.0.1: +proxy-agent@^4.0.1, proxy-agent@~4.0.1: version "4.0.1" resolved "https://registry.npmjs.org/proxy-agent/-/proxy-agent-4.0.1.tgz#326c3250776c7044cd19655ccbfadf2e065a045c" integrity sha512-ODnQnW2jc/FUVwHHuaZEfN5otg/fMbvMxz9nMSUQfJ9JU7q2SZvSULSsjLloVgJOiv9yhc8GlNMKc4GkFmcVEA== @@ -16496,7 +16858,7 @@ read-pkg@^5.2.0: parse-json "^5.0.0" type-fest "^0.6.0" -read@1, read@~1.0.1: +read@1, read@^1.0.4, read@~1.0.1: version "1.0.7" resolved "https://registry.npmjs.org/read/-/read-1.0.7.tgz#b3da19bd052431a97671d44a42634adf710b40c4" integrity sha1-s9oZvQUkMal2cdRKQmNK33ELQMQ= @@ -16892,6 +17254,15 @@ require-from-string@^2.0.2: resolved "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== +require-in-the-middle@^5.0.0: + version "5.1.0" + resolved "https://registry.npmjs.org/require-in-the-middle/-/require-in-the-middle-5.1.0.tgz#b768f800377b47526d026bbf5a7f727f16eb412f" + integrity sha512-M2rLKVupQfJ5lf9OvqFGIT+9iVLnTmjgbOmpil12hiSQNn5zJTKGPoIisETNjfK+09vP3rpm1zJajmErpr2sEQ== + dependencies: + debug "^4.1.1" + module-details-from-path "^1.0.3" + resolve "^1.12.0" + require-main-filename@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" @@ -16978,7 +17349,7 @@ resolve@1.17.0: dependencies: path-parse "^1.0.6" -resolve@^1.10.0, resolve@^1.10.1, resolve@^1.14.2, resolve@^1.16.1, resolve@^1.17.0, resolve@^1.18.1, resolve@^1.20.0, resolve@^1.3.2, resolve@^1.4.0, resolve@^1.5.0, resolve@^1.8.1: +resolve@^1.10.0, resolve@^1.10.1, resolve@^1.12.0, resolve@^1.14.2, resolve@^1.16.1, resolve@^1.17.0, resolve@^1.18.1, resolve@^1.20.0, resolve@^1.3.2, resolve@^1.4.0, resolve@^1.5.0, resolve@^1.8.1: version "1.20.0" resolved "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== @@ -17372,6 +17743,11 @@ run-queue@^1.0.0, run-queue@^1.0.3: dependencies: aproba "^1.1.1" +run-series@^1.1.8: + version "1.1.9" + resolved "https://registry.npmjs.org/run-series/-/run-series-1.1.9.tgz#15ba9cb90e6a6c054e67c98e1dc063df0ecc113a" + integrity sha512-Arc4hUN896vjkqCYrUXquBFtRZdv1PfLbTYP71efP6butxyQ0kWpiNJyAgsxscmQg1cqvHY32/UCBzXedTpU2g== + rxjs@^6.4.0, rxjs@^6.5.2: version "6.6.7" resolved "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" @@ -17517,22 +17893,27 @@ semver-diff@^3.1.1: resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== +semver@6.3.0, semver@^6.0.0, semver@^6.1.0, semver@^6.1.1, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0: + version "6.3.0" + resolved "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + semver@7.0.0: version "7.0.0" resolved "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e" integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A== -semver@7.x, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5: +semver@7.x, semver@^7.2, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5: version "7.3.5" resolved "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== dependencies: lru-cache "^6.0.0" -semver@^6.0.0, semver@^6.1.0, semver@^6.1.1, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0: - version "6.3.0" - resolved "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== +semver@~7.2.0: + version "7.2.3" + resolved "https://registry.npmjs.org/semver/-/semver-7.2.3.tgz#3641217233c6382173c76bf2c7ecd1e1c16b0d8a" + integrity sha512-utbW9Z7ZxVvwiIWkdOMLOR9G/NFXh2aRucghkVrEMJWuC++r3lCkBC3LwqBinyHzGMAJxY5tn6VakZGHObq5ig== seq-queue@^0.0.5: version "0.0.5" @@ -17659,6 +18040,11 @@ shellwords@^0.1.1: resolved "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww== +shimmer@^1.1.0, shimmer@^1.2.0: + version "1.2.1" + resolved "https://registry.npmjs.org/shimmer/-/shimmer-1.2.1.tgz#610859f7de327b587efebf501fb43117f9aff337" + integrity sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw== + side-channel@^1.0.4: version "1.0.4" resolved "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" @@ -17668,7 +18054,7 @@ side-channel@^1.0.4: get-intrinsic "^1.0.2" object-inspect "^1.9.0" -signal-exit@^3.0.0, signal-exit@^3.0.2: +signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.3: version "3.0.3" resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== @@ -17836,7 +18222,7 @@ source-map-resolve@^0.5.0, source-map-resolve@^0.5.2: source-map-url "^0.4.0" urix "^0.1.0" -source-map-support@^0.5.16, source-map-support@^0.5.17, source-map-support@^0.5.6, source-map-support@~0.5.19: +source-map-support@0.5.19, source-map-support@^0.5.16, source-map-support@^0.5.17, source-map-support@^0.5.6, source-map-support@~0.5.19: version "0.5.19" resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== @@ -17947,6 +18333,11 @@ split@^1.0.0: dependencies: through "2" +sprintf-js@1.1.2: + version "1.1.2" + resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz#da1765262bf8c0f571749f2ad6c26300207ae673" + integrity sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug== + sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" @@ -18454,6 +18845,11 @@ symbol-tree@^3.2.2, symbol-tree@^3.2.4: resolved "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== +systeminformation@^5.7: + version "5.8.8" + resolved "https://registry.npmjs.org/systeminformation/-/systeminformation-5.8.8.tgz#8a073a1e2cfa7a4285e60654f08b0f9b123bd29f" + integrity sha512-wss1OIzo2jP176PyNZ6W4LcMw7tytRltQJetu3S9BJ8ZHzPWd+R8C/UVLp8hOgQZlc/ADBQr4BlHVrLU9wsmXw== + table@^6.0.9: version "6.7.1" resolved "https://registry.npmjs.org/table/-/table-6.7.1.tgz#ee05592b7143831a8c94f3cee6aae4c1ccef33e2" @@ -18910,6 +19306,11 @@ tsconfig-paths@^3.9.0: minimist "^1.2.0" strip-bom "^3.0.0" +tslib@1.9.3: + version "1.9.3" + resolved "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" + integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== + tslib@2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/tslib/-/tslib-2.0.1.tgz#410eb0d113e5b6356490eec749603725b021b43e" @@ -18949,6 +19350,11 @@ tunnel-agent@^0.6.0: dependencies: safe-buffer "^5.0.1" +tv4@^1.3.0: + version "1.3.0" + resolved "https://registry.npmjs.org/tv4/-/tv4-1.3.0.tgz#d020c846fadd50c855abb25ebaecc68fc10f7963" + integrity sha1-0CDIRvrdUMhVq7JeuuzGj8EPeWM= + tween-functions@^1.0.1: version "1.2.0" resolved "https://registry.npmjs.org/tween-functions/-/tween-functions-1.2.0.tgz#1ae3a50e7c60bb3def774eac707acbca73bbc3ff" @@ -18959,6 +19365,13 @@ tweetnacl@^0.14.3, tweetnacl@~0.14.0: resolved "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= +tx2@~1.0.4: + version "1.0.4" + resolved "https://registry.npmjs.org/tx2/-/tx2-1.0.4.tgz#cb9432df22e0b8c54daf711b51b708f094449ddf" + integrity sha512-rU+y30nUY3PyIi+znvv74HzxlpULKwMPAyRK+YiCjvGkk3rY3fic3D6Z+avLpun3V5A6HFwPQ9JrBTMNEV/dxg== + dependencies: + json-stringify-safe "^5.0.1" + type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" resolved "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" @@ -19575,7 +19988,7 @@ utility@^1.16.1, utility@^1.8.0: mz "^2.7.0" unescape "^1.0.1" -uuid@^3.0.1, uuid@^3.3.2: +uuid@^3.0.1, uuid@^3.2.1, uuid@^3.3.2: version "3.4.0" resolved "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== @@ -19726,6 +20139,16 @@ vinyl@^2.0.0, vinyl@^2.1.0: remove-trailing-separator "^1.0.1" replace-ext "^1.0.0" +vizion@~2.2.1: + version "2.2.1" + resolved "https://registry.npmjs.org/vizion/-/vizion-2.2.1.tgz#04201ea45ffd145d5b5210e385a8f35170387fb2" + integrity sha512-sfAcO2yeSU0CSPFI/DmZp3FsFE9T+8913nv1xWBOyzODv13fwkn6Vl7HqxGpkr9F608M+8SuFId3s+BlZqfXww== + dependencies: + async "^2.6.3" + git-node-fs "^1.0.0" + ini "^1.3.5" + js-git "^0.7.8" + vm-browserify@^1.0.1: version "1.1.2" resolved "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0" @@ -20068,11 +20491,21 @@ ws@^6.1.2: dependencies: async-limiter "~1.0.0" +ws@^7.0.0: + version "7.5.5" + resolved "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz#8b4bc4af518cfabd0473ae4f99144287b33eb881" + integrity sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w== + ws@^7.4.6: version "7.5.3" resolved "https://registry.npmjs.org/ws/-/ws-7.5.3.tgz#160835b63c7d97bfab418fc1b8a9fced2ac01a74" integrity sha512-kQ/dHIzuLrS6Je9+uv81ueZomEwH0qVYstcAQ4/Z93K8zeko9gtAbttJWzoC5ukqXY1PpoouV3+VSOqEAFt5wg== +ws@~7.4.0: + version "7.4.6" + resolved "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" + integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== + xdg-basedir@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-3.0.0.tgz#496b2cc109eca8dbacfe2dc72b603c17c5870ad4" @@ -20162,6 +20595,14 @@ yaml@^1.10.0: resolved "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== +yamljs@0.3.0: + version "0.3.0" + resolved "https://registry.npmjs.org/yamljs/-/yamljs-0.3.0.tgz#dc060bf267447b39f7304e9b2bfbe8b5a7ddb03b" + integrity sha512-C/FsVVhht4iPQYXOInoxUM/1ELSf9EsgKH34FofQOp6hwCPrW4vG4w5++TED3xRUo8gD7l0P1J1dLlDYzODsTQ== + dependencies: + argparse "^1.0.7" + glob "^7.0.5" + yargs-parser@13.0.0: version "13.0.0" resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.0.0.tgz#3fc44f3e76a8bdb1cc3602e860108602e5ccde8b" From 37347cb6b290225b179dd6d2686f9192a70c605f Mon Sep 17 00:00:00 2001 From: chenos Date: Tue, 14 Sep 2021 16:28:11 +0800 Subject: [PATCH 4/6] feat: add collections table/form --- .../admin-layout/Collections/index.tsx | 756 ++++++++++++++++++ .../src/components/admin-layout/index.tsx | 3 +- .../plugin-collections/src/actions/fields.ts | 5 +- .../plugin-collections/src/models/field.ts | 5 + packages/plugin-collections/src/server.ts | 2 + 5 files changed, 766 insertions(+), 5 deletions(-) create mode 100644 packages/client/src/components/admin-layout/Collections/index.tsx diff --git a/packages/client/src/components/admin-layout/Collections/index.tsx b/packages/client/src/components/admin-layout/Collections/index.tsx new file mode 100644 index 000000000..64081293d --- /dev/null +++ b/packages/client/src/components/admin-layout/Collections/index.tsx @@ -0,0 +1,756 @@ +import { SchemaRenderer } from '../../../'; +import React, { useContext, useEffect, useMemo, useState } from 'react'; +import { FormItem } from '@formily/antd'; +import { action } from '@formily/reactive'; +import { + useCollectionContext, + useCollectionsContext, +} from '../../../constate/Collections'; +import { Button, Drawer, Menu, Dropdown, Space } from 'antd'; +import { PlusOutlined, DownOutlined } from '@ant-design/icons'; +import cls from 'classnames'; +import { uid, isValid, clone } from '@formily/shared'; +import { Resource } from '../../../resource'; +import { TableRowContext, useTable } from '../../../schemas/table'; +import { useRequest } from 'ahooks'; +import { VisibleContext } from '../../../context'; +import { connect, FormProvider, observer, useForm } from '@formily/react'; +import { DescriptionsContext } from '../../../schemas/form'; +import { createContext } from 'react'; +import { ISchema } from '../../../'; +import { createForm, Field } from '@formily/core'; +import { SchemaField } from '../../../schemas'; +import { + interfaces, + options, +} from '../../../schemas/database-field/interfaces'; + +export const RoleContext = createContext(null); + +function VisibleProvider(props) { + const ctx = useContext(TableRowContext); + const [visible, setVisible] = useState(false); + return ( + + {props.children} + + ); +} + +const useResource = () => { + const resource = Resource.make('collections'); + return { + resource, + }; +}; + +const useCollectionsResource = () => { + const descriptionsContext = useContext(DescriptionsContext); + console.log('descriptionsContext.service', descriptionsContext.service); + const resource = Resource.make('collections'); + return { + resource, + }; +}; + +class ActionPermissionResource extends Resource { + save(options?: any) { + console.log('ActionPermissionResource.save'); + return Promise.resolve({}); + } +} + +const useActionPermissionSubmit = () => { + const form = useForm(); + const role = useContext(RoleContext); + const resource = Resource.make({ + resourceName: 'roles', + resourceKey: role.name, + }); + return { + async run() { + await resource.save(form.values); + console.log('useActionPermissionSubmit', form.values?.actionPermissions); + }, + }; +}; + +const useActionPermissionResource = ({ onSuccess }) => { + const role = useContext(RoleContext); + console.log('RoleContext', role); + // const { props } = useTable(); + const ctx = useContext(TableRowContext); + const resource = ActionPermissionResource.make({ + resourceName: 'action_permissions', + }); + const service = useRequest( + (params?: any) => { + return resource.list({ + ...params, + filter: { + role_name: role.name, + collection_name: ctx.record.name, + }, + appends: ['fields'], + }); + }, + { + formatResult: (result) => result?.data, + onSuccess(data) { + console.log('actionPermissions', data); + onSuccess({ + actionPermissions: data.map((permission) => { + const item: any = {}; + Object.keys(permission).forEach((key) => { + if (isValid(permission[key])) { + item[key] = permission[key]; + } + }); + item.fields = permission?.fields.map((field) => field.key) || []; + return item; + }), + }); + }, + manual: true, + }, + ); + const [visible] = useContext(VisibleContext); + + useEffect(() => { + if (visible) { + service.run({}); + } + }, [visible]); + + return { resource, service, initialValues: service.data, ...service }; +}; + +const useDetailsResource = ({ onSuccess }) => { + const { props } = useTable(); + const ctx = useContext(TableRowContext); + const resource = Resource.make({ + resourceName: 'collections', + resourceKey: ctx.record[props.rowKey], + }); + const service = useRequest( + (params?: any) => { + return resource.get({ ...params }); + }, + { + formatResult: (result) => result?.data, + onSuccess, + manual: true, + }, + ); + const [visible] = useContext(VisibleContext); + + useEffect(() => { + if (visible) { + service.run({}); + } + }, [visible]); + + return { resource, service, initialValues: service.data, ...service }; +}; + +const useFieldsResource = () => { + const { props } = useTable(); + const ctx = useContext(TableRowContext); + class FieldResource extends Resource { + list(options) { + return super.list({ + ...options, + filter: { state: 1, collection_name: ctx.record[props.rowKey] }, + }); + } + } + const resource = FieldResource.make('fields'); + return { + resource, + }; +}; + +const fieldInterfaces = []; +for (const [key, schema] of interfaces) { + fieldInterfaces.push({ + value: key, + label: schema.title, + }); +} + +const collectionSchema: ISchema = { + type: 'array', + 'x-decorator': 'VisibleProvider', + 'x-component': 'Table', + default: [], + 'x-component-props': { + rowKey: 'key', + dragSort: true, + showIndex: true, + refreshRequestOnChange: true, + pagination: { + pageSize: 10, + }, + defaultAppends: ['uiSchema'], + useResource: useFieldsResource, + collectionName: 'fields', + }, + properties: { + [uid()]: { + type: 'void', + 'x-component': 'Table.ActionBar', + properties: { + [uid()]: { + type: 'void', + name: 'action1', + title: '删除', + 'x-align': 'right', + 'x-decorator': 'AddNew.Displayed', + 'x-decorator-props': { + displayName: 'destroy', + }, + 'x-component': 'Action', + 'x-component-props': { + icon: 'DeleteOutlined', + confirm: { + title: '删除数据', + content: '删除后无法恢复,确定要删除吗?', + }, + useAction: '{{ Table.useTableDestroyAction }}', + }, + }, + [uid()]: { + type: 'void', + title: '添加', + 'x-align': 'right', + 'x-decorator': 'AddNew.Displayed', + 'x-decorator-props': { + displayName: 'create', + }, + 'x-component': 'CreateFieldButton', + 'x-component-props': { + type: 'primary', + icon: 'PlusOutlined', + }, + }, + }, + }, + column1: { + type: 'void', + title: '字段名称', + 'x-component': 'Table.Column', + properties: { + 'uiSchema.title': { + type: 'string', + 'x-component': 'Input', + 'x-read-pretty': true, + }, + }, + }, + column2: { + type: 'void', + title: '字段标识', + 'x-component': 'Table.Column', + properties: { + name: { + type: 'string', + 'x-component': 'Input', + 'x-read-pretty': true, + }, + }, + }, + column3: { + type: 'void', + title: '字段类型', + 'x-component': 'Table.Column', + properties: { + interface: { + type: 'string', + 'x-component': 'Select', + 'x-read-pretty': true, + // @ts-ignore + enum: fieldInterfaces, + }, + }, + }, + [uid()]: { + type: 'void', + title: '操作', + 'x-component': 'Table.Column', + 'x-component-props': { + width: 160, + }, + properties: { + [uid()]: { + type: 'void', + 'x-component': 'Action.Group', + 'x-component-props': { + type: 'link', + }, + properties: { + [uid()]: { + type: 'void', + title: '编辑', + 'x-component': 'EditFieldButton', + 'x-component-props': { + type: 'link', + useAction() { + return { + async run() { + alert('abc'); + }, + }; + }, + }, + 'x-action-type': 'update', + }, + [uid()]: { + type: 'void', + title: '删除', + 'x-component': 'Action', + 'x-action-type': 'destroy', + 'x-component-props': { + type: 'link', + confirm: { + title: '删除数据', + content: '删除后无法恢复,确定要删除吗?', + }, + useAction: '{{ Table.useTableDestroyAction }}', + }, + }, + }, + }, + }, + }, + }, +}; + +function FieldConfigTitle() { + const ctx = useContext(TableRowContext); + return <>{`配置「${ctx.record.title}」表字段`}; +} + +const schema: ISchema = { + type: 'void', + name: 'action', + 'x-component': 'Action', + 'x-component-props': { + tooltip: '数据表配置', + className: 'nb-database-config', + icon: 'DatabaseOutlined', + type: 'primary', + }, + properties: { + modal1: { + type: 'void', + title: '数据表配置', + 'x-component': 'Action.Drawer', + properties: { + table: { + type: 'array', + // 'x-decorator': 'CardItem', + 'x-component': 'Table', + default: [], + 'x-component-props': { + rowKey: 'name', + dragSort: true, + showIndex: true, + refreshRequestOnChange: true, + pagination: { + pageSize: 10, + }, + useResource, + collectionName: 'collections', + }, + properties: { + [uid()]: { + type: 'void', + 'x-component': 'Table.ActionBar', + properties: { + [uid()]: { + type: 'void', + name: 'action1', + title: '删除', + 'x-align': 'right', + 'x-decorator': 'AddNew.Displayed', + 'x-decorator-props': { + displayName: 'destroy', + }, + 'x-component': 'Action', + 'x-component-props': { + icon: 'DeleteOutlined', + confirm: { + title: '删除数据', + content: '删除后无法恢复,确定要删除吗?', + }, + useAction: '{{ Table.useTableDestroyAction }}', + }, + }, + [uid()]: { + type: 'void', + title: '创建数据表', + 'x-align': 'right', + 'x-decorator': 'AddNew.Displayed', + 'x-decorator-props': { + displayName: 'create', + }, + 'x-component': 'Action', + 'x-component-props': { + type: 'primary', + icon: 'PlusOutlined', + }, + properties: { + modal: { + type: 'void', + title: '创建数据表', + 'x-decorator': 'Form', + 'x-component': 'Action.Drawer', + 'x-component-props': { + useOkAction: '{{ Table.useTableCreateAction }}', + }, + properties: { + title: { + type: 'string', + title: '数据表名称', + 'x-component': 'Input', + 'x-decorator': 'FormilyFormItem', + }, + }, + }, + }, + }, + }, + }, + column1: { + type: 'void', + title: '数据表名称', + 'x-component': 'Table.Column', + properties: { + title: { + type: 'string', + 'x-component': 'Input', + 'x-read-pretty': true, + }, + }, + }, + column2: { + type: 'void', + title: '数据表标识', + 'x-component': 'Table.Column', + properties: { + name: { + type: 'string', + 'x-component': 'Input', + 'x-read-pretty': true, + }, + }, + }, + [uid()]: { + type: 'void', + title: '操作', + 'x-component': 'Table.Column', + 'x-component-props': { + width: 160, + }, + properties: { + [uid()]: { + type: 'void', + 'x-component': 'Action.Group', + 'x-component-props': { + type: 'link', + }, + properties: { + [uid()]: { + type: 'void', + title: '配置字段', + 'x-component': 'Action', + 'x-component-props': { + type: 'link', + }, + 'x-action-type': 'view', + properties: { + [uid()]: { + type: 'void', + title: , + // 'x-decorator': 'RoleProvider', + 'x-component': 'Action.Drawer', + 'x-component-props': {}, + properties: { + [uid()]: collectionSchema, + }, + }, + }, + }, + [uid()]: { + type: 'void', + title: '编辑', + 'x-component': 'Action', + 'x-component-props': { + type: 'link', + }, + 'x-action-type': 'update', + properties: { + [uid()]: { + type: 'void', + title: '编辑数据表', + 'x-decorator': 'Form', + 'x-decorator-props': { + useResource: useDetailsResource, + }, + 'x-component': 'Action.Drawer', + 'x-component-props': { + useOkAction: '{{ Table.useTableUpdateAction }}', + }, + properties: { + title: { + type: 'string', + title: '数据表名称', + 'x-component': 'Input', + 'x-decorator': 'FormilyFormItem', + }, + }, + }, + }, + }, + [uid()]: { + type: 'void', + title: '删除', + 'x-component': 'Action', + 'x-action-type': 'destroy', + 'x-component-props': { + type: 'link', + confirm: { + title: '删除数据', + content: '删除后无法恢复,确定要删除吗?', + }, + useAction: '{{ Table.useTableDestroyAction }}', + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, +}; + +function CreateFieldButton() { + const { refresh } = useCollectionsContext(); + const ctx = useContext(TableRowContext); + const { service } = useTable(); + const [visible, setVisible] = useState(false); + const form = useMemo(() => createForm(), []); + const [properties, setProperties] = useState({}); + const { collections = [], loading } = useCollectionsContext(); + + const loadCollections = async (field: any) => { + return collections.map((item: any) => ({ + label: item.title, + value: item.name, + })); + }; + + const loadCollectionFields = async (field: Field) => { + const target = field.query('....target').get('value'); + const f = field.query('....target').take(); + console.log('loadCollectionFields', f, field); + const collection = collections?.find((item) => item.name === target); + if (!collection) { + return []; + } + return collection?.generalFields + ?.filter((item) => item?.uiSchema?.title) + ?.map((item) => ({ + label: item?.uiSchema?.title || item.name, + value: item.name, + })); + }; + + const menu = ( + { + console.log('click', info.key); + const schema = interfaces.get(info.key); + form.setValues({ + ...schema.default, + collection_name: ctx.record.name, + key: uid(), + name: uid(), + interface: info.key, + }); + setProperties(clone(schema.properties)); + setVisible(true); + }} + > + {options.map( + (option, groupIndex) => + option.children.length > 0 && ( + + {option.children.map((item) => ( + + {item.title} + + ))} + + ), + )} + + ); + return ( + <> + + + + setVisible(false)} + footer={ + + + + + } + > + + + + + + ); +} + +function EditFieldButton() { + const { refresh } = useCollectionsContext(); + const { service } = useTable(); + const ctx = useContext(TableRowContext); + const [visible, setVisible] = useState(false); + const form = useMemo(() => createForm(), []); + const schema = interfaces.get(ctx.record.interface); + const { collections = [], loading } = useCollectionsContext(); + + const loadCollections = async (field: any) => { + return collections.map((item: any) => ({ + label: item.title, + value: item.name, + })); + }; + + const loadCollectionFields = async (field: Field) => { + const target = field.query('....target').get('value'); + const f = field.query('....target').take(); + console.log('loadCollectionFields', f, field); + const collection = collections?.find((item) => item.name === target); + if (!collection) { + return []; + } + return collection?.generalFields + ?.filter((item) => item?.uiSchema?.title) + ?.map((item) => ({ + label: item?.uiSchema?.title || item.name, + value: item.name, + })); + }; + return ( + <> + + setVisible(false)} + footer={ + + + + + } + > + + + + + + ); +} + +export const Collections = () => { + return ( + + ); +}; + +export default Collections; diff --git a/packages/client/src/components/admin-layout/index.tsx b/packages/client/src/components/admin-layout/index.tsx index 140995162..568179eef 100644 --- a/packages/client/src/components/admin-layout/index.tsx +++ b/packages/client/src/components/admin-layout/index.tsx @@ -36,6 +36,7 @@ import { } from '../../constate'; import { uid } from '@formily/shared'; import { Permissions } from './Permissions'; +import { Collections } from './Collections' import { More } from './More'; import { UserInfo } from './UserInfo'; import { @@ -160,7 +161,7 @@ function LayoutWithMenu(props: LayoutWithMenuProps) { /> - + diff --git a/packages/plugin-collections/src/actions/fields.ts b/packages/plugin-collections/src/actions/fields.ts index 048b834b7..8bdcd498b 100644 --- a/packages/plugin-collections/src/actions/fields.ts +++ b/packages/plugin-collections/src/actions/fields.ts @@ -1,13 +1,10 @@ import { Model, ModelCtor } from '@nocobase/database'; import { actions, middlewares } from '@nocobase/actions'; -import { sort } from '@nocobase/actions/src/actions/common'; import { cloneDeep, omit } from 'lodash'; export const create = async (ctx: actions.Context, next: actions.Next) => { await actions.common.create(ctx, async () => {}); - const { associated } = ctx.action.params; await ctx.body.generateReverseField(); - await associated.migrate(); - // console.log('associated.migrate'); + await ctx.body.migrate(); await next(); } diff --git a/packages/plugin-collections/src/models/field.ts b/packages/plugin-collections/src/models/field.ts index 6453b59fa..3cb750e2b 100644 --- a/packages/plugin-collections/src/models/field.ts +++ b/packages/plugin-collections/src/models/field.ts @@ -42,6 +42,11 @@ export class Field extends Model { return props; } + async migrate() { + const collection = await this.getCollection(); + await collection.migrate() + } + async getNestedFields() { const fields = await this.getChildren(); const items = []; diff --git a/packages/plugin-collections/src/server.ts b/packages/plugin-collections/src/server.ts index 08b1a7df2..f777e9bfe 100644 --- a/packages/plugin-collections/src/server.ts +++ b/packages/plugin-collections/src/server.ts @@ -96,4 +96,6 @@ export default async function (this: Application, options = {}) { this.resourcer.registerActionHandler('collections.fields:create', create); this.resourcer.registerActionHandler('collections:findAll', findAll); this.resourcer.registerActionHandler('collections:createOrUpdate', createOrUpdate); + this.resourcer.registerActionHandler('fields:create', create); + this.resourcer.registerActionHandler('collections:create', createOrUpdate); } From a3c4a8dd9c321ec7366e192883caba1bd24e14b6 Mon Sep 17 00:00:00 2001 From: chenos Date: Tue, 14 Sep 2021 16:29:47 +0800 Subject: [PATCH 5/6] fix: defaultPageSize=100 --- .../client/src/components/admin-layout/Collections/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/client/src/components/admin-layout/Collections/index.tsx b/packages/client/src/components/admin-layout/Collections/index.tsx index 64081293d..ff8c884b7 100644 --- a/packages/client/src/components/admin-layout/Collections/index.tsx +++ b/packages/client/src/components/admin-layout/Collections/index.tsx @@ -189,7 +189,7 @@ const collectionSchema: ISchema = { showIndex: true, refreshRequestOnChange: true, pagination: { - pageSize: 10, + pageSize: 100, }, defaultAppends: ['uiSchema'], useResource: useFieldsResource, @@ -357,7 +357,7 @@ const schema: ISchema = { showIndex: true, refreshRequestOnChange: true, pagination: { - pageSize: 10, + pageSize: 100, }, useResource, collectionName: 'collections', From 819f1a3472a86a111e14cf7175ac9d5e377687f2 Mon Sep 17 00:00:00 2001 From: chenos Date: Tue, 14 Sep 2021 16:44:11 +0800 Subject: [PATCH 6/6] fix: Field form values is not displayed --- .../src/components/admin-layout/Collections/index.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/client/src/components/admin-layout/Collections/index.tsx b/packages/client/src/components/admin-layout/Collections/index.tsx index ff8c884b7..cd9549a18 100644 --- a/packages/client/src/components/admin-layout/Collections/index.tsx +++ b/packages/client/src/components/admin-layout/Collections/index.tsx @@ -652,7 +652,7 @@ function CreateFieldButton() { } function EditFieldButton() { - const { refresh } = useCollectionsContext(); + const { refresh, findCollection } = useCollectionsContext(); const { service } = useTable(); const ctx = useContext(TableRowContext); const [visible, setVisible] = useState(false); @@ -688,7 +688,11 @@ function EditFieldButton() { type={'link'} onClick={() => { setVisible(true); - form.setValues(clone(ctx.record)); + const collection = findCollection(ctx.record.collection_name); + const values = collection?.generalFields?.find( + (field) => field.key === ctx.record.key, + ); + form.setValues(clone(values || {})); }} > 编辑