diff --git a/package-lock.json b/package-lock.json index 4e350f5..85d60ae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,9 +23,6 @@ "admin": { "name": "@o2o/admin", "version": "0.0.0", - "dev": true, - "optional": true, - "peer": true, "dependencies": { "@o2o/shared": "*", "@tailwindcss/vite": "^4.1.14", @@ -176,6 +173,7 @@ "integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.7", @@ -637,6 +635,7 @@ "resolved": "https://registry.npmjs.org/@dnd-kit/core/-/core-6.3.1.tgz", "integrity": "sha512-xkGBRQQab4RLwgXxoqETICr6S5JlogafbhNsidmrkVv2YRs5MLwpjoF2qpiGjQt8S9AoxtIV603s0GIUpY5eYQ==", "license": "MIT", + "peer": true, "dependencies": { "@dnd-kit/accessibility": "^3.1.1", "@dnd-kit/utilities": "^3.2.2", @@ -1624,9 +1623,6 @@ "cpu": [ "x64" ], - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1963,6 +1959,42 @@ } } }, + "node_modules/@reduxjs/toolkit": { + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/@reduxjs/toolkit/-/toolkit-2.13.0.tgz", + "integrity": "sha512-f6jwVRfwW30+tnllz4YcsHHpPYYOE7abcHkyUCovD+P7DyhdAI5prz2Fh/8TLhakjpN+7aIEion1s5L/tvlYlA==", + "license": "MIT", + "dependencies": { + "@standard-schema/spec": "^1.0.0", + "@standard-schema/utils": "^0.3.0", + "immer": "^11.0.0", + "redux": "^5.0.1", + "redux-thunk": "^3.1.0", + "reselect": "^5.1.0" + }, + "peerDependencies": { + "react": "^16.9.0 || ^17.0.0 || ^18 || ^19", + "react-redux": "^7.2.1 || ^8.1.3 || ^9.0.0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + }, + "react-redux": { + "optional": true + } + } + }, + "node_modules/@reduxjs/toolkit/node_modules/immer": { + "version": "11.1.21", + "resolved": "https://registry.npmjs.org/immer/-/immer-11.1.21.tgz", + "integrity": "sha512-bZSadeCPGdaY5/qRLgr6mDSH1ra21rD3rqpiWk7+QTr4ayYPTE9qZYdLh/NdPhMe0wSrTvHD/Lk8q5EwhUs0aw==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/immer" + } + }, "node_modules/@remix-run/node-fetch-server": { "version": "0.13.3", "resolved": "https://registry.npmjs.org/@remix-run/node-fetch-server/-/node-fetch-server-0.13.3.tgz", @@ -2062,9 +2094,6 @@ "cpu": [ "arm" ], - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -2078,9 +2107,6 @@ "cpu": [ "arm" ], - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -2094,9 +2120,6 @@ "cpu": [ "arm64" ], - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -2110,9 +2133,6 @@ "cpu": [ "arm64" ], - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -2126,9 +2146,6 @@ "cpu": [ "loong64" ], - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -2142,9 +2159,6 @@ "cpu": [ "loong64" ], - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -2158,9 +2172,6 @@ "cpu": [ "ppc64" ], - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -2174,9 +2185,6 @@ "cpu": [ "ppc64" ], - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -2190,9 +2198,6 @@ "cpu": [ "riscv64" ], - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -2206,9 +2211,6 @@ "cpu": [ "riscv64" ], - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -2222,9 +2224,6 @@ "cpu": [ "s390x" ], - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -2238,9 +2237,6 @@ "cpu": [ "x64" ], - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -2254,9 +2250,6 @@ "cpu": [ "x64" ], - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -2402,8 +2395,8 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz", "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==", - "devOptional": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@standard-schema/utils": { "version": "0.3.0", @@ -2857,9 +2850,6 @@ "cpu": [ "arm64" ], - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -2876,9 +2866,6 @@ "cpu": [ "arm64" ], - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -2895,9 +2882,6 @@ "cpu": [ "x64" ], - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -2914,9 +2898,6 @@ "cpu": [ "x64" ], - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -3083,6 +3064,69 @@ "assertion-error": "^2.0.1" } }, + "node_modules/@types/d3-array": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/@types/d3-array/-/d3-array-3.2.2.tgz", + "integrity": "sha512-hOLWVbm7uRza0BYXpIIW5pxfrKe0W+D5lrFiAEYR+pb6w3N2SwSMaJbXdUfSEv+dT4MfHBLtn5js0LAWaO6otw==", + "license": "MIT" + }, + "node_modules/@types/d3-color": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/@types/d3-color/-/d3-color-3.1.3.tgz", + "integrity": "sha512-iO90scth9WAbmgv7ogoq57O9YpKmFBbmoEoCHDB2xMBY0+/KVrqAaCDyCE16dUspeOvIxFFRI+0sEtqDqy2b4A==", + "license": "MIT" + }, + "node_modules/@types/d3-ease": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/d3-ease/-/d3-ease-3.0.2.tgz", + "integrity": "sha512-NcV1JjO5oDzoK26oMzbILE6HW7uVXOHLQvHshBUW4UMdZGfiY6v5BeQwh9a9tCzv+CeefZQHJt5SRgK154RtiA==", + "license": "MIT" + }, + "node_modules/@types/d3-interpolate": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/d3-interpolate/-/d3-interpolate-3.0.4.tgz", + "integrity": "sha512-mgLPETlrpVV1YRJIglr4Ez47g7Yxjl1lj7YKsiMCb27VJH9W8NVM6Bb9d8kkpG/uAQS5AmbA48q2IAolKKo1MA==", + "license": "MIT", + "dependencies": { + "@types/d3-color": "*" + } + }, + "node_modules/@types/d3-path": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@types/d3-path/-/d3-path-3.1.1.tgz", + "integrity": "sha512-VMZBYyQvbGmWyWVea0EHs/BwLgxc+MKi1zLDCONksozI4YJMcTt8ZEuIR4Sb1MMTE8MMW49v0IwI5+b7RmfWlg==", + "license": "MIT" + }, + "node_modules/@types/d3-scale": { + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/@types/d3-scale/-/d3-scale-4.0.9.tgz", + "integrity": "sha512-dLmtwB8zkAeO/juAMfnV+sItKjlsw2lKdZVVy6LRr0cBmegxSABiLEpGVmSJJ8O08i4+sGR6qQtb6WtuwJdvVw==", + "license": "MIT", + "dependencies": { + "@types/d3-time": "*" + } + }, + "node_modules/@types/d3-shape": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@types/d3-shape/-/d3-shape-3.2.0.tgz", + "integrity": "sha512-kVd74ta9eof3eJOvbNd1vGKS/XERRyQbT26Og63hIsvDO84cjD5gEOhsXf26w3FSoNlPVz84DOFcKv/oou+fMw==", + "license": "MIT", + "dependencies": { + "@types/d3-path": "*" + } + }, + "node_modules/@types/d3-time": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/d3-time/-/d3-time-3.0.4.tgz", + "integrity": "sha512-yuzZug1nkAAaBlBBikKZTgzCeA+k1uy4ZFwWANOfKw5z5LRhV0gNA7gNkKm7HoK+HRN0wX3EkxGk0fpbWhmB7g==", + "license": "MIT" + }, + "node_modules/@types/d3-timer": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/d3-timer/-/d3-timer-3.0.2.tgz", + "integrity": "sha512-Ps3T8E8dZDam6fUyNiMkekK3XUsaUEik+idO9/YjPtfj2qruF8tFBXS7XhtE4iIXBLxhmLjP3SXpLhVf21I9Lw==", + "license": "MIT" + }, "node_modules/@types/deep-eql": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", @@ -3139,6 +3183,7 @@ "integrity": "sha512-AnzbBERsrLKtk2XSfTbYRLjQPdy116Sty4q+T+Bp3IC4l6jNBvreVPAHmpq9qhXQM7CXZPjLVmGMw9sy+hxQ3w==", "devOptional": true, "license": "MIT", + "peer": true, "dependencies": { "csstype": "^3.2.2" } @@ -3167,6 +3212,12 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/use-sync-external-store": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/@types/use-sync-external-store/-/use-sync-external-store-0.0.6.tgz", + "integrity": "sha512-zFDAD+tlpf2r4asuHEj0XH6pY6i0g5NeAHPn+15wk3BV6JA69eERFXC1gyGThDkVa1zCyKr5jox1+2LbV/AMLg==", + "license": "MIT" + }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "8.68.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.68.0.tgz", @@ -3212,6 +3263,7 @@ "integrity": "sha512-fHq2VC1kpyYfvEcbiMjOpySY4WS7voEp89yAThrHRX5sm9j2lzYppCb2umFMEed4fWcyeLjHxrz0mpjNBaBxMQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.68.0", "@typescript-eslint/types": "8.68.0", @@ -3602,6 +3654,7 @@ "integrity": "sha512-lGq+9yr1/GuAWaVYIHRjvvySG5/4VfKIvC8EWxStPdcDh/Ka7FG3twP6v4d5BkravUilhIAsG4Qj83t02LWUPQ==", "dev": true, "license": "MIT", + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -3625,6 +3678,7 @@ "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", "devOptional": true, "license": "MIT", + "peer": true, "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", @@ -3657,6 +3711,7 @@ "integrity": "sha512-V3wD15YHfHz6y0KdhYFjyy9vWtEVALT9UrxfN3zqlI6dMioHnJrqOYfyPKol3oqrnCM9uwkcdCwkJ0WUcbLMTQ==", "devOptional": true, "license": "MIT", + "peer": true, "peerDependencies": { "ajv": "^8.0.1" } @@ -3667,6 +3722,7 @@ "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", "devOptional": true, "license": "MIT", + "peer": true, "dependencies": { "ajv": "^8.0.0" }, @@ -3901,6 +3957,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "baseline-browser-mapping": "^2.11.12", "caniuse-lite": "^1.0.30001809", @@ -4118,6 +4175,7 @@ "integrity": "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=20" } @@ -4185,6 +4243,127 @@ "devOptional": true, "license": "MIT" }, + "node_modules/d3-array": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.2.4.tgz", + "integrity": "sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg==", + "license": "ISC", + "dependencies": { + "internmap": "1 - 2" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-color": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz", + "integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-ease": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-3.0.1.tgz", + "integrity": "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-format": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-3.1.2.tgz", + "integrity": "sha512-AJDdYOdnyRDV5b6ArilzCPPwc1ejkHcoyFarqlPqT7zRYjhavcT3uSrqcMvsgh2CgoPbK3RCwyHaVyxYcP2Arg==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-interpolate": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz", + "integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==", + "license": "ISC", + "dependencies": { + "d3-color": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-path": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-3.1.0.tgz", + "integrity": "sha512-p3KP5HCf/bvjBSSKuXid6Zqijx7wIfNW+J/maPs+iwR35at5JCbLUT0LzF1cnjbCHWhqzQTIN2Jpe8pRebIEFQ==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-scale": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.2.tgz", + "integrity": "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==", + "license": "ISC", + "dependencies": { + "d3-array": "2.10.0 - 3", + "d3-format": "1 - 3", + "d3-interpolate": "1.2.0 - 3", + "d3-time": "2.1.1 - 3", + "d3-time-format": "2 - 4" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-shape": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-3.2.0.tgz", + "integrity": "sha512-SaLBuwGm3MOViRq2ABk3eLoxwZELpH6zhl3FbAoJ7Vm1gofKx6El1Ib5z23NUEhF9AsGl7y+dzLe5Cw2AArGTA==", + "license": "ISC", + "dependencies": { + "d3-path": "^3.1.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-time": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-3.1.0.tgz", + "integrity": "sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q==", + "license": "ISC", + "dependencies": { + "d3-array": "2 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-time-format": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-4.1.0.tgz", + "integrity": "sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==", + "license": "ISC", + "dependencies": { + "d3-time": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-timer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-3.0.1.tgz", + "integrity": "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, "node_modules/data-view-buffer": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz", @@ -4257,6 +4436,12 @@ } } }, + "node_modules/decimal.js-light": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/decimal.js-light/-/decimal.js-light-2.5.1.tgz", + "integrity": "sha512-qIMFpTMZmny+MMIitAB6D7iVPEorVw6YQRWkvarTkT4tBeSLLiHzcwj6q0MmYSFCiVpiqPJTJEYIrpcPzVEIvg==", + "license": "MIT" + }, "node_modules/dedent": { "version": "1.7.2", "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.7.2.tgz", @@ -4373,7 +4558,8 @@ "version": "8.6.0", "resolved": "https://registry.npmjs.org/embla-carousel/-/embla-carousel-8.6.0.tgz", "integrity": "sha512-SjWyZBHJPbqxHOzckOfo8lHisEaJWmwd23XppYFYVh10bU66/Pn5tkVkbkCMZVdbUE5eTCI2nD8OyIP4Z+uwkA==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/embla-carousel-react": { "version": "8.6.0", @@ -4632,6 +4818,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/es-toolkit": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/es-toolkit/-/es-toolkit-1.52.0.tgz", + "integrity": "sha512-XTNEJQh1tY1ZJVcf6ayP/2n4ZPyaHlW2FWs7xvw5ddPuhUVjLD3olQVQS7kf58JbAB48iL0uL/jerTrjtV3lDA==", + "license": "MIT", + "workspaces": [ + "docs", + "benchmarks", + "tests/types", + "tests/browser-compat" + ] + }, "node_modules/es6-promise": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.3.1.tgz", @@ -4710,6 +4908,7 @@ "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", @@ -4912,6 +5111,12 @@ "node": ">=0.10.0" } }, + "node_modules/eventemitter3": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.4.tgz", + "integrity": "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==", + "license": "MIT" + }, "node_modules/execa": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", @@ -5629,6 +5834,15 @@ "node": ">= 0.4" } }, + "node_modules/internmap": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/internmap/-/internmap-2.0.3.tgz", + "integrity": "sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, "node_modules/is-array-buffer": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", @@ -6112,6 +6326,7 @@ "integrity": "sha512-B7qPcEVE3NVkmSJbaYxvv4cHkVW7DQsZz13pUMrfS8z8Q/BuShN+gcTXrUlPiGqM2/t/EEaI030bpxMqY8gMlw==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 10.16.0" } @@ -6392,9 +6607,6 @@ "cpu": [ "arm64" ], - "libc": [ - "glibc" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -6415,9 +6627,6 @@ "cpu": [ "arm64" ], - "libc": [ - "musl" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -6438,9 +6647,6 @@ "cpu": [ "x64" ], - "libc": [ - "glibc" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -6461,9 +6667,6 @@ "cpu": [ "x64" ], - "libc": [ - "musl" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -7489,6 +7692,7 @@ "resolved": "https://registry.npmjs.org/react/-/react-19.2.8.tgz", "integrity": "sha512-PWaYA1L/q9u2u7xYQi+Y3L3Yfnie7XyLeaJICV1MGD6LprsBxcAqGjYyr0eY3p+QdsA+x/Irkt4Qif8D63+Sbw==", "license": "MIT", + "peer": true, "engines": { "node": ">=0.10.0" } @@ -7498,6 +7702,7 @@ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.8.tgz", "integrity": "sha512-rVprimfGBG3DR+Tq0IQG2DT5PxKth1WIGDmj5yPmlzr4YBe7uyE+Du4oVqTDXZSHGGGXRtTJEGSSePyQCMBglQ==", "license": "MIT", + "peer": true, "dependencies": { "scheduler": "^0.27.0" }, @@ -7510,6 +7715,7 @@ "resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.86.0.tgz", "integrity": "sha512-4kbWJrh5jPZt1+YqVcXcGKffGcXV/XVbozknLh0Yjh0KhpoAkus21TAQhzRYqNwFkkObmnSvRlZZ3GT+ehoIrA==", "license": "MIT", + "peer": true, "engines": { "node": ">=18.0.0" }, @@ -7521,6 +7727,37 @@ "react": "^16.8.0 || ^17 || ^18 || ^19" } }, + "node_modules/react-is": { + "version": "19.3.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-19.3.0.tgz", + "integrity": "sha512-UpMYezM4v5/18F28aC66AEsjXIgE02kyEMH6yLdgLXu/UTfa1Ntwck/nNLrbqJsEXW7gPb0coNO9FQse9WTovA==", + "license": "MIT", + "peer": true + }, + "node_modules/react-redux": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-9.3.0.tgz", + "integrity": "sha512-KQopgqFo/p/fgmAs5qz6p5RWaNAzq40WAu7fJIXnQpYxFPbJYtsJPWvGeF2rOBaY/kEuV77AVsX8TsQzKm+A/g==", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/use-sync-external-store": "^0.0.6", + "use-sync-external-store": "^1.4.0" + }, + "peerDependencies": { + "@types/react": "^18.2.25 || ^19", + "react": "^18.0 || ^19", + "redux": "^5.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "redux": { + "optional": true + } + } + }, "node_modules/react-refresh": { "version": "0.18.0", "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.18.0.tgz", @@ -7536,6 +7773,7 @@ "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.18.3.tgz", "integrity": "sha512-gyXgtdr5uACJ5b1Q4udzjVV+tb/rlHIMJKuJ0e89R4Kzgz47z/rgP0dIKxktqIEUhDHluGTPJJH/wRha7CyqsA==", "license": "MIT", + "peer": true, "dependencies": { "cookie": "^1.0.1", "set-cookie-parser": "^2.6.0" @@ -7567,6 +7805,62 @@ "url": "https://paulmillr.com/funding/" } }, + "node_modules/recharts": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/recharts/-/recharts-3.10.1.tgz", + "integrity": "sha512-QXFrvt6IVcw7eeZCoyXTwkIJAX3Dv1nyVhMicXJ47GsGDDpcN8z6o644DibE9XjpBTThtsomLKnTV6lc+cVFUA==", + "license": "MIT", + "workspaces": [ + "www" + ], + "dependencies": { + "@reduxjs/toolkit": "^1.9.0 || 2.x.x", + "clsx": "^2.1.1", + "decimal.js-light": "^2.5.1", + "es-toolkit": "^1.39.3", + "eventemitter3": "^5.0.1", + "immer": "^11.1.8", + "react-redux": "8.x.x || 9.x.x", + "reselect": "5.2.0", + "tiny-invariant": "^1.3.3", + "use-sync-external-store": "^1.2.2", + "victory-vendor": "^37.0.2" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "react-is": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/recharts/node_modules/immer": { + "version": "11.1.21", + "resolved": "https://registry.npmjs.org/immer/-/immer-11.1.21.tgz", + "integrity": "sha512-bZSadeCPGdaY5/qRLgr6mDSH1ra21rD3rqpiWk7+QTr4ayYPTE9qZYdLh/NdPhMe0wSrTvHD/Lk8q5EwhUs0aw==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/immer" + } + }, + "node_modules/redux": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/redux/-/redux-5.0.1.tgz", + "integrity": "sha512-M9/ELqF6fy8FwmkpnF0S3YKOqMyoWJ4+CS5Efg2ct3oY9daQvd/Pc71FpGZsVsbl3Cpb+IIcjBDUnnyBdQbq4w==", + "license": "MIT", + "peer": true + }, + "node_modules/redux-thunk": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/redux-thunk/-/redux-thunk-3.1.0.tgz", + "integrity": "sha512-NW2r5T6ksUKXCabzhL9z+h206HQw/NJkcLm1GPImRQ8IzfXwRGqjVhKJGauHirT0DAuyy6hjdnMZaRoAcy0Klw==", + "license": "MIT", + "peerDependencies": { + "redux": "^5.0.0" + } + }, "node_modules/reflect.getprototypeof": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", @@ -7641,6 +7935,12 @@ "node": ">=0.10.0" } }, + "node_modules/reselect": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/reselect/-/reselect-5.2.0.tgz", + "integrity": "sha512-AgZ3UOZm3YndfrJ4OYjgrT7bmCm/1iqkjvEfH/oYjzh6PD2qw4QuT3jjnXIrpdt4MTpMXclMT3lXbmRY+XRakw==", + "license": "MIT" + }, "node_modules/resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", @@ -8301,6 +8601,12 @@ "url": "https://opencollective.com/webpack" } }, + "node_modules/tiny-invariant": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz", + "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==", + "license": "MIT" + }, "node_modules/tinybench": { "version": "2.9.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", @@ -8356,6 +8662,7 @@ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -8540,6 +8847,7 @@ "integrity": "sha512-uSKqkh8Cr48vllnEy+jdaAgOeR6Y+QCBW7usgUsKj7gJEfR7stw9U/fE49LBnj2tPRKPY0c0EBJSWe9Appmplg==", "dev": true, "license": "Apache-2.0", + "peer": true, "dependencies": { "@gerrit0/mini-shiki": "^3.23.0", "lunr": "^2.3.9", @@ -8629,6 +8937,7 @@ "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", "devOptional": true, "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -8752,6 +9061,15 @@ "dev": true, "license": "MIT" }, + "node_modules/use-sync-external-store": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.7.0.tgz", + "integrity": "sha512-6L+EeigHMQhdaIPNIFUKwfWJSwWFQ8gJbJ2DLOs5sDIegTwR9fRxvnM3uciHKjIZhFz+KAv2emhWMRvDmMcY8A==", + "license": "MIT", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, "node_modules/utility-types": { "version": "3.11.0", "resolved": "https://registry.npmjs.org/utility-types/-/utility-types-3.11.0.tgz", @@ -8768,6 +9086,7 @@ "integrity": "sha512-gjdCvJ6d3RyHAneqxMYMW9QMCwYMb3jpOO0IyHZV1bnRHFBHrX3VkIILt5XYR0WhwHiH7Mty8ovuPZ/O3gamrg==", "devOptional": true, "license": "MIT", + "peer": true, "peerDependencies": { "typescript": ">=5" }, @@ -8787,11 +9106,34 @@ "node": ">= 0.10" } }, + "node_modules/victory-vendor": { + "version": "37.3.6", + "resolved": "https://registry.npmjs.org/victory-vendor/-/victory-vendor-37.3.6.tgz", + "integrity": "sha512-SbPDPdDBYp+5MJHhBCAyI7wKM3d5ivekigc2Dk2s7pgbZ9wIgIBYGVw4zGHBml/qTFbexrofXW6Gu4noGxrOwQ==", + "license": "MIT AND ISC", + "dependencies": { + "@types/d3-array": "^3.0.3", + "@types/d3-ease": "^3.0.0", + "@types/d3-interpolate": "^3.0.1", + "@types/d3-scale": "^4.0.2", + "@types/d3-shape": "^3.1.0", + "@types/d3-time": "^3.0.0", + "@types/d3-timer": "^3.0.0", + "d3-array": "^3.1.6", + "d3-ease": "^3.0.1", + "d3-interpolate": "^3.0.1", + "d3-scale": "^4.0.2", + "d3-shape": "^3.1.0", + "d3-time": "^3.0.0", + "d3-timer": "^3.0.1" + } + }, "node_modules/vite": { "version": "6.4.3", "resolved": "https://registry.npmjs.org/vite/-/vite-6.4.3.tgz", "integrity": "sha512-NTKlcQjlAK7MlQoyb6LgaqHc8sso/pVyUJYWMws3jg21uTJw/LddqIFPcPqP6PzpgbIcZyKI85sFE4HBrQDA8A==", "license": "MIT", + "peer": true, "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.4.4", @@ -8913,6 +9255,7 @@ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -9271,6 +9614,7 @@ "resolved": "https://registry.npmjs.org/zod/-/zod-4.4.3.tgz", "integrity": "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==", "license": "MIT", + "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } @@ -9338,6 +9682,7 @@ "react-dom": "^19.0.1", "react-hook-form": "^7.79.0", "react-router": "^7.17.0", + "recharts": "^3.10.1", "sonner": "^2.0.7", "tailwind-merge": "^3.6.0", "tw-animate-css": "^1.4.0", diff --git a/solution/frontend/package.json b/solution/frontend/package.json index 01b234a..b3b3129 100644 --- a/solution/frontend/package.json +++ b/solution/frontend/package.json @@ -29,6 +29,7 @@ "react-dom": "^19.0.1", "react-hook-form": "^7.79.0", "react-router": "^7.17.0", + "recharts": "^3.10.1", "sonner": "^2.0.7", "tailwind-merge": "^3.6.0", "tw-animate-css": "^1.4.0", diff --git a/solution/frontend/src/api/generated/model/crawlerBotRow.ts b/solution/frontend/src/api/generated/model/crawlerBotRow.ts new file mode 100644 index 0000000..649ecea --- /dev/null +++ b/solution/frontend/src/api/generated/model/crawlerBotRow.ts @@ -0,0 +1,16 @@ +/** + * Generated by orval v7.21.0 ๐Ÿบ + * Do not edit manually. + * Web4Ai API + * OpenAPI spec version: 0.1.0 + */ +import type { CrawlerBotRowBot } from "./crawlerBotRowBot"; +import type { CrawlerBotRowVendor } from "./crawlerBotRowVendor"; + +export interface CrawlerBotRow { + bot?: CrawlerBotRowBot; + vendor?: CrawlerBotRowVendor; + purpose: string; + hits: number; + last_at: string; +} diff --git a/solution/frontend/src/api/generated/model/crawlerBotRowBot.ts b/solution/frontend/src/api/generated/model/crawlerBotRowBot.ts new file mode 100644 index 0000000..b0c0e0c --- /dev/null +++ b/solution/frontend/src/api/generated/model/crawlerBotRowBot.ts @@ -0,0 +1,8 @@ +/** + * Generated by orval v7.21.0 ๐Ÿบ + * Do not edit manually. + * Web4Ai API + * OpenAPI spec version: 0.1.0 + */ + +export type CrawlerBotRowBot = string | null; diff --git a/solution/frontend/src/api/generated/model/crawlerBotRowVendor.ts b/solution/frontend/src/api/generated/model/crawlerBotRowVendor.ts new file mode 100644 index 0000000..9c10534 --- /dev/null +++ b/solution/frontend/src/api/generated/model/crawlerBotRowVendor.ts @@ -0,0 +1,8 @@ +/** + * Generated by orval v7.21.0 ๐Ÿบ + * Do not edit manually. + * Web4Ai API + * OpenAPI spec version: 0.1.0 + */ + +export type CrawlerBotRowVendor = string | null; diff --git a/solution/frontend/src/api/generated/model/crawlerDaily.ts b/solution/frontend/src/api/generated/model/crawlerDaily.ts new file mode 100644 index 0000000..513028a --- /dev/null +++ b/solution/frontend/src/api/generated/model/crawlerDaily.ts @@ -0,0 +1,12 @@ +/** + * Generated by orval v7.21.0 ๐Ÿบ + * Do not edit manually. + * Web4Ai API + * OpenAPI spec version: 0.1.0 + */ + +export interface CrawlerDaily { + day: string; + purpose: string; + hits: number; +} diff --git a/solution/frontend/src/api/generated/model/crawlerHitRow.ts b/solution/frontend/src/api/generated/model/crawlerHitRow.ts new file mode 100644 index 0000000..996910c --- /dev/null +++ b/solution/frontend/src/api/generated/model/crawlerHitRow.ts @@ -0,0 +1,17 @@ +/** + * Generated by orval v7.21.0 ๐Ÿบ + * Do not edit manually. + * Web4Ai API + * OpenAPI spec version: 0.1.0 + */ +import type { CrawlerHitRowBot } from "./crawlerHitRowBot"; +import type { CrawlerHitRowVendor } from "./crawlerHitRowVendor"; + +export interface CrawlerHitRow { + created_at: string; + kind: string; + bot?: CrawlerHitRowBot; + vendor?: CrawlerHitRowVendor; + purpose: string; + path: string; +} diff --git a/solution/frontend/src/api/generated/model/crawlerHitRowBot.ts b/solution/frontend/src/api/generated/model/crawlerHitRowBot.ts new file mode 100644 index 0000000..acae877 --- /dev/null +++ b/solution/frontend/src/api/generated/model/crawlerHitRowBot.ts @@ -0,0 +1,8 @@ +/** + * Generated by orval v7.21.0 ๐Ÿบ + * Do not edit manually. + * Web4Ai API + * OpenAPI spec version: 0.1.0 + */ + +export type CrawlerHitRowBot = string | null; diff --git a/solution/frontend/src/api/generated/model/crawlerHitRowVendor.ts b/solution/frontend/src/api/generated/model/crawlerHitRowVendor.ts new file mode 100644 index 0000000..4aa428e --- /dev/null +++ b/solution/frontend/src/api/generated/model/crawlerHitRowVendor.ts @@ -0,0 +1,8 @@ +/** + * Generated by orval v7.21.0 ๐Ÿบ + * Do not edit manually. + * Web4Ai API + * OpenAPI spec version: 0.1.0 + */ + +export type CrawlerHitRowVendor = string | null; diff --git a/solution/frontend/src/api/generated/model/crawlerPathRow.ts b/solution/frontend/src/api/generated/model/crawlerPathRow.ts new file mode 100644 index 0000000..f02d673 --- /dev/null +++ b/solution/frontend/src/api/generated/model/crawlerPathRow.ts @@ -0,0 +1,12 @@ +/** + * Generated by orval v7.21.0 ๐Ÿบ + * Do not edit manually. + * Web4Ai API + * OpenAPI spec version: 0.1.0 + */ + +export interface CrawlerPathRow { + path: string; + hits: number; + last_at: string; +} diff --git a/solution/frontend/src/api/generated/model/crawlerRootRow.ts b/solution/frontend/src/api/generated/model/crawlerRootRow.ts new file mode 100644 index 0000000..84a2be1 --- /dev/null +++ b/solution/frontend/src/api/generated/model/crawlerRootRow.ts @@ -0,0 +1,15 @@ +/** + * Generated by orval v7.21.0 ๐Ÿบ + * Do not edit manually. + * Web4Ai API + * OpenAPI spec version: 0.1.0 + */ +import type { CrawlerRootRowBot } from "./crawlerRootRowBot"; + +export interface CrawlerRootRow { + kind: string; + bot?: CrawlerRootRowBot; + purpose: string; + hits: number; + last_at: string; +} diff --git a/solution/frontend/src/api/generated/model/crawlerRootRowBot.ts b/solution/frontend/src/api/generated/model/crawlerRootRowBot.ts new file mode 100644 index 0000000..e9a0033 --- /dev/null +++ b/solution/frontend/src/api/generated/model/crawlerRootRowBot.ts @@ -0,0 +1,8 @@ +/** + * Generated by orval v7.21.0 ๐Ÿบ + * Do not edit manually. + * Web4Ai API + * OpenAPI spec version: 0.1.0 + */ + +export type CrawlerRootRowBot = string | null; diff --git a/solution/frontend/src/api/generated/model/crawlerSiteRow.ts b/solution/frontend/src/api/generated/model/crawlerSiteRow.ts new file mode 100644 index 0000000..0b5716b --- /dev/null +++ b/solution/frontend/src/api/generated/model/crawlerSiteRow.ts @@ -0,0 +1,15 @@ +/** + * Generated by orval v7.21.0 ๐Ÿบ + * Do not edit manually. + * Web4Ai API + * OpenAPI spec version: 0.1.0 + */ + +export interface CrawlerSiteRow { + site_id: string; + place_id: string; + name: string; + hits: number; + ai_hits: number; + last_at: string; +} diff --git a/solution/frontend/src/api/generated/model/crawlerStatsParams.ts b/solution/frontend/src/api/generated/model/crawlerStatsParams.ts new file mode 100644 index 0000000..4105d77 --- /dev/null +++ b/solution/frontend/src/api/generated/model/crawlerStatsParams.ts @@ -0,0 +1,17 @@ +/** + * Generated by orval v7.21.0 ๐Ÿบ + * Do not edit manually. + * Web4Ai API + * OpenAPI spec version: 0.1.0 + */ + +export type CrawlerStatsParams = { + /** + * KST ๋‚ ์งœ, ๊ธฐ๋ณธ to-6์ผ + */ + from?: string | null; + /** + * KST ๋‚ ์งœ, ๊ธฐ๋ณธ ์˜ค๋Š˜ + */ + to?: string | null; +}; diff --git a/solution/frontend/src/api/generated/model/crawlerSummary.ts b/solution/frontend/src/api/generated/model/crawlerSummary.ts new file mode 100644 index 0000000..3187586 --- /dev/null +++ b/solution/frontend/src/api/generated/model/crawlerSummary.ts @@ -0,0 +1,14 @@ +/** + * Generated by orval v7.21.0 ๐Ÿบ + * Do not edit manually. + * Web4Ai API + * OpenAPI spec version: 0.1.0 + */ +import type { CrawlerSummaryLastAt } from "./crawlerSummaryLastAt"; + +export interface CrawlerSummary { + total?: number; + ai?: number; + bots?: number; + last_at?: CrawlerSummaryLastAt; +} diff --git a/solution/frontend/src/api/generated/model/crawlerSummaryLastAt.ts b/solution/frontend/src/api/generated/model/crawlerSummaryLastAt.ts new file mode 100644 index 0000000..3d84127 --- /dev/null +++ b/solution/frontend/src/api/generated/model/crawlerSummaryLastAt.ts @@ -0,0 +1,8 @@ +/** + * Generated by orval v7.21.0 ๐Ÿบ + * Do not edit manually. + * Web4Ai API + * OpenAPI spec version: 0.1.0 + */ + +export type CrawlerSummaryLastAt = string | null; diff --git a/solution/frontend/src/api/generated/model/crawlerUaRow.ts b/solution/frontend/src/api/generated/model/crawlerUaRow.ts new file mode 100644 index 0000000..c4fbae4 --- /dev/null +++ b/solution/frontend/src/api/generated/model/crawlerUaRow.ts @@ -0,0 +1,12 @@ +/** + * Generated by orval v7.21.0 ๐Ÿบ + * Do not edit manually. + * Web4Ai API + * OpenAPI spec version: 0.1.0 + */ + +export interface CrawlerUaRow { + user_agent: string; + hits: number; + last_at: string; +} diff --git a/solution/frontend/src/api/generated/model/index.ts b/solution/frontend/src/api/generated/model/index.ts index 0e9c746..28698a6 100644 --- a/solution/frontend/src/api/generated/model/index.ts +++ b/solution/frontend/src/api/generated/model/index.ts @@ -14,6 +14,21 @@ export * from "./buildStatus"; export * from "./checkSlugParams"; export * from "./confirm"; export * from "./confirmArgs"; +export * from "./crawlerBotRow"; +export * from "./crawlerBotRowBot"; +export * from "./crawlerBotRowVendor"; +export * from "./crawlerDaily"; +export * from "./crawlerHitRow"; +export * from "./crawlerHitRowBot"; +export * from "./crawlerHitRowVendor"; +export * from "./crawlerPathRow"; +export * from "./crawlerRootRow"; +export * from "./crawlerRootRowBot"; +export * from "./crawlerSiteRow"; +export * from "./crawlerStatsParams"; +export * from "./crawlerSummary"; +export * from "./crawlerSummaryLastAt"; +export * from "./crawlerUaRow"; export * from "./decision"; export * from "./editRedirectParams"; export * from "./errorInfo"; @@ -258,6 +273,10 @@ export * from "./resCategorySchema"; export * from "./resCategorySchemaCategory"; export * from "./resCategorySchemaLabel"; export * from "./resCategorySchemaMsg"; +export * from "./resCrawlerStats"; +export * from "./resCrawlerStatsDateFrom"; +export * from "./resCrawlerStatsDateTo"; +export * from "./resCrawlerStatsMsg"; export * from "./resExtractFacts"; export * from "./resExtractFactsMsg"; export * from "./resExtractedFact"; @@ -391,6 +410,7 @@ export * from "./searchPlacesPublicParams"; export * from "./showcaseItem"; export * from "./showcaseItemRegion"; export * from "./showcaseItemThumbnailUrl"; +export * from "./siteCrawlerStatsParams"; export * from "./siteData"; export * from "./siteDataCurrentVersionId"; export * from "./siteDataDomain"; diff --git a/solution/frontend/src/api/generated/model/resCrawlerStats.ts b/solution/frontend/src/api/generated/model/resCrawlerStats.ts new file mode 100644 index 0000000..350993f --- /dev/null +++ b/solution/frontend/src/api/generated/model/resCrawlerStats.ts @@ -0,0 +1,36 @@ +/** + * Generated by orval v7.21.0 ๐Ÿบ + * Do not edit manually. + * Web4Ai API + * OpenAPI spec version: 0.1.0 + */ +import type { ErrorInfo } from "./errorInfo"; +import type { ResCrawlerStatsMsg } from "./resCrawlerStatsMsg"; +import type { ResCrawlerStatsDateFrom } from "./resCrawlerStatsDateFrom"; +import type { ResCrawlerStatsDateTo } from "./resCrawlerStatsDateTo"; +import type { CrawlerSummary } from "./crawlerSummary"; +import type { CrawlerDaily } from "./crawlerDaily"; +import type { CrawlerBotRow } from "./crawlerBotRow"; +import type { CrawlerSiteRow } from "./crawlerSiteRow"; +import type { CrawlerRootRow } from "./crawlerRootRow"; +import type { CrawlerUaRow } from "./crawlerUaRow"; +import type { CrawlerPathRow } from "./crawlerPathRow"; +import type { CrawlerHitRow } from "./crawlerHitRow"; + +/** + * ์ „์ฒด(sitesยทroot_filesยทothers)์™€ ์‚ฌ์ดํŠธ๋ณ„(pagesยทrecent)์ด ๊ฐ™์€ ๋ชจ๋ธ์„ ์“ด๋‹ค โ€” ํ•ด๋‹น ์—†๋Š” ์นธ์€ ๋น„์–ด ์žˆ๋‹ค. + */ +export interface ResCrawlerStats { + result?: ErrorInfo; + msg?: ResCrawlerStatsMsg; + date_from?: ResCrawlerStatsDateFrom; + date_to?: ResCrawlerStatsDateTo; + summary?: CrawlerSummary; + daily?: CrawlerDaily[]; + bots?: CrawlerBotRow[]; + sites?: CrawlerSiteRow[]; + root_files?: CrawlerRootRow[]; + others?: CrawlerUaRow[]; + pages?: CrawlerPathRow[]; + recent?: CrawlerHitRow[]; +} diff --git a/solution/frontend/src/api/generated/model/resCrawlerStatsDateFrom.ts b/solution/frontend/src/api/generated/model/resCrawlerStatsDateFrom.ts new file mode 100644 index 0000000..f2fcdbb --- /dev/null +++ b/solution/frontend/src/api/generated/model/resCrawlerStatsDateFrom.ts @@ -0,0 +1,8 @@ +/** + * Generated by orval v7.21.0 ๐Ÿบ + * Do not edit manually. + * Web4Ai API + * OpenAPI spec version: 0.1.0 + */ + +export type ResCrawlerStatsDateFrom = string | null; diff --git a/solution/frontend/src/api/generated/model/resCrawlerStatsDateTo.ts b/solution/frontend/src/api/generated/model/resCrawlerStatsDateTo.ts new file mode 100644 index 0000000..ac46239 --- /dev/null +++ b/solution/frontend/src/api/generated/model/resCrawlerStatsDateTo.ts @@ -0,0 +1,8 @@ +/** + * Generated by orval v7.21.0 ๐Ÿบ + * Do not edit manually. + * Web4Ai API + * OpenAPI spec version: 0.1.0 + */ + +export type ResCrawlerStatsDateTo = string | null; diff --git a/solution/frontend/src/api/generated/model/resCrawlerStatsMsg.ts b/solution/frontend/src/api/generated/model/resCrawlerStatsMsg.ts new file mode 100644 index 0000000..d02d41c --- /dev/null +++ b/solution/frontend/src/api/generated/model/resCrawlerStatsMsg.ts @@ -0,0 +1,8 @@ +/** + * Generated by orval v7.21.0 ๐Ÿบ + * Do not edit manually. + * Web4Ai API + * OpenAPI spec version: 0.1.0 + */ + +export type ResCrawlerStatsMsg = string | null; diff --git a/solution/frontend/src/api/generated/model/siteCrawlerStatsParams.ts b/solution/frontend/src/api/generated/model/siteCrawlerStatsParams.ts new file mode 100644 index 0000000..21fbc77 --- /dev/null +++ b/solution/frontend/src/api/generated/model/siteCrawlerStatsParams.ts @@ -0,0 +1,17 @@ +/** + * Generated by orval v7.21.0 ๐Ÿบ + * Do not edit manually. + * Web4Ai API + * OpenAPI spec version: 0.1.0 + */ + +export type SiteCrawlerStatsParams = { + /** + * KST ๋‚ ์งœ, ๊ธฐ๋ณธ to-6์ผ + */ + from?: string | null; + /** + * KST ๋‚ ์งœ, ๊ธฐ๋ณธ ์˜ค๋Š˜ + */ + to?: string | null; +}; diff --git a/solution/frontend/src/api/generated/ops/ops.ts b/solution/frontend/src/api/generated/ops/ops.ts index e2822c4..8234ab8 100644 --- a/solution/frontend/src/api/generated/ops/ops.ts +++ b/solution/frontend/src/api/generated/ops/ops.ts @@ -18,11 +18,14 @@ import type { } from "@tanstack/react-query"; import type { + CrawlerStatsParams, HTTPValidationError, ListSitesParams, ListUsersParams, + ResCrawlerStats, ResOpsSites, ResOpsUsers, + SiteCrawlerStatsParams, } from ".././model"; import { customFetch } from "../../mutator/custom-fetch"; @@ -312,3 +315,334 @@ export function useListUsers< return query; } + +/** + * @summary ์ „์ฒด ํฌ๋กค๋Ÿฌ ํ†ต๊ณ„(๊ฐœ๋ฐœ์ž ์ „์šฉ) + */ +export const crawlerStats = ( + params?: CrawlerStatsParams, + options?: SecondParameter, + signal?: AbortSignal, +) => { + return customFetch( + { url: `/v1/ops/stats/crawlers`, method: "GET", params, signal }, + options, + ); +}; + +export const getCrawlerStatsQueryKey = (params?: CrawlerStatsParams) => { + return [`/v1/ops/stats/crawlers`, ...(params ? [params] : [])] as const; +}; + +export const getCrawlerStatsQueryOptions = < + TData = Awaited>, + TError = HTTPValidationError, +>( + params?: CrawlerStatsParams, + options?: { + query?: Partial< + UseQueryOptions>, TError, TData> + >; + request?: SecondParameter; + }, +) => { + const { query: queryOptions, request: requestOptions } = options ?? {}; + + const queryKey = queryOptions?.queryKey ?? getCrawlerStatsQueryKey(params); + + const queryFn: QueryFunction>> = ({ + signal, + }) => crawlerStats(params, requestOptions, signal); + + return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< + Awaited>, + TError, + TData + > & { queryKey: DataTag }; +}; + +export type CrawlerStatsQueryResult = NonNullable< + Awaited> +>; +export type CrawlerStatsQueryError = HTTPValidationError; + +export function useCrawlerStats< + TData = Awaited>, + TError = HTTPValidationError, +>( + params: undefined | CrawlerStatsParams, + options: { + query: Partial< + UseQueryOptions>, TError, TData> + > & + Pick< + DefinedInitialDataOptions< + Awaited>, + TError, + Awaited> + >, + "initialData" + >; + request?: SecondParameter; + }, + queryClient?: QueryClient, +): DefinedUseQueryResult & { + queryKey: DataTag; +}; +export function useCrawlerStats< + TData = Awaited>, + TError = HTTPValidationError, +>( + params?: CrawlerStatsParams, + options?: { + query?: Partial< + UseQueryOptions>, TError, TData> + > & + Pick< + UndefinedInitialDataOptions< + Awaited>, + TError, + Awaited> + >, + "initialData" + >; + request?: SecondParameter; + }, + queryClient?: QueryClient, +): UseQueryResult & { + queryKey: DataTag; +}; +export function useCrawlerStats< + TData = Awaited>, + TError = HTTPValidationError, +>( + params?: CrawlerStatsParams, + options?: { + query?: Partial< + UseQueryOptions>, TError, TData> + >; + request?: SecondParameter; + }, + queryClient?: QueryClient, +): UseQueryResult & { + queryKey: DataTag; +}; +/** + * @summary ์ „์ฒด ํฌ๋กค๋Ÿฌ ํ†ต๊ณ„(๊ฐœ๋ฐœ์ž ์ „์šฉ) + */ + +export function useCrawlerStats< + TData = Awaited>, + TError = HTTPValidationError, +>( + params?: CrawlerStatsParams, + options?: { + query?: Partial< + UseQueryOptions>, TError, TData> + >; + request?: SecondParameter; + }, + queryClient?: QueryClient, +): UseQueryResult & { + queryKey: DataTag; +} { + const queryOptions = getCrawlerStatsQueryOptions(params, options); + + const query = useQuery(queryOptions, queryClient) as UseQueryResult< + TData, + TError + > & { queryKey: DataTag }; + + query.queryKey = queryOptions.queryKey; + + return query; +} + +/** + * @summary ์‚ฌ์ดํŠธ๋ณ„ ํฌ๋กค๋Ÿฌ ํ†ต๊ณ„(๊ฐœ๋ฐœ์ž ์ „์šฉ) + */ +export const siteCrawlerStats = ( + placeId: string, + params?: SiteCrawlerStatsParams, + options?: SecondParameter, + signal?: AbortSignal, +) => { + return customFetch( + { + url: `/v1/ops/sites/${placeId}/stats/crawlers`, + method: "GET", + params, + signal, + }, + options, + ); +}; + +export const getSiteCrawlerStatsQueryKey = ( + placeId?: string, + params?: SiteCrawlerStatsParams, +) => { + return [ + `/v1/ops/sites/${placeId}/stats/crawlers`, + ...(params ? [params] : []), + ] as const; +}; + +export const getSiteCrawlerStatsQueryOptions = < + TData = Awaited>, + TError = HTTPValidationError, +>( + placeId: string, + params?: SiteCrawlerStatsParams, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + >; + request?: SecondParameter; + }, +) => { + const { query: queryOptions, request: requestOptions } = options ?? {}; + + const queryKey = + queryOptions?.queryKey ?? getSiteCrawlerStatsQueryKey(placeId, params); + + const queryFn: QueryFunction< + Awaited> + > = ({ signal }) => siteCrawlerStats(placeId, params, requestOptions, signal); + + return { + queryKey, + queryFn, + enabled: !!placeId, + ...queryOptions, + } as UseQueryOptions< + Awaited>, + TError, + TData + > & { queryKey: DataTag }; +}; + +export type SiteCrawlerStatsQueryResult = NonNullable< + Awaited> +>; +export type SiteCrawlerStatsQueryError = HTTPValidationError; + +export function useSiteCrawlerStats< + TData = Awaited>, + TError = HTTPValidationError, +>( + placeId: string, + params: undefined | SiteCrawlerStatsParams, + options: { + query: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > & + Pick< + DefinedInitialDataOptions< + Awaited>, + TError, + Awaited> + >, + "initialData" + >; + request?: SecondParameter; + }, + queryClient?: QueryClient, +): DefinedUseQueryResult & { + queryKey: DataTag; +}; +export function useSiteCrawlerStats< + TData = Awaited>, + TError = HTTPValidationError, +>( + placeId: string, + params?: SiteCrawlerStatsParams, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > & + Pick< + UndefinedInitialDataOptions< + Awaited>, + TError, + Awaited> + >, + "initialData" + >; + request?: SecondParameter; + }, + queryClient?: QueryClient, +): UseQueryResult & { + queryKey: DataTag; +}; +export function useSiteCrawlerStats< + TData = Awaited>, + TError = HTTPValidationError, +>( + placeId: string, + params?: SiteCrawlerStatsParams, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + >; + request?: SecondParameter; + }, + queryClient?: QueryClient, +): UseQueryResult & { + queryKey: DataTag; +}; +/** + * @summary ์‚ฌ์ดํŠธ๋ณ„ ํฌ๋กค๋Ÿฌ ํ†ต๊ณ„(๊ฐœ๋ฐœ์ž ์ „์šฉ) + */ + +export function useSiteCrawlerStats< + TData = Awaited>, + TError = HTTPValidationError, +>( + placeId: string, + params?: SiteCrawlerStatsParams, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + >; + request?: SecondParameter; + }, + queryClient?: QueryClient, +): UseQueryResult & { + queryKey: DataTag; +} { + const queryOptions = getSiteCrawlerStatsQueryOptions( + placeId, + params, + options, + ); + + const query = useQuery(queryOptions, queryClient) as UseQueryResult< + TData, + TError + > & { queryKey: DataTag }; + + query.queryKey = queryOptions.queryKey; + + return query; +} diff --git a/solution/frontend/src/features/ops-stats/CrawlerDailyChart.tsx b/solution/frontend/src/features/ops-stats/CrawlerDailyChart.tsx new file mode 100644 index 0000000..2323756 --- /dev/null +++ b/solution/frontend/src/features/ops-stats/CrawlerDailyChart.tsx @@ -0,0 +1,34 @@ +import {Bar, BarChart, CartesianGrid, Legend, ResponsiveContainer, Tooltip, XAxis, YAxis} from 'recharts'; +import type {CrawlerDaily} from '@/api'; +import {PURPOSE_COLOR, PURPOSES, purposeLabel} from './labels'; +import {daysBetween} from './range'; + +// recharts ๋Š” ํ–‰ ํ•˜๋‚˜๋ฅผ {day, search: n, training: n, โ€ฆ} ๋กœ ๋ฐ›๋Š”๋‹ค. +type Row = Record; + +function pivot(daily: CrawlerDaily[], from: string, to: string): Row[] { + const rows = new Map(daysBetween(from, to).map((day) => [day, {day}])); + for (const {day, purpose, hits} of daily) { + const row = rows.get(day); + if (row) row[purpose] = Number(row[purpose] ?? 0) + hits; + } + return [...rows.values()]; +} + +/** recharts ๋ฅผ ์ด ํŒŒ์ผ์—๋งŒ ๋‘”๋‹ค โ€” CrawlerStatsPanel ์ด lazy() ๋กœ ๋ถˆ๋Ÿฌ ์‚ฌ์žฅ๋‹˜ ํ™”๋ฉด ๋ฒˆ๋“ค์— ์•ˆ ๋“ค์–ด๊ฐ„๋‹ค. */ +export default function CrawlerDailyChart({daily, from, to}: {daily: CrawlerDaily[]; from: string; to: string}) { + return ( + + + + day.slice(5)} fontSize={11} /> + + [value, purposeLabel(String(name))]} /> + purposeLabel(String(value))} wrapperStyle={{fontSize: 11}} /> + {PURPOSES.map((purpose) => ( + + ))} + + + ); +} diff --git a/solution/frontend/src/features/ops-stats/CrawlerStatsPanel.tsx b/solution/frontend/src/features/ops-stats/CrawlerStatsPanel.tsx new file mode 100644 index 0000000..4d7567d --- /dev/null +++ b/solution/frontend/src/features/ops-stats/CrawlerStatsPanel.tsx @@ -0,0 +1,195 @@ +import {lazy, Suspense, type ReactNode} from 'react'; +import {Link} from 'react-router'; +import {Bot, Loader2} from 'lucide-react'; +import type {ResCrawlerStats} from '@/api'; +import {EmptyState} from '@/components/layout/AppShell'; +import {Badge} from '@/components/ui/badge'; +import {Card, CardContent, CardHeader, CardTitle} from '@/components/ui/card'; +import {cn} from '@/lib/utils'; +import {formatKst, purposeLabel} from './labels'; +import {RANGE_DAYS, type RangeDays} from './range'; + +const CrawlerDailyChart = lazy(() => import('./CrawlerDailyChart')); + +export function RangeTabs({value, onChange}: {value: RangeDays; onChange: (days: RangeDays) => void}) { + return ( +
+ {RANGE_DAYS.map((days) => ( + + ))} +
+ ); +} + +function Stat({label, value}: {label: string; value: ReactNode}) { + return ( + + +

{label}

+

{value}

+
+
+ ); +} + +function Section({title, children}: {title: string; children: ReactNode}) { + return ( + + + {title} + + {children} + + ); +} + +function Table({head, rows}: {head: string[]; rows: ReactNode[][]}) { + if (rows.length === 0) return

๊ธฐ๋ก์ด ์—†์Šต๋‹ˆ๋‹ค.

; + return ( +
+ + + + {head.map((h) => ( + + ))} + + + + {rows.map((cells, i) => ( + + {cells.map((cell, j) => ( + + ))} + + ))} + +
+ {h} +
+ {cell} +
+
+ ); +} + +/** ํฌ๋กค๋ง ํƒญ ๋ณธ๋ฌธ. scope ์— ๋”ฐ๋ผ ์•„๋ž˜์ชฝ ํ‘œ๊ฐ€ ๊ฐˆ๋ฆฐ๋‹ค โ€” ์ „์ฒด: ์‚ฌ์ดํŠธ ์ˆœ์œ„ยท๊ณต์šฉ ํŒŒ์ผยท๊ธฐํƒ€ UA / ์‚ฌ์ดํŠธ: ํŽ˜์ด์ง€ยท์ตœ๊ทผ ๊ธฐ๋ก. */ +export function CrawlerStatsPanel({data, scope}: {data: ResCrawlerStats; scope: 'overall' | 'site'}) { + const summary = data.summary; + if (!summary?.total) { + return ; + } + return ( +
+
+ + + + {formatKst(summary.last_at)}} /> +
+ +
+ {data.date_from && data.date_to && ( + }> + + + )} +
+ +
+ [ + b.bot, + b.vendor ?? 'โ€”', + + {purposeLabel(b.purpose)} + , + b.hits, + formatKst(b.last_at), + ])} + /> + + + {scope === 'overall' ? ( + <> +
+
[ + + {s.name} + , + s.hits, + s.ai_hits, + formatKst(s.last_at), + ])} + /> + +
+
[ + r.kind === 'robots' ? 'robots.txt' : 'sitemap.xml', + r.bot ?? '๊ธฐํƒ€', + purposeLabel(r.purpose), + r.hits, + formatKst(r.last_at), + ])} + /> + +
+
[ + + {o.user_agent} + , + o.hits, + formatKst(o.last_at), + ])} + /> + + + ) : ( + <> +
+
[ + + {p.path} + , + p.hits, + formatKst(p.last_at), + ])} + /> + +
+
[ + formatKst(r.created_at), + r.bot ?? '๊ธฐํƒ€', + purposeLabel(r.purpose), + + {r.path} + , + ])} + /> + + + )} + + ); +} diff --git a/solution/frontend/src/features/ops-stats/OverallCrawlerStats.tsx b/solution/frontend/src/features/ops-stats/OverallCrawlerStats.tsx new file mode 100644 index 0000000..50ee7a7 --- /dev/null +++ b/solution/frontend/src/features/ops-stats/OverallCrawlerStats.tsx @@ -0,0 +1,35 @@ +import {useState} from 'react'; +import {keepPreviousData} from '@tanstack/react-query'; +import {Loader2} from 'lucide-react'; +import {useCrawlerStats} from '@/api'; +import {EmptyState} from '@/components/layout/AppShell'; +import {CrawlerStatsPanel, RangeTabs} from './CrawlerStatsPanel'; +import {rangeParams, type RangeDays} from './range'; + +export function OverallCrawlerStats() { + const [days, setDays] = useState(7); + const {data, isLoading, isError, error} = useCrawlerStats(rangeParams(days), { + query: {placeholderData: keepPreviousData}, + }); + + return ( +
+
+

ํฌ๋กค๋ง (์ „์ฒด ์‚ฌ์ดํŠธ)

+ +
+ {isLoading && ( +
+ +
+ )} + {(isError || data?.result?.success === false) && ( + + )} + {data?.result?.success && } +
+ ); +} diff --git a/solution/frontend/src/features/ops-stats/SitesTabs.tsx b/solution/frontend/src/features/ops-stats/SitesTabs.tsx new file mode 100644 index 0000000..b1757ad --- /dev/null +++ b/solution/frontend/src/features/ops-stats/SitesTabs.tsx @@ -0,0 +1,31 @@ +import {cn} from '@/lib/utils'; + +export type SitesTab = 'list' | 'stats'; + +const TABS: ReadonlyArray = [ + ['list', '๋ชฉ๋ก'], + ['stats', '์ „์ฒด ํ†ต๊ณ„'], +]; + +/** ์‚ฌ์ดํŠธ๊ด€๋ฆฌ ์ƒ๋‹จ ํƒญ โ€” ํ˜„์žฌ ํƒญ์€ URL(?tab=)์ด ๋“ค๊ณ  ์žˆ๋‹ค. */ +export function SitesTabs({tab, onChange}: {tab: SitesTab; onChange: (tab: SitesTab) => void}) { + return ( +
+ {TABS.map(([value, label]) => ( + + ))} +
+ ); +} diff --git a/solution/frontend/src/features/ops-stats/labels.ts b/solution/frontend/src/features/ops-stats/labels.ts new file mode 100644 index 0000000..fc6d90e --- /dev/null +++ b/solution/frontend/src/features/ops-stats/labels.ts @@ -0,0 +1,35 @@ +/** ์šฉ๋„ ์ˆœ์„œ โ€” ๋ˆ„์  ๋ง‰๋Œ€์˜ ์•„๋ž˜โ†’์œ„, ํ‘œ์˜ ์ •๋ ฌ ๊ธฐ์ค€. AI ์ชฝ์„ ์•„๋ž˜์— ๊น๋‹ค(์ด ํ™”๋ฉด์ด ๋ณด๋ ค๋Š” ๊ฒƒ). */ +export const PURPOSES = ['search', 'user-fetch', 'training', 'search-engine', 'other'] as const; +export type Purpose = (typeof PURPOSES)[number]; + +export const PURPOSE_LABEL: Record = { + search: 'AI ๊ฒ€์ƒ‰ ์ƒ‰์ธ', + 'user-fetch': 'AI ์‹ค์‹œ๊ฐ„ ์กฐํšŒ', + training: 'AI ํ•™์Šต', + 'search-engine': '๊ฒ€์ƒ‰์—”์ง„', + other: '๊ธฐํƒ€', +}; + +export const PURPOSE_COLOR: Record = { + search: '#2563eb', + 'user-fetch': '#7c3aed', + training: '#0d9488', + 'search-engine': '#f59e0b', + other: '#9ca3af', +}; + +export function purposeLabel(value: string): string { + return PURPOSE_LABEL[value as Purpose] ?? value; +} + +/** ์„œ๋ฒ„ ์‹œ๊ฐ(UTC ISO)์„ KST ๋กœ ์ฝ๋Š”๋‹ค โ€” ์šด์˜์ž๊ฐ€ ํ•œ๊ตญ์— ์žˆ์ง€ ์•Š์•„๋„ ๊ฐ™์€ ์ˆซ์ž๋ฅผ ๋ณธ๋‹ค. */ +export function formatKst(iso?: string | null): string { + if (!iso) return 'โ€”'; + return new Date(iso).toLocaleString('ko-KR', { + timeZone: 'Asia/Seoul', + month: '2-digit', + day: '2-digit', + hour: '2-digit', + minute: '2-digit', + }); +} diff --git a/solution/frontend/src/features/ops-stats/range.ts b/solution/frontend/src/features/ops-stats/range.ts new file mode 100644 index 0000000..b0e5a58 --- /dev/null +++ b/solution/frontend/src/features/ops-stats/range.ts @@ -0,0 +1,22 @@ +export const RANGE_DAYS = [7, 30, 90] as const; +export type RangeDays = (typeof RANGE_DAYS)[number]; + +const DAY_MS = 86_400_000; +const KST_OFFSET_MS = 9 * 3_600_000; + +/** ์„œ๋ฒ„๊ฐ€ KST ๋‚ ์งœ๋กœ ์ž๋ฅด๋ฏ€๋กœ KST ์˜ค๋Š˜์„ ๊ธฐ์ค€์œผ๋กœ ๋งŒ๋“ ๋‹ค(๋ธŒ๋ผ์šฐ์ € ์‹œ๊ฐ„๋Œ€์™€ ๋ฌด๊ด€ํ•˜๊ฒŒ). */ +export function rangeParams(days: RangeDays): {from: string; to: string} { + const kstNow = Date.now() + KST_OFFSET_MS; + const to = new Date(kstNow).toISOString().slice(0, 10); + const from = new Date(kstNow - (days - 1) * DAY_MS).toISOString().slice(0, 10); + return {from, to}; +} + +/** from~to ์˜ ๋ชจ๋“  ๋‚ ์งœ โ€” ์š”์ฒญ์ด ์—†๋˜ ๋‚ ๋„ ๋ง‰๋Œ€ ์ž๋ฆฌ๋ฅผ ๋น„์›Œ ๋‘ฌ์•ผ ์ถ”์ด๊ฐ€ ์™œ๊ณก๋˜์ง€ ์•Š๋Š”๋‹ค. */ +export function daysBetween(from: string, to: string): string[] { + const out: string[] = []; + for (let t = Date.parse(`${from}T00:00:00Z`); t <= Date.parse(`${to}T00:00:00Z`); t += DAY_MS) { + out.push(new Date(t).toISOString().slice(0, 10)); + } + return out; +} diff --git a/solution/frontend/src/pages/OpsSiteStatsPage.tsx b/solution/frontend/src/pages/OpsSiteStatsPage.tsx new file mode 100644 index 0000000..4ca36fc --- /dev/null +++ b/solution/frontend/src/pages/OpsSiteStatsPage.tsx @@ -0,0 +1,62 @@ +import {useState} from 'react'; +import {Link, Navigate, useParams} from 'react-router'; +import {keepPreviousData} from '@tanstack/react-query'; +import {ArrowLeft, Loader2} from 'lucide-react'; +import {UserRole, useSiteCrawlerStats} from '@/api'; +import {AppShell, EmptyState, PageContainer} from '@/components/layout/AppShell'; +import {CrawlerStatsPanel, RangeTabs} from '@/features/ops-stats/CrawlerStatsPanel'; +import {rangeParams, type RangeDays} from '@/features/ops-stats/range'; +import {useAuthStore} from '@/stores/auth'; + +/** ์‚ฌ์ดํŠธ๋ณ„ ํ†ต๊ณ„ โ€” ๊ฐœ๋ฐœ์ž(DEVELOPER) ์ „์šฉ. 2๋‹จ๊ณ„์—์„œ "๋ฐฉ๋ฌธ" ํƒญ์ด ๋ถ™๋Š”๋‹ค. */ +export function OpsSiteStatsPage() { + const {placeId = ''} = useParams(); + const isRestoring = useAuthStore((s) => s.isRestoring); + const role = useAuthStore((s) => s.user?.role); + const [days, setDays] = useState(7); + // enabled: OpsSitesPage ์™€ ๊ฐ™์€ ์ด์œ  โ€” role ํ™•์ • ์ „ ์š”์ฒญ์ด 403 ํ† ์ŠคํŠธ๋ฅผ ๋จผ์ € ๋„์šด๋‹ค. + const {data, isLoading, isError, error} = useSiteCrawlerStats(placeId, rangeParams(days), { + query: {placeholderData: keepPreviousData, enabled: role === UserRole.DEVELOPER && !!placeId}, + }); + + if (isRestoring) return null; + if (role !== UserRole.DEVELOPER) return ; + + return ( + + + + ์‚ฌ์ดํŠธ๊ด€๋ฆฌ + + } + > +
+

ํฌ๋กค๋ง

+ +
+ {isLoading && ( +
+ +
+ )} + {(isError || data?.result?.success === false) && ( + + )} + {data?.result?.success && } +
+
+ ); +} + +// ๋ผ์šฐํŠธ ๋ชจ๋“ˆ์€ default export ๋ฅผ ์š”๊ตฌํ•œ๋‹ค(routes.ts ๊ฐ€ ์ด ํŒŒ์ผ์„ ๊ฐ€๋ฆฌํ‚จ๋‹ค). +export default OpsSiteStatsPage; diff --git a/solution/frontend/src/pages/OpsSitesPage.tsx b/solution/frontend/src/pages/OpsSitesPage.tsx index a7ced69..80526e4 100644 --- a/solution/frontend/src/pages/OpsSitesPage.tsx +++ b/solution/frontend/src/pages/OpsSitesPage.tsx @@ -1,13 +1,15 @@ import {useState} from 'react'; -import {Link, Navigate} from 'react-router'; +import {Link, Navigate, useSearchParams} from 'react-router'; import {keepPreviousData} from '@tanstack/react-query'; -import {Building2, ChevronLeft, ChevronRight, ExternalLink, Loader2, Newspaper, Pencil, Search, Trash2, X} from 'lucide-react'; +import {BarChart3, Building2, ChevronLeft, ChevronRight, ExternalLink, Loader2, Newspaper, Pencil, Search, Trash2, X} from 'lucide-react'; import {PlaceCategory, publishUrlString, SiteStatus} from '@o2o/shared'; import {changeStatus, deletePlace, PublishAction, UserRole, useListSites, type OpsSiteData} from '@/api'; import {AppShell, EmptyState, PageContainer} from '@/components/layout/AppShell'; import {Badge} from '@/components/ui/badge'; import {Button} from '@/components/ui/button'; import {Input} from '@/components/ui/input'; +import {OverallCrawlerStats} from '@/features/ops-stats/OverallCrawlerStats'; +import {SitesTabs, type SitesTab} from '@/features/ops-stats/SitesTabs'; import {notify, notifyApiError} from '@/lib/notify'; import {PUBLISH_HOST} from '@/lib/site'; import {cn} from '@/lib/utils'; @@ -45,11 +47,15 @@ export function OpsSitesPage() { const [search, setSearch] = useState(''); const [category, setCategory] = useState(null); const [busyId, setBusyId] = useState(null); + // ํƒญ์„ URL ์— ๋‘”๋‹ค โ€” ์‚ฌ์ดํŠธ๋ณ„ ํ†ต๊ณ„์—์„œ ๋’ค๋กœ ์˜ค๋ฉด ๋ณด๋˜ ํƒญ์œผ๋กœ ๋Œ์•„์˜จ๋‹ค. + const [params, setParams] = useSearchParams(); + const tab: SitesTab = params.get('tab') === 'stats' ? 'stats' : 'list'; + const changeTab = (next: SitesTab) => setParams(next === 'list' ? {} : {tab: next}); const size = 20; // enabled: role ์ด ํ™•์ •๋˜๊ธฐ ์ „์—” ์š”์ฒญํ•˜์ง€ ์•Š๋Š”๋‹ค โ€” ์–ด์ฐจํ”ผ ๋ฐฑ์—”๋“œ๊ฐ€ 403 ์œผ๋กœ ๋ง‰์ง€๋งŒ, ์‚ฌ์žฅ๋‹˜ ํ™”๋ฉด์—์„œ ์‹คํŒจ ํ† ์ŠคํŠธ๊ฐ€ ๋จผ์ € ๋œจ๋Š” ๊ฒƒ๊ณผ ์ƒˆ๋กœ๊ณ ์นจ ๋•Œ ์ž ๊น์˜ ์˜คํƒ ๋ฆฌ๋‹ค์ด๋ ‰ํŠธ๋ฅผ ๋ง‰๋Š”๋‹ค. const {data, isLoading, isError, error, refetch} = useListSites( {page, size, search: search || undefined, category: category ?? undefined}, - {query: {placeholderData: keepPreviousData, enabled: role === UserRole.DEVELOPER}}, + {query: {placeholderData: keepPreviousData, enabled: role === UserRole.DEVELOPER && tab === 'list'}}, ); // RequireAuth ์™€ ๊ฐ™์€ ์ด์œ  โ€” ๋ณต๊ตฌ๊ฐ€ ๋๋‚˜๊ธฐ ์ „์— ํŒ๋‹จํ•˜๋ฉด ์ƒˆ๋กœ๊ณ ์นจ๋งˆ๋‹ค ๋ฆฌ๋‹ค์ด๋ ‰ํŠธ๊ฐ€ ํ•œ ๋ฒˆ ๋ฒˆ์ฉ์ธ๋‹ค. @@ -85,6 +91,17 @@ export function OpsSitesPage() { if (isRestoring) return null; if (role !== UserRole.DEVELOPER) return ; + if (tab === 'stats') { + return ( + + + + + + + ); + } + const rows = data?.sites ?? []; const total = data?.total ?? 0; const lastPage = Math.max(1, Math.ceil(total / size)); @@ -121,6 +138,7 @@ export function OpsSitesPage() { } > +
{[null, ...Object.keys(CATEGORY_LABEL).map(Number)].map((value) => (