[feat] solution/frontend: 사이트관리 크롤러 통계 — 전체 통계 탭과 사이트별 페이지, recharts 지연 로드

- 사이트관리에 "목록 / 전체 통계" 탭(?tab=stats)과 각 행의 "통계" 버튼(/ops/sites/:placeId/stats)
- 크롤링 화면: 요약 카드 → 일별 누적 막대(용도 4분류+기타) → 봇별 → (전체) 사이트 순위·robots/sitemap·
  기타 UA, (사이트별) 많이 읽힌 페이지·최근 50건. 기간 7/30/90일
- recharts 는 CrawlerDailyChart 한 파일에만 두고 lazy() 로 부른다 — 빌드 확인: 그 청크에만 있고
  사장님 화면의 첫 로딩 스크립트에는 없다
- OpsSitesPage 는 기존 목록 코드를 다시 들여쓰지 않으려고, stats 탭이면 앞에서 바로 return 하고
  탭 UI 는 SitesTabs 로 분리했다(+29/-3)
- orval 로 API 클라이언트 재생성 — 줄바꿈(LF/CRLF)만 바뀐 생성 파일 약 90개는 되돌리고 실제 변경분만 담았다

lint(typegen·tsc·eslint)·build 통과. 화면 레이아웃·차트는 브라우저로 직접 보지 못했다(확장 미연결) —
nginx 경유 API 호출과 SPA 라우트 200 까지만 확인.
This commit is contained in:
skkim committed 2026-10-08 11:32:07 +09:00
1 parent d9c9952230
commit cae3de5586
33 files changed
+1470 -75

No files matched your search

+417 -72
View File
@@ -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",
+1
View File
@@ -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",
@@ -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;
}
@@ -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;
@@ -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;
@@ -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;
}
@@ -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;
}
@@ -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;
@@ -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;
@@ -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;
}
@@ -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;
}
@@ -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;
@@ -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;
}
@@ -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;
};
@@ -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;
}
@@ -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;
@@ -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;
}
@@ -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";
@@ -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[];
}
@@ -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;
@@ -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;
@@ -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;
@@ -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;
};
@@ -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<typeof customFetch>,
signal?: AbortSignal,
) => {
return customFetch<ResCrawlerStats>(
{ 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<ReturnType<typeof crawlerStats>>,
TError = HTTPValidationError,
>(
params?: CrawlerStatsParams,
options?: {
query?: Partial<
UseQueryOptions<Awaited<ReturnType<typeof crawlerStats>>, TError, TData>
>;
request?: SecondParameter<typeof customFetch>;
},
) => {
const { query: queryOptions, request: requestOptions } = options ?? {};
const queryKey = queryOptions?.queryKey ?? getCrawlerStatsQueryKey(params);
const queryFn: QueryFunction<Awaited<ReturnType<typeof crawlerStats>>> = ({
signal,
}) => crawlerStats(params, requestOptions, signal);
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
Awaited<ReturnType<typeof crawlerStats>>,
TError,
TData
> & { queryKey: DataTag<QueryKey, TData, TError> };
};
export type CrawlerStatsQueryResult = NonNullable<
Awaited<ReturnType<typeof crawlerStats>>
>;
export type CrawlerStatsQueryError = HTTPValidationError;
export function useCrawlerStats<
TData = Awaited<ReturnType<typeof crawlerStats>>,
TError = HTTPValidationError,
>(
params: undefined | CrawlerStatsParams,
options: {
query: Partial<
UseQueryOptions<Awaited<ReturnType<typeof crawlerStats>>, TError, TData>
> &
Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof crawlerStats>>,
TError,
Awaited<ReturnType<typeof crawlerStats>>
>,
"initialData"
>;
request?: SecondParameter<typeof customFetch>;
},
queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useCrawlerStats<
TData = Awaited<ReturnType<typeof crawlerStats>>,
TError = HTTPValidationError,
>(
params?: CrawlerStatsParams,
options?: {
query?: Partial<
UseQueryOptions<Awaited<ReturnType<typeof crawlerStats>>, TError, TData>
> &
Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof crawlerStats>>,
TError,
Awaited<ReturnType<typeof crawlerStats>>
>,
"initialData"
>;
request?: SecondParameter<typeof customFetch>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useCrawlerStats<
TData = Awaited<ReturnType<typeof crawlerStats>>,
TError = HTTPValidationError,
>(
params?: CrawlerStatsParams,
options?: {
query?: Partial<
UseQueryOptions<Awaited<ReturnType<typeof crawlerStats>>, TError, TData>
>;
request?: SecondParameter<typeof customFetch>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
/**
* @summary 전체 크롤러 통계(개발자 전용)
*/
export function useCrawlerStats<
TData = Awaited<ReturnType<typeof crawlerStats>>,
TError = HTTPValidationError,
>(
params?: CrawlerStatsParams,
options?: {
query?: Partial<
UseQueryOptions<Awaited<ReturnType<typeof crawlerStats>>, TError, TData>
>;
request?: SecondParameter<typeof customFetch>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
} {
const queryOptions = getCrawlerStatsQueryOptions(params, options);
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
TData,
TError
> & { queryKey: DataTag<QueryKey, TData, TError> };
query.queryKey = queryOptions.queryKey;
return query;
}
/**
* @summary 사이트별 크롤러 통계(개발자 전용)
*/
export const siteCrawlerStats = (
placeId: string,
params?: SiteCrawlerStatsParams,
options?: SecondParameter<typeof customFetch>,
signal?: AbortSignal,
) => {
return customFetch<ResCrawlerStats>(
{
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<ReturnType<typeof siteCrawlerStats>>,
TError = HTTPValidationError,
>(
placeId: string,
params?: SiteCrawlerStatsParams,
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof siteCrawlerStats>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customFetch>;
},
) => {
const { query: queryOptions, request: requestOptions } = options ?? {};
const queryKey =
queryOptions?.queryKey ?? getSiteCrawlerStatsQueryKey(placeId, params);
const queryFn: QueryFunction<
Awaited<ReturnType<typeof siteCrawlerStats>>
> = ({ signal }) => siteCrawlerStats(placeId, params, requestOptions, signal);
return {
queryKey,
queryFn,
enabled: !!placeId,
...queryOptions,
} as UseQueryOptions<
Awaited<ReturnType<typeof siteCrawlerStats>>,
TError,
TData
> & { queryKey: DataTag<QueryKey, TData, TError> };
};
export type SiteCrawlerStatsQueryResult = NonNullable<
Awaited<ReturnType<typeof siteCrawlerStats>>
>;
export type SiteCrawlerStatsQueryError = HTTPValidationError;
export function useSiteCrawlerStats<
TData = Awaited<ReturnType<typeof siteCrawlerStats>>,
TError = HTTPValidationError,
>(
placeId: string,
params: undefined | SiteCrawlerStatsParams,
options: {
query: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof siteCrawlerStats>>,
TError,
TData
>
> &
Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof siteCrawlerStats>>,
TError,
Awaited<ReturnType<typeof siteCrawlerStats>>
>,
"initialData"
>;
request?: SecondParameter<typeof customFetch>;
},
queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useSiteCrawlerStats<
TData = Awaited<ReturnType<typeof siteCrawlerStats>>,
TError = HTTPValidationError,
>(
placeId: string,
params?: SiteCrawlerStatsParams,
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof siteCrawlerStats>>,
TError,
TData
>
> &
Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof siteCrawlerStats>>,
TError,
Awaited<ReturnType<typeof siteCrawlerStats>>
>,
"initialData"
>;
request?: SecondParameter<typeof customFetch>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
export function useSiteCrawlerStats<
TData = Awaited<ReturnType<typeof siteCrawlerStats>>,
TError = HTTPValidationError,
>(
placeId: string,
params?: SiteCrawlerStatsParams,
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof siteCrawlerStats>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customFetch>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
};
/**
* @summary 사이트별 크롤러 통계(개발자 전용)
*/
export function useSiteCrawlerStats<
TData = Awaited<ReturnType<typeof siteCrawlerStats>>,
TError = HTTPValidationError,
>(
placeId: string,
params?: SiteCrawlerStatsParams,
options?: {
query?: Partial<
UseQueryOptions<
Awaited<ReturnType<typeof siteCrawlerStats>>,
TError,
TData
>
>;
request?: SecondParameter<typeof customFetch>;
},
queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
queryKey: DataTag<QueryKey, TData, TError>;
} {
const queryOptions = getSiteCrawlerStatsQueryOptions(
placeId,
params,
options,
);
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
TData,
TError
> & { queryKey: DataTag<QueryKey, TData, TError> };
query.queryKey = queryOptions.queryKey;
return query;
}
@@ -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<string, string | number>;
function pivot(daily: CrawlerDaily[], from: string, to: string): Row[] {
const rows = new Map<string, Row>(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 (
<ResponsiveContainer width="100%" height={240}>
<BarChart data={pivot(daily, from, to)} margin={{top: 8, right: 8, bottom: 0, left: 0}}>
<CartesianGrid strokeDasharray="3 3" vertical={false} />
<XAxis dataKey="day" tickFormatter={(day: string) => day.slice(5)} fontSize={11} />
<YAxis allowDecimals={false} fontSize={11} width={32} />
<Tooltip formatter={(value, name) => [value, purposeLabel(String(name))]} />
<Legend formatter={(value) => purposeLabel(String(value))} wrapperStyle={{fontSize: 11}} />
{PURPOSES.map((purpose) => (
<Bar key={purpose} dataKey={purpose} stackId="hits" fill={PURPOSE_COLOR[purpose]} />
))}
</BarChart>
</ResponsiveContainer>
);
}
@@ -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 (
<div className="flex gap-1.5">
{RANGE_DAYS.map((days) => (
<button
key={days}
type="button"
onClick={() => onChange(days)}
className={cn(
'h-8 cursor-pointer rounded-md border px-3 text-xs font-medium transition-colors',
value === days ? 'border-foreground bg-foreground text-background' : 'border-border hover:bg-muted',
)}
>
최근 {days}일
</button>
))}
</div>
);
}
function Stat({label, value}: {label: string; value: ReactNode}) {
return (
<Card>
<CardContent className="pt-4">
<p className="text-xs text-muted-foreground">{label}</p>
<p className="mt-1 text-xl font-semibold tabular-nums">{value}</p>
</CardContent>
</Card>
);
}
function Section({title, children}: {title: string; children: ReactNode}) {
return (
<Card>
<CardHeader>
<CardTitle>{title}</CardTitle>
</CardHeader>
<CardContent>{children}</CardContent>
</Card>
);
}
function Table({head, rows}: {head: string[]; rows: ReactNode[][]}) {
if (rows.length === 0) return <p className="text-xs text-muted-foreground">기록이 없습니다.</p>;
return (
<div className="overflow-x-auto">
<table className="w-full text-xs">
<thead>
<tr className="border-b border-border text-left text-muted-foreground">
{head.map((h) => (
<th key={h} className="py-2 pr-3 font-medium">
{h}
</th>
))}
</tr>
</thead>
<tbody>
{rows.map((cells, i) => (
<tr key={i} className="border-b border-border last:border-0">
{cells.map((cell, j) => (
<td key={j} className="py-2 pr-3 align-top">
{cell}
</td>
))}
</tr>
))}
</tbody>
</table>
</div>
);
}
/** 크롤링 탭 본문. scope 에 따라 아래쪽 표가 갈린다 — 전체: 사이트 순위·공용 파일·기타 UA / 사이트: 페이지·최근 기록. */
export function CrawlerStatsPanel({data, scope}: {data: ResCrawlerStats; scope: 'overall' | 'site'}) {
const summary = data.summary;
if (!summary?.total) {
return <EmptyState icon={Bot} title="아직 크롤링 기록이 없습니다" description="선택한 기간에 들어온 봇 요청이 없습니다." />;
}
return (
<div className="space-y-4">
<div className="grid grid-cols-2 gap-3 md:grid-cols-4">
<Stat label="총 요청" value={summary.total ?? 0} />
<Stat label="AI 봇 요청" value={summary.ai ?? 0} />
<Stat label="봇 종류" value={summary.bots ?? 0} />
<Stat label="마지막 크롤링" value={<span className="text-base">{formatKst(summary.last_at)}</span>} />
</div>
<Section title="일별 요청 (용도별)">
{data.date_from && data.date_to && (
<Suspense fallback={<Loader2 className="mx-auto size-5 animate-spin text-muted-foreground" />}>
<CrawlerDailyChart daily={data.daily ?? []} from={data.date_from} to={data.date_to} />
</Suspense>
)}
</Section>
<Section title="봇별">
<Table
head={['봇', '회사', '용도', '요청', '마지막']}
rows={(data.bots ?? []).map((b) => [
b.bot,
b.vendor ?? '—',
<Badge key="p" variant="outline">
{purposeLabel(b.purpose)}
</Badge>,
b.hits,
formatKst(b.last_at),
])}
/>
</Section>
{scope === 'overall' ? (
<>
<Section title="크롤링이 많은 사이트">
<Table
head={['사이트', '요청', 'AI 봇', '마지막']}
rows={(data.sites ?? []).map((s) => [
<Link key="n" to={`/ops/sites/${s.place_id}/stats`} className="font-medium hover:underline">
{s.name}
</Link>,
s.hits,
s.ai_hits,
formatKst(s.last_at),
])}
/>
</Section>
<Section title="robots.txt · sitemap.xml">
<Table
head={['파일', '봇', '용도', '요청', '마지막']}
rows={(data.root_files ?? []).map((r) => [
r.kind === 'robots' ? 'robots.txt' : 'sitemap.xml',
r.bot ?? '기타',
purposeLabel(r.purpose),
r.hits,
formatKst(r.last_at),
])}
/>
</Section>
<Section title="목록 밖 봇 (기타) — 자주 보이면 목록에 올린다">
<Table
head={['User-Agent', '요청', '마지막']}
rows={(data.others ?? []).map((o) => [
<span key="ua" className="font-mono text-[11px] break-all">
{o.user_agent}
</span>,
o.hits,
formatKst(o.last_at),
])}
/>
</Section>
</>
) : (
<>
<Section title="많이 읽힌 페이지">
<Table
head={['경로', '요청', '마지막']}
rows={(data.pages ?? []).map((p) => [
<span key="p" className="break-all">
{p.path}
</span>,
p.hits,
formatKst(p.last_at),
])}
/>
</Section>
<Section title="최근 크롤링 50건">
<Table
head={['시각', '봇', '용도', '경로']}
rows={(data.recent ?? []).map((r) => [
formatKst(r.created_at),
r.bot ?? '기타',
purposeLabel(r.purpose),
<span key="p" className="break-all">
{r.path}
</span>,
])}
/>
</Section>
</>
)}
</div>
);
}
@@ -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<RangeDays>(7);
const {data, isLoading, isError, error} = useCrawlerStats(rangeParams(days), {
query: {placeholderData: keepPreviousData},
});
return (
<div className="space-y-4">
<div className="flex items-center justify-between">
<h2 className="text-sm font-semibold">크롤링 (전체 사이트)</h2>
<RangeTabs value={days} onChange={setDays} />
</div>
{isLoading && (
<div className="flex justify-center py-20 text-muted-foreground">
<Loader2 className="size-5 animate-spin" />
</div>
)}
{(isError || data?.result?.success === false) && (
<EmptyState
title="통계를 불러오지 못했습니다"
description={(error as Error)?.message ?? data?.result?.desc ?? '잠시 후 다시 시도해 주세요.'}
/>
)}
{data?.result?.success && <CrawlerStatsPanel data={data} scope="overall" />}
</div>
);
}
@@ -0,0 +1,31 @@
import {cn} from '@/lib/utils';
export type SitesTab = 'list' | 'stats';
const TABS: ReadonlyArray<readonly [SitesTab, string]> = [
['list', '목록'],
['stats', '전체 통계'],
];
/** 사이트관리 상단 탭 — 현재 탭은 URL(?tab=)이 들고 있다. */
export function SitesTabs({tab, onChange}: {tab: SitesTab; onChange: (tab: SitesTab) => void}) {
return (
<div className="mb-4 flex gap-4 border-b border-border text-sm">
{TABS.map(([value, label]) => (
<button
key={value}
type="button"
onClick={() => onChange(value)}
className={cn(
'-mb-px cursor-pointer border-b-2 px-1 pb-2 font-medium transition-colors',
tab === value
? 'border-foreground text-foreground'
: 'border-transparent text-muted-foreground hover:text-foreground',
)}
>
{label}
</button>
))}
</div>
);
}
@@ -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<Purpose, string> = {
search: 'AI 검색 색인',
'user-fetch': 'AI 실시간 조회',
training: 'AI 학습',
'search-engine': '검색엔진',
other: '기타',
};
export const PURPOSE_COLOR: Record<Purpose, string> = {
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',
});
}
@@ -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;
}
@@ -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<RangeDays>(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 <Navigate to="/sites" replace />;
return (
<AppShell>
<PageContainer
title="사이트 통계"
description="이 사이트에 들어온 봇 요청입니다. 자칭 크롤러(UA 기준)이며 IP 대역으로 진위를 확인하지 않습니다."
actions={
<Link
to="/ops/sites"
className="inline-flex h-8 items-center gap-1.5 rounded-md border border-border px-2.5 text-xs font-medium transition-colors hover:bg-muted"
>
<ArrowLeft className="size-3.5" />
사이트관리
</Link>
}
>
<div className="mb-4 flex items-center justify-between">
<h2 className="text-sm font-semibold">크롤링</h2>
<RangeTabs value={days} onChange={setDays} />
</div>
{isLoading && (
<div className="flex justify-center py-20 text-muted-foreground">
<Loader2 className="size-5 animate-spin" />
</div>
)}
{(isError || data?.result?.success === false) && (
<EmptyState
title="통계를 불러오지 못했습니다"
description={(error as Error)?.message ?? data?.result?.desc ?? '잠시 후 다시 시도해 주세요.'}
/>
)}
{data?.result?.success && <CrawlerStatsPanel data={data} scope="site" />}
</PageContainer>
</AppShell>
);
}
// 라우트 모듈은 default export 를 요구한다(routes.ts 가 이 파일을 가리킨다).
export default OpsSiteStatsPage;
+28 -3
View File
@@ -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<number | null>(null);
const [busyId, setBusyId] = useState<string | null>(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 <Navigate to="/sites" replace />;
if (tab === 'stats') {
return (
<AppShell>
<PageContainer title="사이트관리" description="전 계정 사이트 발행 현황입니다. 회사 스코프 없이 전부 보입니다.">
<SitesTabs tab={tab} onChange={changeTab} />
<OverallCrawlerStats />
</PageContainer>
</AppShell>
);
}
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() {
</div>
}
>
<SitesTabs tab={tab} onChange={changeTab} />
<div className="mb-3 flex flex-wrap gap-1.5">
{[null, ...Object.keys(CATEGORY_LABEL).map(Number)].map((value) => (
<button
@@ -193,6 +211,13 @@ export function OpsSitesPage() {
<Newspaper className="size-3.5" />
미니블로그
</Link>
<Link
to={`/ops/sites/${row.place_id}/stats`}
className="inline-flex h-8 items-center gap-1.5 rounded-md border border-border px-2.5 text-xs font-medium transition-colors hover:bg-muted"
>
<BarChart3 className="size-3.5" />
통계
</Link>
{url ? (
<a
href={url}
+1
View File
@@ -23,6 +23,7 @@ export default [
// "내 사이트" 카드의 관리 메뉴에서 온다(?placeId= 로 어느 사이트인지 받는다) — 사장님 여럿이 사이트 여럿을 가질 수 있어 전역 메뉴 하나로는 못 고른다.
route('blog', 'pages/BlogPostsPage.tsx'),
route('ops/sites', 'pages/OpsSitesPage.tsx'),
route('ops/sites/:placeId/stats', 'pages/OpsSiteStatsPage.tsx'),
route('ops/users', 'pages/OpsUsersPage.tsx'),
]),