@minecraft-docker/mcctl-console 1.15.5 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/standalone/package.json +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/BUILD_ID +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/app-build-manifest.json +190 -134
- package/.next/standalone/platform/services/mcctl-console/.next/app-path-routes-manifest.json +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/build-manifest.json +4 -4
- package/.next/standalone/platform/services/mcctl-console/.next/prerender-manifest.json +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/routes-manifest.json +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/audit-logs/page.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/audit-logs/page.js.nft.json +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/audit-logs/page_client-reference-manifest.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/backups/page.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/backups/page.js.nft.json +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/backups/page_client-reference-manifest.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/dashboard/page.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/dashboard/page.js.nft.json +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/dashboard/page_client-reference-manifest.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/players/page.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/players/page.js.nft.json +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/players/page_client-reference-manifest.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/routing/page.js +5 -5
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/routing/page.js.nft.json +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/routing/page_client-reference-manifest.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/[name]/console/page.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/[name]/console/page.js.nft.json +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/[name]/console/page_client-reference-manifest.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/[name]/page.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/[name]/page.js.nft.json +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/[name]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/page.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/page.js.nft.json +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/page_client-reference-manifest.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/settings/page.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/settings/page.js.nft.json +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/settings/page_client-reference-manifest.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/worlds/page.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/worlds/page.js.nft.json +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/worlds/page_client-reference-manifest.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/_not-found.rsc +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/admin/users/page.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/admin/users/page.js.nft.json +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/admin/users/page_client-reference-manifest.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/admin/users.html +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/admin/users.meta +5 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/admin/users.rsc +12 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/audit-logs/[id]/route.js +2 -2
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/audit-logs/export/route.js +2 -2
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/audit-logs/route.js +2 -2
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/audit-logs/stats/route.js +2 -2
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/audit-logs/stream/route.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/auth/[...all]/route.js +2 -2
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/backup/history/route.js +2 -2
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/backup/restore/route.js +2 -2
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/backup/route.js +2 -2
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/players/ban/route.js +2 -2
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/players/kick/route.js +2 -2
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/players/op/[player]/route.js +57 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/players/op/[player]/route.js.nft.json +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/players/op/route.js +2 -2
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/players/route.js +2 -2
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/players/whitelist/route.js +2 -2
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/router/status/route.js +2 -2
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/servers/[name]/[action]/route.js +2 -2
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/servers/[name]/config/route.js +2 -2
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/servers/[name]/exec/route.js +2 -2
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/servers/[name]/route.js +2 -2
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/servers/[name]/world/reset/route.js +2 -2
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/servers/route.js +2 -2
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/user-servers/[id]/route.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/user-servers/route.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/users/route.js +2 -2
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/worlds/[name]/[action]/route.js +2 -2
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/worlds/[name]/route.js +2 -2
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/worlds/route.js +2 -2
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/audit-logs.html +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/audit-logs.rsc +3 -3
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/backups.html +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/backups.rsc +3 -3
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/dashboard.html +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/dashboard.rsc +3 -3
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/index.html +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/index.rsc +2 -2
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/login/page.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/login/page.js.nft.json +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/login.html +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/login.rsc +2 -2
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/page.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/players.html +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/players.rsc +3 -3
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/routing.html +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/routing.rsc +3 -3
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/servers.html +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/servers.rsc +3 -3
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/settings.html +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/settings.meta +5 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/settings.rsc +18 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/signup/page.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/signup/page.js.nft.json +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/signup/page_client-reference-manifest.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/signup.html +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/signup.rsc +2 -2
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/worlds.html +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/worlds.rsc +3 -3
- package/.next/standalone/platform/services/mcctl-console/.next/server/app-paths-manifest.json +17 -14
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/1645.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/2793.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/3029.js +5 -5
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/3048.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/354.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/4282.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/5019.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/6088.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/609.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/613.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/6231.js +74 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/7057.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/7453.js +54 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/8165.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/8389.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/8402.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/8849.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/8872.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/9250.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/middleware-build-manifest.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/middleware-manifest.json +5 -5
- package/.next/standalone/platform/services/mcctl-console/.next/server/next-font-manifest.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/next-font-manifest.json +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/pages/404.html +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/pages/500.html +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/1189-60aed59c0e82a63d.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/1544-d2d1404bef00d038.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/1658-1c16e5a05aaa11ee.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/1668-c41281dc3163e1c2.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/1721-2758853c661770ff.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/190-9ecdd3c2ad7fadef.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/3489-b8c5f08aa4922197.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/4416-2385e5784dc036d6.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/4474-b7d88543d50f7f58.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/5375-a2d3a8fb915a3971.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/5381-4e3aac97e0617278.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/5386-a568e84580b1d208.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/563-d87300cc5ef5920c.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/6357-a9d3501984c53429.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/6479-82b21daf8e380c4d.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/6571-0d9e629a91d9f630.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/6727-e25ea0d10f0fea68.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/6758-d0a2d1008691eff1.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/680-61e3cda59bad5959.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/6857-5b9c04069853bfc4.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/6909-9750e61adcf6f5e5.js +1 -0
- package/.next/{static/chunks/4840-5802e869ffd1d2a9.js → standalone/platform/services/mcctl-console/.next/static/chunks/7073-46594e6380fdda11.js} +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/7436-44378c85b24787cc.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/7782-0f287c9ab0566879.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/787-91c6946656342fe4.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/8625-b235421f69a178fb.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/880-be7151cc9c502be6.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/9760-3b9261fc2cfda017.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/9810-e8bf0b092d80a553.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/audit-logs/{page-7a5d1441bb2811cf.js → page-b879c927081e59a2.js} +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/backups/{page-cc46681d519753dd.js → page-7a59c9269da2d63e.js} +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/dashboard/{page-b548fe2aac951e5b.js → page-d2d8cd0c7a0a54ec.js} +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/layout-bc7b020e80bc6d8d.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/players/page-724151791dd69b93.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/routing/page-909690ecbe76f31c.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/servers/[name]/console/{page-ca0344337ef5da93.js → page-617a1ab914c8d828.js} +1 -1
- package/.next/{static/chunks/app/(main)/servers/[name]/page-55fee1f878b51fb8.js → standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/servers/[name]/page-96518534b90deb1c.js} +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/servers/page-c35bb5a99e6ff107.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/settings/page-a805f639e14a10b0.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/worlds/page-704a3dafb5b8ec15.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/admin/users/page-f45f3cd30725a718.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/login/page-073a17485ca81f18.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/page-06fbf91c6bf684a9.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/signup/page-bfb822f4c5c7ce99.js +1 -0
- package/.next/{static/chunks/main-43f98b458d773ca0.js → standalone/platform/services/mcctl-console/.next/static/chunks/main-d86dc43481acf07f.js} +1 -1
- package/.next/standalone/platform/services/mcctl-console/package.json +1 -1
- package/.next/static/chunks/1189-60aed59c0e82a63d.js +1 -0
- package/.next/static/chunks/1544-d2d1404bef00d038.js +1 -0
- package/.next/static/chunks/1658-1c16e5a05aaa11ee.js +1 -0
- package/.next/static/chunks/1668-c41281dc3163e1c2.js +1 -0
- package/.next/static/chunks/1721-2758853c661770ff.js +1 -0
- package/.next/static/chunks/190-9ecdd3c2ad7fadef.js +1 -0
- package/.next/static/chunks/3489-b8c5f08aa4922197.js +1 -0
- package/.next/static/chunks/4416-2385e5784dc036d6.js +1 -0
- package/.next/static/chunks/4474-b7d88543d50f7f58.js +1 -0
- package/.next/static/chunks/5375-a2d3a8fb915a3971.js +1 -0
- package/.next/static/chunks/5381-4e3aac97e0617278.js +1 -0
- package/.next/static/chunks/5386-a568e84580b1d208.js +1 -0
- package/.next/static/chunks/563-d87300cc5ef5920c.js +1 -0
- package/.next/static/chunks/6357-a9d3501984c53429.js +1 -0
- package/.next/static/chunks/6479-82b21daf8e380c4d.js +1 -0
- package/.next/static/chunks/6571-0d9e629a91d9f630.js +1 -0
- package/.next/static/chunks/6727-e25ea0d10f0fea68.js +1 -0
- package/.next/static/chunks/6758-d0a2d1008691eff1.js +1 -0
- package/.next/static/chunks/680-61e3cda59bad5959.js +1 -0
- package/.next/static/chunks/6857-5b9c04069853bfc4.js +1 -0
- package/.next/static/chunks/6909-9750e61adcf6f5e5.js +1 -0
- package/.next/{standalone/platform/services/mcctl-console/.next/static/chunks/4840-5802e869ffd1d2a9.js → static/chunks/7073-46594e6380fdda11.js} +1 -1
- package/.next/static/chunks/7436-44378c85b24787cc.js +1 -0
- package/.next/static/chunks/7782-0f287c9ab0566879.js +1 -0
- package/.next/static/chunks/787-91c6946656342fe4.js +1 -0
- package/.next/static/chunks/8625-b235421f69a178fb.js +1 -0
- package/.next/static/chunks/880-be7151cc9c502be6.js +1 -0
- package/.next/static/chunks/9760-3b9261fc2cfda017.js +1 -0
- package/.next/static/chunks/9810-e8bf0b092d80a553.js +1 -0
- package/.next/static/chunks/app/(main)/audit-logs/{page-7a5d1441bb2811cf.js → page-b879c927081e59a2.js} +1 -1
- package/.next/static/chunks/app/(main)/backups/{page-cc46681d519753dd.js → page-7a59c9269da2d63e.js} +1 -1
- package/.next/static/chunks/app/(main)/dashboard/{page-b548fe2aac951e5b.js → page-d2d8cd0c7a0a54ec.js} +1 -1
- package/.next/static/chunks/app/(main)/layout-bc7b020e80bc6d8d.js +1 -0
- package/.next/static/chunks/app/(main)/players/page-724151791dd69b93.js +1 -0
- package/.next/static/chunks/app/(main)/routing/page-909690ecbe76f31c.js +1 -0
- package/.next/static/chunks/app/(main)/servers/[name]/console/{page-ca0344337ef5da93.js → page-617a1ab914c8d828.js} +1 -1
- package/.next/{standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/servers/[name]/page-55fee1f878b51fb8.js → static/chunks/app/(main)/servers/[name]/page-96518534b90deb1c.js} +1 -1
- package/.next/static/chunks/app/(main)/servers/page-c35bb5a99e6ff107.js +1 -0
- package/.next/static/chunks/app/(main)/settings/page-a805f639e14a10b0.js +1 -0
- package/.next/static/chunks/app/(main)/worlds/page-704a3dafb5b8ec15.js +1 -0
- package/.next/static/chunks/app/admin/users/page-f45f3cd30725a718.js +1 -0
- package/.next/static/chunks/app/login/page-073a17485ca81f18.js +1 -0
- package/.next/static/chunks/app/page-06fbf91c6bf684a9.js +1 -0
- package/.next/static/chunks/app/signup/page-bfb822f4c5c7ce99.js +1 -0
- package/.next/{standalone/platform/services/mcctl-console/.next/static/chunks/main-43f98b458d773ca0.js → static/chunks/main-d86dc43481acf07f.js} +1 -1
- package/package.json +2 -2
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/1399.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/2365.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/3076.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/3100.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/4972.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/5244.js +0 -74
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/5256.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/6010.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/8024.js +0 -54
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/8243.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/9157.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/959.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/1476-a0570078fdf78fae.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/2022-6da2f9a847a5d61c.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/2093-bceea213e32f6b5f.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/2149-ba1bdd1d726ab70c.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/310-72d3b802b3cefa99.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/315-509f963f6c69d0a8.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/3543-1ec838cbe59f6baa.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/406-64ea09489141e436.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/4278-9a6acf769f296866.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/4538-a0d2c88024f1288a.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/5511-7a419d84918a8d64.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/6189-d8557db379604b3e.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/6594-e49e36eb5a5d1bef.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/6645-68b73fe1df8dba93.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/6655-81288236c1babc44.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/7220-4d1d72de4109ad9b.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/7294-ffa0013d4b0fa40a.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/7413-419718450fadde21.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/8006-219c9bbc650b079e.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/8322-8ae826d4c9b38acc.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/8657-f28db4e9df8cc7b0.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/8696-8adf1e9b1a84f5c0.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/9030-1dcbf06ed6e20e24.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/9887-bff2aa500d1d1995.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/layout-692cb1da92b73287.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/players/page-706f5e796129df33.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/routing/page-14f40cfd98e60a77.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/servers/page-efa5f11aa2956719.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/worlds/page-3de10e94b77f6e45.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/login/page-d6a5da720238e5cf.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/page-8b5b6cb30448bcc5.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/signup/page-6e5550bc9fffa4bc.js +0 -1
- package/.next/static/chunks/1476-a0570078fdf78fae.js +0 -1
- package/.next/static/chunks/2022-6da2f9a847a5d61c.js +0 -1
- package/.next/static/chunks/2093-bceea213e32f6b5f.js +0 -1
- package/.next/static/chunks/2149-ba1bdd1d726ab70c.js +0 -1
- package/.next/static/chunks/310-72d3b802b3cefa99.js +0 -1
- package/.next/static/chunks/315-509f963f6c69d0a8.js +0 -1
- package/.next/static/chunks/3543-1ec838cbe59f6baa.js +0 -1
- package/.next/static/chunks/406-64ea09489141e436.js +0 -1
- package/.next/static/chunks/4278-9a6acf769f296866.js +0 -1
- package/.next/static/chunks/4538-a0d2c88024f1288a.js +0 -1
- package/.next/static/chunks/5511-7a419d84918a8d64.js +0 -1
- package/.next/static/chunks/6189-d8557db379604b3e.js +0 -1
- package/.next/static/chunks/6594-e49e36eb5a5d1bef.js +0 -1
- package/.next/static/chunks/6645-68b73fe1df8dba93.js +0 -1
- package/.next/static/chunks/6655-81288236c1babc44.js +0 -1
- package/.next/static/chunks/7220-4d1d72de4109ad9b.js +0 -1
- package/.next/static/chunks/7294-ffa0013d4b0fa40a.js +0 -1
- package/.next/static/chunks/7413-419718450fadde21.js +0 -1
- package/.next/static/chunks/8006-219c9bbc650b079e.js +0 -1
- package/.next/static/chunks/8322-8ae826d4c9b38acc.js +0 -1
- package/.next/static/chunks/8657-f28db4e9df8cc7b0.js +0 -1
- package/.next/static/chunks/8696-8adf1e9b1a84f5c0.js +0 -1
- package/.next/static/chunks/9030-1dcbf06ed6e20e24.js +0 -1
- package/.next/static/chunks/9887-bff2aa500d1d1995.js +0 -1
- package/.next/static/chunks/app/(main)/layout-692cb1da92b73287.js +0 -1
- package/.next/static/chunks/app/(main)/players/page-706f5e796129df33.js +0 -1
- package/.next/static/chunks/app/(main)/routing/page-14f40cfd98e60a77.js +0 -1
- package/.next/static/chunks/app/(main)/servers/page-efa5f11aa2956719.js +0 -1
- package/.next/static/chunks/app/(main)/worlds/page-3de10e94b77f6e45.js +0 -1
- package/.next/static/chunks/app/login/page-d6a5da720238e5cf.js +0 -1
- package/.next/static/chunks/app/page-8b5b6cb30448bcc5.js +0 -1
- package/.next/static/chunks/app/signup/page-6e5550bc9fffa4bc.js +0 -1
- /package/.next/standalone/platform/services/mcctl-console/.next/static/{J1RLwJBlYRYnOUdff_T8I → lF2Ag_PdEMco5HscTAFVZ}/_buildManifest.js +0 -0
- /package/.next/standalone/platform/services/mcctl-console/.next/static/{J1RLwJBlYRYnOUdff_T8I → lF2Ag_PdEMco5HscTAFVZ}/_ssgManifest.js +0 -0
- /package/.next/static/{J1RLwJBlYRYnOUdff_T8I → lF2Ag_PdEMco5HscTAFVZ}/_buildManifest.js +0 -0
- /package/.next/static/{J1RLwJBlYRYnOUdff_T8I → lF2Ag_PdEMco5HscTAFVZ}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[148],{61943:function(e,n,t){Promise.resolve().then(t.bind(t,34488))},34488:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return p}});var r=t(94655),i=t(7281),s=t(84840),o=t(31317),a=t(10721),u=t(81071),c=t(628),l=t(41565),d=t(69899),h=t(76492),x=t(29983),y=t(92666),f=t(11189);function v(e){let{rows:n}=e;return(0,r.jsx)(c.Z,{children:(0,r.jsxs)(l.Z,{children:[(0,r.jsxs)(i.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[(0,r.jsx)(a.Z,{variant:"circular",width:24,height:24}),(0,r.jsx)(a.Z,{variant:"text",width:"50%",height:32})]}),[...Array(n)].map((e,n)=>(0,r.jsxs)(i.Z,{sx:{display:"flex",justifyContent:"space-between",py:.75},children:[(0,r.jsx)(a.Z,{variant:"text",width:"35%"}),(0,r.jsx)(a.Z,{variant:"text",width:"40%"})]},n))]})})}function m(){return(0,r.jsx)(c.Z,{sx:{height:"100%"},children:(0,r.jsxs)(l.Z,{children:[(0,r.jsxs)(i.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[(0,r.jsx)(a.Z,{variant:"circular",width:24,height:24}),(0,r.jsx)(a.Z,{variant:"text",width:"40%",height:32}),(0,r.jsxs)(i.Z,{sx:{ml:"auto",display:"flex",gap:1},children:[(0,r.jsx)(a.Z,{variant:"rounded",width:70,height:24}),(0,r.jsx)(a.Z,{variant:"rounded",width:70,height:24})]})]}),(0,r.jsx)(a.Z,{variant:"text",width:"30%",sx:{mt:3,mb:1}}),[0,1].map(e=>(0,r.jsxs)(i.Z,{sx:{border:1,borderColor:"divider",p:2,"&:not(:last-child)":{borderBottom:0}},children:[(0,r.jsxs)(i.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:1.5},children:[(0,r.jsx)(a.Z,{variant:"circular",width:10,height:10}),(0,r.jsx)(a.Z,{variant:"text",width:"25%"}),(0,r.jsx)(a.Z,{variant:"text",width:"15%"}),(0,r.jsx)(a.Z,{variant:"text",width:"10%",sx:{ml:"auto"}})]}),[0,1,2].map(e=>(0,r.jsx)(a.Z,{variant:"text",width:"70%",sx:{ml:2.5}},e))]},e))]})})}function p(){let{data:e,isLoading:n,error:t}=(0,y.nv)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.Z,{elevation:0,sx:{mb:4,p:3,background:e=>"linear-gradient(135deg, ".concat((0,h.Fq)(e.palette.warning.main,.1)," 0%, ").concat((0,h.Fq)(e.palette.info.main,.1)," 100%)"),borderRadius:2,border:e=>"1px solid ".concat((0,h.Fq)(e.palette.warning.main,.2))},children:(0,r.jsxs)(i.Z,{sx:{display:"flex",alignItems:"center",gap:2},children:[(0,r.jsx)(i.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:56,height:56,borderRadius:2,bgcolor:"warning.main",color:"warning.contrastText"},children:(0,r.jsx)(x.Z,{sx:{fontSize:32}})}),(0,r.jsxs)(i.Z,{children:[(0,r.jsx)(o.Z,{variant:"h4",component:"h1",fontWeight:"bold",children:"Routing"}),(0,r.jsx)(o.Z,{variant:"body1",color:"text.secondary",children:"Server routing and network configuration"})]})]})}),t&&(0,r.jsxs)(u.Z,{severity:"error",sx:{mb:3},children:["Failed to load router status: ",t.message]}),n?(0,r.jsxs)(s.ZP,{container:!0,spacing:3,children:[(0,r.jsx)(s.ZP,{item:!0,xs:12,md:4,children:(0,r.jsxs)(i.Z,{sx:{display:"flex",flexDirection:"column",gap:3},children:[(0,r.jsx)(v,{rows:4}),(0,r.jsx)(v,{rows:4}),(0,r.jsx)(v,{rows:1})]})}),(0,r.jsx)(s.ZP,{item:!0,xs:12,md:8,children:(0,r.jsx)(m,{})})]}):(null==e?void 0:e.router)?(0,r.jsxs)(s.ZP,{container:!0,spacing:3,children:[(0,r.jsx)(s.ZP,{item:!0,xs:12,md:4,children:(0,r.jsxs)(i.Z,{sx:{display:"flex",flexDirection:"column",gap:3},children:[(0,r.jsx)(f.hI,{router:e.router}),(0,r.jsx)(f.SB,{router:e.router}),(0,r.jsx)(f.E4,{avahi:e.avahi})]})}),(0,r.jsx)(s.ZP,{item:!0,xs:12,md:8,children:(0,r.jsx)(f.Ik,{router:e.router})})]}):null]})}},42936:function(e,n,t){"use strict";async function r(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t={...n.headers};n.body&&(t["Content-Type"]="application/json");let r=await fetch(e,{...n,headers:t});if(!r.ok){let e=await r.json().catch(()=>({error:"UnknownError",message:r.statusText})),n=Error(e.message);throw n.statusCode=r.status,n.code=e.error,n}return r.json()}t.d(n,{SC:function(){return r}})},92666:function(e,n,t){"use strict";t.d(n,{$t:function(){return C},Aw:function(){return d},Fv:function(){return m},Hq:function(){return c},Hy:function(){return u},MH:function(){return j},Sr:function(){return x},_I:function(){return h},c5:function(){return Z},g2:function(){return v},gx:function(){return g},hy:function(){return y},iC:function(){return p},jM:function(){return l},mj:function(){return w},nq:function(){return f},nv:function(){return S},s8:function(){return q},x$:function(){return a}});var r=t(5632),i=t(58919),s=t(20367),o=t(42936);function a(){return(0,r.a)({queryKey:["servers"],queryFn:()=>(0,o.SC)("/api/servers"),refetchInterval:6e4})}function u(e,n){return(0,r.a)({queryKey:["servers",e],queryFn:()=>(0,o.SC)("/api/servers/".concat(encodeURIComponent(e))),enabled:(null==n?void 0:n.enabled)!==!1&&!!e,refetchInterval:3e4})}function c(){let e=(0,i.NL)();return(0,s.D)({mutationFn:e=>{let{name:n,force:t}=e;return(0,o.SC)("/api/servers/".concat(encodeURIComponent(n)).concat(t?"?force=true":""),{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:["servers"]})}})}function l(){let e=(0,i.NL)();return(0,s.D)({mutationFn:e=>(0,o.SC)("/api/servers/".concat(encodeURIComponent(e),"/start"),{method:"POST"}),onSuccess:(n,t)=>{e.invalidateQueries({queryKey:["servers"]}),e.invalidateQueries({queryKey:["servers",t]})}})}function d(){let e=(0,i.NL)();return(0,s.D)({mutationFn:e=>(0,o.SC)("/api/servers/".concat(encodeURIComponent(e),"/stop"),{method:"POST"}),onSuccess:(n,t)=>{e.invalidateQueries({queryKey:["servers"]}),e.invalidateQueries({queryKey:["servers",t]})}})}function h(){let e=(0,i.NL)();return(0,s.D)({mutationFn:e=>(0,o.SC)("/api/servers/".concat(encodeURIComponent(e),"/restart"),{method:"POST"}),onSuccess:(n,t)=>{e.invalidateQueries({queryKey:["servers"]}),e.invalidateQueries({queryKey:["servers",t]})}})}function x(){return(0,r.a)({queryKey:["worlds"],queryFn:()=>(0,o.SC)("/api/worlds"),refetchInterval:3e4})}function y(){let e=(0,i.NL)();return(0,s.D)({mutationFn:e=>(0,o.SC)("/api/worlds",{method:"POST",body:JSON.stringify(e)}),onSuccess:()=>{e.invalidateQueries({queryKey:["worlds"]})}})}function f(){let e=(0,i.NL)();return(0,s.D)({mutationFn:e=>{let{worldName:n,serverName:t}=e;return(0,o.SC)("/api/worlds/".concat(encodeURIComponent(n),"/assign"),{method:"POST",body:JSON.stringify({serverName:t})})},onSuccess:()=>{e.invalidateQueries({queryKey:["worlds"]}),e.invalidateQueries({queryKey:["servers"]})}})}function v(){let e=(0,i.NL)();return(0,s.D)({mutationFn:e=>{let{worldName:n,force:t}=e;return(0,o.SC)("/api/worlds/".concat(encodeURIComponent(n),"/release").concat(t?"?force=true":""),{method:"POST"})},onSuccess:()=>{e.invalidateQueries({queryKey:["worlds"]})}})}function m(){let e=(0,i.NL)();return(0,s.D)({mutationFn:e=>{let{name:n,force:t}=e;return(0,o.SC)("/api/worlds/".concat(encodeURIComponent(n)).concat(t?"?force=true":""),{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:["worlds"]})}})}function p(e,n){return(0,r.a)({queryKey:["servers",e,"config"],queryFn:()=>(0,o.SC)("/api/servers/".concat(encodeURIComponent(e),"/config")),enabled:(null==n?void 0:n.enabled)!==!1&&!!e})}function j(){let e=(0,i.NL)();return(0,s.D)({mutationFn:e=>{let{serverName:n,config:t}=e;return(0,o.SC)("/api/servers/".concat(encodeURIComponent(n),"/config"),{method:"PATCH",body:JSON.stringify(t)})},onSuccess:(n,t)=>{let{serverName:r}=t;e.invalidateQueries({queryKey:["servers",r,"config"]}),e.invalidateQueries({queryKey:["servers",r]})}})}function g(){let e=(0,i.NL)();return(0,s.D)({mutationFn:e=>(0,o.SC)("/api/servers/".concat(encodeURIComponent(e),"/world/reset"),{method:"POST"}),onSuccess:(n,t)=>{e.invalidateQueries({queryKey:["servers",t]}),e.invalidateQueries({queryKey:["worlds"]})}})}function S(){return(0,r.a)({queryKey:["router-status"],queryFn:()=>(0,o.SC)("/api/router/status"),refetchInterval:3e4})}function w(){return(0,r.a)({queryKey:["backup-status"],queryFn:()=>(0,o.SC)("/api/backup"),refetchInterval:6e4})}function C(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20;return(0,r.a)({queryKey:["backup-history",e],queryFn:()=>(0,o.SC)("/api/backup/history?limit=".concat(e)),refetchInterval:6e4})}function Z(){let e=(0,i.NL)();return(0,s.D)({mutationFn:e=>{let{message:n}=e;return(0,o.SC)("/api/backup",{method:"POST",body:JSON.stringify({message:n})})},onSuccess:()=>{e.invalidateQueries({queryKey:["backup-status"]}),e.invalidateQueries({queryKey:["backup-history"]})}})}function q(){let e=(0,i.NL)();return(0,s.D)({mutationFn:e=>(0,o.SC)("/api/backup/restore",{method:"POST",body:JSON.stringify({commitHash:e})}),onSuccess:()=>{e.invalidateQueries({queryKey:["worlds"]}),e.invalidateQueries({queryKey:["servers"]})}})}}},function(e){e.O(0,[6812,9760,6758,680,1668,7436,1071,540,4416,9810,2542,7073,9654,5381,6571,1189,3669,2757,1744],function(){return e(e.s=61943)}),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3767],{32823:function(e,t,n){Promise.resolve().then(n.bind(n,32050))},32050:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return p}});var r=n(94655),s=n(35106),o=n(31358),l=n(7281),c=n(31317),i=n(26138),a=n(41261),u=n(79983),d=n(10117),h=n(73660);function p(e){let{params:t}=e,n=(0,o.x)(),{name:p}=(0,s.use)(t),m=decodeURIComponent(p);return(0,r.jsxs)(l.Z,{sx:{height:"100%",display:"flex",flexDirection:"column"},children:[(0,r.jsxs)(l.Z,{sx:{mb:2},children:[(0,r.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:1},children:[(0,r.jsx)(u.Z,{onClick:()=>n.push("/servers/".concat(p)),size:"small","aria-label":"Back to server",children:(0,r.jsx)(d.Z,{})}),(0,r.jsxs)(i.Z,{"aria-label":"breadcrumb",children:[(0,r.jsx)(a.Z,{component:"button",variant:"body1",onClick:()=>n.push("/servers"),sx:{cursor:"pointer"},underline:"hover",color:"inherit",children:"Servers"}),(0,r.jsx)(a.Z,{component:"button",variant:"body1",onClick:()=>n.push("/servers/".concat(p)),sx:{cursor:"pointer"},underline:"hover",color:"inherit",children:m}),(0,r.jsx)(c.Z,{color:"text.primary",children:"Console"})]})]}),(0,r.jsxs)(c.Z,{variant:"h5",component:"h1",children:[m," Console"]})]}),(0,r.jsx)(l.Z,{sx:{flex:1,minHeight:0},children:(0,r.jsx)(h.K,{serverName:m})})]})}},3454:function(e,t,n){"use strict";n.d(t,{LoadingProvider:function(){return i},startLoading:function(){return a},stopLoading:function(){return u}});var r=n(94655),s=n(35106),o=n(74228),l=n(31477),c=n.n(l);function i(e){let{children:t}=e,n=(0,o.usePathname)(),l=(0,o.useSearchParams)();return(0,s.useEffect)(()=>{c().done()},[n,l]),(0,r.jsx)(r.Fragment,{children:t})}function a(){c().start()}function u(){c().done()}c().configure({showSpinner:!1,speed:300,minimum:.1})},8690:function(e,t,n){"use strict";n.d(t,{Av:function(){return r.startLoading}});var r=n(3454)},73660:function(e,t,n){"use strict";n.d(t,{K:function(){return w}});var r=n(94655),s=n(35106),o=n(18844),l=n.n(o),c=n(7281),i=n(69899),a=n(97436),u=n(30417),d=n(90829),h=n(79983),p=n(31317),m=n(25333),f=n(40064),x=n(45547),g=n(70115),v=n(69123),C=n(93017),b=n(11141),S=n(19127),y=n(69366),j=n(163);let R=[{label:"say",template:"say "},{label:"give",template:"give "},{label:"tp",template:"tp "},{label:"gamemode",template:"gamemode "}],Z=new(l())({fg:"#aaa",bg:"#000",newline:!1,escapeXML:!0,colors:{0:"#000000",1:"#cc0000",2:"#4e9a06",3:"#c4a000",4:"#3465a4",5:"#75507b",6:"#06989a",7:"#d3d7cf",8:"#555753",9:"#ef2929",10:"#8ae234",11:"#fce94f",12:"#729fcf",13:"#ad7fa8",14:"#34e2e2",15:"#eeeeec"}}),k=(0,s.memo)(function(e){let{log:t}=e,n=(0,s.useMemo)(()=>(function(e){let t=e.replace(/\x1b\[\?[\d;]*[a-zA-Z]/g,"").replace(/\x1b\[[0-9;]*[KJH]/g,"").replace(/\x1b=/g,"").replace(/\[\?[\d;]*[a-zA-Z]/g,"").replace(/\[[0-9;]*[KJH]/g,"").replace(/\[m/g,"").replace(/\[(\d+)m/g,"\x1b[$1m").replace(/>\.\.\.\.\r?/g,"").replace(/\r/g,"");return Z.toHtml(t)})(t),[t]);return(0,r.jsx)(c.Z,{sx:{py:.25,whiteSpace:"pre-wrap",wordBreak:"break-all","& span":{}},dangerouslySetInnerHTML:{__html:n}})});function w(e){let{serverName:t}=e,[n,o]=(0,s.useState)(""),[l,Z]=(0,s.useState)([]),[w,E]=(0,s.useState)(-1),[N,O]=(0,s.useState)("ALL"),[T,A]=(0,s.useState)(!0),[I,L]=(0,s.useState)(!0),[z,D]=(0,s.useState)(!1),F=(0,s.useRef)(null),H=(0,s.useRef)(null),{logs:M,isConnected:_,clearLogs:P,reconnect:W,retryCount:K}=(0,j.Y)({serverName:t}),J=(0,s.useMemo)(()=>{let e=M;return I&&(e=e.filter(e=>!e.includes("RCON Listener")&&!e.includes("RCON Client")&&!e.includes("RconClient"))),"ALL"!==N&&(e=e.filter(e=>(e.includes("/ERROR]")||e.includes("/ERROR:")?"ERROR":e.includes("/WARN]")||e.includes("/WARN:")?"WARN":(e.includes("/INFO]")||e.includes("/INFO:"),"INFO"))===N)),e},[M,N,I]);(0,s.useEffect)(()=>{T&&H.current&&(H.current.scrollTop=H.current.scrollHeight)},[J,T]);let U=(0,s.useCallback)(async()=>{let e=n.trim();if(e&&!z){D(!0);try{Z(t=>[...t,e]),E(-1),await fetch("/api/servers/".concat(encodeURIComponent(t),"/exec"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:e})}),o("")}catch(e){console.error("Failed to execute command:",e)}finally{D(!1)}}},[n,t,z]),B=(0,s.useCallback)(e=>{if("Enter"===e.key)e.preventDefault(),U();else if("ArrowUp"===e.key){if(e.preventDefault(),0===l.length)return;let t=-1===w?l.length-1:Math.max(0,w-1);E(t),o(l[t])}else if("ArrowDown"===e.key){if(e.preventDefault(),-1===w)return;let t=w+1;t>=l.length?(E(-1),o("")):(E(t),o(l[t]))}},[l,w,U]),Y=(0,s.useCallback)(e=>{var t;o(e),null===(t=F.current)||void 0===t||t.focus()},[]),Q=_?{text:"Connected",color:"success"}:K>0?{text:"Disconnected (Retry ".concat(K,")"),color:"warning"}:{text:"Disconnected",color:"error"};return(0,r.jsxs)(i.Z,{"data-testid":"server-console",sx:{display:"flex",flexDirection:"column",height:"100%",minHeight:400},children:[(0,r.jsxs)(c.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:2,py:1,borderBottom:1,borderColor:"divider"},children:[(0,r.jsxs)(g.Z,{direction:"row",spacing:1,alignItems:"center",children:[(0,r.jsx)(p.Z,{variant:"subtitle2",children:"Console"}),(0,r.jsx)(m.Z,{"data-testid":"connection-status",label:Q.text,color:Q.color,size:"small"})]}),(0,r.jsxs)(g.Z,{direction:"row",spacing:1,alignItems:"center",children:[(0,r.jsx)(d.Z,{size:"small",variant:"outlined",children:["ALL","INFO","WARN","ERROR"].map(e=>(0,r.jsx)(u.Z,{onClick:()=>O(e),variant:N===e?"contained":"outlined",children:e},e))}),(0,r.jsx)(f.Z,{control:(0,r.jsx)(x.Z,{checked:T,onChange:e=>A(e.target.checked),size:"small",inputProps:{"aria-label":"Auto-scroll"}}),label:"Auto-scroll"}),(0,r.jsx)(f.Z,{control:(0,r.jsx)(x.Z,{checked:I,onChange:e=>L(e.target.checked),size:"small",inputProps:{"aria-label":"Hide RCON"}}),label:"Hide RCON"}),(0,r.jsx)(h.Z,{size:"small",onClick:P,"aria-label":"Clear logs",title:"Clear logs",children:(0,r.jsx)(S.Z,{})}),!_&&(0,r.jsx)(u.Z,{size:"small",startIcon:(0,r.jsx)(y.Z,{}),onClick:W,"aria-label":"Reconnect",children:"Reconnect"})]})]}),(0,r.jsx)(c.Z,{ref:H,sx:{flex:1,overflow:"auto",bgcolor:"#1a1a1a",p:1,fontFamily:"monospace",fontSize:"0.85rem"},children:0===J.length?(0,r.jsx)(p.Z,{color:"text.secondary",sx:{textAlign:"center",py:4,color:"#666"},children:"Waiting for logs..."}):J.map((e,t)=>(0,r.jsx)(k,{log:e},t))}),(0,r.jsx)(v.Z,{}),(0,r.jsx)(c.Z,{sx:{px:2,py:1,bgcolor:"background.default"},children:(0,r.jsxs)(g.Z,{direction:"row",spacing:1,children:[(0,r.jsx)(p.Z,{variant:"caption",color:"text.secondary",sx:{alignSelf:"center"},children:"Quick:"}),R.map(e=>(0,r.jsx)(u.Z,{size:"small",variant:"outlined",onClick:()=>Y(e.template),children:e.label},e.label))]})}),(0,r.jsx)(v.Z,{}),(0,r.jsxs)(c.Z,{sx:{display:"flex",p:1,gap:1},children:[(0,r.jsx)(a.Z,{inputRef:F,fullWidth:!0,size:"small",placeholder:"Enter command...",value:n,onChange:e=>o(e.target.value),onKeyDown:B,disabled:!_||z,InputProps:{sx:{fontFamily:"monospace"}}}),(0,r.jsx)(u.Z,{variant:"contained",onClick:U,disabled:!n.trim()||!_||z,startIcon:z?(0,r.jsx)(C.Z,{size:16}):(0,r.jsx)(b.Z,{}),"aria-label":"Send command",children:"Send"})]})]})}},31358:function(e,t,n){"use strict";n.d(t,{x:function(){return l}});var r=n(74228),s=n(35106),o=n(8690);function l(){let e=(0,r.useRouter)(),t=(0,s.useCallback)((t,n)=>{(0,o.Av)(),e.push(t,n)},[e]),n=(0,s.useCallback)((t,n)=>{(0,o.Av)(),e.replace(t,n)},[e]);return(0,s.useMemo)(()=>({...e,push:t,replace:n}),[e,t,n])}},93757:function(e,t,n){"use strict";n.d(t,{D:function(){return o}});var r=n(35106);class s{connect(e){this.options=e,this.shouldReconnect=!0,this.establishConnection()}establishConnection(){this.options&&(this.updateState("connecting"),this.eventSource&&this.eventSource.close(),this.eventSource=new EventSource(this.options.url,{withCredentials:this.options.withCredentials||!1}),this.eventSource.onopen=()=>{this.updateState("connected"),this.retryCount=0,this.lastError=null},this.eventSource.onmessage=e=>{if(!e.data.startsWith(":"))try{var t,n;let r=JSON.parse(e.data);null===(n=this.options)||void 0===n||null===(t=n.onMessage)||void 0===t||t.call(n,r)}catch(e){console.warn("Failed to parse SSE message:",e)}},this.eventSource.onerror=()=>{var e,t;let n={message:"SSE connection error",code:"CONNECTION_ERROR",retryCount:this.retryCount,timestamp:new Date};this.lastError=n,this.updateState("error"),null===(t=this.options)||void 0===t||null===(e=t.onError)||void 0===e||e.call(t,n),this.shouldReconnect&&this.scheduleReconnect()})}scheduleReconnect(){var e,t;if(!this.options)return;let n=null!==(e=this.options.maxReconnectAttempts)&&void 0!==e?e:1/0;if(this.retryCount>=n)return;this.reconnectTimer&&clearTimeout(this.reconnectTimer);let r=null!==(t=this.options.reconnectInterval)&&void 0!==t?t:3e3;this.reconnectTimer=setTimeout(()=>{this.retryCount++,this.establishConnection()},r)}disconnect(){this.shouldReconnect=!1,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.eventSource&&(this.eventSource.close(),this.eventSource=null),this.updateState("disconnected")}getState(){return this.state}isConnected(){return"connected"===this.state}getLastError(){return this.lastError}getRetryCount(){return this.retryCount}reconnect(){this.retryCount++,this.shouldReconnect=!0,this.eventSource&&(this.eventSource.close(),this.eventSource=null),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.establishConnection()}updateState(e){var t,n;this.state=e,null===(n=this.options)||void 0===n||null===(t=n.onStateChange)||void 0===t||t.call(n,e)}constructor(){this.eventSource=null,this.state="disconnected",this.retryCount=0,this.lastError=null,this.reconnectTimer=null,this.options=null,this.shouldReconnect=!0}}function o(e){let{url:t,onMessage:n,onError:o,reconnectInterval:l=3e3,maxReconnectAttempts:c=1/0,enabled:i=!0,withCredentials:a=!1}=e,[u,d]=(0,r.useState)(null),[h,p]=(0,r.useState)("disconnected"),[m,f]=(0,r.useState)(null),[x,g]=(0,r.useState)(0),v=(0,r.useRef)(null),C=(0,r.useCallback)(e=>{d(e),null==n||n(e)},[n]),b=(0,r.useCallback)(e=>{p(e),"connected"===e&&g(0)},[]),S=(0,r.useCallback)(e=>{f(e),"number"==typeof e.retryCount&&g(e.retryCount),null==o||o(e)},[o]),y=(0,r.useCallback)(()=>{v.current&&(v.current.reconnect(),g(v.current.getRetryCount()))},[]),j=(0,r.useCallback)(()=>{v.current&&v.current.disconnect()},[]);return(0,r.useEffect)(()=>{if(!i){v.current&&(v.current.disconnect(),v.current=null);return}return v.current||(v.current=new s),v.current.connect({url:t,onMessage:C,onStateChange:b,onError:S,reconnectInterval:l,maxReconnectAttempts:c,withCredentials:a}),()=>{v.current&&(v.current.disconnect(),v.current=null)}},[t,i,l,c,a,C,b,S]),{data:u,isConnected:"connected"===h,state:h,error:m,retryCount:x,reconnect:y,disconnect:j}}},163:function(e,t,n){"use strict";n.d(t,{Y:function(){return o}});var r=n(35106),s=n(93757);function o(e){let{serverName:t,maxLines:n=500,enabled:o=!0,reconnectInterval:l=3e3}=e,[c,i]=(0,r.useState)([]);(0,r.useEffect)(()=>{i([])},[t]);let a=(0,r.useCallback)(e=>{let t;"server-log"===e.type?t=e.data.log:"log"in e&&"string"==typeof e.log&&(t=e.log),t&&i(e=>{let r=[...e,t];return r.length>n?r.slice(r.length-n):r})},[n]),{isConnected:u,reconnect:d,retryCount:h}=(0,s.D)({url:"/api/sse/servers/".concat(encodeURIComponent(t),"/logs"),onMessage:a,enabled:o,reconnectInterval:l});return{logs:c,isConnected:u,clearLogs:(0,r.useCallback)(()=>{i([])},[]),reconnect:d,retryCount:h}}}},function(e){e.O(0,[6812,7220,8006,7294,8696,4538,6645,1476,3669,2757,1744],function(){return e(e.s=32823)}),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3767],{32823:function(e,t,n){Promise.resolve().then(n.bind(n,32050))},32050:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return p}});var r=n(94655),s=n(35106),o=n(31358),l=n(7281),c=n(31317),i=n(26138),a=n(41261),u=n(79983),d=n(10117),h=n(73660);function p(e){let{params:t}=e,n=(0,o.x)(),{name:p}=(0,s.use)(t),m=decodeURIComponent(p);return(0,r.jsxs)(l.Z,{sx:{height:"100%",display:"flex",flexDirection:"column"},children:[(0,r.jsxs)(l.Z,{sx:{mb:2},children:[(0,r.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:1},children:[(0,r.jsx)(u.Z,{onClick:()=>n.push("/servers/".concat(p)),size:"small","aria-label":"Back to server",children:(0,r.jsx)(d.Z,{})}),(0,r.jsxs)(i.Z,{"aria-label":"breadcrumb",children:[(0,r.jsx)(a.Z,{component:"button",variant:"body1",onClick:()=>n.push("/servers"),sx:{cursor:"pointer"},underline:"hover",color:"inherit",children:"Servers"}),(0,r.jsx)(a.Z,{component:"button",variant:"body1",onClick:()=>n.push("/servers/".concat(p)),sx:{cursor:"pointer"},underline:"hover",color:"inherit",children:m}),(0,r.jsx)(c.Z,{color:"text.primary",children:"Console"})]})]}),(0,r.jsxs)(c.Z,{variant:"h5",component:"h1",children:[m," Console"]})]}),(0,r.jsx)(l.Z,{sx:{flex:1,minHeight:0},children:(0,r.jsx)(h.K,{serverName:m})})]})}},3454:function(e,t,n){"use strict";n.d(t,{LoadingProvider:function(){return i},startLoading:function(){return a},stopLoading:function(){return u}});var r=n(94655),s=n(35106),o=n(74228),l=n(31477),c=n.n(l);function i(e){let{children:t}=e,n=(0,o.usePathname)(),l=(0,o.useSearchParams)();return(0,s.useEffect)(()=>{c().done()},[n,l]),(0,r.jsx)(r.Fragment,{children:t})}function a(){c().start()}function u(){c().done()}c().configure({showSpinner:!1,speed:300,minimum:.1})},8690:function(e,t,n){"use strict";n.d(t,{Av:function(){return r.startLoading}});var r=n(3454)},73660:function(e,t,n){"use strict";n.d(t,{K:function(){return w}});var r=n(94655),s=n(35106),o=n(18844),l=n.n(o),c=n(7281),i=n(69899),a=n(97436),u=n(30417),d=n(90829),h=n(79983),p=n(31317),m=n(25333),f=n(40064),x=n(45547),g=n(70115),v=n(69123),C=n(93017),b=n(11141),S=n(19127),y=n(69366),j=n(163);let R=[{label:"say",template:"say "},{label:"give",template:"give "},{label:"tp",template:"tp "},{label:"gamemode",template:"gamemode "}],Z=new(l())({fg:"#aaa",bg:"#000",newline:!1,escapeXML:!0,colors:{0:"#000000",1:"#cc0000",2:"#4e9a06",3:"#c4a000",4:"#3465a4",5:"#75507b",6:"#06989a",7:"#d3d7cf",8:"#555753",9:"#ef2929",10:"#8ae234",11:"#fce94f",12:"#729fcf",13:"#ad7fa8",14:"#34e2e2",15:"#eeeeec"}}),k=(0,s.memo)(function(e){let{log:t}=e,n=(0,s.useMemo)(()=>(function(e){let t=e.replace(/\x1b\[\?[\d;]*[a-zA-Z]/g,"").replace(/\x1b\[[0-9;]*[KJH]/g,"").replace(/\x1b=/g,"").replace(/\[\?[\d;]*[a-zA-Z]/g,"").replace(/\[[0-9;]*[KJH]/g,"").replace(/\[m/g,"").replace(/\[(\d+)m/g,"\x1b[$1m").replace(/>\.\.\.\.\r?/g,"").replace(/\r/g,"");return Z.toHtml(t)})(t),[t]);return(0,r.jsx)(c.Z,{sx:{py:.25,whiteSpace:"pre-wrap",wordBreak:"break-all","& span":{}},dangerouslySetInnerHTML:{__html:n}})});function w(e){let{serverName:t}=e,[n,o]=(0,s.useState)(""),[l,Z]=(0,s.useState)([]),[w,E]=(0,s.useState)(-1),[N,O]=(0,s.useState)("ALL"),[T,A]=(0,s.useState)(!0),[I,L]=(0,s.useState)(!0),[z,D]=(0,s.useState)(!1),F=(0,s.useRef)(null),H=(0,s.useRef)(null),{logs:M,isConnected:_,clearLogs:P,reconnect:W,retryCount:K}=(0,j.Y)({serverName:t}),J=(0,s.useMemo)(()=>{let e=M;return I&&(e=e.filter(e=>!e.includes("RCON Listener")&&!e.includes("RCON Client")&&!e.includes("RconClient"))),"ALL"!==N&&(e=e.filter(e=>(e.includes("/ERROR]")||e.includes("/ERROR:")?"ERROR":e.includes("/WARN]")||e.includes("/WARN:")?"WARN":(e.includes("/INFO]")||e.includes("/INFO:"),"INFO"))===N)),e},[M,N,I]);(0,s.useEffect)(()=>{T&&H.current&&(H.current.scrollTop=H.current.scrollHeight)},[J,T]);let U=(0,s.useCallback)(async()=>{let e=n.trim();if(e&&!z){D(!0);try{Z(t=>[...t,e]),E(-1),await fetch("/api/servers/".concat(encodeURIComponent(t),"/exec"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:e})}),o("")}catch(e){console.error("Failed to execute command:",e)}finally{D(!1)}}},[n,t,z]),B=(0,s.useCallback)(e=>{if("Enter"===e.key)e.preventDefault(),U();else if("ArrowUp"===e.key){if(e.preventDefault(),0===l.length)return;let t=-1===w?l.length-1:Math.max(0,w-1);E(t),o(l[t])}else if("ArrowDown"===e.key){if(e.preventDefault(),-1===w)return;let t=w+1;t>=l.length?(E(-1),o("")):(E(t),o(l[t]))}},[l,w,U]),Y=(0,s.useCallback)(e=>{var t;o(e),null===(t=F.current)||void 0===t||t.focus()},[]),Q=_?{text:"Connected",color:"success"}:K>0?{text:"Disconnected (Retry ".concat(K,")"),color:"warning"}:{text:"Disconnected",color:"error"};return(0,r.jsxs)(i.Z,{"data-testid":"server-console",sx:{display:"flex",flexDirection:"column",height:"100%",minHeight:400},children:[(0,r.jsxs)(c.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:2,py:1,borderBottom:1,borderColor:"divider"},children:[(0,r.jsxs)(g.Z,{direction:"row",spacing:1,alignItems:"center",children:[(0,r.jsx)(p.Z,{variant:"subtitle2",children:"Console"}),(0,r.jsx)(m.Z,{"data-testid":"connection-status",label:Q.text,color:Q.color,size:"small"})]}),(0,r.jsxs)(g.Z,{direction:"row",spacing:1,alignItems:"center",children:[(0,r.jsx)(d.Z,{size:"small",variant:"outlined",children:["ALL","INFO","WARN","ERROR"].map(e=>(0,r.jsx)(u.Z,{onClick:()=>O(e),variant:N===e?"contained":"outlined",children:e},e))}),(0,r.jsx)(f.Z,{control:(0,r.jsx)(x.Z,{checked:T,onChange:e=>A(e.target.checked),size:"small",inputProps:{"aria-label":"Auto-scroll"}}),label:"Auto-scroll"}),(0,r.jsx)(f.Z,{control:(0,r.jsx)(x.Z,{checked:I,onChange:e=>L(e.target.checked),size:"small",inputProps:{"aria-label":"Hide RCON"}}),label:"Hide RCON"}),(0,r.jsx)(h.Z,{size:"small",onClick:P,"aria-label":"Clear logs",title:"Clear logs",children:(0,r.jsx)(S.Z,{})}),!_&&(0,r.jsx)(u.Z,{size:"small",startIcon:(0,r.jsx)(y.Z,{}),onClick:W,"aria-label":"Reconnect",children:"Reconnect"})]})]}),(0,r.jsx)(c.Z,{ref:H,sx:{flex:1,overflow:"auto",bgcolor:"#1a1a1a",p:1,fontFamily:"monospace",fontSize:"0.85rem"},children:0===J.length?(0,r.jsx)(p.Z,{color:"text.secondary",sx:{textAlign:"center",py:4,color:"#666"},children:"Waiting for logs..."}):J.map((e,t)=>(0,r.jsx)(k,{log:e},t))}),(0,r.jsx)(v.Z,{}),(0,r.jsx)(c.Z,{sx:{px:2,py:1,bgcolor:"background.default"},children:(0,r.jsxs)(g.Z,{direction:"row",spacing:1,children:[(0,r.jsx)(p.Z,{variant:"caption",color:"text.secondary",sx:{alignSelf:"center"},children:"Quick:"}),R.map(e=>(0,r.jsx)(u.Z,{size:"small",variant:"outlined",onClick:()=>Y(e.template),children:e.label},e.label))]})}),(0,r.jsx)(v.Z,{}),(0,r.jsxs)(c.Z,{sx:{display:"flex",p:1,gap:1},children:[(0,r.jsx)(a.Z,{inputRef:F,fullWidth:!0,size:"small",placeholder:"Enter command...",value:n,onChange:e=>o(e.target.value),onKeyDown:B,disabled:!_||z,InputProps:{sx:{fontFamily:"monospace"}}}),(0,r.jsx)(u.Z,{variant:"contained",onClick:U,disabled:!n.trim()||!_||z,startIcon:z?(0,r.jsx)(C.Z,{size:16}):(0,r.jsx)(b.Z,{}),"aria-label":"Send command",children:"Send"})]})]})}},31358:function(e,t,n){"use strict";n.d(t,{x:function(){return l}});var r=n(74228),s=n(35106),o=n(8690);function l(){let e=(0,r.useRouter)(),t=(0,s.useCallback)((t,n)=>{(0,o.Av)(),e.push(t,n)},[e]),n=(0,s.useCallback)((t,n)=>{(0,o.Av)(),e.replace(t,n)},[e]);return(0,s.useMemo)(()=>({...e,push:t,replace:n}),[e,t,n])}},93757:function(e,t,n){"use strict";n.d(t,{D:function(){return o}});var r=n(35106);class s{connect(e){this.options=e,this.shouldReconnect=!0,this.establishConnection()}establishConnection(){this.options&&(this.updateState("connecting"),this.eventSource&&this.eventSource.close(),this.eventSource=new EventSource(this.options.url,{withCredentials:this.options.withCredentials||!1}),this.eventSource.onopen=()=>{this.updateState("connected"),this.retryCount=0,this.lastError=null},this.eventSource.onmessage=e=>{if(!e.data.startsWith(":"))try{var t,n;let r=JSON.parse(e.data);null===(n=this.options)||void 0===n||null===(t=n.onMessage)||void 0===t||t.call(n,r)}catch(e){console.warn("Failed to parse SSE message:",e)}},this.eventSource.onerror=()=>{var e,t;let n={message:"SSE connection error",code:"CONNECTION_ERROR",retryCount:this.retryCount,timestamp:new Date};this.lastError=n,this.updateState("error"),null===(t=this.options)||void 0===t||null===(e=t.onError)||void 0===e||e.call(t,n),this.shouldReconnect&&this.scheduleReconnect()})}scheduleReconnect(){var e,t;if(!this.options)return;let n=null!==(e=this.options.maxReconnectAttempts)&&void 0!==e?e:1/0;if(this.retryCount>=n)return;this.reconnectTimer&&clearTimeout(this.reconnectTimer);let r=null!==(t=this.options.reconnectInterval)&&void 0!==t?t:3e3;this.reconnectTimer=setTimeout(()=>{this.retryCount++,this.establishConnection()},r)}disconnect(){this.shouldReconnect=!1,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.eventSource&&(this.eventSource.close(),this.eventSource=null),this.updateState("disconnected")}getState(){return this.state}isConnected(){return"connected"===this.state}getLastError(){return this.lastError}getRetryCount(){return this.retryCount}reconnect(){this.retryCount++,this.shouldReconnect=!0,this.eventSource&&(this.eventSource.close(),this.eventSource=null),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.establishConnection()}updateState(e){var t,n;this.state=e,null===(n=this.options)||void 0===n||null===(t=n.onStateChange)||void 0===t||t.call(n,e)}constructor(){this.eventSource=null,this.state="disconnected",this.retryCount=0,this.lastError=null,this.reconnectTimer=null,this.options=null,this.shouldReconnect=!0}}function o(e){let{url:t,onMessage:n,onError:o,reconnectInterval:l=3e3,maxReconnectAttempts:c=1/0,enabled:i=!0,withCredentials:a=!1}=e,[u,d]=(0,r.useState)(null),[h,p]=(0,r.useState)("disconnected"),[m,f]=(0,r.useState)(null),[x,g]=(0,r.useState)(0),v=(0,r.useRef)(null),C=(0,r.useCallback)(e=>{d(e),null==n||n(e)},[n]),b=(0,r.useCallback)(e=>{p(e),"connected"===e&&g(0)},[]),S=(0,r.useCallback)(e=>{f(e),"number"==typeof e.retryCount&&g(e.retryCount),null==o||o(e)},[o]),y=(0,r.useCallback)(()=>{v.current&&(v.current.reconnect(),g(v.current.getRetryCount()))},[]),j=(0,r.useCallback)(()=>{v.current&&v.current.disconnect()},[]);return(0,r.useEffect)(()=>{if(!i){v.current&&(v.current.disconnect(),v.current=null);return}return v.current||(v.current=new s),v.current.connect({url:t,onMessage:C,onStateChange:b,onError:S,reconnectInterval:l,maxReconnectAttempts:c,withCredentials:a}),()=>{v.current&&(v.current.disconnect(),v.current=null)}},[t,i,l,c,a,C,b,S]),{data:u,isConnected:"connected"===h,state:h,error:m,retryCount:x,reconnect:y,disconnect:j}}},163:function(e,t,n){"use strict";n.d(t,{Y:function(){return o}});var r=n(35106),s=n(93757);function o(e){let{serverName:t,maxLines:n=500,enabled:o=!0,reconnectInterval:l=3e3}=e,[c,i]=(0,r.useState)([]);(0,r.useEffect)(()=>{i([])},[t]);let a=(0,r.useCallback)(e=>{let t;"server-log"===e.type?t=e.data.log:"log"in e&&"string"==typeof e.log&&(t=e.log),t&&i(e=>{let r=[...e,t];return r.length>n?r.slice(r.length-n):r})},[n]),{isConnected:u,reconnect:d,retryCount:h}=(0,s.D)({url:"/api/sse/servers/".concat(encodeURIComponent(t),"/logs"),onMessage:a,enabled:o,reconnectInterval:l});return{logs:c,isConnected:u,clearLogs:(0,r.useCallback)(()=>{i([])},[]),reconnect:d,retryCount:h}}}},function(e){e.O(0,[6812,9760,6758,680,1668,7436,1658,6727,6357,5375,3669,2757,1744],function(){return e(e.s=32823)}),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[278],{59616:function(e,r,s){Promise.resolve().then(s.bind(s,41517))},41517:function(e,r,s){"use strict";s.r(r),s.d(r,{default:function(){return eL}});var t=s(94655),n=s(35106),i=s(74228),a=s(31358),l=s(7281),o=s(30417),d=s(79983),c=s(81071),x=s(93017),h=s(10721),u=s(628),m=s(41565),p=s(31317),j=s(35694),g=s(7178),v=s(17820),Z=s(73424),f=s(99770),b=s(62508),y=s(5682),C=s(76678),w=s(97436),S=s(84840),R=s(76492),k=s(10117),I=s(5501),P=s(37809),z=s(21111),W=s(17978),F=s(89573),O=s(96292),A=s(33104),M=s(25333),T=s(52082),D=s(69123),E=s(71185),B=s(30165),N=s(97293),U=s(11259),L=s(66615),H=s(89161),q=s(34071),K=s(4405);function G(e){let{value:r,unit:s,label:n,icon:i,progress:a,progressMax:o,color:d="#1bd96a"}=e;return(0,t.jsxs)(u.Z,{"data-testid":"resource-stat-card",sx:{p:2.5,bgcolor:"background.paper",border:"1px solid",borderColor:"divider",borderRadius:3},children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:2},children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"baseline",gap:.75,flexWrap:"wrap",minWidth:0},children:[(0,t.jsx)(p.Z,{variant:"h4",component:"span",sx:{fontWeight:700,color:"text.primary",fontFamily:"'JetBrains Mono', 'Fira Code', monospace",letterSpacing:"-0.5px"},children:r}),(0,t.jsx)(p.Z,{variant:"body2",component:"span",sx:{color:"text.secondary",fontWeight:500},children:s})]}),(0,t.jsx)(l.Z,{sx:{color:"text.secondary",flexShrink:0},children:i})]}),(0,t.jsx)(p.Z,{variant:"body2",sx:{color:"text.secondary",fontWeight:500,mt:.5},children:n}),(0,t.jsx)(K.Z,{variant:"determinate",value:Math.min(a/o*100,100),sx:{mt:1,height:6,borderRadius:1.5,bgcolor:"#2a2d3a","& .MuiLinearProgress-bar":{borderRadius:1.5,background:"linear-gradient(90deg, ".concat(d," 0%, ").concat(d,"cc 100%)")}}})]})}var _=s(163),J=s(73660),V=s(90158),Q=s(58347),Y=s(95511),$=s(46725),X=s(26577),ee=s(56813),er=s(26892),es=s(84509);function et(e){var r;let{serverName:s}=e,{data:n,isLoading:i,error:a}=(0,es.HZ)(s,{limit:20});if(i)return(0,t.jsx)(l.Z,{children:[void 0,void 0,void 0,void 0,void 0].map((e,r)=>(0,t.jsxs)(l.Z,{sx:{display:"flex",gap:2,py:1.5},children:[(0,t.jsx)(h.Z,{variant:"rounded",width:60,height:24}),(0,t.jsx)(h.Z,{variant:"text",width:"60%"}),(0,t.jsx)(h.Z,{variant:"text",width:50})]},r))});if(a)return(0,t.jsxs)(c.Z,{severity:"error",children:["Failed to load activity: ",a.message]});let d=null!==(r=null==n?void 0:n.logs)&&void 0!==r?r:[];if(0===d.length)return(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",sx:{py:4,textAlign:"center"},children:"No activity recorded for this server yet."});let x="/audit-logs?targetType=server&targetName=".concat(encodeURIComponent(s));return(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(V.Z,{sx:{py:0},children:d.map(e=>{var r;return(0,t.jsx)(Q.ZP,{sx:{px:0,py:1.5,"&:not(:last-child)":{borderBottom:"1px solid",borderColor:"divider"}},children:(0,t.jsx)(Z.Z,{primary:(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,t.jsx)(ee.I,{action:e.action,size:"small"}),(0,t.jsxs)(p.Z,{variant:"body2",color:"text.secondary",children:["by ",e.actor.replace("api:","").replace("cli:","")]}),(0,t.jsx)(er.c,{status:e.status,size:"small"})]}),secondary:(0,t.jsx)(Y.Z,{title:(r=e.timestamp,new Intl.DateTimeFormat(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:"short"}).format(new Date(r))),arrow:!0,children:(0,t.jsx)(p.Z,{variant:"caption",component:"span",color:"text.disabled",children:function(e){let r=new Date,s=new Date(e),t=Math.floor((r.getTime()-s.getTime())/6e4),n=Math.floor(t/60);return t<1?"just now":t<60?"".concat(t,"m ago"):n<24?"".concat(n,"h ago"):"".concat(Math.floor(n/24),"d ago")}(e.timestamp)})})})},e.id)})}),(0,t.jsx)(l.Z,{sx:{mt:2,textAlign:"center"},children:(0,t.jsx)(o.Z,{component:$.default,href:x,size:"small",endIcon:(0,t.jsx)(X.Z,{}),sx:{textTransform:"none"},children:"View Full History"})})]})}var en=s(62328),ei=s(29793),ea=s(75726),el=s(40064),eo=s(38393),ed=s(37530),ec=s(5942),ex=s(84420),eh=s(46121),eu=s(84775),em=s(92666);function ep(e){var r,s;let{serverName:i,isRunning:a}=e,{data:d,isLoading:h}=(0,em.iC)(i),j=(0,em.MH)(),v=(0,em.gx)(),[Z,R]=(0,n.useState)({}),[k,I]=(0,n.useState)(!1),[P,z]=(0,n.useState)(!1),[W,F]=(0,n.useState)(!1),[O,A]=(0,n.useState)(""),[M,T]=(0,n.useState)({open:!1,message:"",severity:"info"});(0,n.useEffect)(()=>{(null==d?void 0:d.config)&&R(d.config)},[d]);let E=(e,r)=>{R(s=>({...s,[e]:r})),I(!0),("memory"===e||"useAikarFlags"===e)&&z(!0)},B=async()=>{try{let e=await j.mutateAsync({serverName:i,config:Z});T({open:!0,message:e.restartRequired?"Settings saved. Restart required for some changes to take effect.":"Settings saved successfully.",severity:e.restartRequired?"warning":"success"}),I(!1),z(!1)}catch(e){T({open:!0,message:e instanceof Error?e.message:"Failed to save settings",severity:"error"})}},N=async()=>{if("RESET"!==O){T({open:!0,message:"Please type RESET to confirm",severity:"warning"});return}try{await v.mutateAsync(i),T({open:!0,message:"World reset successfully",severity:"success"}),F(!1),A("")}catch(e){T({open:!0,message:e instanceof Error?e.message:"Failed to reset world",severity:"error"})}};return h?(0,t.jsx)(l.Z,{sx:{display:"flex",justifyContent:"center",py:8},children:(0,t.jsx)(x.Z,{})}):(0,t.jsxs)(l.Z,{children:[P&&(0,t.jsx)(c.Z,{severity:"warning",icon:(0,t.jsx)(ex.Z,{}),sx:{mb:3},children:"Performance settings require a server restart to take effect."}),(0,t.jsx)(u.Z,{sx:{mb:3,borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(p.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,children:"Server Properties"}),(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"These settings can be changed without restarting the server."}),(0,t.jsx)(D.Z,{sx:{mb:3}}),(0,t.jsxs)(S.ZP,{container:!0,spacing:3,children:[(0,t.jsx)(S.ZP,{item:!0,xs:12,children:(0,t.jsx)(w.Z,{fullWidth:!0,label:"MOTD (Message of the Day)",value:Z.motd||"",onChange:e=>E("motd",e.target.value),helperText:"The message displayed in the server list"})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsx)(w.Z,{fullWidth:!0,type:"number",label:"Max Players",value:Z.maxPlayers||20,onChange:e=>E("maxPlayers",parseInt(e.target.value,10)),inputProps:{min:1,max:100}})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsxs)(ei.Z,{fullWidth:!0,children:[(0,t.jsx)(ea.Z,{children:"Difficulty"}),(0,t.jsxs)(en.Z,{value:Z.difficulty||"normal",label:"Difficulty",onChange:e=>E("difficulty",e.target.value),children:[(0,t.jsx)(g.Z,{value:"peaceful",children:"Peaceful"}),(0,t.jsx)(g.Z,{value:"easy",children:"Easy"}),(0,t.jsx)(g.Z,{value:"normal",children:"Normal"}),(0,t.jsx)(g.Z,{value:"hard",children:"Hard"})]})]})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsxs)(ei.Z,{fullWidth:!0,children:[(0,t.jsx)(ea.Z,{children:"Game Mode"}),(0,t.jsxs)(en.Z,{value:Z.gameMode||"survival",label:"Game Mode",onChange:e=>E("gameMode",e.target.value),children:[(0,t.jsx)(g.Z,{value:"survival",children:"Survival"}),(0,t.jsx)(g.Z,{value:"creative",children:"Creative"}),(0,t.jsx)(g.Z,{value:"adventure",children:"Adventure"}),(0,t.jsx)(g.Z,{value:"spectator",children:"Spectator"})]})]})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsx)(el.Z,{control:(0,t.jsx)(eo.Z,{checked:null===(r=Z.pvp)||void 0===r||r,onChange:e=>E("pvp",e.target.checked)}),label:"Enable PvP"})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsx)(w.Z,{fullWidth:!0,type:"number",label:"View Distance (chunks)",value:Z.viewDistance||10,onChange:e=>E("viewDistance",parseInt(e.target.value,10)),inputProps:{min:3,max:32}})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsx)(w.Z,{fullWidth:!0,type:"number",label:"Spawn Protection (blocks)",value:Z.spawnProtection||16,onChange:e=>E("spawnProtection",parseInt(e.target.value,10)),inputProps:{min:0,max:128}})})]})]})}),(0,t.jsx)(u.Z,{sx:{mb:3,borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(p.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,children:"Performance Settings"}),(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"These settings require a server restart to take effect."}),(0,t.jsx)(D.Z,{sx:{mb:3}}),(0,t.jsxs)(S.ZP,{container:!0,spacing:3,children:[(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsx)(w.Z,{fullWidth:!0,label:"Memory Allocation",value:Z.memory||"4G",onChange:e=>E("memory",e.target.value),helperText:"Format: 4G, 8G, etc."})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsx)(el.Z,{control:(0,t.jsx)(eo.Z,{checked:null!==(s=Z.useAikarFlags)&&void 0!==s&&s,onChange:e=>E("useAikarFlags",e.target.checked)}),label:"Use Aikar's Flags (Optimized GC)"})})]})]})}),(0,t.jsx)(l.Z,{sx:{display:"flex",justifyContent:"flex-end",mb:3},children:(0,t.jsx)(o.Z,{variant:"contained",size:"large",startIcon:(0,t.jsx)(ec.Z,{}),onClick:B,disabled:!k||j.isPending,sx:{px:4},children:j.isPending?"Saving...":"Save Changes"})}),(0,t.jsx)(u.Z,{sx:{borderRadius:3,borderColor:"error.main",borderWidth:1,borderStyle:"solid"},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(p.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,color:"error",children:"Danger Zone"}),(0,t.jsx)(D.Z,{sx:{mb:3}}),(0,t.jsxs)(l.Z,{sx:{mb:3},children:[(0,t.jsx)(p.Z,{variant:"subtitle1",fontWeight:600,gutterBottom:!0,children:"Reset World"}),(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"This will permanently delete the current world and generate a new one. This action cannot be undone."}),(0,t.jsx)(o.Z,{variant:"outlined",color:"error",startIcon:(0,t.jsx)(eu.Z,{}),onClick:()=>F(!0),disabled:a,children:"Reset World"}),a&&(0,t.jsx)(p.Z,{variant:"caption",color:"text.secondary",sx:{ml:2},children:"Stop the server first"})]})]})}),(0,t.jsxs)(f.Z,{open:W,onClose:()=>F(!1),maxWidth:"sm",fullWidth:!0,children:[(0,t.jsx)(b.Z,{children:(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,t.jsx)(ex.Z,{color:"error"}),(0,t.jsx)(p.Z,{variant:"h6",fontWeight:600,children:"Reset World"})]})}),(0,t.jsxs)(y.Z,{children:[(0,t.jsxs)(p.Z,{variant:"body1",gutterBottom:!0,children:["This will permanently delete the world for ",(0,t.jsx)("strong",{children:i})," and generate a new one."]}),(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",gutterBottom:!0,children:"This action cannot be undone. All player progress and builds will be lost."}),(0,t.jsx)(w.Z,{fullWidth:!0,label:"Type RESET to confirm",value:O,onChange:e=>A(e.target.value),sx:{mt:3},autoFocus:!0})]}),(0,t.jsxs)(C.Z,{children:[(0,t.jsx)(o.Z,{onClick:()=>F(!1),children:"Cancel"}),(0,t.jsx)(o.Z,{variant:"contained",color:"error",onClick:N,disabled:"RESET"!==O||v.isPending,startIcon:v.isPending?(0,t.jsx)(x.Z,{size:16}):(0,t.jsx)(eh.Z,{}),children:v.isPending?"Resetting...":"Reset World"})]})]}),(0,t.jsx)(ed.Z,{open:M.open,autoHideDuration:6e3,onClose:()=>T({...M,open:!1}),anchorOrigin:{vertical:"bottom",horizontal:"right"},children:(0,t.jsx)(c.Z,{onClose:()=>T({...M,open:!1}),severity:M.severity,sx:{width:"100%"},children:M.message})})]})}var ej=s(86702),eg=s(47606),ev=s(407),eZ=s(56056),ef=s(28058),eb=s(11597),ey=s(59602);let eC={admin:{label:"Owner",color:"primary",variant:"filled"},manage:{label:"Operator",color:"info",variant:"outlined"},view:{label:"Viewer",color:"default",variant:"outlined"}};function ew(e){let{permission:r,size:s="medium"}=e,n=eC[r];return(0,t.jsx)(M.Z,{label:n.label,color:n.color,variant:n.variant,size:s})}var eS=s(99046),eR=s(68038),ek=s(34080),eI=s(39181),eP=s(5632),ez=s(58919),eW=s(20367),eF=s(42936);function eO(e){var r,s;let{open:i,onClose:a,serverId:d}=e,[h,u]=(0,n.useState)(""),[m,j]=(0,n.useState)(null),[g,v]=(0,n.useState)("view"),{data:Z,isLoading:S}=(s={enabled:i},(0,eP.a)({queryKey:["users","search",h],queryFn:()=>(0,eF.SC)("/api/users?q=".concat(encodeURIComponent(h))),enabled:(null==s?void 0:s.enabled)!==!1&&h.length>=2,staleTime:3e4})),R=function(){let e=(0,ez.NL)();return(0,eW.D)({mutationFn:e=>(0,eF.SC)("/api/user-servers",{method:"POST",body:JSON.stringify(e)}),onSuccess:(r,s)=>{e.invalidateQueries({queryKey:["user-servers",s.serverId]}),e.invalidateQueries({queryKey:["user-servers"]})}})}(),k=(0,n.useMemo)(()=>{var e;return null!==(e=null==Z?void 0:Z.users)&&void 0!==e?e:[]},[Z]),I=()=>{u(""),j(null),v("view"),R.reset(),a()};return(0,t.jsxs)(f.Z,{open:i,onClose:I,maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{borderRadius:3}},children:[(0,t.jsx)(b.Z,{sx:{fontWeight:600},children:"Add User Access"}),(0,t.jsxs)(y.Z,{sx:{display:"flex",flexDirection:"column",gap:3,pt:"8px !important"},children:[R.isError&&(0,t.jsx)(c.Z,{severity:"error",sx:{mb:1},children:(null===(r=R.error)||void 0===r?void 0:r.message)||"Failed to grant access"}),(0,t.jsx)(eS.Z,{options:k,getOptionLabel:e=>e.name||e.email,isOptionEqualToValue:(e,r)=>e.id===r.id,value:m,onChange:(e,r)=>j(r),inputValue:h,onInputChange:(e,r)=>u(r),loading:S,filterOptions:e=>e,noOptionsText:h.length<2?"Type at least 2 characters":"No users found",renderInput:e=>(0,t.jsx)(w.Z,{...e,label:"Search User",placeholder:"Search by name or email...",InputProps:{...e.InputProps,endAdornment:(0,t.jsxs)(t.Fragment,{children:[S&&(0,t.jsx)(x.Z,{size:20}),e.InputProps.endAdornment]})}}),renderOption:(e,r)=>{var s,n,i;let{key:a,...o}=e;return(0,t.jsxs)(l.Z,{component:"li",...o,sx:{display:"flex",gap:1.5,py:1},children:[(0,t.jsx)(ej.Z,{src:null!==(i=r.image)&&void 0!==i?i:void 0,sx:{width:32,height:32,bgcolor:"primary.main",fontSize:14},children:((null===(s=r.name)||void 0===s?void 0:s[0])||(null===(n=r.email)||void 0===n?void 0:n[0])||"?").toUpperCase()}),(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(p.Z,{variant:"body2",fontWeight:500,children:r.name||"Unknown"}),(0,t.jsx)(p.Z,{variant:"caption",color:"text.secondary",children:r.email})]})]},a)}}),(0,t.jsxs)(ei.Z,{children:[(0,t.jsx)(eR.Z,{sx:{fontWeight:500,mb:1},children:"Permission Level"}),(0,t.jsxs)(ek.Z,{value:g,onChange:e=>v(e.target.value),children:[(0,t.jsx)(el.Z,{value:"view",control:(0,t.jsx)(eI.Z,{size:"small"}),label:(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(p.Z,{variant:"body2",fontWeight:500,children:"Viewer"}),(0,t.jsx)(p.Z,{variant:"caption",color:"text.secondary",children:"Can view server status and logs"})]})}),(0,t.jsx)(el.Z,{value:"manage",control:(0,t.jsx)(eI.Z,{size:"small"}),label:(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(p.Z,{variant:"body2",fontWeight:500,children:"Operator"}),(0,t.jsx)(p.Z,{variant:"caption",color:"text.secondary",children:"Can start, stop, and configure the server"})]})}),(0,t.jsx)(el.Z,{value:"admin",control:(0,t.jsx)(eI.Z,{size:"small"}),label:(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(p.Z,{variant:"body2",fontWeight:500,children:"Owner"}),(0,t.jsx)(p.Z,{variant:"caption",color:"text.secondary",children:"Full control including managing other users"})]})})]})]})]}),(0,t.jsxs)(C.Z,{sx:{px:3,pb:2},children:[(0,t.jsx)(o.Z,{onClick:I,color:"inherit",children:"Cancel"}),(0,t.jsx)(o.Z,{onClick:()=>{m&&R.mutate({userId:m.id,serverId:d,permission:g},{onSuccess:I})},variant:"contained",disabled:!m||R.isPending,sx:{borderRadius:2},children:R.isPending?"Adding...":"Add User"})]})]})}function eA(e){var r,s;let{serverId:i}=e,{data:a,isLoading:x,error:f}=(0,eP.a)({queryKey:["user-servers",i],queryFn:()=>(0,eF.SC)("/api/user-servers?serverId=".concat(encodeURIComponent(i))),enabled:!!i}),b=function(){let e=(0,ez.NL)();return(0,eW.D)({mutationFn:e=>{let{id:r,permission:s}=e;return(0,eF.SC)("/api/user-servers/".concat(encodeURIComponent(r)),{method:"PATCH",body:JSON.stringify({permission:s})})},onSuccess:()=>{e.invalidateQueries({queryKey:["user-servers"]})}})}(),y=function(){let e=(0,ez.NL)();return(0,eW.D)({mutationFn:e=>(0,eF.SC)("/api/user-servers/".concat(encodeURIComponent(e)),{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["user-servers"]})}})}(),[C,w]=(0,n.useState)(!1),[S,R]=(0,n.useState)(null),[k,I]=(0,n.useState)(null),z=(e,r)=>{R(e.currentTarget),I(r)},W=()=>{R(null),I(null)},F=e=>{if(!k||k.permission===e){W();return}b.mutate({id:k.id,permission:e},{onSettled:W})},O=null!==(r=null==a?void 0:a.users.filter(e=>"admin"===e.permission).length)&&void 0!==r?r:0,A=(null==k?void 0:k.permission)==="admin"&&O<=1;if(x)return(0,t.jsx)(u.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,t.jsx)(h.Z,{variant:"text",width:"30%",height:32}),(0,t.jsx)(h.Z,{variant:"rounded",width:120,height:36,sx:{borderRadius:2}})]}),(0,t.jsx)(D.Z,{sx:{mb:2}}),[0,1,2].map(e=>(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:2,py:1.5,borderBottom:"1px solid",borderColor:"divider"},children:[(0,t.jsx)(h.Z,{variant:"circular",width:40,height:40}),(0,t.jsxs)(l.Z,{sx:{flex:1},children:[(0,t.jsx)(h.Z,{variant:"text",width:"40%"}),(0,t.jsx)(h.Z,{variant:"text",width:"60%"})]}),(0,t.jsx)(h.Z,{variant:"rounded",width:80,height:28,sx:{borderRadius:10}}),(0,t.jsx)(h.Z,{variant:"circular",width:32,height:32})]},e))]})});if(f)return(0,t.jsxs)(c.Z,{severity:"error",children:["Failed to load access list: ",f.message]});let M=null!==(s=null==a?void 0:a.users)&&void 0!==s?s:[];return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,t.jsx)(p.Z,{variant:"h6",fontWeight:600,children:"Server Access"}),(0,t.jsx)(o.Z,{variant:"contained",size:"small",startIcon:(0,t.jsx)(eg.Z,{}),onClick:()=>w(!0),sx:{borderRadius:2},children:"Add User"})]}),(0,t.jsx)(D.Z,{sx:{mb:1}}),0===M.length?(0,t.jsx)(l.Z,{sx:{py:4,textAlign:"center"},children:(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",children:"No users have been granted access to this server yet."})}):M.map(e=>{var r,s,n,i,a,o,c,x;return(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:2,py:1.5,"&:not(:last-child)":{borderBottom:"1px solid",borderColor:"divider"}},children:[(0,t.jsx)(ej.Z,{src:null!==(x=null===(r=e.user)||void 0===r?void 0:r.image)&&void 0!==x?x:void 0,sx:{width:40,height:40,bgcolor:"primary.main",fontSize:16},children:((null===(n=e.user)||void 0===n?void 0:null===(s=n.name)||void 0===s?void 0:s[0])||(null===(a=e.user)||void 0===a?void 0:null===(i=a.email)||void 0===i?void 0:i[0])||"?").toUpperCase()}),(0,t.jsxs)(l.Z,{sx:{flex:1,minWidth:0},children:[(0,t.jsx)(p.Z,{variant:"body2",fontWeight:500,noWrap:!0,children:(null===(o=e.user)||void 0===o?void 0:o.name)||"Unknown User"}),(0,t.jsx)(p.Z,{variant:"caption",color:"text.secondary",noWrap:!0,children:(null===(c=e.user)||void 0===c?void 0:c.email)||e.userId})]}),(0,t.jsx)(ew,{permission:e.permission,size:"small"}),(0,t.jsx)(d.Z,{size:"small",onClick:r=>z(r,e),sx:{color:"text.secondary"},children:(0,t.jsx)(P.Z,{fontSize:"small"})})]},e.id)}),(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mt:2,pt:1},children:[(0,t.jsx)(ey.Z,{sx:{fontSize:16,color:"text.disabled"}}),(0,t.jsx)(p.Z,{variant:"caption",color:"text.disabled",children:"Only platform admins and server owners can manage access."})]})]})}),(0,t.jsxs)(j.Z,{anchorEl:S,open:!!S,onClose:W,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},disableScrollLock:!0,children:[(0,t.jsxs)(g.Z,{onClick:()=>F("admin"),disabled:(null==k?void 0:k.permission)==="admin",children:[(0,t.jsx)(v.Z,{children:(0,t.jsx)(ev.Z,{fontSize:"small"})}),(0,t.jsx)(Z.Z,{children:"Change to Owner"})]}),(0,t.jsxs)(g.Z,{onClick:()=>F("manage"),disabled:(null==k?void 0:k.permission)==="manage"||A,children:[(0,t.jsx)(v.Z,{children:(0,t.jsx)(eZ.Z,{fontSize:"small"})}),(0,t.jsx)(Z.Z,{children:"Change to Operator"})]}),(0,t.jsxs)(g.Z,{onClick:()=>F("view"),disabled:(null==k?void 0:k.permission)==="view"||A,children:[(0,t.jsx)(v.Z,{children:(0,t.jsx)(ef.Z,{fontSize:"small"})}),(0,t.jsx)(Z.Z,{children:"Change to Viewer"})]}),(0,t.jsx)(D.Z,{}),(0,t.jsxs)(g.Z,{onClick:()=>{k&&y.mutate(k.id,{onSettled:W})},disabled:A,sx:{color:"error.main"},children:[(0,t.jsx)(v.Z,{children:(0,t.jsx)(eb.Z,{fontSize:"small",sx:{color:"error.main"}})}),(0,t.jsx)(Z.Z,{children:"Remove Access"})]})]}),(0,t.jsx)(eO,{open:C,onClose:()=>w(!1),serverId:i})]})}let eM=["Overview","Activity","Content","Files","Backups","Access","Options"];function eT(e){return e.replace(/\x1b\[\?[\d;]*[a-zA-Z]/g,"").replace(/\x1b\[[0-9;]*[a-zA-Z]/g,"").replace(/\x1b=/g,"").replace(/\[\?[\d;]*[a-zA-Z]/g,"").replace(/\[[0-9;]*[a-zA-Z]/g,"").replace(/\[m/g,"").replace(/>\.\.\.\.\r?/g,"").replace(/\r/g,"").trim()}function eD(e){var r,s,i,a,c;let{server:x,onSendCommand:h}=e,[j,g]=(0,n.useState)("Overview"),[v,Z]=(0,n.useState)(""),[b,C]=(0,n.useState)(!0),[k,I]=(0,n.useState)(!1),P=(0,n.useRef)(null),{logs:z,isConnected:W}=(0,_.Y)({serverName:x.name}),F=(0,n.useMemo)(()=>z.filter(e=>!e.includes("RCON Listener")&&!e.includes("RCON Client")&&!e.includes("RconClient")),[z]);(0,n.useEffect)(()=>{P.current&&b&&(P.current.scrollTop=P.current.scrollHeight)},[F,b]);let O=async()=>{v.trim()&&h&&(await h(v.trim()),Z(""))},A=null!==(a=null===(r=x.stats)||void 0===r?void 0:r.cpuPercent)&&void 0!==a?a:0;(null===(s=x.stats)||void 0===s?void 0:s.memoryUsage)&&x.stats.memoryUsage,function(e){if(!e)return;let r=e.match(/^(\d+)\s*(M|G)?$/i);if(r)parseInt(r[1],10),(r[2]||"M").toUpperCase()}(x.memory);let K=null!==(c=null===(i=x.stats)||void 0===i?void 0:i.memoryPercent)&&void 0!==c?c:0;return(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(l.Z,{sx:{display:"flex",gap:.5,mb:3},children:eM.map(e=>(0,t.jsx)(o.Z,{onClick:()=>g(e),sx:{px:2,py:1,borderRadius:5,fontSize:14,fontWeight:500,textTransform:"none",bgcolor:j===e?"primary.main":"transparent",color:j===e?"#0a0e14":"text.secondary","&:hover":{bgcolor:j===e?"primary.main":(0,R.Fq)("#1bd96a",.1)}},children:e},e))}),(0,t.jsxs)(l.Z,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(3, 1fr)"},gap:2,mb:2.5},children:[(0,t.jsx)(G,{value:"".concat(A.toFixed(2),"%"),unit:"/ 100%",label:"CPU usage",icon:(0,t.jsx)(B.Z,{sx:{fontSize:28}}),progress:A,progressMax:100,color:"#1bd96a"}),(0,t.jsx)(G,{value:"".concat(K.toFixed(2),"%"),unit:"/ 100%",label:"Memory usage",icon:(0,t.jsx)(N.Z,{sx:{fontSize:28}}),progress:K,progressMax:100,color:"#1bd96a"}),(0,t.jsx)(G,{value:x.worldSize||"0 B",unit:"/ 10 GB",label:"World size",icon:(0,t.jsx)(U.Z,{sx:{fontSize:28}}),progress:function(e){if(!e)return 0;let r=e.match(/^([\d.]+)\s*(B|KB|MB|MiB|GB|GiB)?$/i);if(!r)return 0;let s=parseFloat(r[1]);switch((r[2]||"B").toUpperCase()){case"GB":case"GIB":return 1024*s;case"MB":case"MIB":return s;case"KB":return s/1024;default:return s/1048576}}(x.worldSize),progressMax:10240,color:"#1bd96a"})]}),(0,t.jsxs)(u.Z,{sx:{bgcolor:"background.paper",borderRadius:3,border:"1px solid",borderColor:"divider",overflow:"hidden"},children:[(0,t.jsxs)(l.Z,{sx:{px:3,py:2,borderBottom:"1px solid",borderColor:"divider",display:"flex",alignItems:"center",gap:1.25},children:[(0,t.jsx)(p.Z,{variant:"h6",sx:{fontWeight:700,color:"text.primary"},children:"Console"}),(0,t.jsx)(l.Z,{sx:{width:10,height:10,borderRadius:"50%",bgcolor:W?"primary.main":"error.main",boxShadow:W?"0 0 8px rgba(27, 217, 106, 0.4)":"0 0 8px rgba(239, 68, 68, 0.4)"}})]}),(0,t.jsxs)(l.Z,{sx:{position:"relative"},children:[(0,t.jsx)(l.Z,{ref:P,onScroll:()=>{if(!P.current)return;let{scrollTop:e,scrollHeight:r,clientHeight:s}=P.current;C(r-e-s<30)},sx:{height:360,overflowY:"auto",px:2.5,py:2,fontFamily:"'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace",fontSize:13,lineHeight:1.85,color:"#b4b6c4",bgcolor:"#0a0a0a",scrollbarWidth:"thin",scrollbarColor:"#3a3d4e #0a0a0a","&::-webkit-scrollbar":{width:8},"&::-webkit-scrollbar-track":{bgcolor:"#0a0a0a"},"&::-webkit-scrollbar-thumb":{bgcolor:"#3a3d4e",borderRadius:4}},children:0===F.length?(0,t.jsx)(p.Z,{sx:{color:"text.secondary",textAlign:"center",py:8},children:"Waiting for logs..."}):F.map((e,r)=>{let s=function(e){let r=eT(e).match(/\[(\d{2}:\d{2}:\d{2})\]\s*\[([^/]+)\/(\w+)\]:\s*(.+)/);return r?{time:r[1],thread:r[2],level:r[3]||"INFO",msg:r[4]}:null}(e);return s?(0,t.jsxs)(l.Z,{sx:{display:"flex",gap:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[(0,t.jsxs)(l.Z,{component:"span",sx:{color:"#4a4d60"},children:["[",s.time,"]"]}),(0,t.jsxs)(l.Z,{component:"span",sx:{color:"#4a4d60"},children:["\xa0[",s.thread,"/",(0,t.jsx)(l.Z,{component:"span",sx:{color:"WARN"===s.level?"#e8a848":"#6b6e80"},children:s.level}),"]:\xa0"]}),(0,t.jsx)(l.Z,{component:"span",sx:{color:"WARN"===s.level?"#c4a45a":"#b4b6c4"},children:s.msg})]},r):(0,t.jsx)(l.Z,{sx:{color:"#b4b6c4"},children:eT(e)},r)})}),(0,t.jsx)(d.Z,{onClick:()=>I(!0),sx:{position:"absolute",top:12,right:12,width:36,height:36,borderRadius:2,bgcolor:"#282a3a",border:"1px solid #3a3d4e",color:"#8b8da0","&:hover":{bgcolor:"#313440"}},children:(0,t.jsx)(L.Z,{sx:{fontSize:18}})}),!b&&(0,t.jsx)(d.Z,{onClick:()=>{P.current&&P.current.scrollTo({top:P.current.scrollHeight,behavior:"smooth"})},sx:{position:"absolute",bottom:12,right:12,width:36,height:36,borderRadius:2,bgcolor:"#282a3a",border:"1px solid #3a3d4e",color:"#8b8da0","&:hover":{bgcolor:"#313440"}},children:(0,t.jsx)(H.Z,{sx:{fontSize:18}})})]}),(0,t.jsx)(l.Z,{sx:{px:2.5,py:1.5,borderTop:"1px solid",borderColor:"divider"},children:(0,t.jsx)(w.Z,{fullWidth:!0,size:"small",placeholder:"Send a command",value:v,onChange:e=>Z(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),O())},disabled:!W,InputProps:{startAdornment:(0,t.jsx)(T.Z,{position:"start",children:(0,t.jsx)(q.Z,{sx:{fontSize:16,color:"#999"}})}),sx:{bgcolor:"#13141c",borderRadius:2,fontFamily:"'JetBrains Mono', 'Fira Code', monospace",fontSize:14,"& .MuiOutlinedInput-notchedOutline":{borderColor:"#2a2d3e"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#3a3d4e"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"primary.main"}}}})})]}),"Overview"===j&&(0,t.jsxs)(S.ZP,{container:!0,spacing:3,sx:{mt:1},children:[(0,t.jsx)(S.ZP,{item:!0,xs:12,md:6,children:(0,t.jsx)(u.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(p.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,children:"Server Information"}),(0,t.jsx)(D.Z,{sx:{mb:2}}),(0,t.jsx)(eE,{label:"Name",value:x.name}),(0,t.jsx)(eE,{label:"Container",value:x.container}),(0,t.jsx)(eE,{label:"Hostname",value:x.hostname}),(0,t.jsx)(eE,{label:"Type",value:x.type}),(0,t.jsx)(eE,{label:"Version",value:x.version}),(0,t.jsx)(eE,{label:"Memory",value:x.memory}),(0,t.jsx)(eE,{label:"Uptime",value:x.uptime||function(e){if(!e||e<0)return"0s";let r=Math.floor(e/3600),s=Math.floor(e%3600/60),t=e%60;return r>0?"".concat(r,"h ").concat(s,"m"):s>0?"".concat(s,"m ").concat(t,"s"):"".concat(t,"s")}(x.uptimeSeconds)})]})})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,md:6,children:(0,t.jsx)(u.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(p.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,children:"Players"}),(0,t.jsx)(D.Z,{sx:{mb:2}}),x.players?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eE,{label:"Online",value:"".concat(x.players.online," / ").concat(x.players.max)}),x.players.list&&x.players.list.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",sx:{mt:2,mb:1},children:"Online Players"}),(0,t.jsx)(l.Z,{sx:{display:"flex",flexWrap:"wrap",gap:1},children:x.players.list.map(e=>(0,t.jsx)(M.Z,{label:e,size:"small"},e))})]})]}):(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",children:"Player information unavailable"})]})})})]}),"Activity"===j&&(0,t.jsx)(l.Z,{sx:{mt:3},children:(0,t.jsx)(u.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(p.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,children:"Server Activity"}),(0,t.jsx)(D.Z,{sx:{mb:2}}),(0,t.jsx)(et,{serverName:x.name})]})})}),"Content"===j&&(0,t.jsx)(l.Z,{sx:{mt:3},children:(0,t.jsx)(p.Z,{variant:"body1",color:"text.secondary",children:"Content management coming soon"})}),"Files"===j&&(0,t.jsx)(l.Z,{sx:{mt:3},children:(0,t.jsx)(p.Z,{variant:"body1",color:"text.secondary",children:"File browser coming soon"})}),"Backups"===j&&(0,t.jsx)(l.Z,{sx:{mt:3},children:(0,t.jsx)(p.Z,{variant:"body1",color:"text.secondary",children:"Backup management coming soon"})}),"Access"===j&&(0,t.jsx)(l.Z,{sx:{mt:3},children:(0,t.jsx)(eA,{serverId:x.name})}),"Options"===j&&(0,t.jsx)(l.Z,{sx:{mt:3},children:(0,t.jsx)(ep,{serverName:x.name,isRunning:"running"===x.status})}),(0,t.jsxs)(f.Z,{open:k,onClose:()=>I(!1),maxWidth:"xl",fullWidth:!0,PaperProps:{sx:{height:"90vh",bgcolor:"background.paper"}},children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",p:2,borderBottom:1,borderColor:"divider"},children:[(0,t.jsxs)(p.Z,{variant:"h6",sx:{fontFamily:'"Minecraft", sans-serif',fontWeight:400,letterSpacing:"0.05em"},children:["Console - ",x.name]}),(0,t.jsx)(d.Z,{onClick:()=>I(!1),children:(0,t.jsx)(E.Z,{})})]}),(0,t.jsx)(y.Z,{sx:{p:0,display:"flex",flexDirection:"column"},children:(0,t.jsx)(J.K,{serverName:x.name})})]})]})}function eE(e){let{label:r,value:s}=e;return s?(0,t.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",py:1},children:[(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",children:r}),(0,t.jsx)(p.Z,{variant:"body2",sx:{fontWeight:500},children:s})]}):null}var eB=s(93757);function eN(){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,t.jsx)("line",{x1:"8",y1:"12",x2:"16",y2:"12"})]})}function eU(){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("path",{d:"M21 2v6h-6"}),(0,t.jsx)("path",{d:"M3 12a9 9 0 0115.36-6.36L21 8"}),(0,t.jsx)("path",{d:"M3 22v-6h6"}),(0,t.jsx)("path",{d:"M21 12a9 9 0 01-15.36 6.36L3 16"})]})}function eL(){var e,r,s,M;let T=(0,i.useParams)(),D=(0,a.x)(),E=decodeURIComponent(T.name),{data:B,isLoading:N,error:U}=(0,em.Hy)(E),{status:L,health:H}=function(e){let{serverName:r,onStatusChange:s,enabled:t=!0,reconnectInterval:i=3e3}=e,[a,l]=(0,n.useState)(null),[o,d]=(0,n.useState)(null);(0,n.useEffect)(()=>{l(null),d(null)},[r]);let c=(0,n.useCallback)(e=>{if("server-status"===e.type){let r=e.data.status,t=e.data.health;l(r),d(t),null==s||s(r,t)}},[s]),{isConnected:x,reconnect:h,retryCount:u}=(0,eB.D)({url:"/api/sse/servers/".concat(encodeURIComponent(r),"/status"),onMessage:c,enabled:t,reconnectInterval:i});return{status:a,health:o,isConnected:x,reconnect:h,retryCount:u}}({serverName:E,enabled:!!E}),[q,K]=(0,n.useState)(null),[G,_]=(0,n.useState)(!1),[J,V]=(0,n.useState)(""),Q=(0,em.jM)(),Y=(0,em.Aw)(),$=(0,em._I)(),X=(0,em.Hq)(),ee=async()=>{try{await Q.mutateAsync(E)}catch(e){console.error("Failed to start server:",e)}},er=async()=>{try{await Y.mutateAsync(E)}catch(e){console.error("Failed to stop server:",e)}},es=async()=>{try{await $.mutateAsync(E)}catch(e){console.error("Failed to restart server:",e)}},et=async e=>{try{await fetch("/api/servers/".concat(encodeURIComponent(E),"/exec"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:e})})}catch(e){console.error("Failed to send command:",e)}},en=L||(null==B?void 0:B.server.status),ei=Q.isPending||Y.isPending||$.isPending,ea=null==B?void 0:B.server;return(0,t.jsxs)(t.Fragment,{children:[U&&(0,t.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to load server: ",U.message]}),Q.isError&&(0,t.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to start server: ",null===(e=Q.error)||void 0===e?void 0:e.message]}),Y.isError&&(0,t.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to stop server: ",null===(r=Y.error)||void 0===r?void 0:r.message]}),$.isError&&(0,t.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to restart server: ",null===(s=$.error)||void 0===s?void 0:s.message]}),X.isError&&(0,t.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to delete server: ",null===(M=X.error)||void 0===M?void 0:M.message]}),N?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:2,mb:2.5},children:[(0,t.jsx)(h.Z,{variant:"rounded",width:64,height:64,sx:{borderRadius:3,flexShrink:0}}),(0,t.jsxs)(l.Z,{sx:{flex:1},children:[(0,t.jsx)(h.Z,{variant:"text",width:80,height:18,sx:{mb:.5}}),(0,t.jsx)(h.Z,{variant:"text",width:"40%",height:40}),(0,t.jsxs)(l.Z,{sx:{display:"flex",gap:2,mt:.75},children:[(0,t.jsx)(h.Z,{variant:"text",width:100}),(0,t.jsx)(h.Z,{variant:"text",width:60}),(0,t.jsx)(h.Z,{variant:"text",width:140}),(0,t.jsx)(h.Z,{variant:"text",width:50})]})]}),(0,t.jsxs)(l.Z,{sx:{display:"flex",gap:1,flexShrink:0},children:[(0,t.jsx)(h.Z,{variant:"rounded",width:90,height:40,sx:{borderRadius:2}}),(0,t.jsx)(h.Z,{variant:"rounded",width:36,height:36,sx:{borderRadius:2}})]})]}),(0,t.jsx)(l.Z,{sx:{display:"flex",gap:.5,mb:3},children:[80,70,65,50,65,65].map((e,r)=>(0,t.jsx)(h.Z,{variant:"rounded",width:e,height:36,sx:{borderRadius:5}},r))}),(0,t.jsx)(l.Z,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(3, 1fr)"},gap:2,mb:2.5},children:[0,1,2].map(e=>(0,t.jsx)(u.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:1.5},children:[(0,t.jsx)(h.Z,{variant:"text",width:"50%"}),(0,t.jsx)(h.Z,{variant:"circular",width:28,height:28})]}),(0,t.jsx)(h.Z,{variant:"text",width:"60%",height:36}),(0,t.jsx)(h.Z,{variant:"rounded",width:"100%",height:6,sx:{borderRadius:3,mt:1}})]})},e))}),(0,t.jsxs)(u.Z,{sx:{borderRadius:3,border:"1px solid",borderColor:"divider"},children:[(0,t.jsxs)(l.Z,{sx:{px:3,py:2,borderBottom:"1px solid",borderColor:"divider",display:"flex",alignItems:"center",gap:1.25},children:[(0,t.jsx)(h.Z,{variant:"text",width:80,height:28}),(0,t.jsx)(h.Z,{variant:"circular",width:10,height:10})]}),(0,t.jsx)(h.Z,{variant:"rectangular",height:360,sx:{bgcolor:"#0a0a0a"}}),(0,t.jsx)(l.Z,{sx:{px:2.5,py:1.5,borderTop:"1px solid",borderColor:"divider"},children:(0,t.jsx)(h.Z,{variant:"rounded",width:"100%",height:40,sx:{borderRadius:2}})})]}),(0,t.jsxs)(S.ZP,{container:!0,spacing:3,sx:{mt:1},children:[(0,t.jsx)(S.ZP,{item:!0,xs:12,md:6,children:(0,t.jsx)(u.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(h.Z,{variant:"text",width:"40%",height:28,sx:{mb:1}}),(0,t.jsx)(h.Z,{variant:"rectangular",height:1,sx:{mb:2}}),[0,1,2,3,4,5,6].map(e=>(0,t.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",py:1},children:[(0,t.jsx)(h.Z,{variant:"text",width:"30%"}),(0,t.jsx)(h.Z,{variant:"text",width:"40%"})]},e))]})})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,md:6,children:(0,t.jsx)(u.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(h.Z,{variant:"text",width:"30%",height:28,sx:{mb:1}}),(0,t.jsx)(h.Z,{variant:"rectangular",height:1,sx:{mb:2}}),(0,t.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",py:1},children:[(0,t.jsx)(h.Z,{variant:"text",width:"25%"}),(0,t.jsx)(h.Z,{variant:"text",width:"20%"})]})]})})})]})]}):ea?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:2,mb:2.5},children:[(0,t.jsx)(l.Z,{sx:{width:64,height:64,borderRadius:3,overflow:"hidden",bgcolor:"background.paper",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,border:"1px solid",borderColor:"divider",fontSize:36},children:function(e){if(!e)return"\uD83C\uDFAE";let r=e.toUpperCase();return["PAPER","SPIGOT","BUKKIT","PURPUR"].includes(r)?"\uD83D\uDD0C":["FORGE","NEOFORGE","FABRIC","QUILT"].includes(r)?"\uD83D\uDD27":"\uD83C\uDFAE"}(ea.type)}),(0,t.jsxs)(l.Z,{sx:{flex:1},children:[(0,t.jsxs)(p.Z,{onClick:()=>D.push("/servers"),sx:{fontSize:12,color:"primary.main",cursor:"pointer",mb:.25,display:"flex",alignItems:"center",gap:.5,"&:hover":{textDecoration:"underline"}},children:[(0,t.jsx)(k.Z,{sx:{fontSize:14}})," All servers"]}),(0,t.jsx)(p.Z,{variant:"h4",component:"h1",sx:{fontFamily:'"Minecraft", sans-serif',fontWeight:400,color:"text.primary",letterSpacing:"0.5px",m:0,textTransform:"uppercase"},children:E}),(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:0,mt:.75,flexWrap:"wrap",fontSize:13,color:"text.secondary"},children:[ea.version&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:.5},children:[(0,t.jsx)(W.Z,{sx:{fontSize:14}}),"Minecraft ",ea.version]}),(0,t.jsx)(l.Z,{component:"span",sx:{mx:1.25,color:"#3a3d4e"},children:"|"})]}),ea.type&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:.5},children:[(0,t.jsx)(F.Z,{sx:{fontSize:14}}),ea.type]}),(0,t.jsx)(l.Z,{component:"span",sx:{mx:1.25,color:"#3a3d4e"},children:"|"})]}),ea.hostname&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:.5},children:[(0,t.jsx)(O.Z,{sx:{fontSize:14}}),ea.hostname]}),(0,t.jsx)(l.Z,{component:"span",sx:{mx:1.25,color:"#3a3d4e"},children:"|"})]}),(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:.5},children:[(0,t.jsx)(A.Z,{sx:{fontSize:14}}),ea.uptime||function(e){if(!e||e<0)return"0s";let r=Math.floor(e/3600),s=Math.floor(e%3600/60),t=e%60;return r>0?"".concat(r,"h ").concat(s,"m"):s>0?"".concat(s,"m ").concat(t,"s"):"".concat(t,"s")}(ea.uptimeSeconds)||"0s"]})]})]}),(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1.25,flexShrink:0},children:[("stopped"===en||"exited"===en||"not_created"===en)&&(0,t.jsx)(o.Z,{variant:"contained",color:"success",startIcon:ei?(0,t.jsx)(x.Z,{size:16,color:"inherit"}):(0,t.jsx)(I.Z,{}),onClick:ee,disabled:ei,sx:{px:2,py:1,borderRadius:2,fontSize:14,fontWeight:600},children:"Start"}),"running"===en&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.Z,{variant:"outlined",startIcon:ei?(0,t.jsx)(x.Z,{size:16}):(0,t.jsx)(eN,{}),onClick:er,disabled:ei,sx:{px:2,py:1,borderRadius:2,fontSize:14,fontWeight:500,borderColor:"divider",color:"text.secondary","&:hover":{borderColor:"text.secondary",bgcolor:(0,R.Fq)("#fff",.05)}},children:"Stop"}),(0,t.jsx)(o.Z,{variant:"contained",startIcon:ei?(0,t.jsx)(x.Z,{size:16,color:"inherit"}):(0,t.jsx)(eU,{}),onClick:es,disabled:ei,sx:{px:2,py:1,borderRadius:2,fontSize:14,fontWeight:600,bgcolor:"primary.main",color:"#0a0e14","&:hover":{bgcolor:"primary.dark"}},children:"Restart"})]}),(0,t.jsx)(d.Z,{onClick:e=>K(e.currentTarget),sx:{width:36,height:36,borderRadius:2,border:"1px solid",borderColor:"divider",color:"text.secondary"},children:(0,t.jsx)(P.Z,{sx:{fontSize:18}})}),(0,t.jsx)(j.Z,{anchorEl:q,open:!!q,onClose:()=>K(null),children:(0,t.jsxs)(g.Z,{onClick:()=>{K(null),_(!0),V("")},sx:{color:"error.main"},children:[(0,t.jsx)(v.Z,{children:(0,t.jsx)(z.Z,{fontSize:"small",sx:{color:"error.main"}})}),(0,t.jsx)(Z.Z,{children:"Delete Server"})]})})]})]}),(0,t.jsx)(eD,{server:ea,onSendCommand:et})]}):(0,t.jsx)(c.Z,{severity:"warning",children:"Server not found"}),(0,t.jsxs)(f.Z,{open:G,onClose:()=>{_(!1),V("")},maxWidth:"sm",fullWidth:!0,children:[(0,t.jsx)(b.Z,{children:"Delete Server"}),(0,t.jsxs)(y.Z,{children:[(0,t.jsxs)(p.Z,{sx:{mb:2},children:["This action cannot be undone. Type ",(0,t.jsx)("strong",{children:E})," to confirm deletion."]}),(0,t.jsx)(w.Z,{label:"Server name",value:J,onChange:e=>V(e.target.value),fullWidth:!0,autoFocus:!0})]}),(0,t.jsxs)(C.Z,{sx:{px:3,pb:2},children:[(0,t.jsx)(o.Z,{onClick:()=>{_(!1),V("")},children:"Cancel"}),(0,t.jsx)(o.Z,{variant:"contained",color:"error",onClick:()=>{J===E&&X.mutate({name:E,force:!0},{onSuccess:()=>{D.push("/servers")}})},disabled:J!==E||X.isPending,startIcon:X.isPending?(0,t.jsx)(x.Z,{size:16}):null,children:X.isPending?"Deleting...":"Delete"})]})]})]})}},73660:function(e,r,s){"use strict";s.d(r,{K:function(){return k}});var t=s(94655),n=s(35106),i=s(18844),a=s.n(i),l=s(7281),o=s(69899),d=s(97436),c=s(30417),x=s(90829),h=s(79983),u=s(31317),m=s(25333),p=s(40064),j=s(45547),g=s(70115),v=s(69123),Z=s(93017),f=s(11141),b=s(19127),y=s(69366),C=s(163);let w=[{label:"say",template:"say "},{label:"give",template:"give "},{label:"tp",template:"tp "},{label:"gamemode",template:"gamemode "}],S=new(a())({fg:"#aaa",bg:"#000",newline:!1,escapeXML:!0,colors:{0:"#000000",1:"#cc0000",2:"#4e9a06",3:"#c4a000",4:"#3465a4",5:"#75507b",6:"#06989a",7:"#d3d7cf",8:"#555753",9:"#ef2929",10:"#8ae234",11:"#fce94f",12:"#729fcf",13:"#ad7fa8",14:"#34e2e2",15:"#eeeeec"}}),R=(0,n.memo)(function(e){let{log:r}=e,s=(0,n.useMemo)(()=>(function(e){let r=e.replace(/\x1b\[\?[\d;]*[a-zA-Z]/g,"").replace(/\x1b\[[0-9;]*[KJH]/g,"").replace(/\x1b=/g,"").replace(/\[\?[\d;]*[a-zA-Z]/g,"").replace(/\[[0-9;]*[KJH]/g,"").replace(/\[m/g,"").replace(/\[(\d+)m/g,"\x1b[$1m").replace(/>\.\.\.\.\r?/g,"").replace(/\r/g,"");return S.toHtml(r)})(r),[r]);return(0,t.jsx)(l.Z,{sx:{py:.25,whiteSpace:"pre-wrap",wordBreak:"break-all","& span":{}},dangerouslySetInnerHTML:{__html:s}})});function k(e){let{serverName:r}=e,[s,i]=(0,n.useState)(""),[a,S]=(0,n.useState)([]),[k,I]=(0,n.useState)(-1),[P,z]=(0,n.useState)("ALL"),[W,F]=(0,n.useState)(!0),[O,A]=(0,n.useState)(!0),[M,T]=(0,n.useState)(!1),D=(0,n.useRef)(null),E=(0,n.useRef)(null),{logs:B,isConnected:N,clearLogs:U,reconnect:L,retryCount:H}=(0,C.Y)({serverName:r}),q=(0,n.useMemo)(()=>{let e=B;return O&&(e=e.filter(e=>!e.includes("RCON Listener")&&!e.includes("RCON Client")&&!e.includes("RconClient"))),"ALL"!==P&&(e=e.filter(e=>(e.includes("/ERROR]")||e.includes("/ERROR:")?"ERROR":e.includes("/WARN]")||e.includes("/WARN:")?"WARN":(e.includes("/INFO]")||e.includes("/INFO:"),"INFO"))===P)),e},[B,P,O]);(0,n.useEffect)(()=>{W&&E.current&&(E.current.scrollTop=E.current.scrollHeight)},[q,W]);let K=(0,n.useCallback)(async()=>{let e=s.trim();if(e&&!M){T(!0);try{S(r=>[...r,e]),I(-1),await fetch("/api/servers/".concat(encodeURIComponent(r),"/exec"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:e})}),i("")}catch(e){console.error("Failed to execute command:",e)}finally{T(!1)}}},[s,r,M]),G=(0,n.useCallback)(e=>{if("Enter"===e.key)e.preventDefault(),K();else if("ArrowUp"===e.key){if(e.preventDefault(),0===a.length)return;let r=-1===k?a.length-1:Math.max(0,k-1);I(r),i(a[r])}else if("ArrowDown"===e.key){if(e.preventDefault(),-1===k)return;let r=k+1;r>=a.length?(I(-1),i("")):(I(r),i(a[r]))}},[a,k,K]),_=(0,n.useCallback)(e=>{var r;i(e),null===(r=D.current)||void 0===r||r.focus()},[]),J=N?{text:"Connected",color:"success"}:H>0?{text:"Disconnected (Retry ".concat(H,")"),color:"warning"}:{text:"Disconnected",color:"error"};return(0,t.jsxs)(o.Z,{"data-testid":"server-console",sx:{display:"flex",flexDirection:"column",height:"100%",minHeight:400},children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:2,py:1,borderBottom:1,borderColor:"divider"},children:[(0,t.jsxs)(g.Z,{direction:"row",spacing:1,alignItems:"center",children:[(0,t.jsx)(u.Z,{variant:"subtitle2",children:"Console"}),(0,t.jsx)(m.Z,{"data-testid":"connection-status",label:J.text,color:J.color,size:"small"})]}),(0,t.jsxs)(g.Z,{direction:"row",spacing:1,alignItems:"center",children:[(0,t.jsx)(x.Z,{size:"small",variant:"outlined",children:["ALL","INFO","WARN","ERROR"].map(e=>(0,t.jsx)(c.Z,{onClick:()=>z(e),variant:P===e?"contained":"outlined",children:e},e))}),(0,t.jsx)(p.Z,{control:(0,t.jsx)(j.Z,{checked:W,onChange:e=>F(e.target.checked),size:"small",inputProps:{"aria-label":"Auto-scroll"}}),label:"Auto-scroll"}),(0,t.jsx)(p.Z,{control:(0,t.jsx)(j.Z,{checked:O,onChange:e=>A(e.target.checked),size:"small",inputProps:{"aria-label":"Hide RCON"}}),label:"Hide RCON"}),(0,t.jsx)(h.Z,{size:"small",onClick:U,"aria-label":"Clear logs",title:"Clear logs",children:(0,t.jsx)(b.Z,{})}),!N&&(0,t.jsx)(c.Z,{size:"small",startIcon:(0,t.jsx)(y.Z,{}),onClick:L,"aria-label":"Reconnect",children:"Reconnect"})]})]}),(0,t.jsx)(l.Z,{ref:E,sx:{flex:1,overflow:"auto",bgcolor:"#1a1a1a",p:1,fontFamily:"monospace",fontSize:"0.85rem"},children:0===q.length?(0,t.jsx)(u.Z,{color:"text.secondary",sx:{textAlign:"center",py:4,color:"#666"},children:"Waiting for logs..."}):q.map((e,r)=>(0,t.jsx)(R,{log:e},r))}),(0,t.jsx)(v.Z,{}),(0,t.jsx)(l.Z,{sx:{px:2,py:1,bgcolor:"background.default"},children:(0,t.jsxs)(g.Z,{direction:"row",spacing:1,children:[(0,t.jsx)(u.Z,{variant:"caption",color:"text.secondary",sx:{alignSelf:"center"},children:"Quick:"}),w.map(e=>(0,t.jsx)(c.Z,{size:"small",variant:"outlined",onClick:()=>_(e.template),children:e.label},e.label))]})}),(0,t.jsx)(v.Z,{}),(0,t.jsxs)(l.Z,{sx:{display:"flex",p:1,gap:1},children:[(0,t.jsx)(d.Z,{inputRef:D,fullWidth:!0,size:"small",placeholder:"Enter command...",value:s,onChange:e=>i(e.target.value),onKeyDown:G,disabled:!N||M,InputProps:{sx:{fontFamily:"monospace"}}}),(0,t.jsx)(c.Z,{variant:"contained",onClick:K,disabled:!s.trim()||!N||M,startIcon:M?(0,t.jsx)(Z.Z,{size:16}):(0,t.jsx)(f.Z,{}),"aria-label":"Send command",children:"Send"})]})]})}},163:function(e,r,s){"use strict";s.d(r,{Y:function(){return i}});var t=s(35106),n=s(93757);function i(e){let{serverName:r,maxLines:s=500,enabled:i=!0,reconnectInterval:a=3e3}=e,[l,o]=(0,t.useState)([]);(0,t.useEffect)(()=>{o([])},[r]);let d=(0,t.useCallback)(e=>{let r;"server-log"===e.type?r=e.data.log:"log"in e&&"string"==typeof e.log&&(r=e.log),r&&o(e=>{let t=[...e,r];return t.length>s?t.slice(t.length-s):t})},[s]),{isConnected:c,reconnect:x,retryCount:h}=(0,n.D)({url:"/api/sse/servers/".concat(encodeURIComponent(r),"/logs"),onMessage:d,enabled:i,reconnectInterval:a});return{logs:l,isConnected:c,clearLogs:(0,t.useCallback)(()=>{o([])},[]),reconnect:x,retryCount:h}}}},function(e){e.O(0,[6812,7220,8006,7294,8696,1071,540,6189,4840,5511,55,310,3543,8347,2149,4538,6645,9887,6594,2537,3669,2757,1744],function(){return e(e.s=59616)}),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[278],{59616:function(e,r,s){Promise.resolve().then(s.bind(s,41517))},41517:function(e,r,s){"use strict";s.r(r),s.d(r,{default:function(){return eL}});var t=s(94655),n=s(35106),i=s(74228),a=s(31358),l=s(7281),o=s(30417),d=s(79983),c=s(81071),x=s(93017),h=s(10721),u=s(628),m=s(41565),p=s(31317),j=s(35694),g=s(7178),v=s(17820),Z=s(73424),f=s(99770),b=s(62508),y=s(5682),C=s(76678),w=s(97436),S=s(84840),R=s(76492),k=s(10117),I=s(5501),P=s(37809),z=s(21111),W=s(17978),F=s(89573),O=s(96292),A=s(33104),M=s(25333),T=s(52082),D=s(69123),E=s(71185),B=s(30165),N=s(97293),U=s(11259),L=s(66615),H=s(89161),q=s(34071),K=s(4405);function G(e){let{value:r,unit:s,label:n,icon:i,progress:a,progressMax:o,color:d="#1bd96a"}=e;return(0,t.jsxs)(u.Z,{"data-testid":"resource-stat-card",sx:{p:2.5,bgcolor:"background.paper",border:"1px solid",borderColor:"divider",borderRadius:3},children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:2},children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"baseline",gap:.75,flexWrap:"wrap",minWidth:0},children:[(0,t.jsx)(p.Z,{variant:"h4",component:"span",sx:{fontWeight:700,color:"text.primary",fontFamily:"'JetBrains Mono', 'Fira Code', monospace",letterSpacing:"-0.5px"},children:r}),(0,t.jsx)(p.Z,{variant:"body2",component:"span",sx:{color:"text.secondary",fontWeight:500},children:s})]}),(0,t.jsx)(l.Z,{sx:{color:"text.secondary",flexShrink:0},children:i})]}),(0,t.jsx)(p.Z,{variant:"body2",sx:{color:"text.secondary",fontWeight:500,mt:.5},children:n}),(0,t.jsx)(K.Z,{variant:"determinate",value:Math.min(a/o*100,100),sx:{mt:1,height:6,borderRadius:1.5,bgcolor:"#2a2d3a","& .MuiLinearProgress-bar":{borderRadius:1.5,background:"linear-gradient(90deg, ".concat(d," 0%, ").concat(d,"cc 100%)")}}})]})}var _=s(163),J=s(73660),V=s(90158),Q=s(58347),Y=s(95511),$=s(46725),X=s(26577),ee=s(56813),er=s(26892),es=s(84509);function et(e){var r;let{serverName:s}=e,{data:n,isLoading:i,error:a}=(0,es.HZ)(s,{limit:20});if(i)return(0,t.jsx)(l.Z,{children:[void 0,void 0,void 0,void 0,void 0].map((e,r)=>(0,t.jsxs)(l.Z,{sx:{display:"flex",gap:2,py:1.5},children:[(0,t.jsx)(h.Z,{variant:"rounded",width:60,height:24}),(0,t.jsx)(h.Z,{variant:"text",width:"60%"}),(0,t.jsx)(h.Z,{variant:"text",width:50})]},r))});if(a)return(0,t.jsxs)(c.Z,{severity:"error",children:["Failed to load activity: ",a.message]});let d=null!==(r=null==n?void 0:n.logs)&&void 0!==r?r:[];if(0===d.length)return(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",sx:{py:4,textAlign:"center"},children:"No activity recorded for this server yet."});let x="/audit-logs?targetType=server&targetName=".concat(encodeURIComponent(s));return(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(V.Z,{sx:{py:0},children:d.map(e=>{var r;return(0,t.jsx)(Q.ZP,{sx:{px:0,py:1.5,"&:not(:last-child)":{borderBottom:"1px solid",borderColor:"divider"}},children:(0,t.jsx)(Z.Z,{primary:(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,t.jsx)(ee.I,{action:e.action,size:"small"}),(0,t.jsxs)(p.Z,{variant:"body2",color:"text.secondary",children:["by ",e.actor.replace("api:","").replace("cli:","")]}),(0,t.jsx)(er.c,{status:e.status,size:"small"})]}),secondary:(0,t.jsx)(Y.Z,{title:(r=e.timestamp,new Intl.DateTimeFormat(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:"short"}).format(new Date(r))),arrow:!0,children:(0,t.jsx)(p.Z,{variant:"caption",component:"span",color:"text.disabled",children:function(e){let r=new Date,s=new Date(e),t=Math.floor((r.getTime()-s.getTime())/6e4),n=Math.floor(t/60);return t<1?"just now":t<60?"".concat(t,"m ago"):n<24?"".concat(n,"h ago"):"".concat(Math.floor(n/24),"d ago")}(e.timestamp)})})})},e.id)})}),(0,t.jsx)(l.Z,{sx:{mt:2,textAlign:"center"},children:(0,t.jsx)(o.Z,{component:$.default,href:x,size:"small",endIcon:(0,t.jsx)(X.Z,{}),sx:{textTransform:"none"},children:"View Full History"})})]})}var en=s(62328),ei=s(29793),ea=s(75726),el=s(40064),eo=s(38393),ed=s(37530),ec=s(5942),ex=s(84420),eh=s(46121),eu=s(84775),em=s(92666);function ep(e){var r,s;let{serverName:i,isRunning:a}=e,{data:d,isLoading:h}=(0,em.iC)(i),j=(0,em.MH)(),v=(0,em.gx)(),[Z,R]=(0,n.useState)({}),[k,I]=(0,n.useState)(!1),[P,z]=(0,n.useState)(!1),[W,F]=(0,n.useState)(!1),[O,A]=(0,n.useState)(""),[M,T]=(0,n.useState)({open:!1,message:"",severity:"info"});(0,n.useEffect)(()=>{(null==d?void 0:d.config)&&R(d.config)},[d]);let E=(e,r)=>{R(s=>({...s,[e]:r})),I(!0),("memory"===e||"useAikarFlags"===e)&&z(!0)},B=async()=>{try{let e=await j.mutateAsync({serverName:i,config:Z});T({open:!0,message:e.restartRequired?"Settings saved. Restart required for some changes to take effect.":"Settings saved successfully.",severity:e.restartRequired?"warning":"success"}),I(!1),z(!1)}catch(e){T({open:!0,message:e instanceof Error?e.message:"Failed to save settings",severity:"error"})}},N=async()=>{if("RESET"!==O){T({open:!0,message:"Please type RESET to confirm",severity:"warning"});return}try{await v.mutateAsync(i),T({open:!0,message:"World reset successfully",severity:"success"}),F(!1),A("")}catch(e){T({open:!0,message:e instanceof Error?e.message:"Failed to reset world",severity:"error"})}};return h?(0,t.jsx)(l.Z,{sx:{display:"flex",justifyContent:"center",py:8},children:(0,t.jsx)(x.Z,{})}):(0,t.jsxs)(l.Z,{children:[P&&(0,t.jsx)(c.Z,{severity:"warning",icon:(0,t.jsx)(ex.Z,{}),sx:{mb:3},children:"Performance settings require a server restart to take effect."}),(0,t.jsx)(u.Z,{sx:{mb:3,borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(p.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,children:"Server Properties"}),(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"These settings can be changed without restarting the server."}),(0,t.jsx)(D.Z,{sx:{mb:3}}),(0,t.jsxs)(S.ZP,{container:!0,spacing:3,children:[(0,t.jsx)(S.ZP,{item:!0,xs:12,children:(0,t.jsx)(w.Z,{fullWidth:!0,label:"MOTD (Message of the Day)",value:Z.motd||"",onChange:e=>E("motd",e.target.value),helperText:"The message displayed in the server list"})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsx)(w.Z,{fullWidth:!0,type:"number",label:"Max Players",value:Z.maxPlayers||20,onChange:e=>E("maxPlayers",parseInt(e.target.value,10)),inputProps:{min:1,max:100}})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsxs)(ei.Z,{fullWidth:!0,children:[(0,t.jsx)(ea.Z,{children:"Difficulty"}),(0,t.jsxs)(en.Z,{value:Z.difficulty||"normal",label:"Difficulty",onChange:e=>E("difficulty",e.target.value),children:[(0,t.jsx)(g.Z,{value:"peaceful",children:"Peaceful"}),(0,t.jsx)(g.Z,{value:"easy",children:"Easy"}),(0,t.jsx)(g.Z,{value:"normal",children:"Normal"}),(0,t.jsx)(g.Z,{value:"hard",children:"Hard"})]})]})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsxs)(ei.Z,{fullWidth:!0,children:[(0,t.jsx)(ea.Z,{children:"Game Mode"}),(0,t.jsxs)(en.Z,{value:Z.gameMode||"survival",label:"Game Mode",onChange:e=>E("gameMode",e.target.value),children:[(0,t.jsx)(g.Z,{value:"survival",children:"Survival"}),(0,t.jsx)(g.Z,{value:"creative",children:"Creative"}),(0,t.jsx)(g.Z,{value:"adventure",children:"Adventure"}),(0,t.jsx)(g.Z,{value:"spectator",children:"Spectator"})]})]})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsx)(el.Z,{control:(0,t.jsx)(eo.Z,{checked:null===(r=Z.pvp)||void 0===r||r,onChange:e=>E("pvp",e.target.checked)}),label:"Enable PvP"})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsx)(w.Z,{fullWidth:!0,type:"number",label:"View Distance (chunks)",value:Z.viewDistance||10,onChange:e=>E("viewDistance",parseInt(e.target.value,10)),inputProps:{min:3,max:32}})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsx)(w.Z,{fullWidth:!0,type:"number",label:"Spawn Protection (blocks)",value:Z.spawnProtection||16,onChange:e=>E("spawnProtection",parseInt(e.target.value,10)),inputProps:{min:0,max:128}})})]})]})}),(0,t.jsx)(u.Z,{sx:{mb:3,borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(p.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,children:"Performance Settings"}),(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"These settings require a server restart to take effect."}),(0,t.jsx)(D.Z,{sx:{mb:3}}),(0,t.jsxs)(S.ZP,{container:!0,spacing:3,children:[(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsx)(w.Z,{fullWidth:!0,label:"Memory Allocation",value:Z.memory||"4G",onChange:e=>E("memory",e.target.value),helperText:"Format: 4G, 8G, etc."})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsx)(el.Z,{control:(0,t.jsx)(eo.Z,{checked:null!==(s=Z.useAikarFlags)&&void 0!==s&&s,onChange:e=>E("useAikarFlags",e.target.checked)}),label:"Use Aikar's Flags (Optimized GC)"})})]})]})}),(0,t.jsx)(l.Z,{sx:{display:"flex",justifyContent:"flex-end",mb:3},children:(0,t.jsx)(o.Z,{variant:"contained",size:"large",startIcon:(0,t.jsx)(ec.Z,{}),onClick:B,disabled:!k||j.isPending,sx:{px:4},children:j.isPending?"Saving...":"Save Changes"})}),(0,t.jsx)(u.Z,{sx:{borderRadius:3,borderColor:"error.main",borderWidth:1,borderStyle:"solid"},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(p.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,color:"error",children:"Danger Zone"}),(0,t.jsx)(D.Z,{sx:{mb:3}}),(0,t.jsxs)(l.Z,{sx:{mb:3},children:[(0,t.jsx)(p.Z,{variant:"subtitle1",fontWeight:600,gutterBottom:!0,children:"Reset World"}),(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"This will permanently delete the current world and generate a new one. This action cannot be undone."}),(0,t.jsx)(o.Z,{variant:"outlined",color:"error",startIcon:(0,t.jsx)(eu.Z,{}),onClick:()=>F(!0),disabled:a,children:"Reset World"}),a&&(0,t.jsx)(p.Z,{variant:"caption",color:"text.secondary",sx:{ml:2},children:"Stop the server first"})]})]})}),(0,t.jsxs)(f.Z,{open:W,onClose:()=>F(!1),maxWidth:"sm",fullWidth:!0,children:[(0,t.jsx)(b.Z,{children:(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,t.jsx)(ex.Z,{color:"error"}),(0,t.jsx)(p.Z,{variant:"h6",fontWeight:600,children:"Reset World"})]})}),(0,t.jsxs)(y.Z,{children:[(0,t.jsxs)(p.Z,{variant:"body1",gutterBottom:!0,children:["This will permanently delete the world for ",(0,t.jsx)("strong",{children:i})," and generate a new one."]}),(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",gutterBottom:!0,children:"This action cannot be undone. All player progress and builds will be lost."}),(0,t.jsx)(w.Z,{fullWidth:!0,label:"Type RESET to confirm",value:O,onChange:e=>A(e.target.value),sx:{mt:3},autoFocus:!0})]}),(0,t.jsxs)(C.Z,{children:[(0,t.jsx)(o.Z,{onClick:()=>F(!1),children:"Cancel"}),(0,t.jsx)(o.Z,{variant:"contained",color:"error",onClick:N,disabled:"RESET"!==O||v.isPending,startIcon:v.isPending?(0,t.jsx)(x.Z,{size:16}):(0,t.jsx)(eh.Z,{}),children:v.isPending?"Resetting...":"Reset World"})]})]}),(0,t.jsx)(ed.Z,{open:M.open,autoHideDuration:6e3,onClose:()=>T({...M,open:!1}),anchorOrigin:{vertical:"bottom",horizontal:"right"},children:(0,t.jsx)(c.Z,{onClose:()=>T({...M,open:!1}),severity:M.severity,sx:{width:"100%"},children:M.message})})]})}var ej=s(86702),eg=s(47606),ev=s(407),eZ=s(56056),ef=s(28058),eb=s(11597),ey=s(59602);let eC={admin:{label:"Owner",color:"primary",variant:"filled"},manage:{label:"Operator",color:"info",variant:"outlined"},view:{label:"Viewer",color:"default",variant:"outlined"}};function ew(e){let{permission:r,size:s="medium"}=e,n=eC[r];return(0,t.jsx)(M.Z,{label:n.label,color:n.color,variant:n.variant,size:s})}var eS=s(99046),eR=s(68038),ek=s(34080),eI=s(39181),eP=s(5632),ez=s(58919),eW=s(20367),eF=s(42936);function eO(e){var r,s;let{open:i,onClose:a,serverId:d}=e,[h,u]=(0,n.useState)(""),[m,j]=(0,n.useState)(null),[g,v]=(0,n.useState)("view"),{data:Z,isLoading:S}=(s={enabled:i},(0,eP.a)({queryKey:["users","search",h],queryFn:()=>(0,eF.SC)("/api/users?q=".concat(encodeURIComponent(h))),enabled:(null==s?void 0:s.enabled)!==!1&&h.length>=2,staleTime:3e4})),R=function(){let e=(0,ez.NL)();return(0,eW.D)({mutationFn:e=>(0,eF.SC)("/api/user-servers",{method:"POST",body:JSON.stringify(e)}),onSuccess:(r,s)=>{e.invalidateQueries({queryKey:["user-servers",s.serverId]}),e.invalidateQueries({queryKey:["user-servers"]})}})}(),k=(0,n.useMemo)(()=>{var e;return null!==(e=null==Z?void 0:Z.users)&&void 0!==e?e:[]},[Z]),I=()=>{u(""),j(null),v("view"),R.reset(),a()};return(0,t.jsxs)(f.Z,{open:i,onClose:I,maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{borderRadius:3}},children:[(0,t.jsx)(b.Z,{sx:{fontWeight:600},children:"Add User Access"}),(0,t.jsxs)(y.Z,{sx:{display:"flex",flexDirection:"column",gap:3,pt:"8px !important"},children:[R.isError&&(0,t.jsx)(c.Z,{severity:"error",sx:{mb:1},children:(null===(r=R.error)||void 0===r?void 0:r.message)||"Failed to grant access"}),(0,t.jsx)(eS.Z,{options:k,getOptionLabel:e=>e.name||e.email,isOptionEqualToValue:(e,r)=>e.id===r.id,value:m,onChange:(e,r)=>j(r),inputValue:h,onInputChange:(e,r)=>u(r),loading:S,filterOptions:e=>e,noOptionsText:h.length<2?"Type at least 2 characters":"No users found",renderInput:e=>(0,t.jsx)(w.Z,{...e,label:"Search User",placeholder:"Search by name or email...",InputProps:{...e.InputProps,endAdornment:(0,t.jsxs)(t.Fragment,{children:[S&&(0,t.jsx)(x.Z,{size:20}),e.InputProps.endAdornment]})}}),renderOption:(e,r)=>{var s,n,i;let{key:a,...o}=e;return(0,t.jsxs)(l.Z,{component:"li",...o,sx:{display:"flex",gap:1.5,py:1},children:[(0,t.jsx)(ej.Z,{src:null!==(i=r.image)&&void 0!==i?i:void 0,sx:{width:32,height:32,bgcolor:"primary.main",fontSize:14},children:((null===(s=r.name)||void 0===s?void 0:s[0])||(null===(n=r.email)||void 0===n?void 0:n[0])||"?").toUpperCase()}),(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(p.Z,{variant:"body2",fontWeight:500,children:r.name||"Unknown"}),(0,t.jsx)(p.Z,{variant:"caption",color:"text.secondary",children:r.email})]})]},a)}}),(0,t.jsxs)(ei.Z,{children:[(0,t.jsx)(eR.Z,{sx:{fontWeight:500,mb:1},children:"Permission Level"}),(0,t.jsxs)(ek.Z,{value:g,onChange:e=>v(e.target.value),children:[(0,t.jsx)(el.Z,{value:"view",control:(0,t.jsx)(eI.Z,{size:"small"}),label:(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(p.Z,{variant:"body2",fontWeight:500,children:"Viewer"}),(0,t.jsx)(p.Z,{variant:"caption",color:"text.secondary",children:"Can view server status and logs"})]})}),(0,t.jsx)(el.Z,{value:"manage",control:(0,t.jsx)(eI.Z,{size:"small"}),label:(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(p.Z,{variant:"body2",fontWeight:500,children:"Operator"}),(0,t.jsx)(p.Z,{variant:"caption",color:"text.secondary",children:"Can start, stop, and configure the server"})]})}),(0,t.jsx)(el.Z,{value:"admin",control:(0,t.jsx)(eI.Z,{size:"small"}),label:(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(p.Z,{variant:"body2",fontWeight:500,children:"Owner"}),(0,t.jsx)(p.Z,{variant:"caption",color:"text.secondary",children:"Full control including managing other users"})]})})]})]})]}),(0,t.jsxs)(C.Z,{sx:{px:3,pb:2},children:[(0,t.jsx)(o.Z,{onClick:I,color:"inherit",children:"Cancel"}),(0,t.jsx)(o.Z,{onClick:()=>{m&&R.mutate({userId:m.id,serverId:d,permission:g},{onSuccess:I})},variant:"contained",disabled:!m||R.isPending,sx:{borderRadius:2},children:R.isPending?"Adding...":"Add User"})]})]})}function eA(e){var r,s;let{serverId:i}=e,{data:a,isLoading:x,error:f}=(0,eP.a)({queryKey:["user-servers",i],queryFn:()=>(0,eF.SC)("/api/user-servers?serverId=".concat(encodeURIComponent(i))),enabled:!!i}),b=function(){let e=(0,ez.NL)();return(0,eW.D)({mutationFn:e=>{let{id:r,permission:s}=e;return(0,eF.SC)("/api/user-servers/".concat(encodeURIComponent(r)),{method:"PATCH",body:JSON.stringify({permission:s})})},onSuccess:()=>{e.invalidateQueries({queryKey:["user-servers"]})}})}(),y=function(){let e=(0,ez.NL)();return(0,eW.D)({mutationFn:e=>(0,eF.SC)("/api/user-servers/".concat(encodeURIComponent(e)),{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["user-servers"]})}})}(),[C,w]=(0,n.useState)(!1),[S,R]=(0,n.useState)(null),[k,I]=(0,n.useState)(null),z=(e,r)=>{R(e.currentTarget),I(r)},W=()=>{R(null),I(null)},F=e=>{if(!k||k.permission===e){W();return}b.mutate({id:k.id,permission:e},{onSettled:W})},O=null!==(r=null==a?void 0:a.users.filter(e=>"admin"===e.permission).length)&&void 0!==r?r:0,A=(null==k?void 0:k.permission)==="admin"&&O<=1;if(x)return(0,t.jsx)(u.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,t.jsx)(h.Z,{variant:"text",width:"30%",height:32}),(0,t.jsx)(h.Z,{variant:"rounded",width:120,height:36,sx:{borderRadius:2}})]}),(0,t.jsx)(D.Z,{sx:{mb:2}}),[0,1,2].map(e=>(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:2,py:1.5,borderBottom:"1px solid",borderColor:"divider"},children:[(0,t.jsx)(h.Z,{variant:"circular",width:40,height:40}),(0,t.jsxs)(l.Z,{sx:{flex:1},children:[(0,t.jsx)(h.Z,{variant:"text",width:"40%"}),(0,t.jsx)(h.Z,{variant:"text",width:"60%"})]}),(0,t.jsx)(h.Z,{variant:"rounded",width:80,height:28,sx:{borderRadius:10}}),(0,t.jsx)(h.Z,{variant:"circular",width:32,height:32})]},e))]})});if(f)return(0,t.jsxs)(c.Z,{severity:"error",children:["Failed to load access list: ",f.message]});let M=null!==(s=null==a?void 0:a.users)&&void 0!==s?s:[];return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,t.jsx)(p.Z,{variant:"h6",fontWeight:600,children:"Server Access"}),(0,t.jsx)(o.Z,{variant:"contained",size:"small",startIcon:(0,t.jsx)(eg.Z,{}),onClick:()=>w(!0),sx:{borderRadius:2},children:"Add User"})]}),(0,t.jsx)(D.Z,{sx:{mb:1}}),0===M.length?(0,t.jsx)(l.Z,{sx:{py:4,textAlign:"center"},children:(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",children:"No users have been granted access to this server yet."})}):M.map(e=>{var r,s,n,i,a,o,c,x;return(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:2,py:1.5,"&:not(:last-child)":{borderBottom:"1px solid",borderColor:"divider"}},children:[(0,t.jsx)(ej.Z,{src:null!==(x=null===(r=e.user)||void 0===r?void 0:r.image)&&void 0!==x?x:void 0,sx:{width:40,height:40,bgcolor:"primary.main",fontSize:16},children:((null===(n=e.user)||void 0===n?void 0:null===(s=n.name)||void 0===s?void 0:s[0])||(null===(a=e.user)||void 0===a?void 0:null===(i=a.email)||void 0===i?void 0:i[0])||"?").toUpperCase()}),(0,t.jsxs)(l.Z,{sx:{flex:1,minWidth:0},children:[(0,t.jsx)(p.Z,{variant:"body2",fontWeight:500,noWrap:!0,children:(null===(o=e.user)||void 0===o?void 0:o.name)||"Unknown User"}),(0,t.jsx)(p.Z,{variant:"caption",color:"text.secondary",noWrap:!0,children:(null===(c=e.user)||void 0===c?void 0:c.email)||e.userId})]}),(0,t.jsx)(ew,{permission:e.permission,size:"small"}),(0,t.jsx)(d.Z,{size:"small",onClick:r=>z(r,e),sx:{color:"text.secondary"},children:(0,t.jsx)(P.Z,{fontSize:"small"})})]},e.id)}),(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mt:2,pt:1},children:[(0,t.jsx)(ey.Z,{sx:{fontSize:16,color:"text.disabled"}}),(0,t.jsx)(p.Z,{variant:"caption",color:"text.disabled",children:"Only platform admins and server owners can manage access."})]})]})}),(0,t.jsxs)(j.Z,{anchorEl:S,open:!!S,onClose:W,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},disableScrollLock:!0,children:[(0,t.jsxs)(g.Z,{onClick:()=>F("admin"),disabled:(null==k?void 0:k.permission)==="admin",children:[(0,t.jsx)(v.Z,{children:(0,t.jsx)(ev.Z,{fontSize:"small"})}),(0,t.jsx)(Z.Z,{children:"Change to Owner"})]}),(0,t.jsxs)(g.Z,{onClick:()=>F("manage"),disabled:(null==k?void 0:k.permission)==="manage"||A,children:[(0,t.jsx)(v.Z,{children:(0,t.jsx)(eZ.Z,{fontSize:"small"})}),(0,t.jsx)(Z.Z,{children:"Change to Operator"})]}),(0,t.jsxs)(g.Z,{onClick:()=>F("view"),disabled:(null==k?void 0:k.permission)==="view"||A,children:[(0,t.jsx)(v.Z,{children:(0,t.jsx)(ef.Z,{fontSize:"small"})}),(0,t.jsx)(Z.Z,{children:"Change to Viewer"})]}),(0,t.jsx)(D.Z,{}),(0,t.jsxs)(g.Z,{onClick:()=>{k&&y.mutate(k.id,{onSettled:W})},disabled:A,sx:{color:"error.main"},children:[(0,t.jsx)(v.Z,{children:(0,t.jsx)(eb.Z,{fontSize:"small",sx:{color:"error.main"}})}),(0,t.jsx)(Z.Z,{children:"Remove Access"})]})]}),(0,t.jsx)(eO,{open:C,onClose:()=>w(!1),serverId:i})]})}let eM=["Overview","Activity","Content","Files","Backups","Access","Options"];function eT(e){return e.replace(/\x1b\[\?[\d;]*[a-zA-Z]/g,"").replace(/\x1b\[[0-9;]*[a-zA-Z]/g,"").replace(/\x1b=/g,"").replace(/\[\?[\d;]*[a-zA-Z]/g,"").replace(/\[[0-9;]*[a-zA-Z]/g,"").replace(/\[m/g,"").replace(/>\.\.\.\.\r?/g,"").replace(/\r/g,"").trim()}function eD(e){var r,s,i,a,c;let{server:x,onSendCommand:h}=e,[j,g]=(0,n.useState)("Overview"),[v,Z]=(0,n.useState)(""),[b,C]=(0,n.useState)(!0),[k,I]=(0,n.useState)(!1),P=(0,n.useRef)(null),{logs:z,isConnected:W}=(0,_.Y)({serverName:x.name}),F=(0,n.useMemo)(()=>z.filter(e=>!e.includes("RCON Listener")&&!e.includes("RCON Client")&&!e.includes("RconClient")),[z]);(0,n.useEffect)(()=>{P.current&&b&&(P.current.scrollTop=P.current.scrollHeight)},[F,b]);let O=async()=>{v.trim()&&h&&(await h(v.trim()),Z(""))},A=null!==(a=null===(r=x.stats)||void 0===r?void 0:r.cpuPercent)&&void 0!==a?a:0;(null===(s=x.stats)||void 0===s?void 0:s.memoryUsage)&&x.stats.memoryUsage,function(e){if(!e)return;let r=e.match(/^(\d+)\s*(M|G)?$/i);if(r)parseInt(r[1],10),(r[2]||"M").toUpperCase()}(x.memory);let K=null!==(c=null===(i=x.stats)||void 0===i?void 0:i.memoryPercent)&&void 0!==c?c:0;return(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(l.Z,{sx:{display:"flex",gap:.5,mb:3},children:eM.map(e=>(0,t.jsx)(o.Z,{onClick:()=>g(e),sx:{px:2,py:1,borderRadius:5,fontSize:14,fontWeight:500,textTransform:"none",bgcolor:j===e?"primary.main":"transparent",color:j===e?"#0a0e14":"text.secondary","&:hover":{bgcolor:j===e?"primary.main":(0,R.Fq)("#1bd96a",.1)}},children:e},e))}),(0,t.jsxs)(l.Z,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(3, 1fr)"},gap:2,mb:2.5},children:[(0,t.jsx)(G,{value:"".concat(A.toFixed(2),"%"),unit:"/ 100%",label:"CPU usage",icon:(0,t.jsx)(B.Z,{sx:{fontSize:28}}),progress:A,progressMax:100,color:"#1bd96a"}),(0,t.jsx)(G,{value:"".concat(K.toFixed(2),"%"),unit:"/ 100%",label:"Memory usage",icon:(0,t.jsx)(N.Z,{sx:{fontSize:28}}),progress:K,progressMax:100,color:"#1bd96a"}),(0,t.jsx)(G,{value:x.worldSize||"0 B",unit:"/ 10 GB",label:"World size",icon:(0,t.jsx)(U.Z,{sx:{fontSize:28}}),progress:function(e){if(!e)return 0;let r=e.match(/^([\d.]+)\s*(B|KB|MB|MiB|GB|GiB)?$/i);if(!r)return 0;let s=parseFloat(r[1]);switch((r[2]||"B").toUpperCase()){case"GB":case"GIB":return 1024*s;case"MB":case"MIB":return s;case"KB":return s/1024;default:return s/1048576}}(x.worldSize),progressMax:10240,color:"#1bd96a"})]}),(0,t.jsxs)(u.Z,{sx:{bgcolor:"background.paper",borderRadius:3,border:"1px solid",borderColor:"divider",overflow:"hidden"},children:[(0,t.jsxs)(l.Z,{sx:{px:3,py:2,borderBottom:"1px solid",borderColor:"divider",display:"flex",alignItems:"center",gap:1.25},children:[(0,t.jsx)(p.Z,{variant:"h6",sx:{fontWeight:700,color:"text.primary"},children:"Console"}),(0,t.jsx)(l.Z,{sx:{width:10,height:10,borderRadius:"50%",bgcolor:W?"primary.main":"error.main",boxShadow:W?"0 0 8px rgba(27, 217, 106, 0.4)":"0 0 8px rgba(239, 68, 68, 0.4)"}})]}),(0,t.jsxs)(l.Z,{sx:{position:"relative"},children:[(0,t.jsx)(l.Z,{ref:P,onScroll:()=>{if(!P.current)return;let{scrollTop:e,scrollHeight:r,clientHeight:s}=P.current;C(r-e-s<30)},sx:{height:360,overflowY:"auto",px:2.5,py:2,fontFamily:"'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace",fontSize:13,lineHeight:1.85,color:"#b4b6c4",bgcolor:"#0a0a0a",scrollbarWidth:"thin",scrollbarColor:"#3a3d4e #0a0a0a","&::-webkit-scrollbar":{width:8},"&::-webkit-scrollbar-track":{bgcolor:"#0a0a0a"},"&::-webkit-scrollbar-thumb":{bgcolor:"#3a3d4e",borderRadius:4}},children:0===F.length?(0,t.jsx)(p.Z,{sx:{color:"text.secondary",textAlign:"center",py:8},children:"Waiting for logs..."}):F.map((e,r)=>{let s=function(e){let r=eT(e).match(/\[(\d{2}:\d{2}:\d{2})\]\s*\[([^/]+)\/(\w+)\]:\s*(.+)/);return r?{time:r[1],thread:r[2],level:r[3]||"INFO",msg:r[4]}:null}(e);return s?(0,t.jsxs)(l.Z,{sx:{display:"flex",gap:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[(0,t.jsxs)(l.Z,{component:"span",sx:{color:"#4a4d60"},children:["[",s.time,"]"]}),(0,t.jsxs)(l.Z,{component:"span",sx:{color:"#4a4d60"},children:["\xa0[",s.thread,"/",(0,t.jsx)(l.Z,{component:"span",sx:{color:"WARN"===s.level?"#e8a848":"#6b6e80"},children:s.level}),"]:\xa0"]}),(0,t.jsx)(l.Z,{component:"span",sx:{color:"WARN"===s.level?"#c4a45a":"#b4b6c4"},children:s.msg})]},r):(0,t.jsx)(l.Z,{sx:{color:"#b4b6c4"},children:eT(e)},r)})}),(0,t.jsx)(d.Z,{onClick:()=>I(!0),sx:{position:"absolute",top:12,right:12,width:36,height:36,borderRadius:2,bgcolor:"#282a3a",border:"1px solid #3a3d4e",color:"#8b8da0","&:hover":{bgcolor:"#313440"}},children:(0,t.jsx)(L.Z,{sx:{fontSize:18}})}),!b&&(0,t.jsx)(d.Z,{onClick:()=>{P.current&&P.current.scrollTo({top:P.current.scrollHeight,behavior:"smooth"})},sx:{position:"absolute",bottom:12,right:12,width:36,height:36,borderRadius:2,bgcolor:"#282a3a",border:"1px solid #3a3d4e",color:"#8b8da0","&:hover":{bgcolor:"#313440"}},children:(0,t.jsx)(H.Z,{sx:{fontSize:18}})})]}),(0,t.jsx)(l.Z,{sx:{px:2.5,py:1.5,borderTop:"1px solid",borderColor:"divider"},children:(0,t.jsx)(w.Z,{fullWidth:!0,size:"small",placeholder:"Send a command",value:v,onChange:e=>Z(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),O())},disabled:!W,InputProps:{startAdornment:(0,t.jsx)(T.Z,{position:"start",children:(0,t.jsx)(q.Z,{sx:{fontSize:16,color:"#999"}})}),sx:{bgcolor:"#13141c",borderRadius:2,fontFamily:"'JetBrains Mono', 'Fira Code', monospace",fontSize:14,"& .MuiOutlinedInput-notchedOutline":{borderColor:"#2a2d3e"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#3a3d4e"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"primary.main"}}}})})]}),"Overview"===j&&(0,t.jsxs)(S.ZP,{container:!0,spacing:3,sx:{mt:1},children:[(0,t.jsx)(S.ZP,{item:!0,xs:12,md:6,children:(0,t.jsx)(u.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(p.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,children:"Server Information"}),(0,t.jsx)(D.Z,{sx:{mb:2}}),(0,t.jsx)(eE,{label:"Name",value:x.name}),(0,t.jsx)(eE,{label:"Container",value:x.container}),(0,t.jsx)(eE,{label:"Hostname",value:x.hostname}),(0,t.jsx)(eE,{label:"Type",value:x.type}),(0,t.jsx)(eE,{label:"Version",value:x.version}),(0,t.jsx)(eE,{label:"Memory",value:x.memory}),(0,t.jsx)(eE,{label:"Uptime",value:x.uptime||function(e){if(!e||e<0)return"0s";let r=Math.floor(e/3600),s=Math.floor(e%3600/60),t=e%60;return r>0?"".concat(r,"h ").concat(s,"m"):s>0?"".concat(s,"m ").concat(t,"s"):"".concat(t,"s")}(x.uptimeSeconds)})]})})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,md:6,children:(0,t.jsx)(u.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(p.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,children:"Players"}),(0,t.jsx)(D.Z,{sx:{mb:2}}),x.players?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eE,{label:"Online",value:"".concat(x.players.online," / ").concat(x.players.max)}),x.players.list&&x.players.list.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",sx:{mt:2,mb:1},children:"Online Players"}),(0,t.jsx)(l.Z,{sx:{display:"flex",flexWrap:"wrap",gap:1},children:x.players.list.map(e=>(0,t.jsx)(M.Z,{label:e,size:"small"},e))})]})]}):(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",children:"Player information unavailable"})]})})})]}),"Activity"===j&&(0,t.jsx)(l.Z,{sx:{mt:3},children:(0,t.jsx)(u.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(p.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,children:"Server Activity"}),(0,t.jsx)(D.Z,{sx:{mb:2}}),(0,t.jsx)(et,{serverName:x.name})]})})}),"Content"===j&&(0,t.jsx)(l.Z,{sx:{mt:3},children:(0,t.jsx)(p.Z,{variant:"body1",color:"text.secondary",children:"Content management coming soon"})}),"Files"===j&&(0,t.jsx)(l.Z,{sx:{mt:3},children:(0,t.jsx)(p.Z,{variant:"body1",color:"text.secondary",children:"File browser coming soon"})}),"Backups"===j&&(0,t.jsx)(l.Z,{sx:{mt:3},children:(0,t.jsx)(p.Z,{variant:"body1",color:"text.secondary",children:"Backup management coming soon"})}),"Access"===j&&(0,t.jsx)(l.Z,{sx:{mt:3},children:(0,t.jsx)(eA,{serverId:x.name})}),"Options"===j&&(0,t.jsx)(l.Z,{sx:{mt:3},children:(0,t.jsx)(ep,{serverName:x.name,isRunning:"running"===x.status})}),(0,t.jsxs)(f.Z,{open:k,onClose:()=>I(!1),maxWidth:"xl",fullWidth:!0,PaperProps:{sx:{height:"90vh",bgcolor:"background.paper"}},children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",p:2,borderBottom:1,borderColor:"divider"},children:[(0,t.jsxs)(p.Z,{variant:"h6",sx:{fontFamily:'"Minecraft", sans-serif',fontWeight:400,letterSpacing:"0.05em"},children:["Console - ",x.name]}),(0,t.jsx)(d.Z,{onClick:()=>I(!1),children:(0,t.jsx)(E.Z,{})})]}),(0,t.jsx)(y.Z,{sx:{p:0,display:"flex",flexDirection:"column"},children:(0,t.jsx)(J.K,{serverName:x.name})})]})]})}function eE(e){let{label:r,value:s}=e;return s?(0,t.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",py:1},children:[(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",children:r}),(0,t.jsx)(p.Z,{variant:"body2",sx:{fontWeight:500},children:s})]}):null}var eB=s(93757);function eN(){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,t.jsx)("line",{x1:"8",y1:"12",x2:"16",y2:"12"})]})}function eU(){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("path",{d:"M21 2v6h-6"}),(0,t.jsx)("path",{d:"M3 12a9 9 0 0115.36-6.36L21 8"}),(0,t.jsx)("path",{d:"M3 22v-6h6"}),(0,t.jsx)("path",{d:"M21 12a9 9 0 01-15.36 6.36L3 16"})]})}function eL(){var e,r,s,M;let T=(0,i.useParams)(),D=(0,a.x)(),E=decodeURIComponent(T.name),{data:B,isLoading:N,error:U}=(0,em.Hy)(E),{status:L,health:H}=function(e){let{serverName:r,onStatusChange:s,enabled:t=!0,reconnectInterval:i=3e3}=e,[a,l]=(0,n.useState)(null),[o,d]=(0,n.useState)(null);(0,n.useEffect)(()=>{l(null),d(null)},[r]);let c=(0,n.useCallback)(e=>{if("server-status"===e.type){let r=e.data.status,t=e.data.health;l(r),d(t),null==s||s(r,t)}},[s]),{isConnected:x,reconnect:h,retryCount:u}=(0,eB.D)({url:"/api/sse/servers/".concat(encodeURIComponent(r),"/status"),onMessage:c,enabled:t,reconnectInterval:i});return{status:a,health:o,isConnected:x,reconnect:h,retryCount:u}}({serverName:E,enabled:!!E}),[q,K]=(0,n.useState)(null),[G,_]=(0,n.useState)(!1),[J,V]=(0,n.useState)(""),Q=(0,em.jM)(),Y=(0,em.Aw)(),$=(0,em._I)(),X=(0,em.Hq)(),ee=async()=>{try{await Q.mutateAsync(E)}catch(e){console.error("Failed to start server:",e)}},er=async()=>{try{await Y.mutateAsync(E)}catch(e){console.error("Failed to stop server:",e)}},es=async()=>{try{await $.mutateAsync(E)}catch(e){console.error("Failed to restart server:",e)}},et=async e=>{try{await fetch("/api/servers/".concat(encodeURIComponent(E),"/exec"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:e})})}catch(e){console.error("Failed to send command:",e)}},en=L||(null==B?void 0:B.server.status),ei=Q.isPending||Y.isPending||$.isPending,ea=null==B?void 0:B.server;return(0,t.jsxs)(t.Fragment,{children:[U&&(0,t.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to load server: ",U.message]}),Q.isError&&(0,t.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to start server: ",null===(e=Q.error)||void 0===e?void 0:e.message]}),Y.isError&&(0,t.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to stop server: ",null===(r=Y.error)||void 0===r?void 0:r.message]}),$.isError&&(0,t.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to restart server: ",null===(s=$.error)||void 0===s?void 0:s.message]}),X.isError&&(0,t.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to delete server: ",null===(M=X.error)||void 0===M?void 0:M.message]}),N?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:2,mb:2.5},children:[(0,t.jsx)(h.Z,{variant:"rounded",width:64,height:64,sx:{borderRadius:3,flexShrink:0}}),(0,t.jsxs)(l.Z,{sx:{flex:1},children:[(0,t.jsx)(h.Z,{variant:"text",width:80,height:18,sx:{mb:.5}}),(0,t.jsx)(h.Z,{variant:"text",width:"40%",height:40}),(0,t.jsxs)(l.Z,{sx:{display:"flex",gap:2,mt:.75},children:[(0,t.jsx)(h.Z,{variant:"text",width:100}),(0,t.jsx)(h.Z,{variant:"text",width:60}),(0,t.jsx)(h.Z,{variant:"text",width:140}),(0,t.jsx)(h.Z,{variant:"text",width:50})]})]}),(0,t.jsxs)(l.Z,{sx:{display:"flex",gap:1,flexShrink:0},children:[(0,t.jsx)(h.Z,{variant:"rounded",width:90,height:40,sx:{borderRadius:2}}),(0,t.jsx)(h.Z,{variant:"rounded",width:36,height:36,sx:{borderRadius:2}})]})]}),(0,t.jsx)(l.Z,{sx:{display:"flex",gap:.5,mb:3},children:[80,70,65,50,65,65].map((e,r)=>(0,t.jsx)(h.Z,{variant:"rounded",width:e,height:36,sx:{borderRadius:5}},r))}),(0,t.jsx)(l.Z,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(3, 1fr)"},gap:2,mb:2.5},children:[0,1,2].map(e=>(0,t.jsx)(u.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:1.5},children:[(0,t.jsx)(h.Z,{variant:"text",width:"50%"}),(0,t.jsx)(h.Z,{variant:"circular",width:28,height:28})]}),(0,t.jsx)(h.Z,{variant:"text",width:"60%",height:36}),(0,t.jsx)(h.Z,{variant:"rounded",width:"100%",height:6,sx:{borderRadius:3,mt:1}})]})},e))}),(0,t.jsxs)(u.Z,{sx:{borderRadius:3,border:"1px solid",borderColor:"divider"},children:[(0,t.jsxs)(l.Z,{sx:{px:3,py:2,borderBottom:"1px solid",borderColor:"divider",display:"flex",alignItems:"center",gap:1.25},children:[(0,t.jsx)(h.Z,{variant:"text",width:80,height:28}),(0,t.jsx)(h.Z,{variant:"circular",width:10,height:10})]}),(0,t.jsx)(h.Z,{variant:"rectangular",height:360,sx:{bgcolor:"#0a0a0a"}}),(0,t.jsx)(l.Z,{sx:{px:2.5,py:1.5,borderTop:"1px solid",borderColor:"divider"},children:(0,t.jsx)(h.Z,{variant:"rounded",width:"100%",height:40,sx:{borderRadius:2}})})]}),(0,t.jsxs)(S.ZP,{container:!0,spacing:3,sx:{mt:1},children:[(0,t.jsx)(S.ZP,{item:!0,xs:12,md:6,children:(0,t.jsx)(u.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(h.Z,{variant:"text",width:"40%",height:28,sx:{mb:1}}),(0,t.jsx)(h.Z,{variant:"rectangular",height:1,sx:{mb:2}}),[0,1,2,3,4,5,6].map(e=>(0,t.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",py:1},children:[(0,t.jsx)(h.Z,{variant:"text",width:"30%"}),(0,t.jsx)(h.Z,{variant:"text",width:"40%"})]},e))]})})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,md:6,children:(0,t.jsx)(u.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(h.Z,{variant:"text",width:"30%",height:28,sx:{mb:1}}),(0,t.jsx)(h.Z,{variant:"rectangular",height:1,sx:{mb:2}}),(0,t.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",py:1},children:[(0,t.jsx)(h.Z,{variant:"text",width:"25%"}),(0,t.jsx)(h.Z,{variant:"text",width:"20%"})]})]})})})]})]}):ea?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:2,mb:2.5},children:[(0,t.jsx)(l.Z,{sx:{width:64,height:64,borderRadius:3,overflow:"hidden",bgcolor:"background.paper",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,border:"1px solid",borderColor:"divider",fontSize:36},children:function(e){if(!e)return"\uD83C\uDFAE";let r=e.toUpperCase();return["PAPER","SPIGOT","BUKKIT","PURPUR"].includes(r)?"\uD83D\uDD0C":["FORGE","NEOFORGE","FABRIC","QUILT"].includes(r)?"\uD83D\uDD27":"\uD83C\uDFAE"}(ea.type)}),(0,t.jsxs)(l.Z,{sx:{flex:1},children:[(0,t.jsxs)(p.Z,{onClick:()=>D.push("/servers"),sx:{fontSize:12,color:"primary.main",cursor:"pointer",mb:.25,display:"flex",alignItems:"center",gap:.5,"&:hover":{textDecoration:"underline"}},children:[(0,t.jsx)(k.Z,{sx:{fontSize:14}})," All servers"]}),(0,t.jsx)(p.Z,{variant:"h4",component:"h1",sx:{fontFamily:'"Minecraft", sans-serif',fontWeight:400,color:"text.primary",letterSpacing:"0.5px",m:0,textTransform:"uppercase"},children:E}),(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:0,mt:.75,flexWrap:"wrap",fontSize:13,color:"text.secondary"},children:[ea.version&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:.5},children:[(0,t.jsx)(W.Z,{sx:{fontSize:14}}),"Minecraft ",ea.version]}),(0,t.jsx)(l.Z,{component:"span",sx:{mx:1.25,color:"#3a3d4e"},children:"|"})]}),ea.type&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:.5},children:[(0,t.jsx)(F.Z,{sx:{fontSize:14}}),ea.type]}),(0,t.jsx)(l.Z,{component:"span",sx:{mx:1.25,color:"#3a3d4e"},children:"|"})]}),ea.hostname&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:.5},children:[(0,t.jsx)(O.Z,{sx:{fontSize:14}}),ea.hostname]}),(0,t.jsx)(l.Z,{component:"span",sx:{mx:1.25,color:"#3a3d4e"},children:"|"})]}),(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:.5},children:[(0,t.jsx)(A.Z,{sx:{fontSize:14}}),ea.uptime||function(e){if(!e||e<0)return"0s";let r=Math.floor(e/3600),s=Math.floor(e%3600/60),t=e%60;return r>0?"".concat(r,"h ").concat(s,"m"):s>0?"".concat(s,"m ").concat(t,"s"):"".concat(t,"s")}(ea.uptimeSeconds)||"0s"]})]})]}),(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1.25,flexShrink:0},children:[("stopped"===en||"exited"===en||"not_created"===en)&&(0,t.jsx)(o.Z,{variant:"contained",color:"success",startIcon:ei?(0,t.jsx)(x.Z,{size:16,color:"inherit"}):(0,t.jsx)(I.Z,{}),onClick:ee,disabled:ei,sx:{px:2,py:1,borderRadius:2,fontSize:14,fontWeight:600},children:"Start"}),"running"===en&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.Z,{variant:"outlined",startIcon:ei?(0,t.jsx)(x.Z,{size:16}):(0,t.jsx)(eN,{}),onClick:er,disabled:ei,sx:{px:2,py:1,borderRadius:2,fontSize:14,fontWeight:500,borderColor:"divider",color:"text.secondary","&:hover":{borderColor:"text.secondary",bgcolor:(0,R.Fq)("#fff",.05)}},children:"Stop"}),(0,t.jsx)(o.Z,{variant:"contained",startIcon:ei?(0,t.jsx)(x.Z,{size:16,color:"inherit"}):(0,t.jsx)(eU,{}),onClick:es,disabled:ei,sx:{px:2,py:1,borderRadius:2,fontSize:14,fontWeight:600,bgcolor:"primary.main",color:"#0a0e14","&:hover":{bgcolor:"primary.dark"}},children:"Restart"})]}),(0,t.jsx)(d.Z,{onClick:e=>K(e.currentTarget),sx:{width:36,height:36,borderRadius:2,border:"1px solid",borderColor:"divider",color:"text.secondary"},children:(0,t.jsx)(P.Z,{sx:{fontSize:18}})}),(0,t.jsx)(j.Z,{anchorEl:q,open:!!q,onClose:()=>K(null),children:(0,t.jsxs)(g.Z,{onClick:()=>{K(null),_(!0),V("")},sx:{color:"error.main"},children:[(0,t.jsx)(v.Z,{children:(0,t.jsx)(z.Z,{fontSize:"small",sx:{color:"error.main"}})}),(0,t.jsx)(Z.Z,{children:"Delete Server"})]})})]})]}),(0,t.jsx)(eD,{server:ea,onSendCommand:et})]}):(0,t.jsx)(c.Z,{severity:"warning",children:"Server not found"}),(0,t.jsxs)(f.Z,{open:G,onClose:()=>{_(!1),V("")},maxWidth:"sm",fullWidth:!0,children:[(0,t.jsx)(b.Z,{children:"Delete Server"}),(0,t.jsxs)(y.Z,{children:[(0,t.jsxs)(p.Z,{sx:{mb:2},children:["This action cannot be undone. Type ",(0,t.jsx)("strong",{children:E})," to confirm deletion."]}),(0,t.jsx)(w.Z,{label:"Server name",value:J,onChange:e=>V(e.target.value),fullWidth:!0,autoFocus:!0})]}),(0,t.jsxs)(C.Z,{sx:{px:3,pb:2},children:[(0,t.jsx)(o.Z,{onClick:()=>{_(!1),V("")},children:"Cancel"}),(0,t.jsx)(o.Z,{variant:"contained",color:"error",onClick:()=>{J===E&&X.mutate({name:E,force:!0},{onSuccess:()=>{D.push("/servers")}})},disabled:J!==E||X.isPending,startIcon:X.isPending?(0,t.jsx)(x.Z,{size:16}):null,children:X.isPending?"Deleting...":"Delete"})]})]})]})}},73660:function(e,r,s){"use strict";s.d(r,{K:function(){return k}});var t=s(94655),n=s(35106),i=s(18844),a=s.n(i),l=s(7281),o=s(69899),d=s(97436),c=s(30417),x=s(90829),h=s(79983),u=s(31317),m=s(25333),p=s(40064),j=s(45547),g=s(70115),v=s(69123),Z=s(93017),f=s(11141),b=s(19127),y=s(69366),C=s(163);let w=[{label:"say",template:"say "},{label:"give",template:"give "},{label:"tp",template:"tp "},{label:"gamemode",template:"gamemode "}],S=new(a())({fg:"#aaa",bg:"#000",newline:!1,escapeXML:!0,colors:{0:"#000000",1:"#cc0000",2:"#4e9a06",3:"#c4a000",4:"#3465a4",5:"#75507b",6:"#06989a",7:"#d3d7cf",8:"#555753",9:"#ef2929",10:"#8ae234",11:"#fce94f",12:"#729fcf",13:"#ad7fa8",14:"#34e2e2",15:"#eeeeec"}}),R=(0,n.memo)(function(e){let{log:r}=e,s=(0,n.useMemo)(()=>(function(e){let r=e.replace(/\x1b\[\?[\d;]*[a-zA-Z]/g,"").replace(/\x1b\[[0-9;]*[KJH]/g,"").replace(/\x1b=/g,"").replace(/\[\?[\d;]*[a-zA-Z]/g,"").replace(/\[[0-9;]*[KJH]/g,"").replace(/\[m/g,"").replace(/\[(\d+)m/g,"\x1b[$1m").replace(/>\.\.\.\.\r?/g,"").replace(/\r/g,"");return S.toHtml(r)})(r),[r]);return(0,t.jsx)(l.Z,{sx:{py:.25,whiteSpace:"pre-wrap",wordBreak:"break-all","& span":{}},dangerouslySetInnerHTML:{__html:s}})});function k(e){let{serverName:r}=e,[s,i]=(0,n.useState)(""),[a,S]=(0,n.useState)([]),[k,I]=(0,n.useState)(-1),[P,z]=(0,n.useState)("ALL"),[W,F]=(0,n.useState)(!0),[O,A]=(0,n.useState)(!0),[M,T]=(0,n.useState)(!1),D=(0,n.useRef)(null),E=(0,n.useRef)(null),{logs:B,isConnected:N,clearLogs:U,reconnect:L,retryCount:H}=(0,C.Y)({serverName:r}),q=(0,n.useMemo)(()=>{let e=B;return O&&(e=e.filter(e=>!e.includes("RCON Listener")&&!e.includes("RCON Client")&&!e.includes("RconClient"))),"ALL"!==P&&(e=e.filter(e=>(e.includes("/ERROR]")||e.includes("/ERROR:")?"ERROR":e.includes("/WARN]")||e.includes("/WARN:")?"WARN":(e.includes("/INFO]")||e.includes("/INFO:"),"INFO"))===P)),e},[B,P,O]);(0,n.useEffect)(()=>{W&&E.current&&(E.current.scrollTop=E.current.scrollHeight)},[q,W]);let K=(0,n.useCallback)(async()=>{let e=s.trim();if(e&&!M){T(!0);try{S(r=>[...r,e]),I(-1),await fetch("/api/servers/".concat(encodeURIComponent(r),"/exec"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:e})}),i("")}catch(e){console.error("Failed to execute command:",e)}finally{T(!1)}}},[s,r,M]),G=(0,n.useCallback)(e=>{if("Enter"===e.key)e.preventDefault(),K();else if("ArrowUp"===e.key){if(e.preventDefault(),0===a.length)return;let r=-1===k?a.length-1:Math.max(0,k-1);I(r),i(a[r])}else if("ArrowDown"===e.key){if(e.preventDefault(),-1===k)return;let r=k+1;r>=a.length?(I(-1),i("")):(I(r),i(a[r]))}},[a,k,K]),_=(0,n.useCallback)(e=>{var r;i(e),null===(r=D.current)||void 0===r||r.focus()},[]),J=N?{text:"Connected",color:"success"}:H>0?{text:"Disconnected (Retry ".concat(H,")"),color:"warning"}:{text:"Disconnected",color:"error"};return(0,t.jsxs)(o.Z,{"data-testid":"server-console",sx:{display:"flex",flexDirection:"column",height:"100%",minHeight:400},children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:2,py:1,borderBottom:1,borderColor:"divider"},children:[(0,t.jsxs)(g.Z,{direction:"row",spacing:1,alignItems:"center",children:[(0,t.jsx)(u.Z,{variant:"subtitle2",children:"Console"}),(0,t.jsx)(m.Z,{"data-testid":"connection-status",label:J.text,color:J.color,size:"small"})]}),(0,t.jsxs)(g.Z,{direction:"row",spacing:1,alignItems:"center",children:[(0,t.jsx)(x.Z,{size:"small",variant:"outlined",children:["ALL","INFO","WARN","ERROR"].map(e=>(0,t.jsx)(c.Z,{onClick:()=>z(e),variant:P===e?"contained":"outlined",children:e},e))}),(0,t.jsx)(p.Z,{control:(0,t.jsx)(j.Z,{checked:W,onChange:e=>F(e.target.checked),size:"small",inputProps:{"aria-label":"Auto-scroll"}}),label:"Auto-scroll"}),(0,t.jsx)(p.Z,{control:(0,t.jsx)(j.Z,{checked:O,onChange:e=>A(e.target.checked),size:"small",inputProps:{"aria-label":"Hide RCON"}}),label:"Hide RCON"}),(0,t.jsx)(h.Z,{size:"small",onClick:U,"aria-label":"Clear logs",title:"Clear logs",children:(0,t.jsx)(b.Z,{})}),!N&&(0,t.jsx)(c.Z,{size:"small",startIcon:(0,t.jsx)(y.Z,{}),onClick:L,"aria-label":"Reconnect",children:"Reconnect"})]})]}),(0,t.jsx)(l.Z,{ref:E,sx:{flex:1,overflow:"auto",bgcolor:"#1a1a1a",p:1,fontFamily:"monospace",fontSize:"0.85rem"},children:0===q.length?(0,t.jsx)(u.Z,{color:"text.secondary",sx:{textAlign:"center",py:4,color:"#666"},children:"Waiting for logs..."}):q.map((e,r)=>(0,t.jsx)(R,{log:e},r))}),(0,t.jsx)(v.Z,{}),(0,t.jsx)(l.Z,{sx:{px:2,py:1,bgcolor:"background.default"},children:(0,t.jsxs)(g.Z,{direction:"row",spacing:1,children:[(0,t.jsx)(u.Z,{variant:"caption",color:"text.secondary",sx:{alignSelf:"center"},children:"Quick:"}),w.map(e=>(0,t.jsx)(c.Z,{size:"small",variant:"outlined",onClick:()=>_(e.template),children:e.label},e.label))]})}),(0,t.jsx)(v.Z,{}),(0,t.jsxs)(l.Z,{sx:{display:"flex",p:1,gap:1},children:[(0,t.jsx)(d.Z,{inputRef:D,fullWidth:!0,size:"small",placeholder:"Enter command...",value:s,onChange:e=>i(e.target.value),onKeyDown:G,disabled:!N||M,InputProps:{sx:{fontFamily:"monospace"}}}),(0,t.jsx)(c.Z,{variant:"contained",onClick:K,disabled:!s.trim()||!N||M,startIcon:M?(0,t.jsx)(Z.Z,{size:16}):(0,t.jsx)(f.Z,{}),"aria-label":"Send command",children:"Send"})]})]})}},163:function(e,r,s){"use strict";s.d(r,{Y:function(){return i}});var t=s(35106),n=s(93757);function i(e){let{serverName:r,maxLines:s=500,enabled:i=!0,reconnectInterval:a=3e3}=e,[l,o]=(0,t.useState)([]);(0,t.useEffect)(()=>{o([])},[r]);let d=(0,t.useCallback)(e=>{let r;"server-log"===e.type?r=e.data.log:"log"in e&&"string"==typeof e.log&&(r=e.log),r&&o(e=>{let t=[...e,r];return t.length>s?t.slice(t.length-s):t})},[s]),{isConnected:c,reconnect:x,retryCount:h}=(0,n.D)({url:"/api/sse/servers/".concat(encodeURIComponent(r),"/logs"),onMessage:d,enabled:i,reconnectInterval:a});return{logs:l,isConnected:c,clearLogs:(0,t.useCallback)(()=>{o([])},[]),reconnect:x,retryCount:h}}}},function(e){e.O(0,[6812,9760,6758,680,1668,7436,1071,540,4416,9810,7073,880,55,6857,8347,1658,1544,6727,6357,787,1721,3489,2537,3669,2757,1744],function(){return e(e.s=59616)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[224],{49726:function(e,t,r){Promise.resolve().then(r.bind(r,7854))},7854:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return en}});var n=r(94655),s=r(35106),o=r(31358),i=r(7281),a=r(30417),l=r(81071),c=r(93017),u=r(69899),d=r(31317),h=r(76492),m=r(32366),p=r(78067),x=r(84840),f=r(97436),v=r(52082),y=r(89923),g=r(10297),S=r(42431),C=r(628),j=r(41565),b=r(25935),Z=r(79983),w=r(25333),k=r(95511),T=r(5501),q=r(93315),R=r(27171),I=r(96292);let E=e=>{switch(e){case"running":return"success";case"stopped":case"exited":case"not_created":return"error";case"created":return"warning";default:return"default"}},F=e=>{switch(e){case"running":return"Running";case"stopped":case"exited":return"Stopped";case"not_created":return"Not Created";case"created":return"Created";default:return e||"Unknown"}},N=e=>{if(!e)return"-";let t=e.split(",").map(e=>e.trim());return t.find(e=>e.endsWith(".local"))||t[0]||"-"};function O(e){var t;let{server:r,statusOverride:s,onClick:o,onStart:a,onStop:l,loading:c=!1}=e,u=(null==s?void 0:s.status)||r.status,h=(e,t)=>{e.stopPropagation(),t(r.name)},m="running"===u,p="stopped"===u||"exited"===u||"not_created"===u,x=N(r.hostname),f=(null===(t=r.hostname)||void 0===t?void 0:t.split(",").map(e=>e.trim()))||[];return(0,n.jsxs)(C.Z,{role:"article",onClick:()=>{o&&o(r.name)},sx:{cursor:o?"pointer":"default",transition:"all 0.2s",height:180,display:"flex",flexDirection:"column","&:hover":o?{transform:"translateY(-2px)",boxShadow:4}:{}},children:[(0,n.jsxs)(j.Z,{sx:{flex:1,pb:1},children:[(0,n.jsxs)(i.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,n.jsx)(d.Z,{variant:"h6",component:"h3",sx:{fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1,mr:1},children:r.name}),(0,n.jsx)(w.Z,{label:F(u),size:"small",color:E(u),sx:{fontWeight:500,minWidth:70}})]}),(0,n.jsxs)(i.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:1.5},children:[(0,n.jsx)(I.Z,{sx:{fontSize:16,color:"text.secondary"}}),(0,n.jsx)(k.Z,{title:f.length>1?f.join("\n"):"",arrow:!0,children:(0,n.jsxs)(d.Z,{variant:"body2",color:"text.secondary",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[x,f.length>1&&" (+".concat(f.length-1,")")]})})]}),(0,n.jsxs)(i.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,n.jsx)(R.Z,{sx:{fontSize:16,color:"text.secondary"}}),(0,n.jsx)(d.Z,{variant:"body2",color:"text.secondary",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r.container})]})]}),(0,n.jsxs)(b.Z,{sx:{justifyContent:"flex-end",px:2,py:1.5,borderTop:"1px solid",borderColor:"divider"},children:[p&&a&&(0,n.jsx)(Z.Z,{"aria-label":"Start server",color:"success",onClick:e=>h(e,a),disabled:c,size:"small",children:(0,n.jsx)(T.Z,{})}),m&&l&&(0,n.jsx)(Z.Z,{"aria-label":"Stop server",color:"error",onClick:e=>h(e,l),disabled:c,size:"small",children:(0,n.jsx)(q.Z,{})}),!p&&!m&&(0,n.jsx)(i.Z,{sx:{height:34}})]})]})}function L(e){let{servers:t,statusMap:r={},onServerClick:o,onStart:l,onStop:c,onCreate:u,loadingServers:h=[]}=e,[p,C]=(0,s.useState)(""),[j,b]=(0,s.useState)("all"),Z=(0,s.useMemo)(()=>t.filter(e=>{if(p&&!e.name.toLowerCase().includes(p.toLowerCase()))return!1;let t=r[e.name],n=(null==t?void 0:t.status)||e.status;return("running"!==j||"running"===n)&&("stopped"!==j||"stopped"===n||"exited"===n||"not_created"===n)}),[t,r,p,j]);return 0===t.length?(0,n.jsxs)(i.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"400px",gap:2},children:[(0,n.jsx)(d.Z,{variant:"h6",color:"text.secondary",children:"No servers found"}),u&&(0,n.jsx)(a.Z,{variant:"contained",startIcon:(0,n.jsx)(m.Z,{}),onClick:u,children:"Create Server"})]}):(0,n.jsxs)(i.Z,{children:[(0,n.jsxs)(i.Z,{sx:{display:"flex",flexDirection:{xs:"column",sm:"row"},gap:2,mb:3,alignItems:{xs:"stretch",sm:"center"},justifyContent:"space-between"},children:[(0,n.jsxs)(g.Z,{value:j,exclusive:!0,onChange:(e,t)=>{null!==t&&b(t)},size:"small",sx:{flexShrink:0},children:[(0,n.jsx)(y.Z,{value:"all",children:"All"}),(0,n.jsx)(y.Z,{value:"running",children:"Running"}),(0,n.jsx)(y.Z,{value:"stopped",children:"Stopped"})]}),(0,n.jsx)(f.Z,{size:"small",placeholder:"Search servers...",value:p,onChange:e=>C(e.target.value),InputProps:{startAdornment:(0,n.jsx)(v.Z,{position:"start",children:(0,n.jsx)(S.Z,{})})},sx:{flexGrow:{xs:1,sm:0},minWidth:{sm:300}}})]}),(0,n.jsxs)(d.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:[Z.length," ",1===Z.length?"server":"servers"]}),0===Z.length?(0,n.jsx)(i.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"200px",gap:2},children:(0,n.jsx)(d.Z,{variant:"h6",color:"text.secondary",children:"No servers found"})}):(0,n.jsx)(x.ZP,{container:!0,spacing:2,children:Z.map(e=>(0,n.jsx)(x.ZP,{item:!0,xs:12,sm:6,md:4,children:(0,n.jsx)(O,{server:e,statusOverride:r[e.name],onClick:o,onStart:l,onStop:c,loading:h.includes(e.name)})},e.name))})]})}var P=r(99770),D=r(62508),K=r(5682),M=r(76678),A=r(7178),Q=r(40064),W=r(45547),U=r(4405),z=r(73383),_=r(82285),G=r(13609),V=r(46207),H=r(43436),J=r(87716);let $=["VANILLA","PAPER","FABRIC","FORGE","NEOFORGE"],B=["","forge","fabric","neoforge","quilt"],Y={name:"",type:"PAPER",version:"1.21.1",memory:"4G",autoStart:!1,sudoPassword:""},X=[{key:"initializing",label:"Initializing"},{key:"creating",label:"Creating"},{key:"configuring",label:"Configuring"},{key:"starting",label:"Starting"}];function ee(e){let t,{open:r,onClose:o,onSubmit:u,loading:h=!1,status:m="idle",progress:p=0,message:x=""}=e,[v,S]=(0,s.useState)("standard"),[C,j]=(0,s.useState)(Y),[b,Z]=(0,s.useState)({}),[w,k]=(0,s.useState)(!1),T=(0,s.useRef)(null),q=(0,s.useRef)(null),R=X.findIndex(e=>e.key===m),I="idle"!==m&&"completed"!==m&&"error"!==m;(0,s.useEffect)(()=>{r||(S("standard"),j(Y),Z({}),k(!1))},[r]);let E=e=>e?/^[a-z0-9-]+$/.test(e)?null:"Only lowercase letters, numbers, and hyphens are allowed":"Server name is required",F=e=>e?null:"Modpack slug is required",N=e=>t=>{let r=t.target.value;j(t=>({...t,[e]:r})),"memory"===e&&k(!0),b[e]&&Z(t=>({...t,[e]:""}))};return(0,n.jsx)(P.Z,{open:r,onClose:I?void 0:o,maxWidth:"sm",fullWidth:!0,children:(0,n.jsxs)("form",{onSubmit:e=>{e.preventDefault(),Z({});let t=E(C.name);if(t){Z({name:t});return}if("modpack"===v){let e=F(C.modpack||"");if(e){Z({modpack:e});return}}let r={name:C.name,memory:C.memory,autoStart:C.autoStart,sudoPassword:C.sudoPassword};"standard"===v?(r.type=C.type,r.version=C.version):(r.type="MODRINTH",r.modpack=C.modpack,C.modpackVersion&&(r.modpackVersion=C.modpackVersion),C.modLoader&&(r.modLoader=C.modLoader)),u(r)},children:[(0,n.jsx)(D.Z,{children:"completed"===m?(0,n.jsxs)(i.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,n.jsx)(V.Z,{color:"success"}),"Server Created Successfully"]}):"error"===m?(0,n.jsxs)(i.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,n.jsx)(H.Z,{color:"error"}),"Creation Failed"]}):"Create New Server"}),(0,n.jsx)(K.Z,{children:I||"completed"===m||"error"===m?(0,n.jsxs)(i.Z,{sx:{py:2},children:[(0,n.jsx)(z.Z,{activeStep:R,alternativeLabel:!0,sx:{mb:3},children:X.map(e=>(0,n.jsx)(_.Z,{children:(0,n.jsx)(G.Z,{children:e.label})},e.key))}),I&&(0,n.jsxs)(i.Z,{sx:{mb:3},children:[(0,n.jsxs)(i.Z,{sx:{display:"flex",justifyContent:"space-between",mb:1},children:[(0,n.jsx)(d.Z,{variant:"body2",color:"text.secondary",children:x}),(0,n.jsxs)(d.Z,{variant:"body2",color:"text.secondary",children:[p,"%"]})]}),(0,n.jsx)(U.Z,{variant:"determinate",value:p})]}),"completed"===m&&(0,n.jsx)(d.Z,{color:"success.main",sx:{textAlign:"center"},children:x}),"error"===m&&(0,n.jsx)(d.Z,{color:"error.main",sx:{textAlign:"center"},children:x})]}):(0,n.jsxs)(i.Z,{sx:{display:"flex",flexDirection:"column",gap:2,pt:1},children:[(0,n.jsx)(i.Z,{ref:q,role:"status","aria-live":"polite",sx:{position:"absolute",left:"-10000px",width:"1px",height:"1px",overflow:"hidden"}}),(0,n.jsx)(f.Z,{label:"Server Name",value:C.name,onChange:N("name"),error:!!b.name,helperText:b.name||"Only lowercase letters, numbers, and hyphens",fullWidth:!0,autoFocus:!0,disabled:I}),(0,n.jsxs)(i.Z,{sx:{display:"flex",flexDirection:"column",gap:2},children:[(0,n.jsx)(d.Z,{variant:"subtitle2",color:"text.secondary",children:"Server Type"}),(0,n.jsxs)(g.Z,{value:v,exclusive:!0,onChange:(e,t)=>{null!==t&&(S(t),q.current&&(q.current.textContent="".concat("standard"===t?"Standard Server":"Modpack"," category selected")),w||j(e=>({...e,memory:"standard"===t?"4G":"6G"})),setTimeout(()=>{"modpack"===t&&T.current&&T.current.focus()},300))},"aria-label":"Server category",fullWidth:!0,disabled:I,children:[(0,n.jsx)(y.Z,{value:"standard","aria-label":"Standard Server",children:"Standard Server"}),(0,n.jsx)(y.Z,{value:"modpack","aria-label":"Modpack",children:"Modpack"})]}),(0,n.jsx)(J.Z,{in:"standard"===v,unmountOnExit:!0,children:(0,n.jsxs)(i.Z,{sx:{display:"flex",flexDirection:"column",gap:2,mt:2},children:[(0,n.jsx)(f.Z,{label:"Server Type",select:!0,value:C.type,onChange:N("type"),fullWidth:!0,disabled:I,children:$.map(e=>(0,n.jsx)(A.Z,{value:e,children:e},e))}),(0,n.jsx)(f.Z,{label:"Minecraft Version",value:C.version,onChange:N("version"),helperText:"e.g., 1.21.1, 1.20.4, latest",fullWidth:!0,disabled:I})]})}),(0,n.jsx)(J.Z,{in:"modpack"===v,unmountOnExit:!0,children:(0,n.jsxs)(i.Z,{sx:{display:"flex",flexDirection:"column",gap:2,mt:2},children:[(0,n.jsx)(l.Z,{severity:"info",children:"Minecraft version is automatically determined by the modpack"}),(0,n.jsx)(f.Z,{label:"Modpack Slug",value:C.modpack||"",onChange:N("modpack"),error:!!b.modpack,helperText:b.modpack||"e.g., cobblemon, adrenaserver (from modrinth.com/modpacks/SLUG)",fullWidth:!0,disabled:I,inputRef:T}),(0,n.jsxs)(f.Z,{label:"Mod Loader",select:!0,value:C.modLoader||"",onChange:N("modLoader"),helperText:"Leave empty to auto-detect from modpack",fullWidth:!0,disabled:I,children:[(0,n.jsx)(A.Z,{value:"",children:"Auto-detect"}),B.filter(e=>e).map(e=>(0,n.jsx)(A.Z,{value:e,children:e},e))]}),(0,n.jsx)(f.Z,{label:"Modpack Version",value:C.modpackVersion||"",onChange:N("modpackVersion"),helperText:"Leave empty for latest",fullWidth:!0,disabled:I})]})})]}),(0,n.jsx)(f.Z,{label:"Memory",value:C.memory,onChange:N("memory"),helperText:"e.g., 4G, 8G, 16G",fullWidth:!0,disabled:I}),(0,n.jsx)(f.Z,{label:"Sudo Password",type:"password",value:C.sudoPassword||"",onChange:N("sudoPassword"),helperText:"Required for mDNS hostname registration (avahi)",fullWidth:!0,disabled:I}),(0,n.jsx)(Q.Z,{control:(0,n.jsx)(W.Z,{checked:C.autoStart||!1,onChange:(t="autoStart",e=>{j(r=>({...r,[t]:e.target.checked}))}),disabled:I}),label:"Auto-start after creation"})]})}),(0,n.jsx)(M.Z,{sx:{px:3,pb:2},children:"completed"===m||"error"===m?(0,n.jsx)(a.Z,{onClick:o,variant:"contained",fullWidth:!0,children:"Close"}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.Z,{onClick:o,disabled:I,children:"Cancel"}),(0,n.jsx)(a.Z,{type:"submit",variant:"contained",disabled:I,startIcon:I?(0,n.jsx)(c.Z,{size:16}):null,children:I?"Creating...":"Create"})]})})]})})}var et=r(92666),er=r(59104);function en(){var e,t;let r=(0,o.x)(),[x,f]=(0,s.useState)(!1),[v,y]=(0,s.useState)([]),{data:g,isLoading:S,error:C}=(0,et.x$)(),{statusMap:j}=(0,er.d)(),b=(0,et.jM)(),Z=(0,et.Aw)(),w=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{onSuccess:t,onError:r,onProgress:n}=e,[o,i]=(0,s.useState)("idle"),[a,l]=(0,s.useState)(0),[c,u]=(0,s.useState)(""),[d,h]=(0,s.useState)(null),m=(0,s.useRef)(null),p=(0,s.useRef)(""),x=(0,s.useCallback)(()=>{i("idle"),l(0),u(""),h(null),m.current&&(m.current.close(),m.current=null)},[]),f=(0,s.useCallback)((e,t,r)=>{i(e),u(t),l(r),null==n||n(e,t,r)},[n]),v=(0,s.useCallback)(async e=>{if("idle"===o||"completed"===o||"error"===o){h(null),f("initializing","Initializing server creation...",0),p.current=e.name,m.current&&m.current.close();try{let r=await fetch("/api/servers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!r.ok){let e=await r.text();throw Error(e||"Server creation failed: ".concat(r.statusText))}await r.json(),f("creating","Creating server configuration...",25),await new Promise(e=>setTimeout(e,500)),f("configuring","Configuring Docker compose...",50),await new Promise(e=>setTimeout(e,500)),f("starting","Starting server container...",75),await new Promise(e=>setTimeout(e,500)),f("completed","Server created successfully!",100),null==t||t(e.name)}catch(t){let e=t instanceof Error?t.message:"Unknown error occurred";i("error"),h(e),u("Server creation failed"),null==r||r(e)}}},[o,f,t,r]);return(0,s.useEffect)(()=>()=>{m.current&&(m.current.close(),m.current=null)},[]),{status:o,progress:a,message:c,error:d,isCreating:"idle"!==o&&"completed"!==o&&"error"!==o,createServer:v,reset:x}}({onSuccess:()=>{f(!1)},onError:e=>{console.error("Failed to create server:",e)}}),k=async e=>{y(t=>[...t,e]);try{await b.mutateAsync(e)}catch(e){console.error("Failed to start server:",e)}finally{y(t=>t.filter(t=>t!==e))}},T=async e=>{y(t=>[...t,e]);try{await Z.mutateAsync(e)}catch(e){console.error("Failed to stop server:",e)}finally{y(t=>t.filter(t=>t!==e))}};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(u.Z,{elevation:0,sx:{mb:4,p:3,background:e=>"linear-gradient(135deg, ".concat((0,h.Fq)(e.palette.info.main,.1)," 0%, ").concat((0,h.Fq)(e.palette.primary.main,.1)," 100%)"),borderRadius:2,border:e=>"1px solid ".concat((0,h.Fq)(e.palette.info.main,.2)),display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,n.jsxs)(i.Z,{sx:{display:"flex",alignItems:"center",gap:2},children:[(0,n.jsx)(i.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:56,height:56,borderRadius:2,bgcolor:"info.main",color:"info.contrastText"},children:(0,n.jsx)(p.Z,{sx:{fontSize:32}})}),(0,n.jsxs)(i.Z,{children:[(0,n.jsx)(d.Z,{variant:"h4",component:"h1",fontWeight:"bold",children:"Servers"}),(0,n.jsx)(d.Z,{variant:"body1",color:"text.secondary",children:"Manage your Minecraft servers"})]})]}),(0,n.jsx)(a.Z,{variant:"contained",startIcon:(0,n.jsx)(m.Z,{}),onClick:()=>f(!0),size:"large",children:"Create Server"})]}),C&&(0,n.jsxs)(l.Z,{severity:"error",sx:{mb:3},children:["Failed to load servers: ",C.message]}),w.error&&(0,n.jsxs)(l.Z,{severity:"error",sx:{mb:3},children:["Failed to create server: ",w.error]}),b.isError&&(0,n.jsxs)(l.Z,{severity:"error",sx:{mb:3},children:["Failed to start server: ",null===(e=b.error)||void 0===e?void 0:e.message]}),Z.isError&&(0,n.jsxs)(l.Z,{severity:"error",sx:{mb:3},children:["Failed to stop server: ",null===(t=Z.error)||void 0===t?void 0:t.message]}),S?(0,n.jsx)(i.Z,{sx:{display:"flex",justifyContent:"center",py:8},children:(0,n.jsx)(c.Z,{})}):(0,n.jsx)(L,{servers:(null==g?void 0:g.servers)||[],statusMap:j,onServerClick:e=>{r.push("/servers/".concat(encodeURIComponent(e)))},onStart:k,onStop:T,onCreate:()=>f(!0),loadingServers:v}),(0,n.jsx)(ee,{open:x,onClose:()=>{f(!1),w.reset()},onSubmit:e=>{w.createServer(e)},loading:w.isCreating,status:w.status,progress:w.progress,message:w.message})]})}},3454:function(e,t,r){"use strict";r.d(t,{LoadingProvider:function(){return l},startLoading:function(){return c},stopLoading:function(){return u}});var n=r(94655),s=r(35106),o=r(74228),i=r(31477),a=r.n(i);function l(e){let{children:t}=e,r=(0,o.usePathname)(),i=(0,o.useSearchParams)();return(0,s.useEffect)(()=>{a().done()},[r,i]),(0,n.jsx)(n.Fragment,{children:t})}function c(){a().start()}function u(){a().done()}a().configure({showSpinner:!1,speed:300,minimum:.1})},8690:function(e,t,r){"use strict";r.d(t,{Av:function(){return n.startLoading}});var n=r(3454)},42936:function(e,t,r){"use strict";async function n(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={...t.headers};t.body&&(r["Content-Type"]="application/json");let n=await fetch(e,{...t,headers:r});if(!n.ok){let e=await n.json().catch(()=>({error:"UnknownError",message:n.statusText})),t=Error(e.message);throw t.statusCode=n.status,t.code=e.error,t}return n.json()}r.d(t,{SC:function(){return n}})},31358:function(e,t,r){"use strict";r.d(t,{x:function(){return i}});var n=r(74228),s=r(35106),o=r(8690);function i(){let e=(0,n.useRouter)(),t=(0,s.useCallback)((t,r)=>{(0,o.Av)(),e.push(t,r)},[e]),r=(0,s.useCallback)((t,r)=>{(0,o.Av)(),e.replace(t,r)},[e]);return(0,s.useMemo)(()=>({...e,push:t,replace:r}),[e,t,r])}},92666:function(e,t,r){"use strict";r.d(t,{$t:function(){return b},Aw:function(){return d},Fv:function(){return v},Hq:function(){return c},Hy:function(){return l},MH:function(){return g},Sr:function(){return m},_I:function(){return h},c5:function(){return Z},g2:function(){return f},gx:function(){return S},hy:function(){return p},iC:function(){return y},jM:function(){return u},mj:function(){return j},nq:function(){return x},nv:function(){return C},s8:function(){return w},x$:function(){return a}});var n=r(5632),s=r(58919),o=r(20367),i=r(42936);function a(){return(0,n.a)({queryKey:["servers"],queryFn:()=>(0,i.SC)("/api/servers"),refetchInterval:6e4})}function l(e,t){return(0,n.a)({queryKey:["servers",e],queryFn:()=>(0,i.SC)("/api/servers/".concat(encodeURIComponent(e))),enabled:(null==t?void 0:t.enabled)!==!1&&!!e,refetchInterval:3e4})}function c(){let e=(0,s.NL)();return(0,o.D)({mutationFn:e=>{let{name:t,force:r}=e;return(0,i.SC)("/api/servers/".concat(encodeURIComponent(t)).concat(r?"?force=true":""),{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:["servers"]})}})}function u(){let e=(0,s.NL)();return(0,o.D)({mutationFn:e=>(0,i.SC)("/api/servers/".concat(encodeURIComponent(e),"/start"),{method:"POST"}),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:["servers"]}),e.invalidateQueries({queryKey:["servers",r]})}})}function d(){let e=(0,s.NL)();return(0,o.D)({mutationFn:e=>(0,i.SC)("/api/servers/".concat(encodeURIComponent(e),"/stop"),{method:"POST"}),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:["servers"]}),e.invalidateQueries({queryKey:["servers",r]})}})}function h(){let e=(0,s.NL)();return(0,o.D)({mutationFn:e=>(0,i.SC)("/api/servers/".concat(encodeURIComponent(e),"/restart"),{method:"POST"}),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:["servers"]}),e.invalidateQueries({queryKey:["servers",r]})}})}function m(){return(0,n.a)({queryKey:["worlds"],queryFn:()=>(0,i.SC)("/api/worlds"),refetchInterval:3e4})}function p(){let e=(0,s.NL)();return(0,o.D)({mutationFn:e=>(0,i.SC)("/api/worlds",{method:"POST",body:JSON.stringify(e)}),onSuccess:()=>{e.invalidateQueries({queryKey:["worlds"]})}})}function x(){let e=(0,s.NL)();return(0,o.D)({mutationFn:e=>{let{worldName:t,serverName:r}=e;return(0,i.SC)("/api/worlds/".concat(encodeURIComponent(t),"/assign"),{method:"POST",body:JSON.stringify({serverName:r})})},onSuccess:()=>{e.invalidateQueries({queryKey:["worlds"]}),e.invalidateQueries({queryKey:["servers"]})}})}function f(){let e=(0,s.NL)();return(0,o.D)({mutationFn:e=>{let{worldName:t,force:r}=e;return(0,i.SC)("/api/worlds/".concat(encodeURIComponent(t),"/release").concat(r?"?force=true":""),{method:"POST"})},onSuccess:()=>{e.invalidateQueries({queryKey:["worlds"]})}})}function v(){let e=(0,s.NL)();return(0,o.D)({mutationFn:e=>{let{name:t,force:r}=e;return(0,i.SC)("/api/worlds/".concat(encodeURIComponent(t)).concat(r?"?force=true":""),{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:["worlds"]})}})}function y(e,t){return(0,n.a)({queryKey:["servers",e,"config"],queryFn:()=>(0,i.SC)("/api/servers/".concat(encodeURIComponent(e),"/config")),enabled:(null==t?void 0:t.enabled)!==!1&&!!e})}function g(){let e=(0,s.NL)();return(0,o.D)({mutationFn:e=>{let{serverName:t,config:r}=e;return(0,i.SC)("/api/servers/".concat(encodeURIComponent(t),"/config"),{method:"PATCH",body:JSON.stringify(r)})},onSuccess:(t,r)=>{let{serverName:n}=r;e.invalidateQueries({queryKey:["servers",n,"config"]}),e.invalidateQueries({queryKey:["servers",n]})}})}function S(){let e=(0,s.NL)();return(0,o.D)({mutationFn:e=>(0,i.SC)("/api/servers/".concat(encodeURIComponent(e),"/world/reset"),{method:"POST"}),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:["servers",r]}),e.invalidateQueries({queryKey:["worlds"]})}})}function C(){return(0,n.a)({queryKey:["router-status"],queryFn:()=>(0,i.SC)("/api/router/status"),refetchInterval:3e4})}function j(){return(0,n.a)({queryKey:["backup-status"],queryFn:()=>(0,i.SC)("/api/backup"),refetchInterval:6e4})}function b(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20;return(0,n.a)({queryKey:["backup-history",e],queryFn:()=>(0,i.SC)("/api/backup/history?limit=".concat(e)),refetchInterval:6e4})}function Z(){let e=(0,s.NL)();return(0,o.D)({mutationFn:e=>{let{message:t}=e;return(0,i.SC)("/api/backup",{method:"POST",body:JSON.stringify({message:t})})},onSuccess:()=>{e.invalidateQueries({queryKey:["backup-status"]}),e.invalidateQueries({queryKey:["backup-history"]})}})}function w(){let e=(0,s.NL)();return(0,o.D)({mutationFn:e=>(0,i.SC)("/api/backup/restore",{method:"POST",body:JSON.stringify({commitHash:e})}),onSuccess:()=>{e.invalidateQueries({queryKey:["worlds"]}),e.invalidateQueries({queryKey:["servers"]})}})}},93757:function(e,t,r){"use strict";r.d(t,{D:function(){return o}});var n=r(35106);class s{connect(e){this.options=e,this.shouldReconnect=!0,this.establishConnection()}establishConnection(){this.options&&(this.updateState("connecting"),this.eventSource&&this.eventSource.close(),this.eventSource=new EventSource(this.options.url,{withCredentials:this.options.withCredentials||!1}),this.eventSource.onopen=()=>{this.updateState("connected"),this.retryCount=0,this.lastError=null},this.eventSource.onmessage=e=>{if(!e.data.startsWith(":"))try{var t,r;let n=JSON.parse(e.data);null===(r=this.options)||void 0===r||null===(t=r.onMessage)||void 0===t||t.call(r,n)}catch(e){console.warn("Failed to parse SSE message:",e)}},this.eventSource.onerror=()=>{var e,t;let r={message:"SSE connection error",code:"CONNECTION_ERROR",retryCount:this.retryCount,timestamp:new Date};this.lastError=r,this.updateState("error"),null===(t=this.options)||void 0===t||null===(e=t.onError)||void 0===e||e.call(t,r),this.shouldReconnect&&this.scheduleReconnect()})}scheduleReconnect(){var e,t;if(!this.options)return;let r=null!==(e=this.options.maxReconnectAttempts)&&void 0!==e?e:1/0;if(this.retryCount>=r)return;this.reconnectTimer&&clearTimeout(this.reconnectTimer);let n=null!==(t=this.options.reconnectInterval)&&void 0!==t?t:3e3;this.reconnectTimer=setTimeout(()=>{this.retryCount++,this.establishConnection()},n)}disconnect(){this.shouldReconnect=!1,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.eventSource&&(this.eventSource.close(),this.eventSource=null),this.updateState("disconnected")}getState(){return this.state}isConnected(){return"connected"===this.state}getLastError(){return this.lastError}getRetryCount(){return this.retryCount}reconnect(){this.retryCount++,this.shouldReconnect=!0,this.eventSource&&(this.eventSource.close(),this.eventSource=null),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.establishConnection()}updateState(e){var t,r;this.state=e,null===(r=this.options)||void 0===r||null===(t=r.onStateChange)||void 0===t||t.call(r,e)}constructor(){this.eventSource=null,this.state="disconnected",this.retryCount=0,this.lastError=null,this.reconnectTimer=null,this.options=null,this.shouldReconnect=!0}}function o(e){let{url:t,onMessage:r,onError:o,reconnectInterval:i=3e3,maxReconnectAttempts:a=1/0,enabled:l=!0,withCredentials:c=!1}=e,[u,d]=(0,n.useState)(null),[h,m]=(0,n.useState)("disconnected"),[p,x]=(0,n.useState)(null),[f,v]=(0,n.useState)(0),y=(0,n.useRef)(null),g=(0,n.useCallback)(e=>{d(e),null==r||r(e)},[r]),S=(0,n.useCallback)(e=>{m(e),"connected"===e&&v(0)},[]),C=(0,n.useCallback)(e=>{x(e),"number"==typeof e.retryCount&&v(e.retryCount),null==o||o(e)},[o]),j=(0,n.useCallback)(()=>{y.current&&(y.current.reconnect(),v(y.current.getRetryCount()))},[]),b=(0,n.useCallback)(()=>{y.current&&y.current.disconnect()},[]);return(0,n.useEffect)(()=>{if(!l){y.current&&(y.current.disconnect(),y.current=null);return}return y.current||(y.current=new s),y.current.connect({url:t,onMessage:g,onStateChange:S,onError:C,reconnectInterval:i,maxReconnectAttempts:a,withCredentials:c}),()=>{y.current&&(y.current.disconnect(),y.current=null)}},[t,l,i,a,c,g,S,C]),{data:u,isConnected:"connected"===h,state:h,error:p,retryCount:f,reconnect:j,disconnect:b}}},59104:function(e,t,r){"use strict";r.d(t,{d:function(){return o}});var n=r(35106),s=r(93757);function o(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{onStatusChange:t,enabled:r=!0,reconnectInterval:o=3e3}=e,[i,a]=(0,n.useState)({}),l=(0,n.useCallback)(e=>{if("server-status"===e.type){let{serverName:r,status:n,health:s,timestamp:o}=e.data;a(e=>({...e,[r]:{status:n,health:s,timestamp:o}})),null==t||t(r,n,s)}},[t]),{isConnected:c,reconnect:u,retryCount:d}=(0,s.D)({url:"/api/sse/servers-status",onMessage:l,enabled:r,reconnectInterval:o}),h=(0,n.useCallback)(e=>i[e]||null,[i]);return(0,n.useEffect)(()=>{r||a({})},[r]),{statusMap:i,getServerStatus:h,isConnected:c,reconnect:u,retryCount:d}}}},function(e){e.O(0,[6812,9760,6758,680,1668,7436,1071,540,4416,9810,7073,880,1658,6909,6727,190,5386,3669,2757,1744],function(){return e(e.s=49726)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4978],{70861:function(e,n,t){Promise.resolve().then(t.bind(t,32539))},76544:function(e,n,t){"use strict";var r=t(8091);n.Z=void 0;var i=r(t(66758)),c=t(94655);n.Z=(0,i.default)([(0,c.jsx)("path",{d:"m7.3 14.7 1.2-1.2c-1-1-1.5-2.3-1.5-3.5 0-1.3.5-2.6 1.5-3.5L7.3 5.3c-1.3 1.3-2 3-2 4.7s.7 3.4 2 4.7M19.1 2.9l-1.2 1.2c1.6 1.6 2.4 3.8 2.4 5.9 0 2.1-.8 4.3-2.4 5.9l1.2 1.2c2-2 2.9-4.5 2.9-7.1 0-2.6-1-5.1-2.9-7.1"},"0"),(0,c.jsx)("path",{d:"M6.1 4.1 4.9 2.9C3 4.9 2 7.4 2 10c0 2.6 1 5.1 2.9 7.1l1.2-1.2c-1.6-1.6-2.4-3.8-2.4-5.9 0-2.1.8-4.3 2.4-5.9m10.6 10.6c1.3-1.3 2-3 2-4.7-.1-1.7-.7-3.4-2-4.7l-1.2 1.2c1 1 1.5 2.3 1.5 3.5 0 1.3-.5 2.6-1.5 3.5zM14.5 10c0-1.38-1.12-2.5-2.5-2.5S9.5 8.62 9.5 10c0 .76.34 1.42.87 1.88L7 22h2l.67-2h4.67l.66 2h2l-3.37-10.12c.53-.46.87-1.12.87-1.88m-4.17 8L12 13l1.67 5z"},"1")],"CellTower")},23695:function(e,n,t){"use strict";var r=t(8091);n.Z=void 0;var i=r(t(66758)),c=t(94655);n.Z=(0,i.default)((0,c.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"}),"Info")},70603:function(e,n,t){"use strict";var r=t(8091);n.Z=void 0;var i=r(t(66758)),c=t(94655);n.Z=(0,i.default)((0,c.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1z"}),"Lock")},21605:function(e,n,t){"use strict";var r=t(8091);n.Z=void 0;var i=r(t(66758)),c=t(94655);n.Z=(0,i.default)((0,c.jsx)("path",{d:"M15.9 5c-.17 0-.32.09-.41.23l-.07.15-5.18 11.65c-.16.29-.26.61-.26.96 0 1.11.9 2.01 2.01 2.01.96 0 1.77-.68 1.96-1.59l.01-.03L16.4 5.5c0-.28-.22-.5-.5-.5M1 9l2 2c2.88-2.88 6.79-4.08 10.53-3.62l1.19-2.68C9.89 3.84 4.74 5.27 1 9m20 2 2-2c-1.64-1.64-3.55-2.82-5.59-3.57l-.53 2.82c1.5.62 2.9 1.53 4.12 2.75m-4 4 2-2c-.8-.8-1.7-1.42-2.66-1.89l-.55 2.92c.42.27.83.59 1.21.97M5 13l2 2c1.13-1.13 2.56-1.79 4.03-2l1.28-2.88c-2.63-.08-5.3.87-7.31 2.88"}),"NetworkCheck")},29983:function(e,n,t){"use strict";var r=t(8091);n.Z=void 0;var i=r(t(66758)),c=t(94655);n.Z=(0,i.default)((0,c.jsx)("path",{d:"m20.2 5.9.8-.8C19.6 3.7 17.8 3 16 3s-3.6.7-5 2.1l.8.8C13 4.8 14.5 4.2 16 4.2s3 .6 4.2 1.7m-.9.8c-.9-.9-2.1-1.4-3.3-1.4s-2.4.5-3.3 1.4l.8.8c.7-.7 1.6-1 2.5-1 .9 0 1.8.3 2.5 1zM19 13h-2V9h-2v4H5c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-4c0-1.1-.9-2-2-2M8 18H6v-2h2zm3.5 0h-2v-2h2zm3.5 0h-2v-2h2z"}),"Router")},87739:function(e,n,t){"use strict";var r=t(8091);n.Z=void 0;var i=r(t(66758)),c=t(94655);n.Z=(0,i.default)((0,c.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings")},42730:function(e,n,t){"use strict";var r=t(8091);n.Z=void 0;var i=r(t(66758)),c=t(94655);n.Z=(0,i.default)((0,c.jsx)("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}),"VisibilityOff")},66758:function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return r.createSvgIcon}});var r=t(26505)},52082:function(e,n,t){"use strict";t.d(n,{Z:function(){return z}});var r,i=t(32324),c=t(81500),o=t(35106),s=t(70316),a=t(65951),l=t(38762),u=t(31317),d=t(14406),f=t(85016),v=t(34519),h=t(11379),p=t(9049);function Z(e){return(0,p.ZP)("MuiInputAdornment",e)}let m=(0,h.Z)("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var x=t(28057),b=t(94655);let g=["children","className","component","disablePointerEvents","disableTypography","position","variant"],j=e=>{let{classes:n,disablePointerEvents:t,hiddenLabel:r,position:i,size:c,variant:o}=e,s={root:["root",t&&"disablePointerEvents",i&&"position".concat((0,l.Z)(i)),o,r&&"hiddenLabel",c&&"size".concat((0,l.Z)(c))]};return(0,a.Z)(s,Z,n)},M=(0,v.ZP)("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:(e,n)=>{let{ownerState:t}=e;return[n.root,n["position".concat((0,l.Z)(t.position))],!0===t.disablePointerEvents&&n.disablePointerEvents,n[t.variant]]}})(e=>{let{theme:n,ownerState:t}=e;return(0,c.Z)({display:"flex",height:"0.01em",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(n.vars||n).palette.action.active},"filled"===t.variant&&{["&.".concat(m.positionStart,"&:not(.").concat(m.hiddenLabel,")")]:{marginTop:16}},"start"===t.position&&{marginRight:8},"end"===t.position&&{marginLeft:8},!0===t.disablePointerEvents&&{pointerEvents:"none"})});var z=o.forwardRef(function(e,n){let t=(0,x.i)({props:e,name:"MuiInputAdornment"}),{children:a,className:l,component:v="div",disablePointerEvents:h=!1,disableTypography:p=!1,position:Z,variant:m}=t,z=(0,i.Z)(t,g),y=(0,f.Z)()||{},E=m;m&&y.variant,y&&!E&&(E=y.variant);let C=(0,c.Z)({},t,{hiddenLabel:y.hiddenLabel,size:y.size,disablePointerEvents:h,position:Z,variant:E}),S=j(C);return(0,b.jsx)(d.Z.Provider,{value:null,children:(0,b.jsx)(M,(0,c.Z)({as:v,ownerState:C,className:(0,s.Z)(S.root,l),ref:n},z,{children:"string"!=typeof a||p?(0,b.jsxs)(o.Fragment,{children:["start"===Z?r||(r=(0,b.jsx)("span",{className:"notranslate",children:""})):null,a]}):(0,b.jsx)(u.Z,{color:"text.secondary",children:a})}))})})},27350:function(e,n,t){"use strict";var r=t(34834);n.Z=r.Z},26505:function(e,n,t){"use strict";t.r(n),t.d(n,{capitalize:function(){return i.Z},createChainedFunction:function(){return c.Z},createSvgIcon:function(){return o.Z},debounce:function(){return s.Z},deprecatedPropType:function(){return a},isMuiElement:function(){return l.Z},ownerDocument:function(){return u.Z},ownerWindow:function(){return d.Z},requirePropFactory:function(){return f},setRef:function(){return v},unstable_ClassNameGenerator:function(){return j},unstable_useEnhancedEffect:function(){return h.Z},unstable_useId:function(){return p.Z},unsupportedProp:function(){return Z},useControlled:function(){return m.Z},useEventCallback:function(){return x.Z},useForkRef:function(){return b.Z},useIsFocusVisible:function(){return g.Z}});var r=t(74055),i=t(38762),c=t(27350),o=t(61626),s=t(19521),a=function(e,n){return()=>null},l=t(9290),u=t(34713),d=t(99466);t(81500);var f=function(e,n){return()=>null},v=t(25880).Z,h=t(65425),p=t(88207),Z=function(e,n,t,r,i){return null},m=t(18280),x=t(10620),b=t(38481),g=t(22125);let j={configure:e=>{r.Z.configure(e)}}},88207:function(e,n,t){"use strict";var r=t(40552);n.Z=r.Z},32539:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return d}});var r=t(94655),i=t(35106),c=t(7281),o=t(31317),s=t(37530),a=t(81071),l=t(87739),u=t(11189);function d(){let[e,n]=(0,i.useState)({open:!1,message:"",severity:"success"}),t=e=>{n({open:!0,message:e,severity:"success"})},d=e=>{n({open:!0,message:e,severity:"error"})},f=()=>{n(e=>({...e,open:!1}))};return(0,r.jsxs)(c.Z,{children:[(0,r.jsxs)(c.Z,{sx:{display:"flex",alignItems:"center",gap:1.5,mb:4},children:[(0,r.jsx)(l.Z,{sx:{fontSize:32},color:"primary"}),(0,r.jsx)(o.Z,{variant:"h4",component:"h1",fontWeight:"bold",children:"Settings"})]}),(0,r.jsxs)(c.Z,{sx:{display:"flex",flexDirection:"column",gap:3,maxWidth:700},children:[(0,r.jsx)(u.zd,{onSuccess:t,onError:d}),(0,r.jsx)(u.ms,{onSuccess:t,onError:d}),(0,r.jsx)(u.eE,{})]}),(0,r.jsx)(s.Z,{open:e.open,autoHideDuration:6e3,onClose:f,anchorOrigin:{vertical:"bottom",horizontal:"right"},children:(0,r.jsx)(a.Z,{onClose:f,severity:e.severity,variant:"filled",sx:{width:"100%"},children:e.message})})]})}}},function(e){e.O(0,[6812,9760,6758,680,1668,7436,1071,9810,2542,9654,5381,1721,1189,3669,2757,1744],function(){return e(e.s=70861)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7701],{6199:function(e,n,r){Promise.resolve().then(r.bind(r,36405))},33104:function(e,n,r){"use strict";var t=r(8091);n.Z=void 0;var s=t(r(66758)),i=r(94655);n.Z=(0,s.default)([(0,i.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"},"0"),(0,i.jsx)("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")],"AccessTime")},21111:function(e,n,r){"use strict";var t=r(8091);n.Z=void 0;var s=t(r(66758)),i=r(94655);n.Z=(0,s.default)((0,i.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete")},97812:function(e,n,r){"use strict";var t=r(8091);n.Z=void 0;var s=t(r(66758)),i=r(94655);n.Z=(0,s.default)((0,i.jsx)("path",{d:"M17 7h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1 0 1.43-.98 2.63-2.31 2.98l1.46 1.46C20.88 15.61 22 13.95 22 12c0-2.76-2.24-5-5-5m-1 4h-2.19l2 2H16zM2 4.27l3.11 3.11C3.29 8.12 2 9.91 2 12c0 2.76 2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1 0-1.59 1.21-2.9 2.76-3.07L8.73 11H8v2h2.73L13 15.27V17h1.73l4.01 4L20 19.74 3.27 3z"}),"LinkOff")},84974:function(e,n,r){"use strict";var t=r(8091);n.Z=void 0;var s=t(r(66758)),i=r(94655);n.Z=(0,s.default)((0,i.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39"}),"Public")},36405:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return E}});var t=r(94655),s=r(35106),i=r(7281),l=r(30417),o=r(81071),a=r(93017),c=r(69899),d=r(31317),u=r(99770),x=r(62508),h=r(5682),m=r(76678),f=r(97436),v=r(76492),y=r(32366),p=r(84974),j=r(84840),g=r(52082),Z=r(89923),b=r(10297),S=r(42431),C=r(628),w=r(41565),k=r(25935),q=r(79983),I=r(25333),F=r(95511),L=r(96292),D=r(97812),K=r(21111),N=r(78067),W=r(33104);function z(e){let{world:n,onAssign:r,onRelease:s,onDelete:l,loading:o=!1}=e,a=(e,r)=>{e.stopPropagation(),r(n.name)};return(0,t.jsxs)(C.Z,{role:"article",sx:{transition:"all 0.2s",height:200,display:"flex",flexDirection:"column","&:hover":{transform:"translateY(-2px)",boxShadow:4}},children:[(0,t.jsxs)(w.Z,{sx:{flex:1,pb:1},children:[(0,t.jsxs)(i.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,t.jsx)(d.Z,{variant:"h6",component:"h3",sx:{fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1,mr:1},children:n.name}),(0,t.jsx)(I.Z,{label:n.isLocked?"Locked":"Available",size:"small",color:n.isLocked?"warning":"success",sx:{fontWeight:500,minWidth:80}})]}),(0,t.jsxs)(i.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:1.5},children:[(0,t.jsx)(N.Z,{sx:{fontSize:16,color:"text.secondary"}}),(0,t.jsx)(d.Z,{variant:"body2",color:"text.secondary",children:n.size||"Unknown size"})]}),n.isLocked&&n.lockedBy&&(0,t.jsxs)(i.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:1.5},children:[(0,t.jsx)(L.Z,{sx:{fontSize:16,color:"text.secondary"}}),(0,t.jsx)(F.Z,{title:"Assigned to ".concat(n.lockedBy),arrow:!0,children:(0,t.jsx)(d.Z,{variant:"body2",color:"text.secondary",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.lockedBy})})]}),(0,t.jsxs)(i.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,t.jsx)(W.Z,{sx:{fontSize:16,color:"text.secondary"}}),(0,t.jsx)(d.Z,{variant:"body2",color:"text.secondary",children:(e=>{if(!e)return"-";try{return new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch(n){return e}})(n.lastModified)})]})]}),(0,t.jsxs)(k.Z,{sx:{justifyContent:"flex-end",px:2,py:1.5,borderTop:"1px solid",borderColor:"divider"},children:[!n.isLocked&&r&&(0,t.jsx)(F.Z,{title:"Assign to server",arrow:!0,children:(0,t.jsx)(q.Z,{"aria-label":"Assign world",color:"primary",onClick:e=>a(e,r),disabled:o,size:"small",children:(0,t.jsx)(L.Z,{})})}),n.isLocked&&s&&(0,t.jsx)(F.Z,{title:"Release from server",arrow:!0,children:(0,t.jsx)(q.Z,{"aria-label":"Release world",color:"warning",onClick:e=>a(e,s),disabled:o,size:"small",children:(0,t.jsx)(D.Z,{})})}),l&&(0,t.jsx)(F.Z,{title:"Delete world",arrow:!0,children:(0,t.jsx)(q.Z,{"aria-label":"Delete world",color:"error",onClick:e=>a(e,l),disabled:o,size:"small",children:(0,t.jsx)(K.Z,{})})})]})]})}function T(e){let{worlds:n,onAssign:r,onRelease:o,onDelete:a,onCreate:c,loadingWorlds:u=[]}=e,[x,h]=(0,s.useState)(""),[m,v]=(0,s.useState)("all"),p=(0,s.useMemo)(()=>n.filter(e=>(!x||!!e.name.toLowerCase().includes(x.toLowerCase()))&&("available"!==m||!e.isLocked)&&("locked"!==m||!!e.isLocked)),[n,x,m]);return 0===n.length?(0,t.jsxs)(i.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"400px",gap:2},children:[(0,t.jsx)(d.Z,{variant:"h6",color:"text.secondary",children:"No worlds found"}),c&&(0,t.jsx)(l.Z,{variant:"contained",startIcon:(0,t.jsx)(y.Z,{}),onClick:c,children:"Create World"})]}):(0,t.jsxs)(i.Z,{children:[(0,t.jsxs)(i.Z,{sx:{display:"flex",flexDirection:{xs:"column",sm:"row"},gap:2,mb:3,alignItems:{xs:"stretch",sm:"center"},justifyContent:"space-between"},children:[(0,t.jsxs)(b.Z,{value:m,exclusive:!0,onChange:(e,n)=>{null!==n&&v(n)},size:"small",sx:{flexShrink:0},children:[(0,t.jsx)(Z.Z,{value:"all",children:"All"}),(0,t.jsx)(Z.Z,{value:"available",children:"Available"}),(0,t.jsx)(Z.Z,{value:"locked",children:"Locked"})]}),(0,t.jsx)(f.Z,{size:"small",placeholder:"Search worlds...",value:x,onChange:e=>h(e.target.value),InputProps:{startAdornment:(0,t.jsx)(g.Z,{position:"start",children:(0,t.jsx)(S.Z,{})})},sx:{flexGrow:{xs:1,sm:0},minWidth:{sm:300}}})]}),(0,t.jsxs)(d.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:[p.length," ",1===p.length?"world":"worlds"]}),0===p.length?(0,t.jsx)(i.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"200px",gap:2},children:(0,t.jsx)(d.Z,{variant:"h6",color:"text.secondary",children:"No worlds found"})}):(0,t.jsx)(j.ZP,{container:!0,spacing:2,children:p.map(e=>(0,t.jsx)(j.ZP,{item:!0,xs:12,sm:6,md:4,children:(0,t.jsx)(z,{world:e,onAssign:r,onRelease:o,onDelete:a,loading:u.includes(e.name)})},e.name))})]})}let O={name:"",seed:""};function P(e){let{open:n,onClose:r,onSubmit:o,loading:c=!1}=e,[d,v]=(0,s.useState)(O),[y,p]=(0,s.useState)({});(0,s.useEffect)(()=>{n||(v(O),p({}))},[n]);let j=e=>e?/^[a-z0-9-]+$/.test(e)?null:"Only lowercase letters, numbers, and hyphens are allowed":"World name is required",g=e=>n=>{let r=n.target.value;v(n=>({...n,[e]:r})),y[e]&&p(n=>({...n,[e]:""}))};return(0,t.jsx)(u.Z,{open:n,onClose:c?void 0:r,maxWidth:"sm",fullWidth:!0,children:(0,t.jsxs)("form",{onSubmit:e=>{e.preventDefault(),p({});let n=j(d.name);if(n){p({name:n});return}o({name:d.name,...d.seed?{seed:d.seed}:{}})},children:[(0,t.jsx)(x.Z,{children:"Create New World"}),(0,t.jsx)(h.Z,{children:(0,t.jsxs)(i.Z,{sx:{display:"flex",flexDirection:"column",gap:2,pt:1},children:[(0,t.jsx)(f.Z,{label:"World Name",value:d.name,onChange:g("name"),error:!!y.name,helperText:y.name||"Only lowercase letters, numbers, and hyphens",fullWidth:!0,autoFocus:!0,disabled:c}),(0,t.jsx)(f.Z,{label:"Seed (optional)",value:d.seed||"",onChange:g("seed"),helperText:"Leave empty for a random seed",fullWidth:!0,disabled:c})]})}),(0,t.jsxs)(m.Z,{sx:{px:3,pb:2},children:[(0,t.jsx)(l.Z,{onClick:r,disabled:c,children:"Cancel"}),(0,t.jsx)(l.Z,{type:"submit",variant:"contained",disabled:c,startIcon:c?(0,t.jsx)(a.Z,{size:16}):null,children:c?"Creating...":"Create"})]})]})})}var Q=r(7178),A=r(92666);function R(e){let{open:n,worldName:r,onClose:c,onSubmit:v,loading:y=!1}=e,[p,j]=(0,s.useState)(""),{data:g,isLoading:Z}=(0,A.x$)();(0,s.useEffect)(()=>{n||j("")},[n]);let b=(null==g?void 0:g.servers)||[],S=b.filter(e=>"running"!==e.status),C=b.filter(e=>"running"===e.status);return(0,t.jsx)(u.Z,{open:n,onClose:y?void 0:c,maxWidth:"sm",fullWidth:!0,children:(0,t.jsxs)("form",{onSubmit:e=>{e.preventDefault(),p&&v(r,p)},children:[(0,t.jsxs)(x.Z,{children:["Assign World: ",r]}),(0,t.jsx)(h.Z,{children:(0,t.jsx)(i.Z,{sx:{display:"flex",flexDirection:"column",gap:2,pt:1},children:Z?(0,t.jsx)(i.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,t.jsx)(a.Z,{})}):0===b.length?(0,t.jsx)(d.Z,{color:"text.secondary",children:"No servers available. Create a server first."}):(0,t.jsxs)(t.Fragment,{children:[0===S.length&&C.length>0&&(0,t.jsx)(o.Z,{severity:"warning",children:"All servers are currently running. It is recommended to assign worlds to stopped servers."}),(0,t.jsxs)(f.Z,{label:"Select Server",select:!0,value:p,onChange:e=>j(e.target.value),fullWidth:!0,disabled:y,helperText:"Select a server to assign this world to",children:[S.length>0&&(0,t.jsx)(Q.Z,{disabled:!0,children:(0,t.jsx)(d.Z,{variant:"caption",color:"text.secondary",children:"Available Servers"})}),S.map(e=>(0,t.jsx)(Q.Z,{value:e.name,children:e.name},e.name)),C.length>0&&(0,t.jsx)(Q.Z,{disabled:!0,children:(0,t.jsx)(d.Z,{variant:"caption",color:"text.secondary",children:"Running Servers (not recommended)"})}),C.map(e=>(0,t.jsx)(Q.Z,{value:e.name,children:e.name},e.name))]})]})})}),(0,t.jsxs)(m.Z,{sx:{px:3,pb:2},children:[(0,t.jsx)(l.Z,{onClick:c,disabled:y,children:"Cancel"}),(0,t.jsx)(l.Z,{type:"submit",variant:"contained",disabled:y||!p||Z,startIcon:y?(0,t.jsx)(a.Z,{size:16}):null,children:y?"Assigning...":"Assign"})]})]})})}function E(){var e,n,r,j;let[g,Z]=(0,s.useState)(!1),[b,S]=(0,s.useState)(null),[C,w]=(0,s.useState)(null),[k,q]=(0,s.useState)(""),[I,F]=(0,s.useState)([]),{data:L,isLoading:D,error:K}=(0,A.Sr)(),N=(0,A.hy)(),W=(0,A.nq)(),z=(0,A.g2)(),O=(0,A.Fv)(),Q=async e=>{F(n=>[...n,e]);try{await z.mutateAsync({worldName:e})}catch(e){console.error("Failed to release world:",e)}finally{F(n=>n.filter(n=>n!==e))}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(c.Z,{elevation:0,sx:{mb:4,p:3,background:e=>"linear-gradient(135deg, ".concat((0,v.Fq)(e.palette.success.main,.1)," 0%, ").concat((0,v.Fq)(e.palette.primary.main,.1)," 100%)"),borderRadius:2,border:e=>"1px solid ".concat((0,v.Fq)(e.palette.success.main,.2)),display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,t.jsxs)(i.Z,{sx:{display:"flex",alignItems:"center",gap:2},children:[(0,t.jsx)(i.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:56,height:56,borderRadius:2,bgcolor:"success.main",color:"success.contrastText"},children:(0,t.jsx)(p.Z,{sx:{fontSize:32}})}),(0,t.jsxs)(i.Z,{children:[(0,t.jsx)(d.Z,{variant:"h4",component:"h1",fontWeight:"bold",children:"Worlds"}),(0,t.jsx)(d.Z,{variant:"body1",color:"text.secondary",children:"Manage your Minecraft worlds"})]})]}),(0,t.jsx)(l.Z,{variant:"contained",startIcon:(0,t.jsx)(y.Z,{}),onClick:()=>Z(!0),size:"large",children:"Create World"})]}),K&&(0,t.jsxs)(o.Z,{severity:"error",sx:{mb:3},children:["Failed to load worlds: ",K.message]}),N.isError&&(0,t.jsxs)(o.Z,{severity:"error",sx:{mb:3},children:["Failed to create world: ",null===(e=N.error)||void 0===e?void 0:e.message]}),W.isError&&(0,t.jsxs)(o.Z,{severity:"error",sx:{mb:3},children:["Failed to assign world: ",null===(n=W.error)||void 0===n?void 0:n.message]}),z.isError&&(0,t.jsxs)(o.Z,{severity:"error",sx:{mb:3},children:["Failed to release world: ",null===(r=z.error)||void 0===r?void 0:r.message]}),O.isError&&(0,t.jsxs)(o.Z,{severity:"error",sx:{mb:3},children:["Failed to delete world: ",null===(j=O.error)||void 0===j?void 0:j.message]}),D?(0,t.jsx)(i.Z,{sx:{display:"flex",justifyContent:"center",py:8},children:(0,t.jsx)(a.Z,{})}):(0,t.jsx)(T,{worlds:(null==L?void 0:L.worlds)||[],onAssign:e=>S(e),onRelease:Q,onDelete:e=>{w(e),q("")},onCreate:()=>Z(!0),loadingWorlds:I}),(0,t.jsx)(P,{open:g,onClose:()=>{Z(!1),N.reset()},onSubmit:e=>{N.mutate(e,{onSuccess:()=>{Z(!1)}})},loading:N.isPending}),(0,t.jsx)(R,{open:!!b,worldName:b||"",onClose:()=>S(null),onSubmit:(e,n)=>{F(n=>[...n,e]),W.mutate({worldName:e,serverName:n},{onSuccess:()=>{S(null)},onSettled:()=>{F(n=>n.filter(n=>n!==e))}})},loading:W.isPending}),(0,t.jsxs)(u.Z,{open:!!C,onClose:()=>{w(null),q("")},maxWidth:"sm",fullWidth:!0,children:[(0,t.jsx)(x.Z,{children:"Delete World"}),(0,t.jsxs)(h.Z,{children:[(0,t.jsxs)(d.Z,{sx:{mb:2},children:["This action cannot be undone. Type ",(0,t.jsx)("strong",{children:C})," to confirm deletion."]}),(0,t.jsx)(f.Z,{label:"World name",value:k,onChange:e=>q(e.target.value),fullWidth:!0,autoFocus:!0})]}),(0,t.jsxs)(m.Z,{sx:{px:3,pb:2},children:[(0,t.jsx)(l.Z,{onClick:()=>{w(null),q("")},children:"Cancel"}),(0,t.jsx)(l.Z,{variant:"contained",color:"error",onClick:()=>{C&&k===C&&(F(e=>[...e,C]),O.mutate({name:C,force:!0},{onSuccess:()=>{w(null),q("")},onSettled:()=>{F(e=>e.filter(e=>e!==C))}}))},disabled:k!==C||O.isPending,startIcon:O.isPending?(0,t.jsx)(a.Z,{size:16}):null,children:O.isPending?"Deleting...":"Delete"})]})]})]})}},42936:function(e,n,r){"use strict";async function t(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={...n.headers};n.body&&(r["Content-Type"]="application/json");let t=await fetch(e,{...n,headers:r});if(!t.ok){let e=await t.json().catch(()=>({error:"UnknownError",message:t.statusText})),n=Error(e.message);throw n.statusCode=t.status,n.code=e.error,n}return t.json()}r.d(n,{SC:function(){return t}})},92666:function(e,n,r){"use strict";r.d(n,{$t:function(){return S},Aw:function(){return u},Fv:function(){return y},Hq:function(){return c},Hy:function(){return a},MH:function(){return j},Sr:function(){return h},_I:function(){return x},c5:function(){return C},g2:function(){return v},gx:function(){return g},hy:function(){return m},iC:function(){return p},jM:function(){return d},mj:function(){return b},nq:function(){return f},nv:function(){return Z},s8:function(){return w},x$:function(){return o}});var t=r(5632),s=r(58919),i=r(20367),l=r(42936);function o(){return(0,t.a)({queryKey:["servers"],queryFn:()=>(0,l.SC)("/api/servers"),refetchInterval:6e4})}function a(e,n){return(0,t.a)({queryKey:["servers",e],queryFn:()=>(0,l.SC)("/api/servers/".concat(encodeURIComponent(e))),enabled:(null==n?void 0:n.enabled)!==!1&&!!e,refetchInterval:3e4})}function c(){let e=(0,s.NL)();return(0,i.D)({mutationFn:e=>{let{name:n,force:r}=e;return(0,l.SC)("/api/servers/".concat(encodeURIComponent(n)).concat(r?"?force=true":""),{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:["servers"]})}})}function d(){let e=(0,s.NL)();return(0,i.D)({mutationFn:e=>(0,l.SC)("/api/servers/".concat(encodeURIComponent(e),"/start"),{method:"POST"}),onSuccess:(n,r)=>{e.invalidateQueries({queryKey:["servers"]}),e.invalidateQueries({queryKey:["servers",r]})}})}function u(){let e=(0,s.NL)();return(0,i.D)({mutationFn:e=>(0,l.SC)("/api/servers/".concat(encodeURIComponent(e),"/stop"),{method:"POST"}),onSuccess:(n,r)=>{e.invalidateQueries({queryKey:["servers"]}),e.invalidateQueries({queryKey:["servers",r]})}})}function x(){let e=(0,s.NL)();return(0,i.D)({mutationFn:e=>(0,l.SC)("/api/servers/".concat(encodeURIComponent(e),"/restart"),{method:"POST"}),onSuccess:(n,r)=>{e.invalidateQueries({queryKey:["servers"]}),e.invalidateQueries({queryKey:["servers",r]})}})}function h(){return(0,t.a)({queryKey:["worlds"],queryFn:()=>(0,l.SC)("/api/worlds"),refetchInterval:3e4})}function m(){let e=(0,s.NL)();return(0,i.D)({mutationFn:e=>(0,l.SC)("/api/worlds",{method:"POST",body:JSON.stringify(e)}),onSuccess:()=>{e.invalidateQueries({queryKey:["worlds"]})}})}function f(){let e=(0,s.NL)();return(0,i.D)({mutationFn:e=>{let{worldName:n,serverName:r}=e;return(0,l.SC)("/api/worlds/".concat(encodeURIComponent(n),"/assign"),{method:"POST",body:JSON.stringify({serverName:r})})},onSuccess:()=>{e.invalidateQueries({queryKey:["worlds"]}),e.invalidateQueries({queryKey:["servers"]})}})}function v(){let e=(0,s.NL)();return(0,i.D)({mutationFn:e=>{let{worldName:n,force:r}=e;return(0,l.SC)("/api/worlds/".concat(encodeURIComponent(n),"/release").concat(r?"?force=true":""),{method:"POST"})},onSuccess:()=>{e.invalidateQueries({queryKey:["worlds"]})}})}function y(){let e=(0,s.NL)();return(0,i.D)({mutationFn:e=>{let{name:n,force:r}=e;return(0,l.SC)("/api/worlds/".concat(encodeURIComponent(n)).concat(r?"?force=true":""),{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:["worlds"]})}})}function p(e,n){return(0,t.a)({queryKey:["servers",e,"config"],queryFn:()=>(0,l.SC)("/api/servers/".concat(encodeURIComponent(e),"/config")),enabled:(null==n?void 0:n.enabled)!==!1&&!!e})}function j(){let e=(0,s.NL)();return(0,i.D)({mutationFn:e=>{let{serverName:n,config:r}=e;return(0,l.SC)("/api/servers/".concat(encodeURIComponent(n),"/config"),{method:"PATCH",body:JSON.stringify(r)})},onSuccess:(n,r)=>{let{serverName:t}=r;e.invalidateQueries({queryKey:["servers",t,"config"]}),e.invalidateQueries({queryKey:["servers",t]})}})}function g(){let e=(0,s.NL)();return(0,i.D)({mutationFn:e=>(0,l.SC)("/api/servers/".concat(encodeURIComponent(e),"/world/reset"),{method:"POST"}),onSuccess:(n,r)=>{e.invalidateQueries({queryKey:["servers",r]}),e.invalidateQueries({queryKey:["worlds"]})}})}function Z(){return(0,t.a)({queryKey:["router-status"],queryFn:()=>(0,l.SC)("/api/router/status"),refetchInterval:3e4})}function b(){return(0,t.a)({queryKey:["backup-status"],queryFn:()=>(0,l.SC)("/api/backup"),refetchInterval:6e4})}function S(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20;return(0,t.a)({queryKey:["backup-history",e],queryFn:()=>(0,l.SC)("/api/backup/history?limit=".concat(e)),refetchInterval:6e4})}function C(){let e=(0,s.NL)();return(0,i.D)({mutationFn:e=>{let{message:n}=e;return(0,l.SC)("/api/backup",{method:"POST",body:JSON.stringify({message:n})})},onSuccess:()=>{e.invalidateQueries({queryKey:["backup-status"]}),e.invalidateQueries({queryKey:["backup-history"]})}})}function w(){let e=(0,s.NL)();return(0,i.D)({mutationFn:e=>(0,l.SC)("/api/backup/restore",{method:"POST",body:JSON.stringify({commitHash:e})}),onSuccess:()=>{e.invalidateQueries({queryKey:["worlds"]}),e.invalidateQueries({queryKey:["servers"]})}})}}},function(e){e.O(0,[6812,9760,6758,680,1668,7436,1071,540,4416,9810,7073,880,6909,190,3669,2757,1744],function(){return e(e.s=6199)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9674],{18890:function(e,t,r){Promise.resolve().then(r.bind(r,53693))},71185:function(e,t,r){"use strict";var i=r(8091);t.Z=void 0;var n=i(r(66758)),l=r(94655);t.Z=(0,n.default)((0,l.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close")},69123:function(e,t,r){"use strict";var i=r(32324),n=r(81500),l=r(35106),a=r(70316),o=r(65951),s=r(64577),c=r(34519),d=r(28057),u=r(16945),h=r(94655);let x=["absolute","children","className","component","flexItem","light","orientation","role","textAlign","variant"],Z=e=>{let{absolute:t,children:r,classes:i,flexItem:n,light:l,orientation:a,textAlign:s,variant:c}=e;return(0,o.Z)({root:["root",t&&"absolute",c,l&&"light","vertical"===a&&"vertical",n&&"flexItem",r&&"withChildren",r&&"vertical"===a&&"withChildrenVertical","right"===s&&"vertical"!==a&&"textAlignRight","left"===s&&"vertical"!==a&&"textAlignLeft"],wrapper:["wrapper","vertical"===a&&"wrapperVertical"]},u.V,i)},m=(0,c.ZP)("div",{name:"MuiDivider",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,r.absolute&&t.absolute,t[r.variant],r.light&&t.light,"vertical"===r.orientation&&t.vertical,r.flexItem&&t.flexItem,r.children&&t.withChildren,r.children&&"vertical"===r.orientation&&t.withChildrenVertical,"right"===r.textAlign&&"vertical"!==r.orientation&&t.textAlignRight,"left"===r.textAlign&&"vertical"!==r.orientation&&t.textAlignLeft]}})(e=>{let{theme:t,ownerState:r}=e;return(0,n.Z)({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(t.vars||t).palette.divider,borderBottomWidth:"thin"},r.absolute&&{position:"absolute",bottom:0,left:0,width:"100%"},r.light&&{borderColor:t.vars?"rgba(".concat(t.vars.palette.dividerChannel," / 0.08)"):(0,s.Fq)(t.palette.divider,.08)},"inset"===r.variant&&{marginLeft:72},"middle"===r.variant&&"horizontal"===r.orientation&&{marginLeft:t.spacing(2),marginRight:t.spacing(2)},"middle"===r.variant&&"vertical"===r.orientation&&{marginTop:t.spacing(1),marginBottom:t.spacing(1)},"vertical"===r.orientation&&{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"},r.flexItem&&{alignSelf:"stretch",height:"auto"})},e=>{let{ownerState:t}=e;return(0,n.Z)({},t.children&&{display:"flex",whiteSpace:"nowrap",textAlign:"center",border:0,borderTopStyle:"solid",borderLeftStyle:"solid","&::before, &::after":{content:'""',alignSelf:"center"}})},e=>{let{theme:t,ownerState:r}=e;return(0,n.Z)({},r.children&&"vertical"!==r.orientation&&{"&::before, &::after":{width:"100%",borderTop:"thin solid ".concat((t.vars||t).palette.divider),borderTopStyle:"inherit"}})},e=>{let{theme:t,ownerState:r}=e;return(0,n.Z)({},r.children&&"vertical"===r.orientation&&{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:"thin solid ".concat((t.vars||t).palette.divider),borderLeftStyle:"inherit"}})},e=>{let{ownerState:t}=e;return(0,n.Z)({},"right"===t.textAlign&&"vertical"!==t.orientation&&{"&::before":{width:"90%"},"&::after":{width:"10%"}},"left"===t.textAlign&&"vertical"!==t.orientation&&{"&::before":{width:"10%"},"&::after":{width:"90%"}})}),v=(0,c.ZP)("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.wrapper,"vertical"===r.orientation&&t.wrapperVertical]}})(e=>{let{theme:t,ownerState:r}=e;return(0,n.Z)({display:"inline-block",paddingLeft:"calc(".concat(t.spacing(1)," * 1.2)"),paddingRight:"calc(".concat(t.spacing(1)," * 1.2)")},"vertical"===r.orientation&&{paddingTop:"calc(".concat(t.spacing(1)," * 1.2)"),paddingBottom:"calc(".concat(t.spacing(1)," * 1.2)")})}),f=l.forwardRef(function(e,t){let r=(0,d.i)({props:e,name:"MuiDivider"}),{absolute:l=!1,children:o,className:s,component:c=o?"div":"hr",flexItem:u=!1,light:f=!1,orientation:p="horizontal",role:g="hr"!==c?"separator":void 0,textAlign:j="center",variant:b="fullWidth"}=r,y=(0,i.Z)(r,x),w=(0,n.Z)({},r,{absolute:l,component:c,flexItem:u,light:f,orientation:p,role:g,textAlign:j,variant:b}),C=Z(w);return(0,h.jsx)(m,(0,n.Z)({as:c,className:(0,a.Z)(C.root,s),role:g,ref:t,ownerState:w},y,{children:o?(0,h.jsx)(v,{className:C.wrapper,ownerState:w,children:o}):null}))});f.muiSkipListHighlight=!0,t.Z=f},16945:function(e,t,r){"use strict";r.d(t,{V:function(){return l}});var i=r(11379),n=r(9049);function l(e){return(0,n.ZP)("MuiDivider",e)}let a=(0,i.Z)("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]);t.Z=a},53281:function(e,t,r){"use strict";r.d(t,{Z:function(){return f}});var i=r(81500),n=r(32324),l=r(35106),a=r(70316),o=r(65951),s=r(28057),c=r(34519),d=r(11379),u=r(9049);function h(e){return(0,u.ZP)("MuiTableContainer",e)}(0,d.Z)("MuiTableContainer",["root"]);var x=r(94655);let Z=["className","component"],m=e=>{let{classes:t}=e;return(0,o.Z)({root:["root"]},h,t)},v=(0,c.ZP)("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(e,t)=>t.root})({width:"100%",overflowX:"auto"});var f=l.forwardRef(function(e,t){let r=(0,s.i)({props:e,name:"MuiTableContainer"}),{className:l,component:o="div"}=r,c=(0,n.Z)(r,Z),d=(0,i.Z)({},r,{component:o}),u=m(d);return(0,x.jsx)(v,(0,i.Z)({ref:t,as:o,className:(0,a.Z)(u.root,l),ownerState:d},c))})},11254:function(e,t,r){"use strict";r.d(t,{Z:function(){return j}});var i=r(81500),n=r(32324),l=r(35106),a=r(70316),o=r(65951),s=r(70210),c=r(28057),d=r(34519),u=r(11379),h=r(9049);function x(e){return(0,h.ZP)("MuiTableHead",e)}(0,u.Z)("MuiTableHead",["root"]);var Z=r(94655);let m=["className","component"],v=e=>{let{classes:t}=e;return(0,o.Z)({root:["root"]},x,t)},f=(0,d.ZP)("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-header-group"}),p={variant:"head"},g="thead";var j=l.forwardRef(function(e,t){let r=(0,c.i)({props:e,name:"MuiTableHead"}),{className:l,component:o=g}=r,d=(0,n.Z)(r,m),u=(0,i.Z)({},r,{component:o}),h=v(u);return(0,Z.jsx)(s.Z.Provider,{value:p,children:(0,Z.jsx)(f,(0,i.Z)({as:o,className:(0,a.Z)(h.root,l),ref:t,role:o===g?null:"rowgroup",ownerState:u},d))})})},53693:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return R}});var i=r(94655),n=r(35106),l=r(7281),a=r(93017),o=r(81071),s=r(31317),c=r(5632),d=r(6986),u=r(53281),h=r(69899),x=r(21138),Z=r(11254),m=r(70366),v=r(47001),f=r(84811),p=r(25333);function g(e){let{users:t,onUserClick:r}=e;return 0===t.length?(0,i.jsx)(l.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"200px",p:4},children:(0,i.jsx)(s.Z,{variant:"body1",color:"text.secondary",children:"No users found"})}):(0,i.jsx)(u.Z,{component:h.Z,children:(0,i.jsxs)(x.Z,{children:[(0,i.jsx)(Z.Z,{children:(0,i.jsxs)(m.Z,{children:[(0,i.jsx)(v.Z,{children:"Email"}),(0,i.jsx)(v.Z,{children:"Name"}),(0,i.jsx)(v.Z,{children:"Role"}),(0,i.jsx)(v.Z,{children:"Status"}),(0,i.jsx)(v.Z,{children:"Created At"})]})}),(0,i.jsx)(f.Z,{children:t.map(e=>(0,i.jsxs)(m.Z,{hover:!0,onClick:()=>r(e),sx:{cursor:"pointer"},children:[(0,i.jsx)(v.Z,{children:e.email}),(0,i.jsx)(v.Z,{children:e.name||"N/A"}),(0,i.jsx)(v.Z,{children:"admin"===e.role?(0,i.jsx)(p.Z,{label:"Admin",color:"primary",size:"small"}):(0,i.jsx)(p.Z,{label:"User",size:"small"})}),(0,i.jsx)(v.Z,{children:e.banned?(0,i.jsx)(p.Z,{label:"Banned",color:"error",size:"small"}):(0,i.jsx)(p.Z,{label:"Active",color:"success",size:"small"})}),(0,i.jsx)(v.Z,{children:new Date(e.createdAt).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1})})]},e.id))})]})})}var j=r(99770),b=r(62508),y=r(79983),w=r(5682),C=r(69123),A=r(71185);function S(e){let{user:t,open:r,onClose:n}=e;return(0,i.jsxs)(j.Z,{open:r,onClose:n,maxWidth:"sm",fullWidth:!0,children:[(0,i.jsx)(b.Z,{children:(0,i.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,i.jsx)(s.Z,{variant:"h6",children:"User Details"}),(0,i.jsx)(y.Z,{onClick:n,size:"small","aria-label":"close",children:(0,i.jsx)(A.Z,{})})]})}),(0,i.jsx)(w.Z,{children:(0,i.jsxs)(l.Z,{sx:{display:"flex",flexDirection:"column",gap:2},children:[(0,i.jsxs)(l.Z,{children:[(0,i.jsx)(s.Z,{variant:"caption",color:"text.secondary",children:"Email"}),(0,i.jsx)(s.Z,{variant:"body1",children:t.email})]}),(0,i.jsxs)(l.Z,{children:[(0,i.jsx)(s.Z,{variant:"caption",color:"text.secondary",children:"Name"}),(0,i.jsx)(s.Z,{variant:"body1",children:t.name||"N/A"})]}),(0,i.jsxs)(l.Z,{children:[(0,i.jsx)(s.Z,{variant:"caption",color:"text.secondary",children:"Role"}),(0,i.jsx)(l.Z,{sx:{mt:.5},children:"admin"===t.role?(0,i.jsx)(p.Z,{label:"Admin",color:"primary",size:"small"}):(0,i.jsx)(p.Z,{label:"User",size:"small"})})]}),(0,i.jsxs)(l.Z,{children:[(0,i.jsx)(s.Z,{variant:"caption",color:"text.secondary",children:"Status"}),(0,i.jsx)(l.Z,{sx:{mt:.5},children:t.banned?(0,i.jsx)(p.Z,{label:"Banned",color:"error",size:"small"}):(0,i.jsx)(p.Z,{label:"Active",color:"success",size:"small"})})]}),(0,i.jsx)(C.Z,{}),(0,i.jsxs)(l.Z,{children:[(0,i.jsx)(s.Z,{variant:"caption",color:"text.secondary",children:"Created At"}),(0,i.jsx)(s.Z,{variant:"body2",children:new Date(t.createdAt).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1})})]}),(0,i.jsxs)(l.Z,{children:[(0,i.jsx)(s.Z,{variant:"caption",color:"text.secondary",children:"User ID"}),(0,i.jsx)(s.Z,{variant:"body2",sx:{fontFamily:"monospace",fontSize:"0.875rem"},children:t.id})]})]})})]})}function R(){let{data:e,isLoading:t,isError:r,error:u}=(0,c.a)({queryKey:["admin","users"],queryFn:async()=>{let{data:e,error:t}=await d.zB.listUsers({query:{}});if(t)throw Error(t.message||"Failed to fetch users");return(null==e?void 0:e.users)?e.users.map(e=>{var t,r,i;return{id:e.id,email:e.email,name:null!==(t=e.name)&&void 0!==t?t:null,role:null!==(r=e.role)&&void 0!==r?r:"user",banned:null!==(i=e.banned)&&void 0!==i&&i,createdAt:new Date(e.createdAt)}}):[]}}),[h,x]=(0,n.useState)(null);return t?(0,i.jsx)(l.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"400px"},children:(0,i.jsx)(a.Z,{})}):r?(0,i.jsx)(l.Z,{sx:{p:3},children:(0,i.jsxs)(o.Z,{severity:"error",children:["Failed to load users. ",(null==u?void 0:u.message)||"Please try again later."]})}):(0,i.jsxs)(l.Z,{sx:{p:3},children:[(0,i.jsx)(s.Z,{variant:"h4",component:"h1",gutterBottom:!0,children:"User Management"}),(0,i.jsx)(g,{users:e||[],onUserClick:e=>{x(e)}}),h&&(0,i.jsx)(S,{user:h,open:!0,onClose:()=>{x(null)}})]})}},6986:function(e,t,r){"use strict";r.d(t,{Cp:function(){return h},Nq:function(){return u},cg:function(){return o},kP:function(){return d},w7:function(){return s},y1:function(){return c},zB:function(){return x}});var i=r(77054),n=r(61648),l=r(35016);let a=(0,i.X)({baseURL:l.env.NEXT_PUBLIC_BETTER_AUTH_URL||"",plugins:[(0,n.zB)()]}),{signIn:o,signOut:s,signUp:c,useSession:d,updateUser:u,changePassword:h}=a,x=a.admin}},function(e){e.O(0,[6812,9760,6758,680,1071,540,4416,2542,880,9654,3669,2757,1744],function(){return e(e.s=18890)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2626],{40527:function(e,r,t){Promise.resolve().then(t.bind(t,10672))},628:function(e,r,t){"use strict";t.d(r,{Z:function(){return g}});var n=t(81500),s=t(32324),i=t(35106),a=t(70316),l=t(65951),o=t(34519),d=t(28057),u=t(69899),c=t(11379),x=t(9049);function h(e){return(0,x.ZP)("MuiCard",e)}(0,c.Z)("MuiCard",["root"]);var m=t(94655);let p=["className","raised"],f=e=>{let{classes:r}=e;return(0,l.Z)({root:["root"]},h,r)},Z=(0,o.ZP)(u.Z,{name:"MuiCard",slot:"Root",overridesResolver:(e,r)=>r.root})(()=>({overflow:"hidden"}));var g=i.forwardRef(function(e,r){let t=(0,d.i)({props:e,name:"MuiCard"}),{className:i,raised:l=!1}=t,o=(0,s.Z)(t,p),u=(0,n.Z)({},t,{raised:l}),c=f(u);return(0,m.jsx)(Z,(0,n.Z)({className:(0,a.Z)(c.root,i),elevation:l?8:void 0,ref:r,ownerState:u},o))})},41565:function(e,r,t){"use strict";t.d(r,{Z:function(){return Z}});var n=t(81500),s=t(32324),i=t(35106),a=t(70316),l=t(65951),o=t(34519),d=t(28057),u=t(11379),c=t(9049);function x(e){return(0,c.ZP)("MuiCardContent",e)}(0,u.Z)("MuiCardContent",["root"]);var h=t(94655);let m=["className","component"],p=e=>{let{classes:r}=e;return(0,l.Z)({root:["root"]},x,r)},f=(0,o.ZP)("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(e,r)=>r.root})(()=>({padding:16,"&:last-child":{paddingBottom:24}}));var Z=i.forwardRef(function(e,r){let t=(0,d.i)({props:e,name:"MuiCardContent"}),{className:i,component:l="div"}=t,o=(0,s.Z)(t,m),u=(0,n.Z)({},t,{component:l}),c=p(u);return(0,h.jsx)(f,(0,n.Z)({as:l,className:(0,a.Z)(c.root,i),ownerState:u,ref:r},o))})},10672:function(e,r,t){"use strict";t.r(r),t.d(r,{default:function(){return h}});var n=t(94655),s=t(74228),i=t(67337),a=t(7281),l=t(628),o=t(41565),d=t(31317),u=t(41261),c=t(85480),x=t(46725);function h(){let e=(0,s.useRouter)();return(0,n.jsx)(i.Z,{maxWidth:"sm",children:(0,n.jsx)(a.Z,{sx:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",py:4},children:(0,n.jsx)(l.Z,{sx:{width:"100%",maxWidth:500},children:(0,n.jsxs)(o.Z,{sx:{p:4},children:[(0,n.jsx)(d.Z,{variant:"h4",component:"h1",gutterBottom:!0,sx:{fontWeight:600,textAlign:"center",mb:3},children:"Welcome Back"}),(0,n.jsx)(d.Z,{variant:"body2",color:"text.secondary",sx:{textAlign:"center",mb:4},children:"Sign in to manage your Minecraft servers"}),(0,n.jsx)(c.U0,{onSuccess:()=>{e.push("/dashboard")}}),(0,n.jsx)(a.Z,{sx:{mt:3,textAlign:"center"},children:(0,n.jsxs)(d.Z,{variant:"body2",color:"text.secondary",children:["Don't have an account?"," ",(0,n.jsx)(u.Z,{component:x.default,href:"/signup",underline:"hover",children:"Sign up"})]})})]})})})})}},85480:function(e,r,t){"use strict";t.d(r,{U0:function(){return m},WS:function(){return p},Ie:function(){return q}});var n=t(94655),s=t(35106),i=t(7281),a=t(81071),l=t(97436),o=t(52082),d=t(79983),u=t(30417),c=t(36848),x=t(554),h=t(6986);function m(e){let{onSuccess:r}=e,[t,m]=(0,s.useState)(""),[p,f]=(0,s.useState)(""),[Z,g]=(0,s.useState)(!1),[j,v]=(0,s.useState)({}),[y,b]=(0,s.useState)(null),[C,w]=(0,s.useState)(!1),S=()=>{let e={};return t?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)||(e.email="Invalid email address"):e.email="Email is required",p||(e.password="Password is required"),v(e),0===Object.keys(e).length},P=async e=>{if(e.preventDefault(),b(null),S()){w(!0);try{let e=await h.cg.email({email:t,password:p});if(e.error){b(e.error.message||"Invalid credentials"),w(!1);return}r&&r()}catch(e){b("An unexpected error occurred. Please try again."),w(!1)}}};return(0,n.jsxs)(i.Z,{component:"form",onSubmit:P,sx:{display:"flex",flexDirection:"column",gap:2},children:[y&&(0,n.jsx)(a.Z,{severity:"error",onClose:()=>b(null),children:y}),(0,n.jsx)(l.Z,{label:"Email",type:"email",value:t,onChange:e=>m(e.target.value),error:!!j.email,helperText:j.email,disabled:C,fullWidth:!0,required:!0}),(0,n.jsx)(l.Z,{label:"Password",type:Z?"text":"password",value:p,onChange:e=>f(e.target.value),error:!!j.password,helperText:j.password,disabled:C,fullWidth:!0,required:!0,InputProps:{endAdornment:(0,n.jsx)(o.Z,{position:"end",children:(0,n.jsx)(d.Z,{"aria-label":"toggle password visibility",onClick:()=>{g(!Z)},edge:"end",children:Z?(0,n.jsx)(c.Z,{}):(0,n.jsx)(x.Z,{})})})}}),(0,n.jsx)(u.Z,{type:"submit",variant:"contained",color:"primary",disabled:C,fullWidth:!0,size:"large",children:C?"Signing in...":"Sign In"})]})}function p(e){let{onSuccess:r}=e,[t,m]=(0,s.useState)(""),[p,f]=(0,s.useState)(""),[Z,g]=(0,s.useState)(""),[j,v]=(0,s.useState)(""),[y,b]=(0,s.useState)(!1),[C,w]=(0,s.useState)(!1),[S,P]=(0,s.useState)({}),[k,W]=(0,s.useState)(null),[q,I]=(0,s.useState)(!1),R=()=>{let e={};return t||(e.name="Name is required"),p?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(p)||(e.email="Invalid email address"):e.email="Email is required",Z?Z.length<8&&(e.password="Password must be at least 8 characters"):e.password="Password is required",j?Z!==j&&(e.confirmPassword="Passwords do not match"):e.confirmPassword="Please confirm your password",P(e),0===Object.keys(e).length},U=async e=>{if(e.preventDefault(),W(null),R()){I(!0);try{let e=await h.y1.email({email:p,password:Z,name:t});if(e.error){W(e.error.message||"Registration failed"),I(!1);return}r&&r()}catch(e){W("An unexpected error occurred. Please try again."),I(!1)}}};return(0,n.jsxs)(i.Z,{component:"form",onSubmit:U,sx:{display:"flex",flexDirection:"column",gap:2},children:[k&&(0,n.jsx)(a.Z,{severity:"error",onClose:()=>W(null),children:k}),(0,n.jsx)(l.Z,{label:"Name",type:"text",value:t,onChange:e=>m(e.target.value),error:!!S.name,helperText:S.name,disabled:q,fullWidth:!0,required:!0}),(0,n.jsx)(l.Z,{label:"Email",type:"email",value:p,onChange:e=>f(e.target.value),error:!!S.email,helperText:S.email,disabled:q,fullWidth:!0,required:!0}),(0,n.jsx)(l.Z,{label:"Password",type:y?"text":"password",value:Z,onChange:e=>g(e.target.value),error:!!S.password,helperText:S.password,disabled:q,fullWidth:!0,required:!0,InputProps:{endAdornment:(0,n.jsx)(o.Z,{position:"end",children:(0,n.jsx)(d.Z,{"aria-label":"toggle password visibility",onClick:()=>{b(!y)},edge:"end",children:y?(0,n.jsx)(c.Z,{}):(0,n.jsx)(x.Z,{})})})}}),(0,n.jsx)(l.Z,{label:"Confirm Password",type:C?"text":"password",value:j,onChange:e=>v(e.target.value),error:!!S.confirmPassword,helperText:S.confirmPassword,disabled:q,fullWidth:!0,required:!0,InputProps:{endAdornment:(0,n.jsx)(o.Z,{position:"end",children:(0,n.jsx)(d.Z,{"aria-label":"toggle password visibility",onClick:()=>{w(!C)},edge:"end",children:C?(0,n.jsx)(c.Z,{}):(0,n.jsx)(x.Z,{})})})}}),(0,n.jsx)(u.Z,{type:"submit",variant:"contained",color:"primary",disabled:q,fullWidth:!0,size:"large",children:q?"Creating account...":"Sign Up"})]})}var f=t(74228),Z=t(93017),g=t(86702),j=t(35694),v=t(31317),y=t(25333),b=t(69123),C=t(7178),w=t(17820),S=t(73424),P=t(25169),k=t(41094),W=t(78319);function q(){let e=(0,f.useRouter)(),{data:r,isPending:t}=(0,h.kP)(),[a,l]=(0,s.useState)(null),o=()=>{l(null)},c=async()=>{o(),await (0,h.w7)(),e.push("/login")};if(t)return(0,n.jsx)(i.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:(0,n.jsx)(Z.Z,{size:24})});if(!(null==r?void 0:r.user))return(0,n.jsx)(u.Z,{variant:"contained",color:"primary",onClick:()=>{e.push("/login")},children:"Sign In"});let{user:x}=r,m=((e,r)=>{if(e){let r=e.split(" ");return r.length>=2?"".concat(r[0][0]).concat(r[1][0]).toUpperCase():e.substring(0,2).toUpperCase()}return r?r[0].toUpperCase():"?"})(x.name,x.email);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(d.Z,{onClick:e=>{l(e.currentTarget)},"aria-label":"user menu",children:(0,n.jsx)(g.Z,{sx:{bgcolor:"primary.main"},children:m})}),(0,n.jsxs)(j.Z,{anchorEl:a,open:!!a,onClose:o,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},sx:{mt:1},children:[(0,n.jsxs)(i.Z,{sx:{px:2,py:1.5,minWidth:200},children:[(0,n.jsx)(v.Z,{variant:"subtitle1",fontWeight:"600",children:x.name||"User"}),(0,n.jsx)(v.Z,{variant:"body2",color:"text.secondary",children:x.email}),"admin"===x.role&&(0,n.jsx)(y.Z,{label:"Admin",size:"small",color:"primary",sx:{mt:1}})]}),(0,n.jsx)(b.Z,{}),"admin"===x.role&&(0,n.jsxs)(C.Z,{onClick:()=>{o(),e.push("/admin/users")},children:[(0,n.jsx)(w.Z,{children:(0,n.jsx)(P.Z,{fontSize:"small"})}),(0,n.jsx)(S.Z,{children:"Users"})]}),(0,n.jsxs)(C.Z,{onClick:()=>{o(),e.push("/settings")},children:[(0,n.jsx)(w.Z,{children:(0,n.jsx)(k.Z,{fontSize:"small"})}),(0,n.jsx)(S.Z,{children:"Settings"})]}),(0,n.jsxs)(C.Z,{onClick:c,children:[(0,n.jsx)(w.Z,{children:(0,n.jsx)(W.Z,{fontSize:"small"})}),(0,n.jsx)(S.Z,{children:"Logout"})]})]})]})}},6986:function(e,r,t){"use strict";t.d(r,{Cp:function(){return x},Nq:function(){return c},cg:function(){return l},kP:function(){return u},w7:function(){return o},y1:function(){return d},zB:function(){return h}});var n=t(77054),s=t(61648),i=t(35016);let a=(0,n.X)({baseURL:i.env.NEXT_PUBLIC_BETTER_AUTH_URL||"",plugins:[(0,s.zB)()]}),{signIn:l,signOut:o,signUp:d,useSession:u,updateUser:c,changePassword:x}=a,h=a.admin}},function(e){e.O(0,[6812,9760,6758,680,1668,7436,1071,2542,55,6857,1544,563,3669,2757,1744],function(){return e(e.s=40527)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1931],{54985:function(e,n,u){Promise.resolve().then(u.bind(u,26854))},74228:function(e,n,u){"use strict";var r=u(73310);u.o(r,"useParams")&&u.d(n,{useParams:function(){return r.useParams}}),u.o(r,"usePathname")&&u.d(n,{usePathname:function(){return r.usePathname}}),u.o(r,"useRouter")&&u.d(n,{useRouter:function(){return r.useRouter}}),u.o(r,"useSearchParams")&&u.d(n,{useSearchParams:function(){return r.useSearchParams}}),u.o(r,"useServerInsertedHTML")&&u.d(n,{useServerInsertedHTML:function(){return r.useServerInsertedHTML}})},26854:function(e,n,u){"use strict";u.r(n),u.d(n,{default:function(){return c}});var r=u(94655),t=u(35106),s=u(74228),a=u(7281),i=u(93017),o=u(6986);function c(){let e=(0,s.useRouter)(),{data:n,isPending:u}=(0,o.kP)();return(0,t.useEffect)(()=>{u||((null==n?void 0:n.user)?e.push("/dashboard"):e.push("/login"))},[n,u,e]),(0,r.jsx)(a.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"100vh"},children:(0,r.jsx)(i.Z,{})})}},6986:function(e,n,u){"use strict";u.d(n,{Cp:function(){return h},Nq:function(){return d},cg:function(){return i},kP:function(){return f},w7:function(){return o},y1:function(){return c},zB:function(){return l}});var r=u(77054),t=u(61648),s=u(35016);let a=(0,r.X)({baseURL:s.env.NEXT_PUBLIC_BETTER_AUTH_URL||"",plugins:[(0,t.zB)()]}),{signIn:i,signOut:o,signUp:c,useSession:f,updateUser:d,changePassword:h}=a,l=a.admin}},function(e){e.O(0,[6812,9760,2542,3669,2757,1744],function(){return e(e.s=54985)}),_N_E=e.O()}]);
|