@minecraft-docker/mcctl-console 1.13.0 → 1.14.0
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/platform/services/mcctl-console/.next/BUILD_ID +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/app-build-manifest.json +134 -102
- 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 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/backups/page.js.nft.json +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/backups/page_client-reference-manifest.js +1 -0
- 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 +51 -1
- 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)/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.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/_not-found/page.js.nft.json +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/api/backup/history/route.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/backup/history/route.js.nft.json +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/backup/restore/route.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/backup/restore/route.js.nft.json +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/backup/route.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/backup/route.js.nft.json +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/players/ban/route.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/players/kick/route.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/players/op/route.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/players/route.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/players/whitelist/route.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/router/status/route.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/servers/[name]/[action]/route.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/servers/[name]/config/route.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/servers/[name]/exec/route.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/servers/[name]/route.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/servers/[name]/world/reset/route.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/servers/route.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/user-servers/[id]/route.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/user-servers/[id]/route.js.nft.json +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/user-servers/route.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/user-servers/route.js.nft.json +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/users/route.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/users/route.js.nft.json +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/worlds/[name]/[action]/route.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/worlds/[name]/route.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/worlds/route.js +1 -1
- 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 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/backups.meta +5 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/backups.rsc +18 -0
- 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 +1 -1
- 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.js.nft.json +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/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 +18 -11
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/3029.js +51 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/3076.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/3100.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/4972.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/5244.js +74 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/5466.js +2 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/613.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/8243.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/9157.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/9350.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/959.js +1 -1
- 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/1071-235049df1c3caba7.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/1476-a0570078fdf78fae.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/2022-6da2f9a847a5d61c.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/2093-bceea213e32f6b5f.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/212-b904d9ae152f2360.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/2149-ba1bdd1d726ab70c.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/2537-6c9d2dfd403b7448.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/310-72d3b802b3cefa99.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/315-509f963f6c69d0a8.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/3543-1ec838cbe59f6baa.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/406-64ea09489141e436.js +1 -0
- package/.next/{static/chunks/4538-b363c77f66f5a771.js → standalone/platform/services/mcctl-console/.next/static/chunks/4538-a0d2c88024f1288a.js} +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/4840-5802e869ffd1d2a9.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/5511-7a419d84918a8d64.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/6189-d8557db379604b3e.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/6594-e49e36eb5a5d1bef.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/6645-68b73fe1df8dba93.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/6655-81288236c1babc44.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/7413-419718450fadde21.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/{6803-e2b09f75f207f836.js → 8006-219c9bbc650b079e.js} +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/8322-8ae826d4c9b38acc.js +1 -0
- package/.next/{static/chunks/8657-ace229edcbef958f.js → standalone/platform/services/mcctl-console/.next/static/chunks/8657-f28db4e9df8cc7b0.js} +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/8696-8adf1e9b1a84f5c0.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/9030-1dcbf06ed6e20e24.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/9654-84c0d7b06321aab9.js +1 -0
- package/.next/{static/chunks/app/(main)/audit-logs/page-a85c5c81b5ef7100.js → standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/audit-logs/page-7a5d1441bb2811cf.js} +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/backups/page-cc46681d519753dd.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/dashboard/page-b548fe2aac951e5b.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/layout-9311354243420c0d.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/players/page-706f5e796129df33.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/routing/page-14f40cfd98e60a77.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/servers/[name]/console/{page-b25581705b8b2277.js → page-ca0344337ef5da93.js} +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/servers/[name]/page-55fee1f878b51fb8.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/servers/page-efa5f11aa2956719.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/worlds/page-3de10e94b77f6e45.js +1 -0
- package/.next/{static/chunks/app/login/page-39f136cf2697cefc.js → standalone/platform/services/mcctl-console/.next/static/chunks/app/login/page-3ad9d595e6c37214.js} +1 -1
- package/.next/{static/chunks/app/signup/page-9c69da79dac7dff9.js → standalone/platform/services/mcctl-console/.next/static/chunks/app/signup/page-69a8bc2df6bc3559.js} +1 -1
- package/.next/{static/chunks/main-34a19e4bc5b0f28c.js → standalone/platform/services/mcctl-console/.next/static/chunks/main-43f98b458d773ca0.js} +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/css/8dfdea5f9ccf5da4.css +1 -0
- package/.next/static/chunks/1071-235049df1c3caba7.js +1 -0
- package/.next/static/chunks/1476-a0570078fdf78fae.js +1 -0
- package/.next/static/chunks/2022-6da2f9a847a5d61c.js +1 -0
- package/.next/static/chunks/2093-bceea213e32f6b5f.js +1 -0
- package/.next/static/chunks/212-b904d9ae152f2360.js +1 -0
- package/.next/static/chunks/2149-ba1bdd1d726ab70c.js +1 -0
- package/.next/static/chunks/2537-6c9d2dfd403b7448.js +1 -0
- package/.next/static/chunks/310-72d3b802b3cefa99.js +1 -0
- package/.next/static/chunks/315-509f963f6c69d0a8.js +1 -0
- package/.next/static/chunks/3543-1ec838cbe59f6baa.js +1 -0
- package/.next/static/chunks/406-64ea09489141e436.js +1 -0
- package/.next/{standalone/platform/services/mcctl-console/.next/static/chunks/4538-b363c77f66f5a771.js → static/chunks/4538-a0d2c88024f1288a.js} +1 -1
- package/.next/static/chunks/4840-5802e869ffd1d2a9.js +1 -0
- package/.next/static/chunks/5511-7a419d84918a8d64.js +1 -0
- package/.next/static/chunks/6189-d8557db379604b3e.js +1 -0
- package/.next/static/chunks/6594-e49e36eb5a5d1bef.js +1 -0
- package/.next/static/chunks/6645-68b73fe1df8dba93.js +1 -0
- package/.next/static/chunks/6655-81288236c1babc44.js +1 -0
- package/.next/static/chunks/7413-419718450fadde21.js +1 -0
- package/.next/static/chunks/{6803-e2b09f75f207f836.js → 8006-219c9bbc650b079e.js} +1 -1
- package/.next/static/chunks/8322-8ae826d4c9b38acc.js +1 -0
- package/.next/{standalone/platform/services/mcctl-console/.next/static/chunks/8657-ace229edcbef958f.js → static/chunks/8657-f28db4e9df8cc7b0.js} +1 -1
- package/.next/static/chunks/8696-8adf1e9b1a84f5c0.js +1 -0
- package/.next/static/chunks/9030-1dcbf06ed6e20e24.js +1 -0
- package/.next/static/chunks/9654-84c0d7b06321aab9.js +1 -0
- package/.next/{standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/audit-logs/page-a85c5c81b5ef7100.js → static/chunks/app/(main)/audit-logs/page-7a5d1441bb2811cf.js} +1 -1
- package/.next/static/chunks/app/(main)/backups/page-cc46681d519753dd.js +1 -0
- package/.next/static/chunks/app/(main)/dashboard/page-b548fe2aac951e5b.js +1 -0
- package/.next/static/chunks/app/(main)/layout-9311354243420c0d.js +1 -0
- package/.next/static/chunks/app/(main)/players/page-706f5e796129df33.js +1 -0
- package/.next/static/chunks/app/(main)/routing/page-14f40cfd98e60a77.js +1 -0
- package/.next/static/chunks/app/(main)/servers/[name]/console/{page-b25581705b8b2277.js → page-ca0344337ef5da93.js} +1 -1
- package/.next/static/chunks/app/(main)/servers/[name]/page-55fee1f878b51fb8.js +1 -0
- package/.next/static/chunks/app/(main)/servers/page-efa5f11aa2956719.js +1 -0
- package/.next/static/chunks/app/(main)/worlds/page-3de10e94b77f6e45.js +1 -0
- package/.next/{standalone/platform/services/mcctl-console/.next/static/chunks/app/login/page-39f136cf2697cefc.js → static/chunks/app/login/page-3ad9d595e6c37214.js} +1 -1
- package/.next/{standalone/platform/services/mcctl-console/.next/static/chunks/app/signup/page-9c69da79dac7dff9.js → static/chunks/app/signup/page-69a8bc2df6bc3559.js} +1 -1
- package/.next/{standalone/platform/services/mcctl-console/.next/static/chunks/main-34a19e4bc5b0f28c.js → static/chunks/main-43f98b458d773ca0.js} +1 -1
- package/.next/static/css/8dfdea5f9ccf5da4.css +1 -0
- package/package.json +2 -2
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/1277.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/1990.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/2612.js +0 -51
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/3003.js +0 -52
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/5211.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/7427.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/9374.js +0 -74
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/1044-6a0c0a7f6bac9f18.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/1604-89bbfa231d141dfe.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/1692-e2b4fd0b6bff20c2.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/1826-ce6a4d6a0e4ba9bd.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/1857-8bb2c9883e08cdee.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/2537-a2a6d99925a2f67e.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/2590-b868e035d36b0545.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/2609-03ed3c8604060401.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/3418-6f5e8a8a4b7ab70c.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/4136-c4b760387b52c47c.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/4507-e0145a1cb67c26c3.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/5375-5a2ae74444004be4.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/5382-af8412c783dd977e.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/6357-42a429de7d961f53.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/6877-7a90baa4093abc8d.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/7340-99d68f86a8108252.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/8063-134a13770297c002.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/8809-974009fa7800dfcd.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/9409-171ee4b34553d85a.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/dashboard/page-2755e6f9daa86325.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/layout-2849792531fd0eac.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/players/page-2d0dc6a87f23e622.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/routing/page-bbfb7b031b828115.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/servers/[name]/page-36951c10705b7f9a.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/servers/page-886b5fabf41e5c65.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/worlds/page-f04eb3d1fe4c68df.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/css/ce1ae78c22152744.css +0 -1
- package/.next/static/chunks/1044-6a0c0a7f6bac9f18.js +0 -1
- package/.next/static/chunks/1604-89bbfa231d141dfe.js +0 -1
- package/.next/static/chunks/1692-e2b4fd0b6bff20c2.js +0 -1
- package/.next/static/chunks/1826-ce6a4d6a0e4ba9bd.js +0 -1
- package/.next/static/chunks/1857-8bb2c9883e08cdee.js +0 -1
- package/.next/static/chunks/2537-a2a6d99925a2f67e.js +0 -1
- package/.next/static/chunks/2590-b868e035d36b0545.js +0 -1
- package/.next/static/chunks/2609-03ed3c8604060401.js +0 -1
- package/.next/static/chunks/3418-6f5e8a8a4b7ab70c.js +0 -1
- package/.next/static/chunks/4136-c4b760387b52c47c.js +0 -1
- package/.next/static/chunks/4507-e0145a1cb67c26c3.js +0 -1
- package/.next/static/chunks/5375-5a2ae74444004be4.js +0 -1
- package/.next/static/chunks/5382-af8412c783dd977e.js +0 -1
- package/.next/static/chunks/6357-42a429de7d961f53.js +0 -1
- package/.next/static/chunks/6877-7a90baa4093abc8d.js +0 -1
- package/.next/static/chunks/7340-99d68f86a8108252.js +0 -1
- package/.next/static/chunks/8063-134a13770297c002.js +0 -1
- package/.next/static/chunks/8809-974009fa7800dfcd.js +0 -1
- package/.next/static/chunks/9409-171ee4b34553d85a.js +0 -1
- package/.next/static/chunks/app/(main)/dashboard/page-2755e6f9daa86325.js +0 -1
- package/.next/static/chunks/app/(main)/layout-2849792531fd0eac.js +0 -1
- package/.next/static/chunks/app/(main)/players/page-2d0dc6a87f23e622.js +0 -1
- package/.next/static/chunks/app/(main)/routing/page-bbfb7b031b828115.js +0 -1
- package/.next/static/chunks/app/(main)/servers/[name]/page-36951c10705b7f9a.js +0 -1
- package/.next/static/chunks/app/(main)/servers/page-886b5fabf41e5c65.js +0 -1
- package/.next/static/chunks/app/(main)/worlds/page-f04eb3d1fe4c68df.js +0 -1
- package/.next/static/css/ce1ae78c22152744.css +0 -1
- /package/.next/standalone/platform/services/mcctl-console/.next/static/{Liy7QkeEpyjPtxhvsF9oz → 8BG9m6JnLqB8k8011EMcp}/_buildManifest.js +0 -0
- /package/.next/standalone/platform/services/mcctl-console/.next/static/{Liy7QkeEpyjPtxhvsF9oz → 8BG9m6JnLqB8k8011EMcp}/_ssgManifest.js +0 -0
- /package/.next/static/{Liy7QkeEpyjPtxhvsF9oz → 8BG9m6JnLqB8k8011EMcp}/_buildManifest.js +0 -0
- /package/.next/static/{Liy7QkeEpyjPtxhvsF9oz → 8BG9m6JnLqB8k8011EMcp}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9654],{21138:function(e,t,a){a.d(t,{Z:function(){return m}});var r=a(32324),o=a(81500),n=a(35106),i=a(70316),l=a(65951),d=a(73450),c=a(28057),s=a(34519),p=a(11379),u=a(9049);function g(e){return(0,u.ZP)("MuiTable",e)}(0,p.Z)("MuiTable",["root","stickyHeader"]);var v=a(94655);let y=["className","component","padding","size","stickyHeader"],f=e=>{let{classes:t,stickyHeader:a}=e;return(0,l.Z)({root:["root",a&&"stickyHeader"]},g,t)},h=(0,s.ZP)("table",{name:"MuiTable",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:a}=e;return[t.root,a.stickyHeader&&t.stickyHeader]}})(e=>{let{theme:t,ownerState:a}=e;return(0,o.Z)({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":(0,o.Z)({},t.typography.body2,{padding:t.spacing(2),color:(t.vars||t).palette.text.secondary,textAlign:"left",captionSide:"bottom"})},a.stickyHeader&&{borderCollapse:"separate"})}),Z="table";var m=n.forwardRef(function(e,t){let a=(0,c.i)({props:e,name:"MuiTable"}),{className:l,component:s=Z,padding:p="normal",size:u="medium",stickyHeader:g=!1}=a,m=(0,r.Z)(a,y),b=(0,o.Z)({},a,{component:s,padding:p,size:u,stickyHeader:g}),x=f(b),k=n.useMemo(()=>({padding:p,size:u,stickyHeader:g}),[p,u,g]);return(0,v.jsx)(d.Z.Provider,{value:k,children:(0,v.jsx)(h,(0,o.Z)({as:s,role:s===Z?null:"table",ref:t,className:(0,i.Z)(x.root,l),ownerState:b},m))})})},73450:function(e,t,a){let r=a(35106).createContext();t.Z=r},70210:function(e,t,a){let r=a(35106).createContext();t.Z=r},84811:function(e,t,a){a.d(t,{Z:function(){return b}});var r=a(81500),o=a(32324),n=a(35106),i=a(70316),l=a(65951),d=a(70210),c=a(28057),s=a(34519),p=a(11379),u=a(9049);function g(e){return(0,u.ZP)("MuiTableBody",e)}(0,p.Z)("MuiTableBody",["root"]);var v=a(94655);let y=["className","component"],f=e=>{let{classes:t}=e;return(0,l.Z)({root:["root"]},g,t)},h=(0,s.ZP)("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-row-group"}),Z={variant:"body"},m="tbody";var b=n.forwardRef(function(e,t){let a=(0,c.i)({props:e,name:"MuiTableBody"}),{className:n,component:l=m}=a,s=(0,o.Z)(a,y),p=(0,r.Z)({},a,{component:l}),u=f(p);return(0,v.jsx)(d.Z.Provider,{value:Z,children:(0,v.jsx)(h,(0,r.Z)({className:(0,i.Z)(u.root,n),as:l,ref:t,role:l===m?null:"rowgroup",ownerState:p},s))})})},47001:function(e,t,a){a.d(t,{Z:function(){return k}});var r=a(32324),o=a(81500),n=a(35106),i=a(70316),l=a(65951),d=a(64577),c=a(38762),s=a(73450),p=a(70210),u=a(28057),g=a(34519),v=a(11379),y=a(9049);function f(e){return(0,y.ZP)("MuiTableCell",e)}let h=(0,v.Z)("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]);var Z=a(94655);let m=["align","className","component","padding","scope","size","sortDirection","variant"],b=e=>{let{classes:t,variant:a,align:r,padding:o,size:n,stickyHeader:i}=e,d={root:["root",a,i&&"stickyHeader","inherit"!==r&&"align".concat((0,c.Z)(r)),"normal"!==o&&"padding".concat((0,c.Z)(o)),"size".concat((0,c.Z)(n))]};return(0,l.Z)(d,f,t)},x=(0,g.ZP)("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:a}=e;return[t.root,t[a.variant],t["size".concat((0,c.Z)(a.size))],"normal"!==a.padding&&t["padding".concat((0,c.Z)(a.padding))],"inherit"!==a.align&&t["align".concat((0,c.Z)(a.align))],a.stickyHeader&&t.stickyHeader]}})(e=>{let{theme:t,ownerState:a}=e;return(0,o.Z)({},t.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:t.vars?"1px solid ".concat(t.vars.palette.TableCell.border):"1px solid\n ".concat("light"===t.palette.mode?(0,d.$n)((0,d.Fq)(t.palette.divider,1),.88):(0,d._j)((0,d.Fq)(t.palette.divider,1),.68)),textAlign:"left",padding:16},"head"===a.variant&&{color:(t.vars||t).palette.text.primary,lineHeight:t.typography.pxToRem(24),fontWeight:t.typography.fontWeightMedium},"body"===a.variant&&{color:(t.vars||t).palette.text.primary},"footer"===a.variant&&{color:(t.vars||t).palette.text.secondary,lineHeight:t.typography.pxToRem(21),fontSize:t.typography.pxToRem(12)},"small"===a.size&&{padding:"6px 16px",["&.".concat(h.paddingCheckbox)]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}},"checkbox"===a.padding&&{width:48,padding:"0 0 0 4px"},"none"===a.padding&&{padding:0},"left"===a.align&&{textAlign:"left"},"center"===a.align&&{textAlign:"center"},"right"===a.align&&{textAlign:"right",flexDirection:"row-reverse"},"justify"===a.align&&{textAlign:"justify"},a.stickyHeader&&{position:"sticky",top:0,zIndex:2,backgroundColor:(t.vars||t).palette.background.default})});var k=n.forwardRef(function(e,t){let a;let l=(0,u.i)({props:e,name:"MuiTableCell"}),{align:d="inherit",className:c,component:g,padding:v,scope:y,size:f,sortDirection:h,variant:k}=l,C=(0,r.Z)(l,m),w=n.useContext(s.Z),R=n.useContext(p.Z),T=R&&"head"===R.variant,M=y;"td"===(a=g||(T?"th":"td"))?M=void 0:!M&&T&&(M="col");let H=k||R&&R.variant,z=(0,o.Z)({},l,{align:d,component:a,padding:v||(w&&w.padding?w.padding:"normal"),size:f||(w&&w.size?w.size:"medium"),sortDirection:h,stickyHeader:"head"===H&&w&&w.stickyHeader,variant:H}),N=b(z),P=null;return h&&(P="asc"===h?"ascending":"descending"),(0,Z.jsx)(x,(0,o.Z)({as:a,ref:t,className:(0,i.Z)(N.root,c),"aria-sort":P,scope:M,ownerState:z},C))})},70366:function(e,t,a){a.d(t,{Z:function(){return b}});var r=a(81500),o=a(32324),n=a(35106),i=a(70316),l=a(65951),d=a(64577),c=a(70210),s=a(28057),p=a(34519),u=a(11379),g=a(9049);function v(e){return(0,g.ZP)("MuiTableRow",e)}let y=(0,u.Z)("MuiTableRow",["root","selected","hover","head","footer"]);var f=a(94655);let h=["className","component","hover","selected"],Z=e=>{let{classes:t,selected:a,hover:r,head:o,footer:n}=e;return(0,l.Z)({root:["root",a&&"selected",r&&"hover",o&&"head",n&&"footer"]},v,t)},m=(0,p.ZP)("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:a}=e;return[t.root,a.head&&t.head,a.footer&&t.footer]}})(e=>{let{theme:t}=e;return{color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,["&.".concat(y.hover,":hover")]:{backgroundColor:(t.vars||t).palette.action.hover},["&.".concat(y.selected)]:{backgroundColor:t.vars?"rgba(".concat(t.vars.palette.primary.mainChannel," / ").concat(t.vars.palette.action.selectedOpacity,")"):(0,d.Fq)(t.palette.primary.main,t.palette.action.selectedOpacity),"&:hover":{backgroundColor:t.vars?"rgba(".concat(t.vars.palette.primary.mainChannel," / calc(").concat(t.vars.palette.action.selectedOpacity," + ").concat(t.vars.palette.action.hoverOpacity,"))"):(0,d.Fq)(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity)}}}});var b=n.forwardRef(function(e,t){let a=(0,s.i)({props:e,name:"MuiTableRow"}),{className:l,component:d="tr",hover:p=!1,selected:u=!1}=a,g=(0,o.Z)(a,h),v=n.useContext(c.Z),y=(0,r.Z)({},a,{component:d,hover:p,selected:u,head:v&&"head"===v.variant,footer:v&&"footer"===v.variant}),b=Z(y);return(0,f.jsx)(m,(0,r.Z)({as:d,ref:t,className:(0,i.Z)(b.root,l),role:"tr"===d?null:"row",ownerState:y},g))})}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4743],{3590:function(e,t,r){Promise.resolve().then(r.bind(r,52791))},52791:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return eS}});var n=r(94655),s=r(35106),i=r(74228),a=r(7281),o=r(69899),l=r(31317),c=r(25333),d=r(76492),u=r(80620),x=r(78439),h=r(56813),m=r(26892),p=r(84840),g=r(628),j=r(41565),f=r(10721),v=r(69178),y=r(46207),Z=r(45354),b=r(35847);function S(e){var t,r,s;let{stats:i,isLoading:o}=e;if(o)return(0,n.jsx)(p.ZP,{container:!0,spacing:2,children:[0,1,2,3].map(e=>(0,n.jsx)(p.ZP,{item:!0,xs:6,md:3,children:(0,n.jsx)(g.Z,{children:(0,n.jsxs)(j.Z,{children:[(0,n.jsx)(f.Z,{variant:"text",width:"60%"}),(0,n.jsx)(f.Z,{variant:"text",width:"40%",height:40}),(0,n.jsx)(f.Z,{variant:"text",width:"80%"})]})})},e))});let c=null!==(t=null==i?void 0:i.total)&&void 0!==t?t:0,d=c>0?((null!==(r=null==i?void 0:i.byStatus.success)&&void 0!==r?r:0)/c*100).toFixed(1):"0.0",u=null!==(s=null==i?void 0:i.byStatus.failure)&&void 0!==s?s:0,x=i?Object.keys(i.byActor).length:0,h=[{title:"Total Logs",value:c.toLocaleString(),icon:(0,n.jsx)(v.Z,{fontSize:"large"}),color:"#1bd96a",description:"All audit log entries"},{title:"Success Rate",value:"".concat(d,"%"),icon:(0,n.jsx)(y.Z,{fontSize:"large"}),color:"#22c55e",description:"Successful operations"},{title:"Failures",value:u,icon:(0,n.jsx)(Z.Z,{fontSize:"large"}),color:"#ef4444",description:"Failed operations"},{title:"Active Users",value:x,icon:(0,n.jsx)(b.Z,{fontSize:"large"}),color:"#3b82f6",description:"Unique actors"}];return(0,n.jsx)(p.ZP,{container:!0,spacing:2,children:h.map(e=>(0,n.jsx)(p.ZP,{item:!0,xs:6,md:3,children:(0,n.jsx)(g.Z,{sx:{height:"100%",position:"relative",overflow:"hidden","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,height:"4px",background:e.color}},children:(0,n.jsxs)(j.Z,{children:[(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:2},children:[(0,n.jsx)(l.Z,{variant:"body2",color:"text.secondary",sx:{fontWeight:500},children:e.title}),(0,n.jsx)(a.Z,{sx:{color:e.color,opacity:.8},children:e.icon})]}),(0,n.jsx)(l.Z,{variant:"h3",component:"div",sx:{fontWeight:700,color:"text.primary",mb:1},children:e.value}),(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",children:e.description})]})})},e.title))})}var C=r(97436),w=r(63696),T=r(7178),k=r(29793),z=r(36660),N=r(30417),R=r(87716),A=r(79983),E=r(89923),I=r(10297),F=r(50880),L=r(54617),D=r(42431),P=r(81960),W=r(84284),M=r(82925);function O(e){return"server"===e?M.Xn:"player"===e?M.KK:M.xg}function U(e){let t,{filters:r,onFiltersChange:i,onExport:o}=e,[d,u]=(0,s.useState)(!0),x=(t=0,r.action&&t++,r.actor&&t++,r.targetType&&t++,r.targetName&&t++,r.status&&t++,r.from&&t++,r.to&&t++,t),h=O(r.targetType),m=(e,t)=>{let n={...r};""===t||void 0===t?delete n[e]:n[e]=t,"targetType"===e&&n.action&&!O(t).includes(n.action)&&delete n.action,n.offset=0,i(n)};return(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:d?2:0},children:[(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,n.jsxs)(A.Z,{onClick:()=>u(!d),size:"small","aria-label":d?"Collapse filters":"Expand filters",children:[(0,n.jsx)(F.Z,{}),d?(0,n.jsx)(W.Z,{sx:{fontSize:14}}):(0,n.jsx)(P.Z,{sx:{fontSize:14}})]}),(0,n.jsx)(l.Z,{variant:"subtitle2",color:"text.secondary",children:"Filters"}),x>0&&(0,n.jsx)(c.Z,{label:x,size:"small",color:"primary",sx:{height:20,fontSize:"0.7rem"}})]}),(0,n.jsxs)(a.Z,{sx:{display:"flex",gap:1},children:[x>0&&(0,n.jsx)(N.Z,{size:"small",startIcon:(0,n.jsx)(L.Z,{}),onClick:()=>{i({limit:r.limit,sort:r.sort})},color:"inherit",children:"Clear All"}),o&&(0,n.jsx)(N.Z,{size:"small",variant:"outlined",onClick:o,children:"Export"})]})]}),(0,n.jsx)(R.Z,{in:d,children:(0,n.jsxs)(a.Z,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},gap:2,flexWrap:"wrap"},children:[(0,n.jsxs)(a.Z,{sx:{display:"flex",gap:1,alignItems:"center"},children:[(0,n.jsx)(C.Z,{type:"date",label:"From",size:"small",value:r.from?r.from.split("T")[0]:"",onChange:e=>{let t=e.target.value;m("from",t?"".concat(t,"T00:00:00Z"):void 0)},InputLabelProps:{shrink:!0},sx:{minWidth:150}}),(0,n.jsx)(l.Z,{variant:"body2",color:"text.secondary",children:"~"}),(0,n.jsx)(C.Z,{type:"date",label:"To",size:"small",value:r.to?r.to.split("T")[0]:"",onChange:e=>{let t=e.target.value;m("to",t?"".concat(t,"T23:59:59Z"):void 0)},InputLabelProps:{shrink:!0},sx:{minWidth:150}})]}),(0,n.jsxs)(k.Z,{size:"small",sx:{minWidth:160},children:[(0,n.jsx)(z.Z,{children:"Action"}),(0,n.jsxs)(w.Z,{value:r.action||"",label:"Action",onChange:e=>m("action",e.target.value||void 0),children:[(0,n.jsx)(T.Z,{value:"",children:"All Actions"}),h.map(e=>(0,n.jsx)(T.Z,{value:e,children:M.n3[e]||e},e))]})]}),(0,n.jsx)(a.Z,{children:(0,n.jsxs)(I.Z,{value:r.targetType||"",exclusive:!0,onChange:(e,t)=>m("targetType",t||void 0),size:"small",children:[(0,n.jsx)(E.Z,{value:"","aria-label":"All targets",children:"All"}),(0,n.jsx)(E.Z,{value:"server","aria-label":"Server targets",children:"Server"}),(0,n.jsx)(E.Z,{value:"player","aria-label":"Player targets",children:"Player"})]})}),(0,n.jsx)(a.Z,{children:(0,n.jsxs)(I.Z,{value:r.status||"",exclusive:!0,onChange:(e,t)=>m("status",t||void 0),size:"small",children:[(0,n.jsx)(E.Z,{value:"","aria-label":"All statuses",children:"All"}),(0,n.jsx)(E.Z,{value:"success","aria-label":"Success only",children:"Success"}),(0,n.jsx)(E.Z,{value:"failure","aria-label":"Failure only",children:"Failure"})]})}),(0,n.jsx)(C.Z,{label:"Target Name",placeholder:"Search...",size:"small",value:r.targetName||"",onChange:e=>m("targetName",e.target.value||void 0),InputProps:{startAdornment:(0,n.jsx)(D.Z,{sx:{color:"text.secondary",mr:.5,fontSize:18}})},sx:{minWidth:160}}),(0,n.jsx)(C.Z,{label:"Actor",placeholder:"e.g., api:admin",size:"small",value:r.actor||"",onChange:e=>m("actor",e.target.value||void 0),sx:{minWidth:140}})]})})]})}var q=r(21138),K=r(84811),_=r(47001),B=r(53281),V=r(11254),X=r(70366),J=r(6406),H=r(62590),G=r(56877),Q=r(89161),Y=r(60236),$=r(27171),ee=r(30114),et=r(46725);function er(e){var t,r;let{log:i,onClick:o}=e,[d,u]=(0,s.useState)("failure"===i.status),x=i.details&&Object.keys(i.details).length>0,p="failure"===i.status&&i.errorMessage,g=x||p,j=(t=i.targetType,r=i.targetName,"server"===t?"/servers/".concat(encodeURIComponent(r)):"player"===t?"/players":null);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(X.Z,{hover:!0,sx:{cursor:"pointer","&:last-child td, &:last-child th":{border:0}},onClick:()=>null==o?void 0:o(i),tabIndex:0,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),null==o||o(i))},role:"button","aria-label":"".concat(i.action," by ").concat(i.actor," on ").concat(i.targetName),children:[(0,n.jsx)(_.Z,{padding:"checkbox",sx:{width:48},children:g&&(0,n.jsx)(A.Z,{size:"small",onClick:e=>{e.stopPropagation(),u(!d)},"aria-label":d?"Collapse details":"Expand details",children:d?(0,n.jsx)(Y.Z,{}):(0,n.jsx)(Q.Z,{})})}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(H.Z,{title:function(e){let t=new Date(e);return 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(t)}(i.timestamp),arrow:!0,children:(0,n.jsx)(l.Z,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"nowrap"},children:function(e){let t=new Date,r=new Date(e),n=Math.floor((t.getTime()-r.getTime())/1e3),s=Math.floor(n/60),i=Math.floor(s/60),a=Math.floor(i/24);return n<60?"just now":s<60?"".concat(s,"m ago"):i<24?"".concat(i,"h ago"):a<7?"".concat(a,"d ago"):new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"}).format(r)}(i.timestamp)})})}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(h.I,{action:i.action})}),(0,n.jsx)(_.Z,{children:i.actor.startsWith("cli:")?(0,n.jsx)(c.Z,{label:i.actor.replace("cli:",""),size:"small",variant:"outlined",sx:{fontSize:"0.75rem"}}):(0,n.jsx)(l.Z,{variant:"body2",children:i.actor.replace("api:","")})}),(0,n.jsx)(_.Z,{children:(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center"},children:[function(e){switch(e){case"server":return(0,n.jsx)($.Z,{sx:{fontSize:16,mr:.5,color:"text.secondary"}});case"player":return(0,n.jsx)(ee.Z,{sx:{fontSize:16,mr:.5,color:"text.secondary"}});default:return null}}(i.targetType),j?(0,n.jsx)(et.default,{href:j,style:{textDecoration:"none"},onClick:e=>e.stopPropagation(),children:(0,n.jsx)(l.Z,{variant:"body2",sx:{color:"primary.main","&:hover":{textDecoration:"underline"}},children:i.targetName})}):(0,n.jsx)(l.Z,{variant:"body2",children:i.targetName})]})}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(m.c,{status:i.status})})]}),g&&(0,n.jsx)(X.Z,{children:(0,n.jsx)(_.Z,{sx:{py:0},colSpan:6,children:(0,n.jsx)(R.Z,{in:d,timeout:"auto",unmountOnExit:!0,children:(0,n.jsxs)(a.Z,{sx:{py:2,px:2},children:[p&&(0,n.jsx)(G.Z,{severity:"error",sx:{mb:2},children:i.errorMessage}),x&&(0,n.jsxs)(a.Z,{children:[(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",sx:{mb:1,display:"block"},children:"Details"}),(0,n.jsx)(q.Z,{size:"small",sx:{width:"auto"},children:(0,n.jsx)(K.Z,{children:Object.entries(i.details).map(e=>{let[t,r]=e;return(0,n.jsxs)(X.Z,{children:[(0,n.jsx)(_.Z,{sx:{fontWeight:600,color:"text.secondary",border:"none",py:.5,pl:0},children:t}),(0,n.jsx)(_.Z,{sx:{border:"none",py:.5},children:String(r)})]},t)})})})]})]})})})})]})}function en(e){let{logs:t,total:r,isLoading:s,error:i,filters:a,onFiltersChange:c,onRowClick:d,onRetry:u}=e,x=Math.floor((a.offset||0)/(a.limit||50)),h=a.limit||50;return s?(0,n.jsx)(o.Z,{children:(0,n.jsx)(B.Z,{children:(0,n.jsxs)(q.Z,{children:[(0,n.jsx)(V.Z,{children:(0,n.jsxs)(X.Z,{children:[(0,n.jsx)(_.Z,{padding:"checkbox"}),(0,n.jsx)(_.Z,{children:"Timestamp"}),(0,n.jsx)(_.Z,{children:"Action"}),(0,n.jsx)(_.Z,{children:"Actor"}),(0,n.jsx)(_.Z,{children:"Target"}),(0,n.jsx)(_.Z,{children:"Status"})]})}),(0,n.jsx)(K.Z,{children:[void 0,void 0,void 0,void 0,void 0].map((e,t)=>(0,n.jsxs)(X.Z,{children:[(0,n.jsx)(_.Z,{padding:"checkbox"}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(f.Z,{variant:"text",width:80})}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(f.Z,{variant:"rounded",width:70,height:24})}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(f.Z,{variant:"text",width:60})}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(f.Z,{variant:"text",width:100})}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(f.Z,{variant:"rounded",width:50,height:24})})]},t))})]})})}):i?(0,n.jsx)(G.Z,{severity:"error",action:u&&(0,n.jsx)(N.Z,{color:"inherit",size:"small",onClick:u,children:"Retry"}),children:i.message||"Failed to load audit logs"}):0===t.length?(0,n.jsxs)(o.Z,{sx:{p:6,textAlign:"center"},children:[(0,n.jsx)(v.Z,{sx:{fontSize:64,color:"text.disabled",mb:2}}),(0,n.jsx)(l.Z,{variant:"h6",color:"text.secondary",gutterBottom:!0,children:"No audit logs found"}),(0,n.jsx)(l.Z,{variant:"body2",color:"text.disabled",sx:{mb:2},children:"Try adjusting your filters or check back later."}),(0,n.jsx)(N.Z,{variant:"outlined",size:"small",onClick:()=>c({limit:a.limit,sort:a.sort}),children:"Reset Filters"})]}):(0,n.jsxs)(o.Z,{children:[(0,n.jsx)(B.Z,{sx:{overflowX:"auto"},children:(0,n.jsxs)(q.Z,{size:"small",children:[(0,n.jsx)(V.Z,{children:(0,n.jsxs)(X.Z,{children:[(0,n.jsx)(_.Z,{padding:"checkbox",sx:{width:48}}),(0,n.jsx)(_.Z,{sx:{fontWeight:600,whiteSpace:"nowrap"},children:"Timestamp"}),(0,n.jsx)(_.Z,{sx:{fontWeight:600},children:"Action"}),(0,n.jsx)(_.Z,{sx:{fontWeight:600},children:"Actor"}),(0,n.jsx)(_.Z,{sx:{fontWeight:600},children:"Target"}),(0,n.jsx)(_.Z,{sx:{fontWeight:600},children:"Status"})]})}),(0,n.jsx)(K.Z,{children:t.map(e=>(0,n.jsx)(er,{log:e,onClick:d},e.id))})]})}),(0,n.jsx)(J.Z,{component:"div",count:r,page:x,onPageChange:(e,t)=>{c({...a,offset:t*h})},rowsPerPage:h,onRowsPerPageChange:e=>{let t=parseInt(e.target.value,10);c({...a,limit:t,offset:0})},rowsPerPageOptions:[25,50,100],"aria-label":"Audit log pagination"})]})}var es=r(78765),ei=r(69123),ea=r(33402),eo=r(60097),el=r(90158),ec=r(58347),ed=r(73424),eu=r(93017),ex=r(71185),eh=r(84509);function em(e){let{logs:t}=e;return 0===t.length?(0,n.jsx)(l.Z,{variant:"body2",color:"text.secondary",sx:{py:2,textAlign:"center"},children:"No related logs found"}):(0,n.jsx)(el.Z,{dense:!0,sx:{py:0},children:t.map(e=>(0,n.jsx)(ec.ZP,{sx:{px:0,py:1,"&:not(:last-child)":{borderBottom:"1px solid",borderColor:"divider"}},children:(0,n.jsx)(ed.Z,{primary:(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,n.jsx)(h.I,{action:e.action,size:"small"}),e.targetName&&(0,n.jsx)(l.Z,{variant:"body2",color:"text.secondary",children:e.targetName})]}),secondary:function(e){let t=new Date,r=new Date(e),n=Math.floor((t.getTime()-r.getTime())/6e4),s=Math.floor(n/60);return n<60?"".concat(n,"m ago"):s<24?"".concat(s,"h ago"):"".concat(Math.floor(s/24),"d ago")}(e.timestamp)})},e.id))})}function ep(e){var t,r,i,o,c;let{log:d,open:u,onClose:x}=e,[p,g]=(0,s.useState)(0),{data:j,isLoading:f}=(0,eh.VM)(null!==(t=null==d?void 0:d.id)&&void 0!==t?t:null,{enabled:u&&!!d});return(0,n.jsxs)(es.ZP,{anchor:"right",open:u,onClose:x,sx:{"& .MuiDrawer-paper":{width:{xs:"100%",sm:420},maxWidth:"100%"}},children:[(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",p:2,borderBottom:"1px solid",borderColor:"divider"},children:[(0,n.jsx)(l.Z,{variant:"h6",component:"h2",children:"Audit Log Detail"}),(0,n.jsx)(A.Z,{onClick:x,"aria-label":"Close detail drawer",autoFocus:!0,children:(0,n.jsx)(ex.Z,{})})]}),(0,n.jsx)(a.Z,{sx:{p:2,overflow:"auto",flex:1},children:d?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:"ID"}),(0,n.jsx)(l.Z,{variant:"body2",sx:{fontFamily:"monospace",fontSize:"0.8rem",wordBreak:"break-all"},children:d.id})]}),(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:"Timestamp"}),(0,n.jsx)(l.Z,{variant:"body2",children:function(e){let t=new Date(e);return 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(t)}(d.timestamp)})]}),(0,n.jsxs)(a.Z,{sx:{display:"flex",gap:3,mb:3},children:[(0,n.jsxs)(a.Z,{children:[(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:"Action"}),(0,n.jsx)(h.I,{action:d.action,size:"medium"})]}),(0,n.jsxs)(a.Z,{children:[(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:"Status"}),(0,n.jsx)(m.c,{status:d.status,size:"medium"})]})]}),(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:"Actor"}),(0,n.jsx)(l.Z,{variant:"body2",children:d.actor})]}),(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:"Target"}),(0,n.jsxs)(l.Z,{variant:"body2",children:[d.targetType,"/",d.targetName]})]}),"failure"===d.status&&d.errorMessage&&(0,n.jsx)(G.Z,{severity:"error",sx:{mb:3},children:d.errorMessage}),d.details&&Object.keys(d.details).length>0&&(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsx)(ei.Z,{sx:{mb:2}}),(0,n.jsx)(l.Z,{variant:"subtitle2",sx:{mb:1},children:"Details"}),(0,n.jsx)(q.Z,{size:"small",children:(0,n.jsx)(K.Z,{children:Object.entries(d.details).map(e=>{let[t,r]=e;return(0,n.jsxs)(X.Z,{children:[(0,n.jsx)(_.Z,{sx:{fontWeight:600,color:"text.secondary",border:"none",py:.5,pl:0,width:"40%"},children:t}),(0,n.jsx)(_.Z,{sx:{border:"none",py:.5},children:String(r)})]},t)})})})]}),(0,n.jsx)(ei.Z,{sx:{mb:2}}),(0,n.jsx)(l.Z,{variant:"subtitle2",sx:{mb:1},children:"Related Logs"}),f?(0,n.jsx)(a.Z,{sx:{display:"flex",justifyContent:"center",py:3},children:(0,n.jsx)(eu.Z,{size:24})}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(ea.Z,{value:p,onChange:(e,t)=>g(t),sx:{mb:1},children:[(0,n.jsx)(eo.Z,{label:"Same Target (".concat(null!==(r=null==j?void 0:j.relatedLogs.sameTarget.length)&&void 0!==r?r:0,")"),sx:{textTransform:"none",fontSize:"0.8rem"}}),(0,n.jsx)(eo.Z,{label:"Same Actor (".concat(null!==(i=null==j?void 0:j.relatedLogs.sameActor.length)&&void 0!==i?i:0,")"),sx:{textTransform:"none",fontSize:"0.8rem"}})]}),0===p&&(0,n.jsx)(em,{logs:null!==(o=null==j?void 0:j.relatedLogs.sameTarget)&&void 0!==o?o:[]}),1===p&&(0,n.jsx)(em,{logs:null!==(c=null==j?void 0:j.relatedLogs.sameActor)&&void 0!==c?c:[]})]})]}):(0,n.jsx)(l.Z,{color:"text.secondary",children:"No log selected"})})]})}var eg=r(99770),ej=r(62508),ef=r(5682),ev=r(76678),ey=r(15761);function eZ(e){let{open:t,onClose:r,filters:i,totalCount:o}=e,[c,d]=(0,s.useState)("csv"),[u,x]=(0,s.useState)(!1),[h,m]=(0,s.useState)(null),p=function(e){let t=[];return e.action&&t.push("Action: ".concat(e.action)),e.actor&&t.push("Actor: ".concat(e.actor)),e.targetType&&t.push("Type: ".concat(e.targetType)),e.targetName&&t.push("Target: ".concat(e.targetName)),e.status&&t.push("Status: ".concat(e.status)),e.from&&t.push("From: ".concat(e.from.split("T")[0])),e.to&&t.push("To: ".concat(e.to.split("T")[0])),t}(i),g=async()=>{x(!0),m(null);try{let e=function(e,t){let r=new URLSearchParams;return r.set("format",t),e.action&&r.set("action",e.action),e.actor&&r.set("actor",e.actor),e.targetType&&r.set("targetType",e.targetType),e.targetName&&r.set("targetName",e.targetName),e.status&&r.set("status",e.status),e.from&&r.set("from",e.from),e.to&&r.set("to",e.to),"/api/audit-logs/export?".concat(r.toString())}(i,c),t=await fetch(e);if(!t.ok){let e=await t.json().catch(()=>({message:"Export failed"}));throw Error(e.message||"Export failed")}let n=await t.blob(),s=window.URL.createObjectURL(n),a=document.createElement("a");a.href=s;let o=t.headers.get("Content-Disposition"),l=null==o?void 0:o.match(/filename="?([^"]+)"?/);a.download=(null==l?void 0:l[1])||"audit-logs.".concat(c),document.body.appendChild(a),a.click(),document.body.removeChild(a),window.URL.revokeObjectURL(s),r()}catch(e){m(e instanceof Error?e.message:"Export failed")}finally{x(!1)}};return(0,n.jsxs)(eg.Z,{open:t,onClose:r,maxWidth:"sm",fullWidth:!0,children:[(0,n.jsx)(ej.Z,{children:"Export Audit Logs"}),(0,n.jsxs)(ef.Z,{children:[(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsx)(l.Z,{variant:"subtitle2",sx:{mb:1},children:"Format"}),(0,n.jsxs)(I.Z,{value:c,exclusive:!0,onChange:(e,t)=>t&&d(t),size:"small",children:[(0,n.jsx)(E.Z,{value:"csv",children:"CSV"}),(0,n.jsx)(E.Z,{value:"json",children:"JSON"})]})]}),(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsx)(l.Z,{variant:"subtitle2",sx:{mb:1},children:"Applied Filters"}),p.length>0?(0,n.jsx)(a.Z,{sx:{display:"flex",flexDirection:"column",gap:.5},children:p.map(e=>(0,n.jsx)(l.Z,{variant:"body2",color:"text.secondary",children:e},e))}):(0,n.jsx)(l.Z,{variant:"body2",color:"text.secondary",children:"No filters applied (all logs)"})]}),(0,n.jsxs)(a.Z,{sx:{mb:2},children:[(0,n.jsx)(l.Z,{variant:"subtitle2",sx:{mb:.5},children:"Estimated Rows"}),(0,n.jsxs)(l.Z,{variant:"body2",color:"text.secondary",children:[Math.min(o,5e3).toLocaleString()," rows"]})]}),o>5e3&&(0,n.jsxs)(G.Z,{severity:"warning",sx:{mb:2},children:["Export is limited to ",5e3.toLocaleString()," rows. Total matching logs: ",o.toLocaleString(),". Consider narrowing your filters for a complete export."]}),h&&(0,n.jsx)(G.Z,{severity:"error",sx:{mb:2},children:h})]}),(0,n.jsxs)(ev.Z,{children:[(0,n.jsx)(N.Z,{onClick:r,disabled:u,children:"Cancel"}),(0,n.jsx)(N.Z,{variant:"contained",startIcon:u?(0,n.jsx)(eu.Z,{size:16,color:"inherit"}):(0,n.jsx)(ey.Z,{}),onClick:g,disabled:u,children:u?"Exporting...":"Export ".concat(c.toUpperCase())})]})]})}var eb=r(93757);function eS(){var e,t,r;let h=(0,i.useRouter)(),m=(0,i.useSearchParams)(),[p,g]=(0,s.useState)(()=>(function(e){let t={},r=e.get("action"),n=e.get("actor"),s=e.get("targetType"),i=e.get("targetName"),a=e.get("status"),o=e.get("from"),l=e.get("to"),c=e.get("limit"),d=e.get("offset"),u=e.get("sort");return r&&(t.action=r),n&&(t.actor=n),s&&(t.targetType=s),i&&(t.targetName=i),a&&(t.status=a),o&&(t.from=o),l&&(t.to=l),c&&(t.limit=parseInt(c,10)),d&&(t.offset=parseInt(d,10)),("timestamp:asc"===u||"timestamp:desc"===u)&&(t.sort=u),t})(m)),[j,f]=(0,s.useState)(null),[v,y]=(0,s.useState)(!1),[Z,b]=(0,s.useState)(!1),[C,w]=(0,s.useState)(0),T=(0,s.useRef)(new Set),{data:k,isLoading:z,error:N,refetch:R}=(0,eh.hT)(p),{data:A,isLoading:E}=(0,eh.DM)(),{isConnected:I}=(0,eb.D)({url:"/api/audit-logs/stream",enabled:!0,onMessage:(0,s.useCallback)(e=>{if("audit-log"===e.type){let t=e.data;if("id"in t&&"string"==typeof t.id){if(T.current.has(t.id))return;if(T.current.add(t.id),T.current.size>1e3){let e=Array.from(T.current);T.current=new Set(e.slice(e.length-500))}}w(e=>e+1)}},[]),reconnectInterval:3e3,maxReconnectAttempts:1/0});(0,s.useEffect)(()=>{let e=function(e){let t=new URLSearchParams;e.action&&t.set("action",e.action),e.actor&&t.set("actor",e.actor),e.targetType&&t.set("targetType",e.targetType),e.targetName&&t.set("targetName",e.targetName),e.status&&t.set("status",e.status),e.from&&t.set("from",e.from),e.to&&t.set("to",e.to),e.limit&&50!==e.limit&&t.set("limit",String(e.limit)),e.offset&&e.offset>0&&t.set("offset",String(e.offset)),e.sort&&"timestamp:desc"!==e.sort&&t.set("sort",e.sort);let r=t.toString();return r?"?".concat(r):""}(p);e!==(m.toString()?"?".concat(m.toString()):"")&&h.replace("/audit-logs".concat(e),{scroll:!1})},[p,h,m]);let F=(0,s.useCallback)(e=>{g(e),w(0)},[]),L=(0,s.useCallback)(e=>{f(e),y(!0)},[]),D=(0,s.useCallback)(()=>{w(0),R()},[R]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.Z,{elevation:0,sx:{mb:4,p:3,background:e=>"linear-gradient(135deg, ".concat((0,d.Fq)(e.palette.primary.main,.1)," 0%, ").concat((0,d.Fq)(e.palette.secondary.main,.1)," 100%)"),borderRadius:2,border:e=>"1px solid ".concat((0,d.Fq)(e.palette.primary.main,.2))},children:(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:2},children:[(0,n.jsx)(a.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:56,height:56,borderRadius:2,bgcolor:"primary.main",color:"primary.contrastText"},children:(0,n.jsx)(u.Z,{sx:{fontSize:32}})}),(0,n.jsxs)(a.Z,{sx:{flex:1},children:[(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[(0,n.jsx)(l.Z,{variant:"h4",component:"h1",fontWeight:"bold",children:"Audit Log"}),(0,n.jsx)(c.Z,{icon:(0,n.jsx)(x.Z,{sx:{fontSize:10,color:I?"success.main":"text.disabled",animation:I?"pulse 2s infinite":"none","@keyframes pulse":{"0%":{opacity:1},"50%":{opacity:.4},"100%":{opacity:1}}}}),label:I?"Live":"Offline",size:"small",variant:"outlined",sx:{fontSize:"0.7rem"}})]}),(0,n.jsx)(l.Z,{variant:"body1",color:"text.secondary",children:"Monitor all management activities across your servers"})]})]})}),(0,n.jsx)(a.Z,{sx:{mb:3},children:(0,n.jsx)(S,{stats:A,isLoading:E})}),C>0&&(0,n.jsx)(a.Z,{sx:{mb:2,p:1.5,textAlign:"center",bgcolor:"primary.main",color:"primary.contrastText",borderRadius:1,cursor:"pointer","&:hover":{opacity:.9}},onClick:D,role:"button","aria-label":"".concat(C," new logs, click to refresh"),children:(0,n.jsxs)(l.Z,{variant:"body2",fontWeight:600,children:[C," new ",1===C?"log":"logs"," available - Click to refresh"]})}),(0,n.jsx)(U,{filters:p,onFiltersChange:F,onExport:()=>b(!0)}),(0,n.jsx)(en,{logs:null!==(e=null==k?void 0:k.logs)&&void 0!==e?e:[],total:null!==(t=null==k?void 0:k.total)&&void 0!==t?t:0,isLoading:z,error:N,filters:p,onFiltersChange:F,onRowClick:L,onRetry:()=>R()}),(0,n.jsx)(ep,{log:j,open:v,onClose:()=>{y(!1),f(null)}}),(0,n.jsx)(eZ,{open:Z,onClose:()=>b(!1),filters:p,totalCount:null!==(r=null==k?void 0:k.total)&&void 0!==r?r:0})]})}},56813:function(e,t,r){"use strict";r.d(t,{I:function(){return a}});var n=r(94655),s=r(25333),i=r(82925);function a(e){let{action:t,size:r="small"}=e,a=i.Lu[t]||"default",o=i.n3[t]||t;return(0,n.jsx)(s.Z,{label:o,color:a,size:r,variant:"filled",sx:{fontWeight:600,fontSize:"small"===r?"0.7rem":"0.8rem"}})}},26892:function(e,t,r){"use strict";r.d(t,{c:function(){return o}});var n=r(94655),s=r(25333),i=r(46207),a=r(43436);function o(e){let{status:t,size:r="small"}=e;return(0,n.jsx)(s.Z,{icon:"success"===t?(0,n.jsx)(i.Z,{}):(0,n.jsx)(a.Z,{}),label:"success"===t?"OK":"Error",color:"success"===t?"success":"error",size:r,variant:"outlined",sx:{fontWeight:500,fontSize:"small"===r?"0.7rem":"0.8rem"}})}},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}})},84509:function(e,t,r){"use strict";r.d(t,{DM:function(){return a},HZ:function(){return l},VM:function(){return o},hT:function(){return i},oL:function(){return c}});var n=r(5632),s=r(42936);function i(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=function(e){let t=new URLSearchParams;e.action&&t.set("action",e.action),e.actor&&t.set("actor",e.actor),e.targetType&&t.set("targetType",e.targetType),e.targetName&&t.set("targetName",e.targetName),e.status&&t.set("status",e.status),e.from&&t.set("from",e.from),e.to&&t.set("to",e.to),void 0!==e.limit&&t.set("limit",String(e.limit)),void 0!==e.offset&&t.set("offset",String(e.offset)),e.sort&&t.set("sort",e.sort);let r=t.toString();return r?"?".concat(r):""}(e);return(0,n.a)({queryKey:["audit-logs",e],queryFn:()=>(0,s.SC)("/api/audit-logs".concat(r)),enabled:(null==t?void 0:t.enabled)!==!1})}function a(e){return(0,n.a)({queryKey:["audit-logs","stats"],queryFn:()=>(0,s.SC)("/api/audit-logs/stats"),enabled:(null==e?void 0:e.enabled)!==!1,refetchInterval:3e4})}function o(e,t){return(0,n.a)({queryKey:["audit-logs",e],queryFn:()=>(0,s.SC)("/api/audit-logs/".concat(encodeURIComponent(e))),enabled:(null==t?void 0:t.enabled)!==!1&&!!e})}function l(e,t){var r;return i({targetType:"server",targetName:e,limit:null!==(r=null==t?void 0:t.limit)&&void 0!==r?r:20},{enabled:(null==t?void 0:t.enabled)!==!1&&!!e})}function c(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return i({limit:e,sort:"timestamp:desc"})}},93757:function(e,t,r){"use strict";r.d(t,{D:function(){return i}});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 i(e){let{url:t,onMessage:r,onError:i,reconnectInterval:a=3e3,maxReconnectAttempts:o=1/0,enabled:l=!0,withCredentials:c=!1}=e,[d,u]=(0,n.useState)(null),[x,h]=(0,n.useState)("disconnected"),[m,p]=(0,n.useState)(null),[g,j]=(0,n.useState)(0),f=(0,n.useRef)(null),v=(0,n.useCallback)(e=>{u(e),null==r||r(e)},[r]),y=(0,n.useCallback)(e=>{h(e),"connected"===e&&j(0)},[]),Z=(0,n.useCallback)(e=>{p(e),"number"==typeof e.retryCount&&j(e.retryCount),null==i||i(e)},[i]),b=(0,n.useCallback)(()=>{f.current&&(f.current.reconnect(),j(f.current.getRetryCount()))},[]),S=(0,n.useCallback)(()=>{f.current&&f.current.disconnect()},[]);return(0,n.useEffect)(()=>{if(!l){f.current&&(f.current.disconnect(),f.current=null);return}return f.current||(f.current=new s),f.current.connect({url:t,onMessage:v,onStateChange:y,onError:Z,reconnectInterval:a,maxReconnectAttempts:o,withCredentials:c}),()=>{f.current&&(f.current.disconnect(),f.current=null)}},[t,l,a,o,c,v,y,Z]),{data:d,isConnected:"connected"===x,state:x,error:m,retryCount:g,reconnect:b,disconnect:S}}},82925:function(e,t,r){"use strict";r.d(t,{KK:function(){return o},Lu:function(){return n},Xn:function(){return a},n3:function(){return s},xg:function(){return i}});let n={"server.create":"success","server.delete":"error","server.start":"info","server.stop":"warning","server.restart":"secondary","player.whitelist.add":"success","player.whitelist.remove":"warning","player.ban":"error","player.unban":"success","player.op":"info","player.deop":"warning","player.kick":"error","audit.purge":"default"},s={"server.create":"Create","server.delete":"Delete","server.start":"Start","server.stop":"Stop","server.restart":"Restart","player.whitelist.add":"Whitelist Add","player.whitelist.remove":"Whitelist Remove","player.ban":"Ban","player.unban":"Unban","player.op":"Op","player.deop":"Deop","player.kick":"Kick","audit.purge":"Purge"},i=["server.create","server.delete","server.start","server.stop","server.restart","player.whitelist.add","player.whitelist.remove","player.ban","player.unban","player.op","player.deop","player.kick","audit.purge"],a=["server.create","server.delete","server.start","server.stop","server.restart"],o=["player.whitelist.add","player.whitelist.remove","player.ban","player.unban","player.op","player.deop","player.kick"]}},function(e){e.O(0,[6812,7220,6803,7294,1604,6877,540,1857,2590,55,8063,8347,4278,3418,9409,8918,1692,3669,2757,1744],function(){return e(e.s=3590)}),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4743],{3590:function(e,t,r){Promise.resolve().then(r.bind(r,52791))},52791:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return eS}});var n=r(94655),s=r(35106),i=r(74228),a=r(7281),o=r(69899),l=r(31317),c=r(25333),d=r(76492),u=r(80620),x=r(78439),h=r(56813),m=r(26892),p=r(84840),g=r(628),j=r(41565),f=r(10721),v=r(69178),Z=r(46207),y=r(45354),b=r(35847);function S(e){var t,r,s;let{stats:i,isLoading:o}=e;if(o)return(0,n.jsx)(p.ZP,{container:!0,spacing:2,children:[0,1,2,3].map(e=>(0,n.jsx)(p.ZP,{item:!0,xs:6,md:3,children:(0,n.jsx)(g.Z,{children:(0,n.jsxs)(j.Z,{children:[(0,n.jsx)(f.Z,{variant:"text",width:"60%"}),(0,n.jsx)(f.Z,{variant:"text",width:"40%",height:40}),(0,n.jsx)(f.Z,{variant:"text",width:"80%"})]})})},e))});let c=null!==(t=null==i?void 0:i.total)&&void 0!==t?t:0,d=c>0?((null!==(r=null==i?void 0:i.byStatus.success)&&void 0!==r?r:0)/c*100).toFixed(1):"0.0",u=null!==(s=null==i?void 0:i.byStatus.failure)&&void 0!==s?s:0,x=i?Object.keys(i.byActor).length:0,h=[{title:"Total Logs",value:c.toLocaleString(),icon:(0,n.jsx)(v.Z,{fontSize:"large"}),color:"#1bd96a",description:"All audit log entries"},{title:"Success Rate",value:"".concat(d,"%"),icon:(0,n.jsx)(Z.Z,{fontSize:"large"}),color:"#22c55e",description:"Successful operations"},{title:"Failures",value:u,icon:(0,n.jsx)(y.Z,{fontSize:"large"}),color:"#ef4444",description:"Failed operations"},{title:"Active Users",value:x,icon:(0,n.jsx)(b.Z,{fontSize:"large"}),color:"#3b82f6",description:"Unique actors"}];return(0,n.jsx)(p.ZP,{container:!0,spacing:2,children:h.map(e=>(0,n.jsx)(p.ZP,{item:!0,xs:6,md:3,children:(0,n.jsx)(g.Z,{sx:{height:"100%",position:"relative",overflow:"hidden","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,height:"4px",background:e.color}},children:(0,n.jsxs)(j.Z,{children:[(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:2},children:[(0,n.jsx)(l.Z,{variant:"body2",color:"text.secondary",sx:{fontWeight:500},children:e.title}),(0,n.jsx)(a.Z,{sx:{color:e.color,opacity:.8},children:e.icon})]}),(0,n.jsx)(l.Z,{variant:"h3",component:"div",sx:{fontWeight:700,color:"text.primary",mb:1},children:e.value}),(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",children:e.description})]})})},e.title))})}var C=r(97436),w=r(62328),T=r(7178),k=r(29793),z=r(75726),N=r(30417),R=r(87716),A=r(79983),E=r(89923),I=r(10297),F=r(50880),L=r(54617),D=r(42431),P=r(81960),W=r(84284),M=r(82925);function O(e){return"server"===e?M.Xn:"player"===e?M.KK:M.xg}function U(e){let t,{filters:r,onFiltersChange:i,onExport:o}=e,[d,u]=(0,s.useState)(!0),x=(t=0,r.action&&t++,r.actor&&t++,r.targetType&&t++,r.targetName&&t++,r.status&&t++,r.from&&t++,r.to&&t++,t),h=O(r.targetType),m=(e,t)=>{let n={...r};""===t||void 0===t?delete n[e]:n[e]=t,"targetType"===e&&n.action&&!O(t).includes(n.action)&&delete n.action,n.offset=0,i(n)};return(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:d?2:0},children:[(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,n.jsxs)(A.Z,{onClick:()=>u(!d),size:"small","aria-label":d?"Collapse filters":"Expand filters",children:[(0,n.jsx)(F.Z,{}),d?(0,n.jsx)(W.Z,{sx:{fontSize:14}}):(0,n.jsx)(P.Z,{sx:{fontSize:14}})]}),(0,n.jsx)(l.Z,{variant:"subtitle2",color:"text.secondary",children:"Filters"}),x>0&&(0,n.jsx)(c.Z,{label:x,size:"small",color:"primary",sx:{height:20,fontSize:"0.7rem"}})]}),(0,n.jsxs)(a.Z,{sx:{display:"flex",gap:1},children:[x>0&&(0,n.jsx)(N.Z,{size:"small",startIcon:(0,n.jsx)(L.Z,{}),onClick:()=>{i({limit:r.limit,sort:r.sort})},color:"inherit",children:"Clear All"}),o&&(0,n.jsx)(N.Z,{size:"small",variant:"outlined",onClick:o,children:"Export"})]})]}),(0,n.jsx)(R.Z,{in:d,children:(0,n.jsxs)(a.Z,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},gap:2,flexWrap:"wrap"},children:[(0,n.jsxs)(a.Z,{sx:{display:"flex",gap:1,alignItems:"center"},children:[(0,n.jsx)(C.Z,{type:"date",label:"From",size:"small",value:r.from?r.from.split("T")[0]:"",onChange:e=>{let t=e.target.value;m("from",t?"".concat(t,"T00:00:00Z"):void 0)},InputLabelProps:{shrink:!0},sx:{minWidth:150}}),(0,n.jsx)(l.Z,{variant:"body2",color:"text.secondary",children:"~"}),(0,n.jsx)(C.Z,{type:"date",label:"To",size:"small",value:r.to?r.to.split("T")[0]:"",onChange:e=>{let t=e.target.value;m("to",t?"".concat(t,"T23:59:59Z"):void 0)},InputLabelProps:{shrink:!0},sx:{minWidth:150}})]}),(0,n.jsxs)(k.Z,{size:"small",sx:{minWidth:160},children:[(0,n.jsx)(z.Z,{children:"Action"}),(0,n.jsxs)(w.Z,{value:r.action||"",label:"Action",onChange:e=>m("action",e.target.value||void 0),children:[(0,n.jsx)(T.Z,{value:"",children:"All Actions"}),h.map(e=>(0,n.jsx)(T.Z,{value:e,children:M.n3[e]||e},e))]})]}),(0,n.jsx)(a.Z,{children:(0,n.jsxs)(I.Z,{value:r.targetType||"",exclusive:!0,onChange:(e,t)=>m("targetType",t||void 0),size:"small",children:[(0,n.jsx)(E.Z,{value:"","aria-label":"All targets",children:"All"}),(0,n.jsx)(E.Z,{value:"server","aria-label":"Server targets",children:"Server"}),(0,n.jsx)(E.Z,{value:"player","aria-label":"Player targets",children:"Player"})]})}),(0,n.jsx)(a.Z,{children:(0,n.jsxs)(I.Z,{value:r.status||"",exclusive:!0,onChange:(e,t)=>m("status",t||void 0),size:"small",children:[(0,n.jsx)(E.Z,{value:"","aria-label":"All statuses",children:"All"}),(0,n.jsx)(E.Z,{value:"success","aria-label":"Success only",children:"Success"}),(0,n.jsx)(E.Z,{value:"failure","aria-label":"Failure only",children:"Failure"})]})}),(0,n.jsx)(C.Z,{label:"Target Name",placeholder:"Search...",size:"small",value:r.targetName||"",onChange:e=>m("targetName",e.target.value||void 0),InputProps:{startAdornment:(0,n.jsx)(D.Z,{sx:{color:"text.secondary",mr:.5,fontSize:18}})},sx:{minWidth:160}}),(0,n.jsx)(C.Z,{label:"Actor",placeholder:"e.g., api:admin",size:"small",value:r.actor||"",onChange:e=>m("actor",e.target.value||void 0),sx:{minWidth:140}})]})})]})}var q=r(21138),K=r(84811),_=r(47001),B=r(53281),V=r(11254),X=r(70366),J=r(6406),H=r(95511),G=r(81071),Q=r(89161),Y=r(60236),$=r(27171),ee=r(30114),et=r(46725);function er(e){var t,r;let{log:i,onClick:o}=e,[d,u]=(0,s.useState)("failure"===i.status),x=i.details&&Object.keys(i.details).length>0,p="failure"===i.status&&i.errorMessage,g=x||p,j=(t=i.targetType,r=i.targetName,"server"===t?"/servers/".concat(encodeURIComponent(r)):"player"===t?"/players":null);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(X.Z,{hover:!0,sx:{cursor:"pointer","&:last-child td, &:last-child th":{border:0}},onClick:()=>null==o?void 0:o(i),tabIndex:0,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),null==o||o(i))},role:"button","aria-label":"".concat(i.action," by ").concat(i.actor," on ").concat(i.targetName),children:[(0,n.jsx)(_.Z,{padding:"checkbox",sx:{width:48},children:g&&(0,n.jsx)(A.Z,{size:"small",onClick:e=>{e.stopPropagation(),u(!d)},"aria-label":d?"Collapse details":"Expand details",children:d?(0,n.jsx)(Y.Z,{}):(0,n.jsx)(Q.Z,{})})}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(H.Z,{title:function(e){let t=new Date(e);return 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(t)}(i.timestamp),arrow:!0,children:(0,n.jsx)(l.Z,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"nowrap"},children:function(e){let t=new Date,r=new Date(e),n=Math.floor((t.getTime()-r.getTime())/1e3),s=Math.floor(n/60),i=Math.floor(s/60),a=Math.floor(i/24);return n<60?"just now":s<60?"".concat(s,"m ago"):i<24?"".concat(i,"h ago"):a<7?"".concat(a,"d ago"):new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"}).format(r)}(i.timestamp)})})}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(h.I,{action:i.action})}),(0,n.jsx)(_.Z,{children:i.actor.startsWith("cli:")?(0,n.jsx)(c.Z,{label:i.actor.replace("cli:",""),size:"small",variant:"outlined",sx:{fontSize:"0.75rem"}}):(0,n.jsx)(l.Z,{variant:"body2",children:i.actor.replace("api:","")})}),(0,n.jsx)(_.Z,{children:(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center"},children:[function(e){switch(e){case"server":return(0,n.jsx)($.Z,{sx:{fontSize:16,mr:.5,color:"text.secondary"}});case"player":return(0,n.jsx)(ee.Z,{sx:{fontSize:16,mr:.5,color:"text.secondary"}});default:return null}}(i.targetType),j?(0,n.jsx)(et.default,{href:j,style:{textDecoration:"none"},onClick:e=>e.stopPropagation(),children:(0,n.jsx)(l.Z,{variant:"body2",sx:{color:"primary.main","&:hover":{textDecoration:"underline"}},children:i.targetName})}):(0,n.jsx)(l.Z,{variant:"body2",children:i.targetName})]})}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(m.c,{status:i.status})})]}),g&&(0,n.jsx)(X.Z,{children:(0,n.jsx)(_.Z,{sx:{py:0},colSpan:6,children:(0,n.jsx)(R.Z,{in:d,timeout:"auto",unmountOnExit:!0,children:(0,n.jsxs)(a.Z,{sx:{py:2,px:2},children:[p&&(0,n.jsx)(G.Z,{severity:"error",sx:{mb:2},children:i.errorMessage}),x&&(0,n.jsxs)(a.Z,{children:[(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",sx:{mb:1,display:"block"},children:"Details"}),(0,n.jsx)(q.Z,{size:"small",sx:{width:"auto"},children:(0,n.jsx)(K.Z,{children:Object.entries(i.details).map(e=>{let[t,r]=e;return(0,n.jsxs)(X.Z,{children:[(0,n.jsx)(_.Z,{sx:{fontWeight:600,color:"text.secondary",border:"none",py:.5,pl:0},children:t}),(0,n.jsx)(_.Z,{sx:{border:"none",py:.5},children:String(r)})]},t)})})})]})]})})})})]})}function en(e){let{logs:t,total:r,isLoading:s,error:i,filters:a,onFiltersChange:c,onRowClick:d,onRetry:u}=e,x=Math.floor((a.offset||0)/(a.limit||50)),h=a.limit||50;return s?(0,n.jsx)(o.Z,{children:(0,n.jsx)(B.Z,{children:(0,n.jsxs)(q.Z,{children:[(0,n.jsx)(V.Z,{children:(0,n.jsxs)(X.Z,{children:[(0,n.jsx)(_.Z,{padding:"checkbox"}),(0,n.jsx)(_.Z,{children:"Timestamp"}),(0,n.jsx)(_.Z,{children:"Action"}),(0,n.jsx)(_.Z,{children:"Actor"}),(0,n.jsx)(_.Z,{children:"Target"}),(0,n.jsx)(_.Z,{children:"Status"})]})}),(0,n.jsx)(K.Z,{children:[void 0,void 0,void 0,void 0,void 0].map((e,t)=>(0,n.jsxs)(X.Z,{children:[(0,n.jsx)(_.Z,{padding:"checkbox"}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(f.Z,{variant:"text",width:80})}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(f.Z,{variant:"rounded",width:70,height:24})}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(f.Z,{variant:"text",width:60})}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(f.Z,{variant:"text",width:100})}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(f.Z,{variant:"rounded",width:50,height:24})})]},t))})]})})}):i?(0,n.jsx)(G.Z,{severity:"error",action:u&&(0,n.jsx)(N.Z,{color:"inherit",size:"small",onClick:u,children:"Retry"}),children:i.message||"Failed to load audit logs"}):0===t.length?(0,n.jsxs)(o.Z,{sx:{p:6,textAlign:"center"},children:[(0,n.jsx)(v.Z,{sx:{fontSize:64,color:"text.disabled",mb:2}}),(0,n.jsx)(l.Z,{variant:"h6",color:"text.secondary",gutterBottom:!0,children:"No audit logs found"}),(0,n.jsx)(l.Z,{variant:"body2",color:"text.disabled",sx:{mb:2},children:"Try adjusting your filters or check back later."}),(0,n.jsx)(N.Z,{variant:"outlined",size:"small",onClick:()=>c({limit:a.limit,sort:a.sort}),children:"Reset Filters"})]}):(0,n.jsxs)(o.Z,{children:[(0,n.jsx)(B.Z,{sx:{overflowX:"auto"},children:(0,n.jsxs)(q.Z,{size:"small",children:[(0,n.jsx)(V.Z,{children:(0,n.jsxs)(X.Z,{children:[(0,n.jsx)(_.Z,{padding:"checkbox",sx:{width:48}}),(0,n.jsx)(_.Z,{sx:{fontWeight:600,whiteSpace:"nowrap"},children:"Timestamp"}),(0,n.jsx)(_.Z,{sx:{fontWeight:600},children:"Action"}),(0,n.jsx)(_.Z,{sx:{fontWeight:600},children:"Actor"}),(0,n.jsx)(_.Z,{sx:{fontWeight:600},children:"Target"}),(0,n.jsx)(_.Z,{sx:{fontWeight:600},children:"Status"})]})}),(0,n.jsx)(K.Z,{children:t.map(e=>(0,n.jsx)(er,{log:e,onClick:d},e.id))})]})}),(0,n.jsx)(J.Z,{component:"div",count:r,page:x,onPageChange:(e,t)=>{c({...a,offset:t*h})},rowsPerPage:h,onRowsPerPageChange:e=>{let t=parseInt(e.target.value,10);c({...a,limit:t,offset:0})},rowsPerPageOptions:[25,50,100],"aria-label":"Audit log pagination"})]})}var es=r(78765),ei=r(69123),ea=r(33402),eo=r(60097),el=r(90158),ec=r(58347),ed=r(73424),eu=r(93017),ex=r(71185),eh=r(84509);function em(e){let{logs:t}=e;return 0===t.length?(0,n.jsx)(l.Z,{variant:"body2",color:"text.secondary",sx:{py:2,textAlign:"center"},children:"No related logs found"}):(0,n.jsx)(el.Z,{dense:!0,sx:{py:0},children:t.map(e=>(0,n.jsx)(ec.ZP,{sx:{px:0,py:1,"&:not(:last-child)":{borderBottom:"1px solid",borderColor:"divider"}},children:(0,n.jsx)(ed.Z,{primary:(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,n.jsx)(h.I,{action:e.action,size:"small"}),e.targetName&&(0,n.jsx)(l.Z,{variant:"body2",color:"text.secondary",children:e.targetName})]}),secondary:function(e){let t=new Date,r=new Date(e),n=Math.floor((t.getTime()-r.getTime())/6e4),s=Math.floor(n/60);return n<60?"".concat(n,"m ago"):s<24?"".concat(s,"h ago"):"".concat(Math.floor(s/24),"d ago")}(e.timestamp)})},e.id))})}function ep(e){var t,r,i,o,c;let{log:d,open:u,onClose:x}=e,[p,g]=(0,s.useState)(0),{data:j,isLoading:f}=(0,eh.VM)(null!==(t=null==d?void 0:d.id)&&void 0!==t?t:null,{enabled:u&&!!d});return(0,n.jsxs)(es.ZP,{anchor:"right",open:u,onClose:x,sx:{"& .MuiDrawer-paper":{width:{xs:"100%",sm:420},maxWidth:"100%"}},children:[(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",p:2,borderBottom:"1px solid",borderColor:"divider"},children:[(0,n.jsx)(l.Z,{variant:"h6",component:"h2",children:"Audit Log Detail"}),(0,n.jsx)(A.Z,{onClick:x,"aria-label":"Close detail drawer",autoFocus:!0,children:(0,n.jsx)(ex.Z,{})})]}),(0,n.jsx)(a.Z,{sx:{p:2,overflow:"auto",flex:1},children:d?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:"ID"}),(0,n.jsx)(l.Z,{variant:"body2",sx:{fontFamily:"monospace",fontSize:"0.8rem",wordBreak:"break-all"},children:d.id})]}),(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:"Timestamp"}),(0,n.jsx)(l.Z,{variant:"body2",children:function(e){let t=new Date(e);return 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(t)}(d.timestamp)})]}),(0,n.jsxs)(a.Z,{sx:{display:"flex",gap:3,mb:3},children:[(0,n.jsxs)(a.Z,{children:[(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:"Action"}),(0,n.jsx)(h.I,{action:d.action,size:"medium"})]}),(0,n.jsxs)(a.Z,{children:[(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:"Status"}),(0,n.jsx)(m.c,{status:d.status,size:"medium"})]})]}),(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:"Actor"}),(0,n.jsx)(l.Z,{variant:"body2",children:d.actor})]}),(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:"Target"}),(0,n.jsxs)(l.Z,{variant:"body2",children:[d.targetType,"/",d.targetName]})]}),"failure"===d.status&&d.errorMessage&&(0,n.jsx)(G.Z,{severity:"error",sx:{mb:3},children:d.errorMessage}),d.details&&Object.keys(d.details).length>0&&(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsx)(ei.Z,{sx:{mb:2}}),(0,n.jsx)(l.Z,{variant:"subtitle2",sx:{mb:1},children:"Details"}),(0,n.jsx)(q.Z,{size:"small",children:(0,n.jsx)(K.Z,{children:Object.entries(d.details).map(e=>{let[t,r]=e;return(0,n.jsxs)(X.Z,{children:[(0,n.jsx)(_.Z,{sx:{fontWeight:600,color:"text.secondary",border:"none",py:.5,pl:0,width:"40%"},children:t}),(0,n.jsx)(_.Z,{sx:{border:"none",py:.5},children:String(r)})]},t)})})})]}),(0,n.jsx)(ei.Z,{sx:{mb:2}}),(0,n.jsx)(l.Z,{variant:"subtitle2",sx:{mb:1},children:"Related Logs"}),f?(0,n.jsx)(a.Z,{sx:{display:"flex",justifyContent:"center",py:3},children:(0,n.jsx)(eu.Z,{size:24})}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(ea.Z,{value:p,onChange:(e,t)=>g(t),sx:{mb:1},children:[(0,n.jsx)(eo.Z,{label:"Same Target (".concat(null!==(r=null==j?void 0:j.relatedLogs.sameTarget.length)&&void 0!==r?r:0,")"),sx:{textTransform:"none",fontSize:"0.8rem"}}),(0,n.jsx)(eo.Z,{label:"Same Actor (".concat(null!==(i=null==j?void 0:j.relatedLogs.sameActor.length)&&void 0!==i?i:0,")"),sx:{textTransform:"none",fontSize:"0.8rem"}})]}),0===p&&(0,n.jsx)(em,{logs:null!==(o=null==j?void 0:j.relatedLogs.sameTarget)&&void 0!==o?o:[]}),1===p&&(0,n.jsx)(em,{logs:null!==(c=null==j?void 0:j.relatedLogs.sameActor)&&void 0!==c?c:[]})]})]}):(0,n.jsx)(l.Z,{color:"text.secondary",children:"No log selected"})})]})}var eg=r(99770),ej=r(62508),ef=r(5682),ev=r(76678),eZ=r(15761);function ey(e){let{open:t,onClose:r,filters:i,totalCount:o}=e,[c,d]=(0,s.useState)("csv"),[u,x]=(0,s.useState)(!1),[h,m]=(0,s.useState)(null),p=function(e){let t=[];return e.action&&t.push("Action: ".concat(e.action)),e.actor&&t.push("Actor: ".concat(e.actor)),e.targetType&&t.push("Type: ".concat(e.targetType)),e.targetName&&t.push("Target: ".concat(e.targetName)),e.status&&t.push("Status: ".concat(e.status)),e.from&&t.push("From: ".concat(e.from.split("T")[0])),e.to&&t.push("To: ".concat(e.to.split("T")[0])),t}(i),g=async()=>{x(!0),m(null);try{let e=function(e,t){let r=new URLSearchParams;return r.set("format",t),e.action&&r.set("action",e.action),e.actor&&r.set("actor",e.actor),e.targetType&&r.set("targetType",e.targetType),e.targetName&&r.set("targetName",e.targetName),e.status&&r.set("status",e.status),e.from&&r.set("from",e.from),e.to&&r.set("to",e.to),"/api/audit-logs/export?".concat(r.toString())}(i,c),t=await fetch(e);if(!t.ok){let e=await t.json().catch(()=>({message:"Export failed"}));throw Error(e.message||"Export failed")}let n=await t.blob(),s=window.URL.createObjectURL(n),a=document.createElement("a");a.href=s;let o=t.headers.get("Content-Disposition"),l=null==o?void 0:o.match(/filename="?([^"]+)"?/);a.download=(null==l?void 0:l[1])||"audit-logs.".concat(c),document.body.appendChild(a),a.click(),document.body.removeChild(a),window.URL.revokeObjectURL(s),r()}catch(e){m(e instanceof Error?e.message:"Export failed")}finally{x(!1)}};return(0,n.jsxs)(eg.Z,{open:t,onClose:r,maxWidth:"sm",fullWidth:!0,children:[(0,n.jsx)(ej.Z,{children:"Export Audit Logs"}),(0,n.jsxs)(ef.Z,{children:[(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsx)(l.Z,{variant:"subtitle2",sx:{mb:1},children:"Format"}),(0,n.jsxs)(I.Z,{value:c,exclusive:!0,onChange:(e,t)=>t&&d(t),size:"small",children:[(0,n.jsx)(E.Z,{value:"csv",children:"CSV"}),(0,n.jsx)(E.Z,{value:"json",children:"JSON"})]})]}),(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsx)(l.Z,{variant:"subtitle2",sx:{mb:1},children:"Applied Filters"}),p.length>0?(0,n.jsx)(a.Z,{sx:{display:"flex",flexDirection:"column",gap:.5},children:p.map(e=>(0,n.jsx)(l.Z,{variant:"body2",color:"text.secondary",children:e},e))}):(0,n.jsx)(l.Z,{variant:"body2",color:"text.secondary",children:"No filters applied (all logs)"})]}),(0,n.jsxs)(a.Z,{sx:{mb:2},children:[(0,n.jsx)(l.Z,{variant:"subtitle2",sx:{mb:.5},children:"Estimated Rows"}),(0,n.jsxs)(l.Z,{variant:"body2",color:"text.secondary",children:[Math.min(o,5e3).toLocaleString()," rows"]})]}),o>5e3&&(0,n.jsxs)(G.Z,{severity:"warning",sx:{mb:2},children:["Export is limited to ",5e3.toLocaleString()," rows. Total matching logs: ",o.toLocaleString(),". Consider narrowing your filters for a complete export."]}),h&&(0,n.jsx)(G.Z,{severity:"error",sx:{mb:2},children:h})]}),(0,n.jsxs)(ev.Z,{children:[(0,n.jsx)(N.Z,{onClick:r,disabled:u,children:"Cancel"}),(0,n.jsx)(N.Z,{variant:"contained",startIcon:u?(0,n.jsx)(eu.Z,{size:16,color:"inherit"}):(0,n.jsx)(eZ.Z,{}),onClick:g,disabled:u,children:u?"Exporting...":"Export ".concat(c.toUpperCase())})]})]})}var eb=r(93757);function eS(){var e,t,r;let h=(0,i.useRouter)(),m=(0,i.useSearchParams)(),[p,g]=(0,s.useState)(()=>(function(e){let t={},r=e.get("action"),n=e.get("actor"),s=e.get("targetType"),i=e.get("targetName"),a=e.get("status"),o=e.get("from"),l=e.get("to"),c=e.get("limit"),d=e.get("offset"),u=e.get("sort");return r&&(t.action=r),n&&(t.actor=n),s&&(t.targetType=s),i&&(t.targetName=i),a&&(t.status=a),o&&(t.from=o),l&&(t.to=l),c&&(t.limit=parseInt(c,10)),d&&(t.offset=parseInt(d,10)),("timestamp:asc"===u||"timestamp:desc"===u)&&(t.sort=u),t})(m)),[j,f]=(0,s.useState)(null),[v,Z]=(0,s.useState)(!1),[y,b]=(0,s.useState)(!1),[C,w]=(0,s.useState)(0),T=(0,s.useRef)(new Set),{data:k,isLoading:z,error:N,refetch:R}=(0,eh.hT)(p),{data:A,isLoading:E}=(0,eh.DM)(),{isConnected:I}=(0,eb.D)({url:"/api/audit-logs/stream",enabled:!0,onMessage:(0,s.useCallback)(e=>{if("audit-log"===e.type){let t=e.data;if("id"in t&&"string"==typeof t.id){if(T.current.has(t.id))return;if(T.current.add(t.id),T.current.size>1e3){let e=Array.from(T.current);T.current=new Set(e.slice(e.length-500))}}w(e=>e+1)}},[]),reconnectInterval:3e3,maxReconnectAttempts:1/0});(0,s.useEffect)(()=>{let e=function(e){let t=new URLSearchParams;e.action&&t.set("action",e.action),e.actor&&t.set("actor",e.actor),e.targetType&&t.set("targetType",e.targetType),e.targetName&&t.set("targetName",e.targetName),e.status&&t.set("status",e.status),e.from&&t.set("from",e.from),e.to&&t.set("to",e.to),e.limit&&50!==e.limit&&t.set("limit",String(e.limit)),e.offset&&e.offset>0&&t.set("offset",String(e.offset)),e.sort&&"timestamp:desc"!==e.sort&&t.set("sort",e.sort);let r=t.toString();return r?"?".concat(r):""}(p);e!==(m.toString()?"?".concat(m.toString()):"")&&h.replace("/audit-logs".concat(e),{scroll:!1})},[p,h,m]);let F=(0,s.useCallback)(e=>{g(e),w(0)},[]),L=(0,s.useCallback)(e=>{f(e),Z(!0)},[]),D=(0,s.useCallback)(()=>{w(0),R()},[R]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.Z,{elevation:0,sx:{mb:4,p:3,background:e=>"linear-gradient(135deg, ".concat((0,d.Fq)(e.palette.warning.main,.1)," 0%, ").concat((0,d.Fq)(e.palette.error.main,.1)," 100%)"),borderRadius:2,border:e=>"1px solid ".concat((0,d.Fq)(e.palette.warning.main,.2))},children:(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:2},children:[(0,n.jsx)(a.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:56,height:56,borderRadius:2,bgcolor:"warning.main",color:"warning.contrastText"},children:(0,n.jsx)(u.Z,{sx:{fontSize:32}})}),(0,n.jsxs)(a.Z,{sx:{flex:1},children:[(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[(0,n.jsx)(l.Z,{variant:"h4",component:"h1",fontWeight:"bold",children:"Audit Log"}),(0,n.jsx)(c.Z,{icon:(0,n.jsx)(x.Z,{sx:{fontSize:10,color:I?"success.main":"text.disabled",animation:I?"pulse 2s infinite":"none","@keyframes pulse":{"0%":{opacity:1},"50%":{opacity:.4},"100%":{opacity:1}}}}),label:I?"Live":"Offline",size:"small",variant:"outlined",sx:{fontSize:"0.7rem"}})]}),(0,n.jsx)(l.Z,{variant:"body1",color:"text.secondary",children:"Monitor all management activities across your servers"})]})]})}),(0,n.jsx)(a.Z,{sx:{mb:3},children:(0,n.jsx)(S,{stats:A,isLoading:E})}),C>0&&(0,n.jsx)(a.Z,{sx:{mb:2,p:1.5,textAlign:"center",bgcolor:"primary.main",color:"primary.contrastText",borderRadius:1,cursor:"pointer","&:hover":{opacity:.9}},onClick:D,role:"button","aria-label":"".concat(C," new logs, click to refresh"),children:(0,n.jsxs)(l.Z,{variant:"body2",fontWeight:600,children:[C," new ",1===C?"log":"logs"," available - Click to refresh"]})}),(0,n.jsx)(U,{filters:p,onFiltersChange:F,onExport:()=>b(!0)}),(0,n.jsx)(en,{logs:null!==(e=null==k?void 0:k.logs)&&void 0!==e?e:[],total:null!==(t=null==k?void 0:k.total)&&void 0!==t?t:0,isLoading:z,error:N,filters:p,onFiltersChange:F,onRowClick:L,onRetry:()=>R()}),(0,n.jsx)(ep,{log:j,open:v,onClose:()=>{Z(!1),f(null)}}),(0,n.jsx)(ey,{open:y,onClose:()=>b(!1),filters:p,totalCount:null!==(r=null==k?void 0:k.total)&&void 0!==r?r:0})]})}},56813:function(e,t,r){"use strict";r.d(t,{I:function(){return a}});var n=r(94655),s=r(25333),i=r(82925);function a(e){let{action:t,size:r="small"}=e,a=i.Lu[t]||"default",o=i.n3[t]||t;return(0,n.jsx)(s.Z,{label:o,color:a,size:r,variant:"filled",sx:{fontWeight:600,fontSize:"small"===r?"0.7rem":"0.8rem"}})}},26892:function(e,t,r){"use strict";r.d(t,{c:function(){return o}});var n=r(94655),s=r(25333),i=r(46207),a=r(43436);function o(e){let{status:t,size:r="small"}=e;return(0,n.jsx)(s.Z,{icon:"success"===t?(0,n.jsx)(i.Z,{}):(0,n.jsx)(a.Z,{}),label:"success"===t?"OK":"Error",color:"success"===t?"success":"error",size:r,variant:"outlined",sx:{fontWeight:500,fontSize:"small"===r?"0.7rem":"0.8rem"}})}},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}})},84509:function(e,t,r){"use strict";r.d(t,{DM:function(){return a},HZ:function(){return l},VM:function(){return o},hT:function(){return i},oL:function(){return c}});var n=r(5632),s=r(42936);function i(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=function(e){let t=new URLSearchParams;e.action&&t.set("action",e.action),e.actor&&t.set("actor",e.actor),e.targetType&&t.set("targetType",e.targetType),e.targetName&&t.set("targetName",e.targetName),e.status&&t.set("status",e.status),e.from&&t.set("from",e.from),e.to&&t.set("to",e.to),void 0!==e.limit&&t.set("limit",String(e.limit)),void 0!==e.offset&&t.set("offset",String(e.offset)),e.sort&&t.set("sort",e.sort);let r=t.toString();return r?"?".concat(r):""}(e);return(0,n.a)({queryKey:["audit-logs",e],queryFn:()=>(0,s.SC)("/api/audit-logs".concat(r)),enabled:(null==t?void 0:t.enabled)!==!1})}function a(e){return(0,n.a)({queryKey:["audit-logs","stats"],queryFn:()=>(0,s.SC)("/api/audit-logs/stats"),enabled:(null==e?void 0:e.enabled)!==!1,refetchInterval:3e4})}function o(e,t){return(0,n.a)({queryKey:["audit-logs",e],queryFn:()=>(0,s.SC)("/api/audit-logs/".concat(encodeURIComponent(e))),enabled:(null==t?void 0:t.enabled)!==!1&&!!e})}function l(e,t){var r;return i({targetType:"server",targetName:e,limit:null!==(r=null==t?void 0:t.limit)&&void 0!==r?r:20},{enabled:(null==t?void 0:t.enabled)!==!1&&!!e})}function c(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return i({limit:e,sort:"timestamp:desc"})}},93757:function(e,t,r){"use strict";r.d(t,{D:function(){return i}});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 i(e){let{url:t,onMessage:r,onError:i,reconnectInterval:a=3e3,maxReconnectAttempts:o=1/0,enabled:l=!0,withCredentials:c=!1}=e,[d,u]=(0,n.useState)(null),[x,h]=(0,n.useState)("disconnected"),[m,p]=(0,n.useState)(null),[g,j]=(0,n.useState)(0),f=(0,n.useRef)(null),v=(0,n.useCallback)(e=>{u(e),null==r||r(e)},[r]),Z=(0,n.useCallback)(e=>{h(e),"connected"===e&&j(0)},[]),y=(0,n.useCallback)(e=>{p(e),"number"==typeof e.retryCount&&j(e.retryCount),null==i||i(e)},[i]),b=(0,n.useCallback)(()=>{f.current&&(f.current.reconnect(),j(f.current.getRetryCount()))},[]),S=(0,n.useCallback)(()=>{f.current&&f.current.disconnect()},[]);return(0,n.useEffect)(()=>{if(!l){f.current&&(f.current.disconnect(),f.current=null);return}return f.current||(f.current=new s),f.current.connect({url:t,onMessage:v,onStateChange:Z,onError:y,reconnectInterval:a,maxReconnectAttempts:o,withCredentials:c}),()=>{f.current&&(f.current.disconnect(),f.current=null)}},[t,l,a,o,c,v,Z,y]),{data:d,isConnected:"connected"===x,state:x,error:m,retryCount:g,reconnect:b,disconnect:S}}},82925:function(e,t,r){"use strict";r.d(t,{KK:function(){return o},Lu:function(){return n},Xn:function(){return a},n3:function(){return s},xg:function(){return i}});let n={"server.create":"success","server.delete":"error","server.start":"info","server.stop":"warning","server.restart":"secondary","player.whitelist.add":"success","player.whitelist.remove":"warning","player.ban":"error","player.unban":"success","player.op":"info","player.deop":"warning","player.kick":"error","audit.purge":"default"},s={"server.create":"Create","server.delete":"Delete","server.start":"Start","server.stop":"Stop","server.restart":"Restart","player.whitelist.add":"Whitelist Add","player.whitelist.remove":"Whitelist Remove","player.ban":"Ban","player.unban":"Unban","player.op":"Op","player.deop":"Deop","player.kick":"Kick","audit.purge":"Purge"},i=["server.create","server.delete","server.start","server.stop","server.restart","player.whitelist.add","player.whitelist.remove","player.ban","player.unban","player.op","player.deop","player.kick","audit.purge"],a=["server.create","server.delete","server.start","server.stop","server.restart"],o=["player.whitelist.add","player.whitelist.remove","player.ban","player.unban","player.op","player.deop","player.kick"]}},function(e){e.O(0,[6812,7220,8006,7294,8696,1071,540,6189,4840,5511,55,310,8347,4278,9654,2022,8918,406,3669,2757,1744],function(){return e(e.s=3590)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6302],{1366:function(e,n,t){Promise.resolve().then(t.bind(t,6643))},6643:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return P}});var r=t(94655),s=t(31317),i=t(7281),o=t(69899),a=t(70115),c=t(76492),u=t(91606),l=t(628),d=t(41565),h=t(25333),x=t(46207),y=t(43436),m=t(92666);function j(){let{data:e,isLoading:n,error:t}=(0,m.mj)();if(n)return(0,r.jsx)(l.Z,{children:(0,r.jsxs)(d.Z,{children:[(0,r.jsx)(s.Z,{variant:"h6",gutterBottom:!0,children:"Backup Status"}),(0,r.jsx)(s.Z,{color:"text.secondary",children:"Loading..."})]})});if(t)return(0,r.jsx)(l.Z,{children:(0,r.jsxs)(d.Z,{children:[(0,r.jsx)(s.Z,{variant:"h6",gutterBottom:!0,children:"Backup Status"}),(0,r.jsx)(s.Z,{color:"error",children:"Failed to load backup status"})]})});let{configured:o,lastBackup:a,repository:c}=e||{};return(0,r.jsx)(l.Z,{children:(0,r.jsxs)(d.Z,{children:[(0,r.jsxs)(i.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,r.jsx)(s.Z,{variant:"h6",children:"Backup Status"}),(0,r.jsx)(h.Z,{icon:o?(0,r.jsx)(x.Z,{}):(0,r.jsx)(y.Z,{}),label:o?"Configured":"Not Configured",color:o?"success":"error",size:"small"})]}),o?(0,r.jsxs)(i.Z,{sx:{display:"flex",flexDirection:"column",gap:1},children:[c&&(0,r.jsxs)(i.Z,{children:[(0,r.jsx)(s.Z,{variant:"caption",color:"text.secondary",children:"Repository"}),(0,r.jsx)(s.Z,{variant:"body2",sx:{fontFamily:"monospace",fontSize:"0.875rem"},children:c})]}),a&&(0,r.jsxs)(i.Z,{children:[(0,r.jsx)(s.Z,{variant:"caption",color:"text.secondary",children:"Last Backup"}),(0,r.jsx)(s.Z,{variant:"body2",children:function(e){let n=new Date,t=new Date(e),r=Math.floor((n.getTime()-t.getTime())/6e4),s=Math.floor(r/60);return r<1?"just now":r<60?"".concat(r," minutes ago"):s<24?"".concat(s," hours ago"):"".concat(Math.floor(s/24)," days ago")}(a)})]}),!a&&(0,r.jsx)(s.Z,{variant:"body2",color:"text.secondary",children:"No backups yet"})]}):(0,r.jsx)(s.Z,{variant:"body2",color:"text.secondary",children:"GitHub backup is not configured. Please configure BACKUP_REPO_URL in your environment."})]})})}var f=t(35106),p=t(21138),v=t(84811),Z=t(47001),g=t(53281),b=t(11254),S=t(70366),C=t(79983),k=t(97731),w=t(30417),q=t(99770),F=t(76678),I=t(5682),K=t(65087),D=t(62508),T=t(81071),N=t(93017);function B(e){var n;let{open:t,commit:o,onClose:a}=e,{mutate:c,isPending:u}=(0,m.s8)(),[l,d]=(0,f.useState)(""),[h,x]=(0,f.useState)(""),y=()=>{u||(d(""),x(""),a())};return(0,r.jsxs)(q.Z,{open:t,onClose:y,maxWidth:"sm",fullWidth:!0,children:[(0,r.jsx)(D.Z,{children:"Restore Backup"}),(0,r.jsxs)(I.Z,{children:[(0,r.jsx)(T.Z,{severity:"warning",sx:{mb:2},children:"This will restore all worlds from the selected backup. Current world data will be overwritten."}),l&&(0,r.jsx)(T.Z,{severity:"success",sx:{mb:2},children:l}),h&&(0,r.jsx)(T.Z,{severity:"error",sx:{mb:2},children:h}),(0,r.jsx)(K.Z,{sx:{mb:2},children:"Are you sure you want to restore from this backup?"}),(0,r.jsxs)(i.Z,{sx:{display:"flex",flexDirection:"column",gap:1},children:[(0,r.jsxs)(i.Z,{children:[(0,r.jsx)(s.Z,{variant:"caption",color:"text.secondary",children:"Commit Hash"}),(0,r.jsx)(s.Z,{variant:"body2",sx:{fontFamily:"monospace",fontSize:"0.875rem"},children:o.hash})]}),(0,r.jsxs)(i.Z,{children:[(0,r.jsx)(s.Z,{variant:"caption",color:"text.secondary",children:"Date"}),(0,r.jsx)(s.Z,{variant:"body2",children:(n=o.date,new Intl.DateTimeFormat(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date(n)))})]}),(0,r.jsxs)(i.Z,{children:[(0,r.jsx)(s.Z,{variant:"caption",color:"text.secondary",children:"Message"}),(0,r.jsx)(s.Z,{variant:"body2",children:o.message})]}),(0,r.jsxs)(i.Z,{children:[(0,r.jsx)(s.Z,{variant:"caption",color:"text.secondary",children:"Author"}),(0,r.jsx)(s.Z,{variant:"body2",children:o.author})]})]})]}),(0,r.jsxs)(F.Z,{children:[(0,r.jsx)(w.Z,{onClick:y,disabled:u,children:"Cancel"}),(0,r.jsx)(w.Z,{onClick:()=>{d(""),x(""),c(o.hash,{onSuccess:()=>{d("Backup restored successfully from ".concat(o.hash.substring(0,7))),setTimeout(()=>{a()},2e3)},onError:e=>{x("Failed to restore backup: ".concat(e.message))}})},variant:"contained",color:"warning",disabled:u,startIcon:u?(0,r.jsx)(N.Z,{size:16}):(0,r.jsx)(k.Z,{}),children:u?"Restoring...":"Restore"})]})]})}function Q(){let{data:e,isLoading:n,error:t}=(0,m.$t)(20),[i,o]=(0,f.useState)(null),a=e=>{o(e)};if(n)return(0,r.jsx)(l.Z,{children:(0,r.jsxs)(d.Z,{children:[(0,r.jsx)(s.Z,{variant:"h6",gutterBottom:!0,children:"Backup History"}),(0,r.jsx)(s.Z,{color:"text.secondary",children:"Loading..."})]})});if(t)return(0,r.jsx)(l.Z,{children:(0,r.jsxs)(d.Z,{children:[(0,r.jsx)(s.Z,{variant:"h6",gutterBottom:!0,children:"Backup History"}),(0,r.jsx)(s.Z,{color:"error",children:"Failed to load backup history"})]})});let c=(null==e?void 0:e.commits)||[];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.Z,{children:(0,r.jsxs)(d.Z,{children:[(0,r.jsx)(s.Z,{variant:"h6",gutterBottom:!0,children:"Backup History"}),0===c.length?(0,r.jsx)(s.Z,{color:"text.secondary",children:"No backup history available"}):(0,r.jsx)(g.Z,{children:(0,r.jsxs)(p.Z,{children:[(0,r.jsx)(b.Z,{children:(0,r.jsxs)(S.Z,{children:[(0,r.jsx)(Z.Z,{children:"Commit"}),(0,r.jsx)(Z.Z,{children:"Date"}),(0,r.jsx)(Z.Z,{children:"Message"}),(0,r.jsx)(Z.Z,{children:"Author"}),(0,r.jsx)(Z.Z,{align:"right",children:"Actions"})]})}),(0,r.jsx)(v.Z,{children:c.map(e=>{var n;return(0,r.jsxs)(S.Z,{children:[(0,r.jsx)(Z.Z,{children:(0,r.jsx)(h.Z,{label:e.hash.substring(0,7),size:"small",variant:"outlined",sx:{fontFamily:"monospace"}})}),(0,r.jsx)(Z.Z,{children:(0,r.jsx)(s.Z,{variant:"body2",children:(n=e.date,new Intl.DateTimeFormat(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(new Date(n)))})}),(0,r.jsx)(Z.Z,{children:(0,r.jsx)(s.Z,{variant:"body2",children:e.message})}),(0,r.jsx)(Z.Z,{children:(0,r.jsx)(s.Z,{variant:"body2",color:"text.secondary",children:e.author})}),(0,r.jsx)(Z.Z,{align:"right",children:(0,r.jsx)(C.Z,{size:"small",color:"primary",onClick:()=>a(e),title:"Restore this backup",children:(0,r.jsx)(k.Z,{})})})]},e.hash)})})]})})]})}),i&&(0,r.jsx)(B,{open:!!i,commit:i,onClose:()=>{o(null)}})]})}var R=t(97436),O=t(34675);function L(e){let{disabled:n}=e,[t,s]=(0,f.useState)(!1),[i,o]=(0,f.useState)(""),[a,c]=(0,f.useState)(""),[u,l]=(0,f.useState)(""),{mutate:d,isPending:h}=(0,m.c5)(),x=()=>{h||(s(!1),o(""),c(""),l(""))};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(w.Z,{variant:"contained",startIcon:(0,r.jsx)(O.Z,{}),onClick:()=>{s(!0),c(""),l(""),o("Backup ".concat(new Date().toISOString().split("T")[0]))},disabled:n||h,children:"Push Backup"}),(0,r.jsxs)(q.Z,{open:t,onClose:x,maxWidth:"sm",fullWidth:!0,children:[(0,r.jsx)(D.Z,{children:"Push Backup"}),(0,r.jsxs)(I.Z,{children:[a&&(0,r.jsx)(T.Z,{severity:"success",sx:{mb:2},children:a}),u&&(0,r.jsx)(T.Z,{severity:"error",sx:{mb:2},children:u}),(0,r.jsx)(R.Z,{autoFocus:!0,margin:"dense",label:"Commit Message",type:"text",fullWidth:!0,variant:"outlined",value:i,onChange:e=>o(e.target.value),disabled:h,helperText:"Optional message describing this backup"})]}),(0,r.jsxs)(F.Z,{children:[(0,r.jsx)(w.Z,{onClick:x,disabled:h,children:"Cancel"}),(0,r.jsx)(w.Z,{onClick:()=>{c(""),l(""),d({message:i||void 0},{onSuccess:e=>{c(e.commitHash?"Backup pushed successfully (".concat(e.commitHash.substring(0,7),")"):"Backup pushed successfully"),setTimeout(()=>{x()},2e3)},onError:e=>{l("Failed to push backup: ".concat(e.message))}})},variant:"contained",disabled:h,startIcon:h?(0,r.jsx)(N.Z,{size:16}):(0,r.jsx)(O.Z,{}),children:h?"Pushing...":"Push"})]})]})]})}function P(){var e;let{data:n}=(0,m.mj)(),t=null!==(e=null==n?void 0:n.configured)&&void 0!==e&&e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(o.Z,{elevation:0,sx:{mb:4,p:3,background:e=>"linear-gradient(135deg, ".concat((0,c.Fq)(e.palette.secondary.main,.1)," 0%, ").concat((0,c.Fq)(e.palette.info.main,.1)," 100%)"),borderRadius:2,border:e=>"1px solid ".concat((0,c.Fq)(e.palette.secondary.main,.2)),display:"flex",justifyContent:"space-between",alignItems:"center"},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:"secondary.main",color:"secondary.contrastText"},children:(0,r.jsx)(u.Z,{sx:{fontSize:32}})}),(0,r.jsxs)(i.Z,{children:[(0,r.jsx)(s.Z,{variant:"h4",component:"h1",fontWeight:"bold",children:"Backups"}),(0,r.jsx)(s.Z,{variant:"body1",color:"text.secondary",children:"Manage world backups and restore points"})]})]}),(0,r.jsx)(L,{disabled:!t})]}),(0,r.jsxs)(a.Z,{spacing:3,children:[(0,r.jsx)(j,{}),t&&(0,r.jsx)(Q,{})]})]})}},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 S},Aw:function(){return d},Fv:function(){return f},Hq:function(){return u},Hy:function(){return c},MH:function(){return v},Sr:function(){return x},_I:function(){return h},c5:function(){return C},g2:function(){return j},gx:function(){return Z},hy:function(){return y},iC:function(){return p},jM:function(){return l},mj:function(){return b},nq:function(){return m},nv:function(){return g},s8:function(){return k},x$:function(){return a}});var r=t(5632),s=t(58919),i=t(20367),o=t(42936);function a(){return(0,r.a)({queryKey:["servers"],queryFn:()=>(0,o.SC)("/api/servers"),refetchInterval:6e4})}function c(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 u(){let e=(0,s.NL)();return(0,i.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,s.NL)();return(0,i.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,s.NL)();return(0,i.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,s.NL)();return(0,i.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,s.NL)();return(0,i.D)({mutationFn:e=>(0,o.SC)("/api/worlds",{method:"POST",body:JSON.stringify(e)}),onSuccess:()=>{e.invalidateQueries({queryKey:["worlds"]})}})}function m(){let e=(0,s.NL)();return(0,i.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 j(){let e=(0,s.NL)();return(0,i.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 f(){let e=(0,s.NL)();return(0,i.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 v(){let e=(0,s.NL)();return(0,i.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 Z(){let e=(0,s.NL)();return(0,i.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 g(){return(0,r.a)({queryKey:["router-status"],queryFn:()=>(0,o.SC)("/api/router/status"),refetchInterval:3e4})}function b(){return(0,r.a)({queryKey:["backup-status"],queryFn:()=>(0,o.SC)("/api/backup"),refetchInterval:6e4})}function S(){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 C(){let e=(0,s.NL)();return(0,i.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 k(){let e=(0,s.NL)();return(0,i.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,7220,8006,7294,8696,1071,540,6189,310,9654,6655,3669,2757,1744],function(){return e(e.s=1366)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2248],{12121:function(e,t,s){Promise.resolve().then(s.bind(s,61714))},61714:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return R}});var r=s(94655),i=s(69899),n=s(76492),a=s(7281),l=s(31317),o=s(84840),c=s(628),d=s(41565),x=s(10721),h=s(25065),m=s(91179),j=s(11767),u=s(53832),p=s(30164),Z=s(92666),g=s(59104);function f(e){let{title:t,value:s,icon:i,color:n="primary",description:o}=e,x={primary:"#1bd96a",success:"#22c55e",info:"#3b82f6",secondary:"#7c3aed"};return(0,r.jsx)(c.Z,{"data-testid":"stat-card",sx:{height:"100%",position:"relative",overflow:"hidden","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,height:"4px",background:x[n]}},children:(0,r.jsxs)(d.Z,{children:[(0,r.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:2},children:[(0,r.jsx)(l.Z,{variant:"body2",color:"text.secondary",sx:{fontWeight:500},children:t}),i&&(0,r.jsx)(a.Z,{sx:{color:x[n],opacity:.8},children:i})]}),(0,r.jsx)(l.Z,{variant:"h3",component:"div",sx:{fontWeight:700,color:"text.primary",mb:o?1:0},children:s}),o&&(0,r.jsx)(l.Z,{variant:"caption",color:"text.secondary",children:o})]})})}var v=s(98406),y=s(93017),b=s(25333),w=s(46725),C=s(8690),S=s(31358);function z(e){let{servers:t,statusMap:s={},isLoading:i,maxItems:n,showViewAll:o=!1,onServerClick:x}=e,h=(0,S.x)(),m=n?t.slice(0,n):t,j=e=>{x?x(e):h.push("/servers/".concat(e))},u=e=>{switch(e){case"running":return"success";case"stopped":case"exited":return"error";case"created":return"warning";default:return"default"}},p=e=>{switch(e){case"healthy":return"success";case"unhealthy":return"error";case"starting":return"warning";default:return"default"}};return i?(0,r.jsxs)(c.Z,{children:[(0,r.jsx)(v.Z,{title:"Servers"}),(0,r.jsx)(d.Z,{children:(0,r.jsx)(a.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,r.jsx)(y.Z,{})})})]}):0===t.length?(0,r.jsxs)(c.Z,{children:[(0,r.jsx)(v.Z,{title:"Servers"}),(0,r.jsx)(d.Z,{children:(0,r.jsx)(l.Z,{color:"text.secondary",align:"center",children:"No servers found. Create your first server to get started."})})]}):(0,r.jsxs)(c.Z,{children:[(0,r.jsx)(v.Z,{title:"Servers",action:o&&t.length>(n||0)?(0,r.jsxs)(w.default,{href:"/servers",onClick:()=>(0,C.Av)(),style:{textDecoration:"none",color:"inherit",fontSize:"0.875rem"},children:["View All (",t.length,")"]}):null}),(0,r.jsx)(d.Z,{children:(0,r.jsx)(a.Z,{sx:{display:"flex",flexDirection:"column",gap:2},children:m.map(e=>{let t=s[e.name],i=(null==t?void 0:t.status)||e.status,n=(null==t?void 0:t.health)||e.health;return(0,r.jsx)(a.Z,{role:"button",onClick:()=>j(e.name),sx:{p:2,borderRadius:1,border:"1px solid",borderColor:"divider",cursor:"pointer",transition:"all 0.2s","&:hover":{borderColor:"primary.main",backgroundColor:"action.hover"}},children:(0,r.jsxs)(a.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,r.jsxs)(a.Z,{children:[(0,r.jsx)(l.Z,{variant:"subtitle1",fontWeight:600,children:e.name}),(0,r.jsx)(l.Z,{variant:"caption",color:"text.secondary",children:e.hostname})]}),(0,r.jsxs)(a.Z,{sx:{display:"flex",gap:1},children:[(0,r.jsx)(b.Z,{label:i,color:u(i),size:"small"}),"none"!==n&&(0,r.jsx)(b.Z,{label:n,color:p(n),size:"small",variant:"outlined"})]})]})},e.name)})})})]})}var k=s(35106),P=s(41261);function A(e){let{maxVersions:t=2,title:s="Recent Updates"}=e,[i,n]=(0,k.useState)([]),[o,h]=(0,k.useState)(!0),[m,j]=(0,k.useState)(null);return((0,k.useEffect)(()=>{(async function(){try{let e=await fetch("https://api.github.com/repos/smallmiro/minecraft-server-manager/contents/CHANGELOG.md",{headers:{Accept:"application/vnd.github.v3+json"}});if(!e.ok)throw Error("Failed to fetch changelog");let s=await e.json(),r=atob(s.content),i=function(e,t){let s=[],r=e.split("\n"),i=null,n="added";for(let e of r){let r=e.match(/^## \[([^\]]+)\] - (\d{4}-\d{2}-\d{2})/);if(r){if(i&&(s.push(i),s.length>=t))break;i={version:r[1],date:r[2],items:[]};continue}let a=e.match(/^### (Added|Fixed|Changed)/i);if(a){n=a[1].toLowerCase();continue}let l=e.match(/^- \*\*([^*]+)\*\*\s*[-–]?\s*(.*)$/);l&&i&&i.items.push({type:n,message:l[1].trim()})}return i&&s.length<t&&s.push(i),s}(r,t);n(i)}catch(e){j(e instanceof Error?e.message:"Unknown error")}finally{h(!1)}})()},[t]),o)?(0,r.jsxs)(c.Z,{children:[(0,r.jsx)(v.Z,{title:s}),(0,r.jsxs)(d.Z,{children:[(0,r.jsx)(x.Z,{variant:"text",width:"60%",height:28}),(0,r.jsx)(x.Z,{variant:"text",width:"80%"}),(0,r.jsx)(x.Z,{variant:"text",width:"70%"}),(0,r.jsxs)(a.Z,{sx:{mt:2},children:[(0,r.jsx)(x.Z,{variant:"text",width:"60%",height:28}),(0,r.jsx)(x.Z,{variant:"text",width:"75%"})]})]})]}):m?(0,r.jsxs)(c.Z,{children:[(0,r.jsx)(v.Z,{title:s}),(0,r.jsx)(d.Z,{children:(0,r.jsx)(l.Z,{color:"text.secondary",align:"center",children:"Unable to load updates"})})]}):(0,r.jsxs)(c.Z,{children:[(0,r.jsx)(v.Z,{title:s,action:(0,r.jsx)(P.Z,{href:"https://github.com/smallmiro/minecraft-server-manager/blob/develop/CHANGELOG.md",target:"_blank",rel:"noopener",sx:{fontSize:13,mr:1},children:"View all"})}),(0,r.jsx)(d.Z,{sx:{pt:0},children:i.map((e,t)=>{let s=e.items.filter(e=>"added"===e.type),n=e.items.filter(e=>"fixed"===e.type),o=e.items.filter(e=>"changed"===e.type);return(0,r.jsxs)(a.Z,{sx:{mb:t<i.length-1?2.5:0,pb:t<i.length-1?2:0,borderBottom:t<i.length-1?"1px solid":"none",borderColor:"divider"},children:[(0,r.jsxs)(l.Z,{variant:"subtitle2",sx:{fontWeight:600,color:"primary.main",mb:1},children:["[",e.version,"] - ",e.date]}),s.length>0&&(0,r.jsxs)(a.Z,{sx:{mb:1},children:[(0,r.jsx)(b.Z,{label:"Added",size:"small",sx:{bgcolor:"success.main",color:"success.contrastText",fontSize:11,height:20,mb:.5}}),s.map((e,t)=>(0,r.jsxs)(l.Z,{variant:"body2",sx:{color:"text.secondary",pl:1},children:["• ",e.message]},t))]}),n.length>0&&(0,r.jsxs)(a.Z,{sx:{mb:1},children:[(0,r.jsx)(b.Z,{label:"Fixed",size:"small",sx:{bgcolor:"warning.main",color:"warning.contrastText",fontSize:11,height:20,mb:.5}}),n.map((e,t)=>(0,r.jsxs)(l.Z,{variant:"body2",sx:{color:"text.secondary",pl:1},children:["• ",e.message]},t))]}),o.length>0&&(0,r.jsxs)(a.Z,{children:[(0,r.jsx)(b.Z,{label:"Changed",size:"small",sx:{bgcolor:"info.main",color:"info.contrastText",fontSize:11,height:20,mb:.5}}),o.map((e,t)=>(0,r.jsxs)(l.Z,{variant:"body2",sx:{color:"text.secondary",pl:1},children:["• ",e.message]},t))]})]},e.version)})})]})}var I=s(30417),F=s(90158),T=s(58347),D=s(73424),E=s(95511),N=s(26577),W=s(56813),L=s(26892),M=s(84509);function O(e){var t;let{maxItems:s=5}=e,{data:i,isLoading:n,error:o}=(0,M.oL)(s),h=null!==(t=null==i?void 0:i.logs)&&void 0!==t?t:[];return(0,r.jsxs)(c.Z,{children:[(0,r.jsx)(v.Z,{title:"Recent Activity",action:(0,r.jsx)(I.Z,{component:w.default,href:"/audit-logs",size:"small",endIcon:(0,r.jsx)(N.Z,{}),sx:{textTransform:"none"},children:"View All"})}),(0,r.jsx)(d.Z,{sx:{pt:0},children:n?(0,r.jsx)(F.Z,{sx:{py:0},children:[...Array(s)].map((e,t)=>(0,r.jsx)(T.ZP,{sx:{px:0,py:1.5},children:(0,r.jsx)(D.Z,{primary:(0,r.jsxs)(a.Z,{sx:{display:"flex",gap:1},children:[(0,r.jsx)(x.Z,{variant:"rounded",width:60,height:24}),(0,r.jsx)(x.Z,{variant:"text",width:80}),(0,r.jsx)(x.Z,{variant:"text",width:60})]}),secondary:(0,r.jsx)(x.Z,{variant:"text",width:50})})},t))}):o?(0,r.jsx)(l.Z,{color:"text.secondary",align:"center",children:"Failed to load recent activity"}):0===h.length?(0,r.jsx)(l.Z,{color:"text.secondary",align:"center",sx:{py:2},children:"No recent activity"}):(0,r.jsx)(F.Z,{sx:{py:0},children:h.map(e=>{var t;return(0,r.jsx)(T.ZP,{sx:{px:0,py:1.5,"&:not(:last-child)":{borderBottom:"1px solid",borderColor:"divider"}},children:(0,r.jsx)(D.Z,{primary:(0,r.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:[(0,r.jsx)(W.I,{action:e.action,size:"small"}),(0,r.jsx)(l.Z,{variant:"body2",sx:{fontWeight:500},children:e.targetName}),(0,r.jsxs)(l.Z,{variant:"body2",color:"text.secondary",children:["by ",e.actor.replace("api:","").replace("cli:","")]}),"failure"===e.status&&(0,r.jsx)(L.c,{status:e.status,size:"small"})]}),secondary:(0,r.jsx)(E.Z,{title:(t=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(t))),arrow:!0,children:(0,r.jsx)(l.Z,{variant:"caption",component:"span",color:"text.disabled",children:function(e){let t=new Date,s=new Date(e),r=Math.floor((t.getTime()-s.getTime())/6e4),i=Math.floor(r/60);return r<1?"just now":r<60?"".concat(r,"m ago"):i<24?"".concat(i,"h ago"):"".concat(Math.floor(i/24),"d ago")}(e.timestamp)})})})},e.id)})})})]})}function R(){let{data:e,isLoading:t}=(0,Z.x$)(),{data:s,isLoading:v}=(0,Z.Sr)(),{statusMap:y}=(0,g.d)(),b=t||v,w=(null==e?void 0:e.total)||0,C=(null==e?void 0:e.servers.filter(e=>{let t=y[e.name];return"running"===((null==t?void 0:t.status)||e.status)}).length)||0,S=(null==s?void 0:s.total)||0;return b?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.Z,{elevation:0,sx:{mb:4,p:3,background:e=>"linear-gradient(135deg, ".concat((0,n.Fq)(e.palette.secondary.main,.1)," 0%, ").concat((0,n.Fq)(e.palette.primary.main,.1)," 100%)"),borderRadius:2,border:e=>"1px solid ".concat((0,n.Fq)(e.palette.secondary.main,.2))},children:(0,r.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:2},children:[(0,r.jsx)(a.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:56,height:56,borderRadius:2,bgcolor:"primary.main",color:"primary.contrastText"},children:(0,r.jsx)(h.Z,{sx:{fontSize:32}})}),(0,r.jsxs)(a.Z,{children:[(0,r.jsx)(l.Z,{variant:"h4",component:"h1",fontWeight:"bold",children:"Dashboard"}),(0,r.jsx)(l.Z,{variant:"body1",color:"text.secondary",children:"Overview of your Minecraft server infrastructure"})]})]})}),(0,r.jsx)(o.ZP,{container:!0,spacing:3,sx:{mb:4},children:[0,1,2,3].map(e=>(0,r.jsx)(o.ZP,{item:!0,xs:12,sm:6,md:3,children:(0,r.jsx)(c.Z,{sx:{height:"100%",position:"relative",overflow:"hidden","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,height:"4px",background:"grey.300"}},children:(0,r.jsxs)(d.Z,{children:[(0,r.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:2},children:[(0,r.jsx)(x.Z,{variant:"text",width:"60%"}),(0,r.jsx)(x.Z,{variant:"circular",width:32,height:32})]}),(0,r.jsx)(x.Z,{variant:"text",width:"40%",height:48}),(0,r.jsx)(x.Z,{variant:"text",width:"70%"})]})})},e))}),(0,r.jsxs)(o.ZP,{container:!0,spacing:3,children:[(0,r.jsx)(o.ZP,{item:!0,xs:12,lg:7,children:(0,r.jsx)(c.Z,{children:(0,r.jsxs)(d.Z,{children:[(0,r.jsx)(x.Z,{variant:"text",width:"30%",height:32,sx:{mb:2}}),[0,1,2,3,4].map(e=>(0,r.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:2,py:1.5,borderBottom:"1px solid",borderColor:"divider"},children:[(0,r.jsx)(x.Z,{variant:"circular",width:10,height:10}),(0,r.jsx)(x.Z,{variant:"text",width:"25%"}),(0,r.jsx)(x.Z,{variant:"rounded",width:60,height:24,sx:{ml:"auto"}})]},e))]})})}),(0,r.jsx)(o.ZP,{item:!0,xs:12,lg:5,children:(0,r.jsxs)(a.Z,{sx:{display:"flex",flexDirection:"column",gap:3},children:[(0,r.jsx)(c.Z,{children:(0,r.jsxs)(d.Z,{children:[(0,r.jsx)(x.Z,{variant:"text",width:"40%",height:32,sx:{mb:2}}),[0,1,2,3].map(e=>(0,r.jsxs)(a.Z,{sx:{display:"flex",gap:1.5,py:1,borderBottom:"1px solid",borderColor:"divider"},children:[(0,r.jsx)(x.Z,{variant:"circular",width:24,height:24}),(0,r.jsxs)(a.Z,{sx:{flex:1},children:[(0,r.jsx)(x.Z,{variant:"text",width:"80%"}),(0,r.jsx)(x.Z,{variant:"text",width:"50%"})]})]},e))]})}),(0,r.jsx)(c.Z,{children:(0,r.jsxs)(d.Z,{children:[(0,r.jsx)(x.Z,{variant:"text",width:"35%",height:32,sx:{mb:2}}),[0,1].map(e=>(0,r.jsxs)(a.Z,{sx:{py:1,borderBottom:"1px solid",borderColor:"divider"},children:[(0,r.jsx)(x.Z,{variant:"text",width:"60%"}),(0,r.jsx)(x.Z,{variant:"text",width:"90%"})]},e))]})})]})})]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.Z,{elevation:0,sx:{mb:4,p:3,background:e=>"linear-gradient(135deg, ".concat((0,n.Fq)(e.palette.secondary.main,.1)," 0%, ").concat((0,n.Fq)(e.palette.primary.main,.1)," 100%)"),borderRadius:2,border:e=>"1px solid ".concat((0,n.Fq)(e.palette.secondary.main,.2))},children:(0,r.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:2},children:[(0,r.jsx)(a.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:56,height:56,borderRadius:2,bgcolor:"secondary.main",color:"secondary.contrastText"},children:(0,r.jsx)(h.Z,{sx:{fontSize:32}})}),(0,r.jsxs)(a.Z,{children:[(0,r.jsx)(l.Z,{variant:"h4",component:"h1",fontWeight:"bold",children:"Dashboard"}),(0,r.jsx)(l.Z,{variant:"body1",color:"text.secondary",children:"Overview of your Minecraft server infrastructure"})]})]})}),(0,r.jsxs)(o.ZP,{container:!0,spacing:3,sx:{mb:4},children:[(0,r.jsx)(o.ZP,{item:!0,xs:12,sm:6,md:3,children:(0,r.jsx)(f,{title:"Total Servers",value:w,icon:(0,r.jsx)(m.Z,{fontSize:"large"}),color:"primary",description:"All configured servers"})}),(0,r.jsx)(o.ZP,{item:!0,xs:12,sm:6,md:3,children:(0,r.jsx)(f,{title:"Online Servers",value:C,icon:(0,r.jsx)(j.Z,{fontSize:"large"}),color:"success",description:"Currently running"})}),(0,r.jsx)(o.ZP,{item:!0,xs:12,sm:6,md:3,children:(0,r.jsx)(f,{title:"Total Players",value:0,icon:(0,r.jsx)(u.Z,{fontSize:"large"}),color:"info",description:"Across all servers"})}),(0,r.jsx)(o.ZP,{item:!0,xs:12,sm:6,md:3,children:(0,r.jsx)(f,{title:"Total Worlds",value:S,icon:(0,r.jsx)(p.Z,{fontSize:"large"}),color:"secondary",description:"Available worlds"})})]}),(0,r.jsxs)(o.ZP,{container:!0,spacing:3,children:[(0,r.jsx)(o.ZP,{item:!0,xs:12,lg:7,children:(0,r.jsx)(z,{servers:(null==e?void 0:e.servers)||[],statusMap:y,isLoading:t,maxItems:5,showViewAll:!0})}),(0,r.jsx)(o.ZP,{item:!0,xs:12,lg:5,children:(0,r.jsxs)(a.Z,{sx:{display:"flex",flexDirection:"column",gap:3},children:[(0,r.jsx)(O,{maxItems:5}),(0,r.jsx)(A,{maxVersions:2})]})})]})]})}},59104:function(e,t,s){"use strict";s.d(t,{d:function(){return n}});var r=s(35106),i=s(93757);function n(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{onStatusChange:t,enabled:s=!0,reconnectInterval:n=3e3}=e,[a,l]=(0,r.useState)({}),o=(0,r.useCallback)(e=>{if("server-status"===e.type){let{serverName:s,status:r,health:i,timestamp:n}=e.data;l(e=>({...e,[s]:{status:r,health:i,timestamp:n}})),null==t||t(s,r,i)}},[t]),{isConnected:c,reconnect:d,retryCount:x}=(0,i.D)({url:"/api/sse/servers-status",onMessage:o,enabled:s,reconnectInterval:n}),h=(0,r.useCallback)(e=>a[e]||null,[a]);return(0,r.useEffect)(()=>{s||l({})},[s]),{statusMap:a,getServerStatus:h,isConnected:c,reconnect:d,retryCount:x}}}},function(e){e.O(0,[6812,7220,8006,7294,540,6189,4840,5511,55,8347,4597,2537,3669,2757,1744],function(){return e(e.s=12121)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4095],{16387:function(e,r,t){Promise.resolve().then(t.bind(t,6453))},6453:function(e,r,t){"use strict";t.r(r),t.d(r,{default:function(){return H}});var n=t(94655),a=t(35106),i=t(7281),s=t(74228),l=t(46725),o=t(56275),c=t(62108),d=t(79983),h=t(31317),x=t(78765),m=t(90158),u=t(58347),p=t(49954),f=t(17820),g=t(73424),b=t(61505),j=t(71185),y=t(76176),v=t(27171),Z=t(35847),w=t(29983),C=t(80620),k=t(84974),S=t(34675),P=t(85480),z=t(64779);function I(e){return(0,n.jsxs)(z.Z,{...e,viewBox:"0 0 32 32",children:[(0,n.jsx)("rect",{width:"32",height:"32",fill:"#5DA840"}),(0,n.jsx)("rect",{x:"4",y:"8",width:"8",height:"8",fill:"#000"}),(0,n.jsx)("rect",{x:"20",y:"8",width:"8",height:"8",fill:"#000"}),(0,n.jsx)("rect",{x:"12",y:"16",width:"8",height:"4",fill:"#000"}),(0,n.jsx)("rect",{x:"8",y:"20",width:"16",height:"8",fill:"#000"}),(0,n.jsx)("rect",{x:"8",y:"28",width:"4",height:"4",fill:"#000"}),(0,n.jsx)("rect",{x:"20",y:"28",width:"4",height:"4",fill:"#000"}),(0,n.jsx)("rect",{x:"0",y:"0",width:"4",height:"4",fill:"#4A9030",opacity:"0.5"}),(0,n.jsx)("rect",{x:"8",y:"4",width:"4",height:"4",fill:"#4A9030",opacity:"0.5"}),(0,n.jsx)("rect",{x:"24",y:"0",width:"4",height:"4",fill:"#4A9030",opacity:"0.5"}),(0,n.jsx)("rect",{x:"28",y:"8",width:"4",height:"4",fill:"#4A9030",opacity:"0.5"}),(0,n.jsx)("rect",{x:"0",y:"24",width:"4",height:"4",fill:"#4A9030",opacity:"0.5"})]})}var W=t(8690);let A=[{label:"Dashboard",href:"/dashboard",icon:(0,n.jsx)(y.Z,{})},{label:"Servers",href:"/servers",icon:(0,n.jsx)(v.Z,{})},{label:"Worlds",href:"/worlds",icon:(0,n.jsx)(k.Z,{})},{label:"Players",href:"/players",icon:(0,n.jsx)(Z.Z,{})},{label:"Audit Log",href:"/audit-logs",icon:(0,n.jsx)(C.Z,{})},{label:"Backups",href:"/backups",icon:(0,n.jsx)(S.Z,{})},{label:"Routing",href:"/routing",icon:(0,n.jsx)(w.Z,{})}];function D(e){let{mobileOpen:r,onMenuToggle:t}=e,a=(0,s.usePathname)(),y=e=>"/dashboard"===e?"/dashboard"===a||"/"===a:a.startsWith(e);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.Z,{position:"fixed",elevation:0,sx:{backgroundColor:"background.paper",borderBottom:"1px solid",borderColor:"divider",zIndex:e=>e.zIndex.drawer+1},children:(0,n.jsxs)(c.Z,{sx:{maxWidth:"1400px",width:"100%",mx:"auto",px:{xs:2,sm:3}},children:[(0,n.jsx)(d.Z,{color:"inherit","aria-label":"open menu",edge:"start",onClick:t,sx:{mr:2,display:{md:"none"}},children:(0,n.jsx)(b.Z,{})}),(0,n.jsxs)(l.default,{href:"/",style:{textDecoration:"none",display:"flex",alignItems:"center"},children:[(0,n.jsx)(I,{sx:{fontSize:28,color:"primary.main",mr:1}}),(0,n.jsx)(h.Z,{variant:"h6",component:"span",sx:{fontFamily:'"Minecraft", sans-serif',fontWeight:400,color:"common.white",letterSpacing:"0.05em",fontSize:"1.1rem"},children:"Minecraft Console"})]}),(0,n.jsx)(i.Z,{component:"nav",sx:{display:{xs:"none",md:"flex"},alignItems:"center",gap:1,ml:4,flex:1},children:A.map(e=>{let r=y(e.href);return(0,n.jsx)(l.default,{href:e.href,style:{textDecoration:"none"},onClick:()=>!r&&(0,W.Av)(),children:(0,n.jsxs)(i.Z,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1,borderRadius:2,color:r?"primary.main":"text.secondary",backgroundColor:r?"action.selected":"transparent",transition:"all 0.2s ease","&:hover":{backgroundColor:"action.hover",color:r?"primary.main":"text.primary"}},children:[(0,n.jsx)(i.Z,{component:"span",sx:{display:"flex",alignItems:"center","& svg":{fontSize:20}},children:e.icon}),(0,n.jsx)(h.Z,{variant:"body2",sx:{fontWeight:r?600:400},children:e.label})]})},e.href)})}),(0,n.jsx)(i.Z,{sx:{display:"flex",alignItems:"center",gap:2},children:(0,n.jsx)(P.Ie,{})})]})}),(0,n.jsx)(x.ZP,{variant:"temporary",anchor:"left",open:r,onClose:t,ModalProps:{keepMounted:!0},sx:{display:{xs:"block",md:"none"},"& .MuiDrawer-paper":{boxSizing:"border-box",width:280,backgroundColor:"background.paper"}},children:(0,n.jsxs)(i.Z,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[(0,n.jsxs)(i.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:2,py:2,minHeight:64,borderBottom:"1px solid",borderColor:"divider"},children:[(0,n.jsxs)(i.Z,{sx:{display:"flex",alignItems:"center"},children:[(0,n.jsx)(I,{sx:{fontSize:24,color:"primary.main",mr:1}}),(0,n.jsx)(h.Z,{variant:"h6",component:"span",sx:{fontFamily:'"Minecraft", sans-serif',fontWeight:400,color:"primary.main",letterSpacing:"0.05em",fontSize:"1rem"},children:"Minecraft Console"})]}),(0,n.jsx)(d.Z,{onClick:t,"aria-label":"close menu",children:(0,n.jsx)(j.Z,{})})]}),(0,n.jsx)(m.Z,{sx:{flex:1,px:1,py:2},children:A.map(e=>{let r=y(e.href);return(0,n.jsx)(u.ZP,{disablePadding:!0,sx:{mb:.5},children:(0,n.jsxs)(p.Z,{component:l.default,href:e.href,onClick:()=>{t(),r||(0,W.Av)()},"aria-current":r?"page":void 0,sx:{borderRadius:2,backgroundColor:r?"action.selected":"transparent","&:hover":{backgroundColor:"action.hover"}},children:[(0,n.jsx)(f.Z,{sx:{color:r?"primary.main":"text.secondary",minWidth:40},children:e.icon}),(0,n.jsx)(g.Z,{primary:e.label,primaryTypographyProps:{fontWeight:r?600:400,color:r?"primary.main":"text.primary"}})]})},e.href)})})]})})]})}var T=t(67337),_=t(41261),E=t(69123),L=t(75845),M=t(43880);function q(e){return(0,n.jsx)(z.Z,{...e,viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M13.983 11.078h2.119a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.119a.185.185 0 00-.185.185v1.888c0 .102.083.185.185.185m-2.954-5.43h2.118a.186.186 0 00.186-.186V3.574a.186.186 0 00-.186-.185h-2.118a.185.185 0 00-.185.185v1.888c0 .102.082.185.185.186m0 2.716h2.118a.187.187 0 00.186-.186V6.29a.186.186 0 00-.186-.185h-2.118a.185.185 0 00-.185.185v1.887c0 .102.082.185.185.186m-2.93 0h2.12a.186.186 0 00.184-.186V6.29a.185.185 0 00-.185-.185H8.1a.185.185 0 00-.185.185v1.887c0 .102.083.185.185.186m-2.964 0h2.119a.186.186 0 00.185-.186V6.29a.185.185 0 00-.185-.185H5.136a.186.186 0 00-.186.185v1.887c0 .102.084.185.186.186m5.893 2.715h2.118a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.118a.185.185 0 00-.185.185v1.888c0 .102.082.185.185.185m-2.93 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.185.185 0 00-.184.185v1.888c0 .102.083.185.185.185m-2.964 0h2.119a.185.185 0 00.185-.185V9.006a.185.185 0 00-.184-.186h-2.12a.186.186 0 00-.186.186v1.887c0 .102.084.185.186.185m-2.92 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.185.185 0 00-.184.185v1.888c0 .102.082.185.185.185M23.763 9.89c-.065-.051-.672-.51-1.954-.51-.338.001-.676.03-1.01.087-.248-1.7-1.653-2.53-1.716-2.566l-.344-.199-.226.327c-.284.438-.49.922-.612 1.43-.23.97-.09 1.882.403 2.661-.595.332-1.55.413-1.744.42H.751a.751.751 0 00-.75.748 11.376 11.376 0 00.692 4.062c.545 1.428 1.355 2.48 2.41 3.124 1.18.723 3.1 1.137 5.275 1.137.983.003 1.963-.086 2.93-.266a12.248 12.248 0 003.823-1.389c.98-.567 1.86-1.288 2.61-2.136 1.252-1.418 1.998-2.997 2.553-4.4h.221c1.372 0 2.215-.549 2.68-1.009.309-.293.55-.65.707-1.046l.098-.288z"})})}let R=[{title:"Resources",links:[{label:"Getting Started",href:"https://minecraft-server-manager.readthedocs.io/en/latest/getting-started/",external:!0},{label:"Configuration",href:"https://minecraft-server-manager.readthedocs.io/en/latest/configuration/",external:!0},{label:"Troubleshooting",href:"https://minecraft-server-manager.readthedocs.io/en/latest/troubleshooting/",external:!0}]},{title:"Documentation",links:[{label:"CLI Commands",href:"https://minecraft-server-manager.readthedocs.io/en/latest/cli/",external:!0},{label:"API Reference",href:"https://minecraft-server-manager.readthedocs.io/en/latest/console/",external:!0},{label:"itzg Reference",href:"https://minecraft-server-manager.readthedocs.io/en/latest/itzg-reference/",external:!0}]},{title:"Community",links:[{label:"GitHub",href:"https://github.com/smallmiro/minecraft-server-manager",external:!0},{label:"Issues",href:"https://github.com/smallmiro/minecraft-server-manager/issues",external:!0}]},{title:"About",links:[{label:"License",href:"https://github.com/smallmiro/minecraft-server-manager/blob/main/LICENSE",external:!0},{label:"Docker Hub",href:"https://hub.docker.com/r/itzg/minecraft-server",external:!0}]}];function B(){let e=new Date().getFullYear();return(0,n.jsx)(i.Z,{component:"footer",sx:{backgroundColor:"background.paper",borderTop:"1px solid",borderColor:"divider",mt:"auto"},children:(0,n.jsxs)(T.Z,{maxWidth:"lg",sx:{py:6},children:[(0,n.jsx)(i.Z,{sx:{display:"grid",gridTemplateColumns:{xs:"repeat(2, 1fr)",sm:"repeat(4, 1fr)"},gap:4,mb:4},children:R.map(e=>(0,n.jsxs)(i.Z,{children:[(0,n.jsx)(h.Z,{variant:"subtitle2",sx:{fontWeight:600,color:"text.primary",mb:2},children:e.title}),(0,n.jsx)(i.Z,{component:"ul",sx:{listStyle:"none",p:0,m:0},children:e.links.map(e=>(0,n.jsx)(i.Z,{component:"li",sx:{mb:1},children:(0,n.jsx)(_.Z,{href:e.href,target:e.external?"_blank":void 0,rel:e.external?"noopener noreferrer":void 0,underline:"hover",sx:{color:"text.secondary",fontSize:"0.875rem",transition:"color 0.2s ease","&:hover":{color:"primary.main"}},children:e.label})},e.label))})]},e.title))}),(0,n.jsx)(E.Z,{sx:{mb:3}}),(0,n.jsxs)(i.Z,{sx:{display:"flex",flexDirection:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",sm:"center"},gap:2},children:[(0,n.jsxs)(h.Z,{variant:"body2",sx:{color:"text.tertiary"},children:[e," \xa9"," ",(0,n.jsx)(_.Z,{href:"https://github.com/smallmiro/minecraft-server-manager",target:"_blank",rel:"noopener noreferrer",underline:"hover",sx:{color:"primary.main"},children:"Minecraft Server Management Console"})]}),(0,n.jsxs)(i.Z,{sx:{display:"flex",gap:2},children:[(0,n.jsx)(_.Z,{href:"https://github.com/smallmiro/minecraft-server-manager",target:"_blank",rel:"noopener noreferrer","aria-label":"GitHub",sx:{color:"text.secondary",transition:"color 0.2s ease","&:hover":{color:"text.primary"}},children:(0,n.jsx)(L.Z,{fontSize:"small"})}),(0,n.jsx)(_.Z,{href:"https://minecraft-server-manager.readthedocs.io/",target:"_blank",rel:"noopener noreferrer","aria-label":"Documentation",sx:{color:"text.secondary",transition:"color 0.2s ease","&:hover":{color:"text.primary"}},children:(0,n.jsx)(M.Z,{fontSize:"small"})}),(0,n.jsx)(_.Z,{href:"https://hub.docker.com/r/itzg/minecraft-server",target:"_blank",rel:"noopener noreferrer","aria-label":"Docker Hub",sx:{color:"text.secondary",transition:"color 0.2s ease","&:hover":{color:"text.primary"}},children:(0,n.jsx)(q,{fontSize:"small"})})]})]})]})})}function H(e){let{children:r}=e,[t,s]=(0,a.useState)(!1);return(0,n.jsxs)(i.Z,{sx:{display:"flex",flexDirection:"column",minHeight:"100vh",backgroundColor:"background.default"},children:[(0,n.jsx)(D,{mobileOpen:t,onMenuToggle:()=>{s(!t)}}),(0,n.jsx)(i.Z,{component:"main",sx:{flexGrow:1,display:"flex",flexDirection:"column",pt:{xs:"".concat(88,"px"),sm:"".concat(96,"px")},pb:{xs:3,sm:4},px:{xs:2,sm:3,md:4},maxWidth:"1400px",width:"100%",mx:"auto"},children:r}),(0,n.jsx)(B,{})]})}},85480:function(e,r,t){"use strict";t.d(r,{U0:function(){return u},WS:function(){return p},Ie:function(){return P}});var n=t(94655),a=t(35106),i=t(7281),s=t(81071),l=t(97436),o=t(52082),c=t(79983),d=t(30417),h=t(36848),x=t(554),m=t(6986);function u(e){let{onSuccess:r}=e,[t,u]=(0,a.useState)(""),[p,f]=(0,a.useState)(""),[g,b]=(0,a.useState)(!1),[j,y]=(0,a.useState)({}),[v,Z]=(0,a.useState)(null),[w,C]=(0,a.useState)(!1),k=()=>{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"),y(e),0===Object.keys(e).length},S=async e=>{if(e.preventDefault(),Z(null),k()){C(!0);try{let e=await m.zB.email({email:t,password:p});if(e.error){Z(e.error.message||"Invalid credentials"),C(!1);return}r&&r()}catch(e){Z("An unexpected error occurred. Please try again."),C(!1)}}};return(0,n.jsxs)(i.Z,{component:"form",onSubmit:S,sx:{display:"flex",flexDirection:"column",gap:2},children:[v&&(0,n.jsx)(s.Z,{severity:"error",onClose:()=>Z(null),children:v}),(0,n.jsx)(l.Z,{label:"Email",type:"email",value:t,onChange:e=>u(e.target.value),error:!!j.email,helperText:j.email,disabled:w,fullWidth:!0,required:!0}),(0,n.jsx)(l.Z,{label:"Password",type:g?"text":"password",value:p,onChange:e=>f(e.target.value),error:!!j.password,helperText:j.password,disabled:w,fullWidth:!0,required:!0,InputProps:{endAdornment:(0,n.jsx)(o.Z,{position:"end",children:(0,n.jsx)(c.Z,{"aria-label":"toggle password visibility",onClick:()=>{b(!g)},edge:"end",children:g?(0,n.jsx)(h.Z,{}):(0,n.jsx)(x.Z,{})})})}}),(0,n.jsx)(d.Z,{type:"submit",variant:"contained",color:"primary",disabled:w,fullWidth:!0,size:"large",children:w?"Signing in...":"Sign In"})]})}function p(e){let{onSuccess:r}=e,[t,u]=(0,a.useState)(""),[p,f]=(0,a.useState)(""),[g,b]=(0,a.useState)(""),[j,y]=(0,a.useState)(""),[v,Z]=(0,a.useState)(!1),[w,C]=(0,a.useState)(!1),[k,S]=(0,a.useState)({}),[P,z]=(0,a.useState)(null),[I,W]=(0,a.useState)(!1),A=()=>{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",g?g.length<8&&(e.password="Password must be at least 8 characters"):e.password="Password is required",j?g!==j&&(e.confirmPassword="Passwords do not match"):e.confirmPassword="Please confirm your password",S(e),0===Object.keys(e).length},D=async e=>{if(e.preventDefault(),z(null),A()){W(!0);try{let e=await m.y1.email({email:p,password:g,name:t});if(e.error){z(e.error.message||"Registration failed"),W(!1);return}r&&r()}catch(e){z("An unexpected error occurred. Please try again."),W(!1)}}};return(0,n.jsxs)(i.Z,{component:"form",onSubmit:D,sx:{display:"flex",flexDirection:"column",gap:2},children:[P&&(0,n.jsx)(s.Z,{severity:"error",onClose:()=>z(null),children:P}),(0,n.jsx)(l.Z,{label:"Name",type:"text",value:t,onChange:e=>u(e.target.value),error:!!k.name,helperText:k.name,disabled:I,fullWidth:!0,required:!0}),(0,n.jsx)(l.Z,{label:"Email",type:"email",value:p,onChange:e=>f(e.target.value),error:!!k.email,helperText:k.email,disabled:I,fullWidth:!0,required:!0}),(0,n.jsx)(l.Z,{label:"Password",type:v?"text":"password",value:g,onChange:e=>b(e.target.value),error:!!k.password,helperText:k.password,disabled:I,fullWidth:!0,required:!0,InputProps:{endAdornment:(0,n.jsx)(o.Z,{position:"end",children:(0,n.jsx)(c.Z,{"aria-label":"toggle password visibility",onClick:()=>{Z(!v)},edge:"end",children:v?(0,n.jsx)(h.Z,{}):(0,n.jsx)(x.Z,{})})})}}),(0,n.jsx)(l.Z,{label:"Confirm Password",type:w?"text":"password",value:j,onChange:e=>y(e.target.value),error:!!k.confirmPassword,helperText:k.confirmPassword,disabled:I,fullWidth:!0,required:!0,InputProps:{endAdornment:(0,n.jsx)(o.Z,{position:"end",children:(0,n.jsx)(c.Z,{"aria-label":"toggle password visibility",onClick:()=>{C(!w)},edge:"end",children:w?(0,n.jsx)(h.Z,{}):(0,n.jsx)(x.Z,{})})})}}),(0,n.jsx)(d.Z,{type:"submit",variant:"contained",color:"primary",disabled:I,fullWidth:!0,size:"large",children:I?"Creating account...":"Sign Up"})]})}var f=t(74228),g=t(93017),b=t(86702),j=t(35694),y=t(31317),v=t(25333),Z=t(69123),w=t(7178),C=t(17820),k=t(73424),S=t(78319);function P(){let e=(0,f.useRouter)(),{data:r,isPending:t}=(0,m.kP)(),[s,l]=(0,a.useState)(null),o=()=>{l(null)},h=async()=>{o(),await (0,m.w7)(),e.push("/login")};if(t)return(0,n.jsx)(i.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:(0,n.jsx)(g.Z,{size:24})});if(!(null==r?void 0:r.user))return(0,n.jsx)(d.Z,{variant:"contained",color:"primary",onClick:()=>{e.push("/login")},children:"Sign In"});let{user:x}=r,u=((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)(c.Z,{onClick:e=>{l(e.currentTarget)},"aria-label":"user menu",children:(0,n.jsx)(b.Z,{sx:{bgcolor:"primary.main"},children:u})}),(0,n.jsxs)(j.Z,{anchorEl:s,open:!!s,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)(y.Z,{variant:"subtitle1",fontWeight:"600",children:x.name||"User"}),(0,n.jsx)(y.Z,{variant:"body2",color:"text.secondary",children:x.email}),"admin"===x.role&&(0,n.jsx)(v.Z,{label:"Admin",size:"small",color:"primary",sx:{mt:1}})]}),(0,n.jsx)(Z.Z,{}),(0,n.jsxs)(w.Z,{onClick:h,children:[(0,n.jsx)(C.Z,{children:(0,n.jsx)(S.Z,{fontSize:"small"})}),(0,n.jsx)(k.Z,{children:"Logout"})]})]})]})}},3454:function(e,r,t){"use strict";t.d(r,{LoadingProvider:function(){return o},startLoading:function(){return c},stopLoading:function(){return d}});var n=t(94655),a=t(35106),i=t(74228),s=t(31477),l=t.n(s);function o(e){let{children:r}=e,t=(0,i.usePathname)(),s=(0,i.useSearchParams)();return(0,a.useEffect)(()=>{l().done()},[t,s]),(0,n.jsx)(n.Fragment,{children:r})}function c(){l().start()}function d(){l().done()}l().configure({showSpinner:!1,speed:300,minimum:.1})},8690:function(e,r,t){"use strict";t.d(r,{Av:function(){return n.startLoading}});var n=t(3454)},6986:function(e,r,t){"use strict";t.d(r,{kP:function(){return c},w7:function(){return l},y1:function(){return o},zB:function(){return s}});var n=t(77054),a=t(61648),i=t(35016);let{signIn:s,signOut:l,signUp:o,useSession:c}=(0,n.X)({baseURL:i.env.NEXT_PUBLIC_BETTER_AUTH_URL||"http://localhost:5000",plugins:[(0,a.zB)()]})}},function(e){e.O(0,[6812,7220,8006,7294,8696,1071,55,3543,8347,2149,2542,8322,8918,212,3669,2757,1744],function(){return e(e.s=16387)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[781],{31809:function(e,r,n){Promise.resolve().then(n.bind(n,83785))},83785:function(e,r,n){"use strict";n.r(r),n.d(r,{default:function(){return X}});var t=n(94655),a=n(35106),s=n(7281),i=n(31317),o=n(84840),l=n(33402),c=n(60097),d=n(29793),u=n(75726),y=n(62328),h=n(7178),p=n(69899),x=n(76492),m=n(35847),j=n(628),f=n(41565),v=n(90158),Z=n(58347),b=n(73424),g=n(69783),C=n(86702),S=n(79983),w=n(30417),k=n(25333),E=n(99770),F=n(62508),I=n(5682),q=n(65087),P=n(76678),N=n(97436),K=n(93017),O=n(81071),R=n(66561),T=n(12795),U=n(96407),L=n(69366),D=n(11597),Q=n(81960),A=n(30114);function B(e){let{onPlayerKicked:r}=e,[n,o]=(0,a.useState)(!0),[l,c]=(0,a.useState)(null),[d,u]=(0,a.useState)([]),[y,h]=(0,a.useState)(!1),[p,x]=(0,a.useState)(null),[m,B]=(0,a.useState)(""),[W,z]=(0,a.useState)(!1),J=(0,a.useCallback)(async()=>{o(!0),c(null);try{let e=await fetch("/api/players");if(!e.ok)throw Error("Failed to fetch players");let r=await e.json();u(r.servers)}catch(e){c("Failed to load players"),console.error("Error fetching players:",e)}finally{o(!1)}},[]);(0,a.useEffect)(()=>{J()},[J]);let _=(e,r)=>{x({player:e,server:r}),B(""),h(!0)},M=async()=>{if(p){z(!0);try{if(!(await fetch("/api/players/kick",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({player:p.player.name,server:p.server,reason:m||"Kicked by administrator"})})).ok)throw Error("Failed to kick player");h(!1),x(null),null==r||r(p.player,p.server),await J()}catch(e){console.error("Error kicking player:",e)}finally{z(!1)}}},H=d.some(e=>e.players.length>0);return(0,t.jsx)(j.Z,{"data-testid":"player-list",children:(0,t.jsxs)(f.Z,{children:[(0,t.jsxs)(s.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,t.jsx)(i.Z,{variant:"h6",children:"Online Players"}),(0,t.jsx)(S.Z,{onClick:J,disabled:n,"aria-label":"Refresh",children:(0,t.jsx)(L.Z,{})})]}),n&&(0,t.jsx)(s.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,t.jsx)(K.Z,{})}),l&&(0,t.jsx)(O.Z,{severity:"error",sx:{mb:2},children:l}),!n&&!l&&!H&&(0,t.jsx)(i.Z,{color:"text.secondary",sx:{textAlign:"center",py:4},children:"No players online"}),!n&&!l&&H&&(0,t.jsx)(s.Z,{children:d.map(e=>(0,t.jsxs)(R.Z,{defaultExpanded:e.players.length>0,children:[(0,t.jsx)(T.Z,{expandIcon:(0,t.jsx)(Q.Z,{}),children:(0,t.jsxs)(s.Z,{sx:{display:"flex",alignItems:"center",gap:2,width:"100%"},children:[(0,t.jsx)(i.Z,{variant:"subtitle1",sx:{fontWeight:500},children:e.name}),(0,t.jsx)(k.Z,{label:"".concat(e.players.length," player").concat(1!==e.players.length?"s":""),size:"small",color:e.players.length>0?"success":"default"})]})}),(0,t.jsx)(U.Z,{children:0===e.players.length?(0,t.jsx)(i.Z,{color:"text.secondary",sx:{fontStyle:"italic"},children:"No players online on this server"}):(0,t.jsx)(v.Z,{dense:!0,children:e.players.map(r=>(0,t.jsxs)(Z.ZP,{secondaryAction:(0,t.jsx)(S.Z,{edge:"end","aria-label":"Kick player",onClick:()=>_(r,e.name),color:"error",children:(0,t.jsx)(D.Z,{})}),children:[(0,t.jsx)(g.Z,{children:(0,t.jsx)(C.Z,{src:"https://mc-heads.net/avatar/".concat(r.uuid,"/40"),alt:r.name,children:(0,t.jsx)(A.Z,{})})}),(0,t.jsx)(b.Z,{primary:r.name,secondary:r.uuid.substring(0,8)+"..."})]},r.uuid))})})]},e.name))}),(0,t.jsxs)(E.Z,{open:y,onClose:()=>h(!1),children:[(0,t.jsx)(F.Z,{children:"Kick Player"}),(0,t.jsxs)(I.Z,{children:[(0,t.jsxs)(q.Z,{children:["Are you sure you want to kick ",null==p?void 0:p.player.name," from ",null==p?void 0:p.server,"?"]}),(0,t.jsx)(N.Z,{autoFocus:!0,margin:"dense",label:"Reason (optional)",fullWidth:!0,variant:"outlined",value:m,onChange:e=>B(e.target.value),placeholder:"Kicked by administrator"})]}),(0,t.jsxs)(P.Z,{children:[(0,t.jsx)(w.Z,{onClick:()=>h(!1),disabled:W,children:"Cancel"}),(0,t.jsx)(w.Z,{onClick:M,color:"error",variant:"contained",disabled:W,"aria-label":"Confirm kick",children:W?(0,t.jsx)(K.Z,{size:20}):"Confirm"})]})]})]})})}var W=n(70115),z=n(21111),J=n(47606);function _(e){let{serverName:r}=e,[n,o]=(0,a.useState)(!0),[l,c]=(0,a.useState)(null),[d,u]=(0,a.useState)([]),[y,h]=(0,a.useState)(""),[p,x]=(0,a.useState)(!1),[m,k]=(0,a.useState)(null),E=(0,a.useCallback)(async()=>{o(!0),c(null);try{let e=await fetch("/api/players/whitelist?server=".concat(encodeURIComponent(r)));if(!e.ok)throw Error("Failed to fetch whitelist");let n=await e.json();u(n.players)}catch(e){c("Failed to load whitelist"),console.error("Error fetching whitelist:",e)}finally{o(!1)}},[r]);(0,a.useEffect)(()=>{E()},[E]);let F=async()=>{if(y.trim()){x(!0),c(null);try{if(!(await fetch("/api/players/whitelist",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({player:y.trim(),server:r})})).ok)throw Error("Failed to add player");h(""),await E()}catch(e){c("Failed to add player to whitelist"),console.error("Error adding player:",e)}finally{x(!1)}}},I=async e=>{k(e),c(null);try{if(!(await fetch("/api/players/whitelist?player=".concat(encodeURIComponent(e),"&server=").concat(encodeURIComponent(r)),{method:"DELETE"})).ok)throw Error("Failed to remove player");await E()}catch(e){c("Failed to remove player from whitelist"),console.error("Error removing player:",e)}finally{k(null)}};return(0,t.jsx)(j.Z,{"data-testid":"whitelist-manager",children:(0,t.jsxs)(f.Z,{children:[(0,t.jsx)(i.Z,{variant:"h6",gutterBottom:!0,children:"Whitelist"}),l&&(0,t.jsx)(O.Z,{severity:"error",sx:{mb:2},children:l}),(0,t.jsxs)(W.Z,{direction:"row",spacing:1,sx:{mb:2},children:[(0,t.jsx)(N.Z,{size:"small",placeholder:"Player name",value:y,onChange:e=>h(e.target.value),onKeyDown:e=>{"Enter"===e.key&&F()},disabled:p,fullWidth:!0}),(0,t.jsx)(w.Z,{variant:"contained",onClick:F,disabled:!y.trim()||p,startIcon:p?(0,t.jsx)(K.Z,{size:16}):(0,t.jsx)(J.Z,{}),"aria-label":"Add player to whitelist",children:"Add"})]}),n&&(0,t.jsx)(s.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,t.jsx)(K.Z,{})}),!n&&0===d.length&&(0,t.jsx)(i.Z,{color:"text.secondary",sx:{textAlign:"center",py:4},children:"No players whitelisted"}),!n&&d.length>0&&(0,t.jsx)(v.Z,{dense:!0,children:d.map(e=>(0,t.jsxs)(Z.ZP,{secondaryAction:(0,t.jsx)(S.Z,{edge:"end","aria-label":"Remove from whitelist",onClick:()=>I(e.name),disabled:m===e.name,color:"error",children:m===e.name?(0,t.jsx)(K.Z,{size:20}):(0,t.jsx)(z.Z,{})}),children:[(0,t.jsx)(g.Z,{children:(0,t.jsx)(C.Z,{src:e.uuid?"https://mc-heads.net/avatar/".concat(e.uuid,"/40"):void 0,alt:e.name,children:(0,t.jsx)(A.Z,{})})}),(0,t.jsx)(b.Z,{primary:e.name,secondary:e.uuid?e.uuid.substring(0,8)+"...":"UUID not available"})]},e.uuid||e.name))})]})})}var M=n(407);function H(e){let{serverName:r}=e,[n,o]=(0,a.useState)(!0),[l,c]=(0,a.useState)(null),[d,u]=(0,a.useState)([]),[y,h]=(0,a.useState)(""),[p,x]=(0,a.useState)(!1),[m,E]=(0,a.useState)(null),F=(0,a.useCallback)(async()=>{o(!0),c(null);try{let e=await fetch("/api/players/op?server=".concat(encodeURIComponent(r)));if(!e.ok)throw Error("Failed to fetch operators");let n=await e.json();u(n.operators)}catch(e){c("Failed to load operators"),console.error("Error fetching operators:",e)}finally{o(!1)}},[r]);(0,a.useEffect)(()=>{F()},[F]);let I=async()=>{if(y.trim()){x(!0),c(null);try{if(!(await fetch("/api/players/op",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({player:y.trim(),server:r})})).ok)throw Error("Failed to add operator");h(""),await F()}catch(e){c("Failed to add operator"),console.error("Error adding operator:",e)}finally{x(!1)}}},q=async e=>{E(e),c(null);try{if(!(await fetch("/api/players/op?player=".concat(encodeURIComponent(e),"&server=").concat(encodeURIComponent(r)),{method:"DELETE"})).ok)throw Error("Failed to remove operator");await F()}catch(e){c("Failed to remove operator"),console.error("Error removing operator:",e)}finally{E(null)}},P=e=>{switch(e){case 4:return"error";case 3:return"secondary";case 2:return"primary";default:return"default"}};return(0,t.jsx)(j.Z,{"data-testid":"op-manager",children:(0,t.jsxs)(f.Z,{children:[(0,t.jsx)(i.Z,{variant:"h6",gutterBottom:!0,children:"Operators"}),l&&(0,t.jsx)(O.Z,{severity:"error",sx:{mb:2},children:l}),(0,t.jsxs)(W.Z,{direction:"row",spacing:1,sx:{mb:2},children:[(0,t.jsx)(N.Z,{size:"small",placeholder:"Player name",value:y,onChange:e=>h(e.target.value),onKeyDown:e=>{"Enter"===e.key&&I()},disabled:p,fullWidth:!0}),(0,t.jsx)(w.Z,{variant:"contained",onClick:I,disabled:!y.trim()||p,startIcon:p?(0,t.jsx)(K.Z,{size:16}):(0,t.jsx)(J.Z,{}),"aria-label":"Add operator",children:"Add"})]}),n&&(0,t.jsx)(s.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,t.jsx)(K.Z,{})}),!n&&0===d.length&&(0,t.jsx)(i.Z,{color:"text.secondary",sx:{textAlign:"center",py:4},children:"No operators configured"}),!n&&d.length>0&&(0,t.jsx)(v.Z,{dense:!0,children:d.map(e=>(0,t.jsxs)(Z.ZP,{secondaryAction:(0,t.jsx)(S.Z,{edge:"end","aria-label":"Remove operator",onClick:()=>q(e.name),disabled:m===e.name,color:"error",children:m===e.name?(0,t.jsx)(K.Z,{size:20}):(0,t.jsx)(z.Z,{})}),children:[(0,t.jsx)(g.Z,{children:(0,t.jsx)(C.Z,{src:e.uuid?"https://mc-heads.net/avatar/".concat(e.uuid,"/40"):void 0,alt:e.name,sx:{bgcolor:"warning.main"},children:(0,t.jsx)(M.Z,{})})}),(0,t.jsx)(b.Z,{primary:(0,t.jsxs)(s.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.name,(0,t.jsx)(k.Z,{label:"Level ".concat(e.level),size:"small",color:P(e.level)})]}),secondary:e.uuid?e.uuid.substring(0,8)+"...":"UUID not available"})]},e.uuid||e.name))})]})})}var $=n(397);function Y(e){let{serverName:r}=e,[n,o]=(0,a.useState)(!0),[l,c]=(0,a.useState)(null),[d,u]=(0,a.useState)([]),[y,h]=(0,a.useState)(!1),[p,x]=(0,a.useState)({player:"",reason:""}),[m,k]=(0,a.useState)(!1),[q,R]=(0,a.useState)(null),T=(0,a.useCallback)(async()=>{o(!0),c(null);try{let e=await fetch("/api/players/ban?server=".concat(encodeURIComponent(r)));if(!e.ok)throw Error("Failed to fetch bans");let n=await e.json();u(n.players)}catch(e){c("Failed to load ban list"),console.error("Error fetching bans:",e)}finally{o(!1)}},[r]);(0,a.useEffect)(()=>{T()},[T]);let U=()=>{h(!1),x({player:"",reason:""})},L=async()=>{if(p.player.trim()){k(!0),c(null);try{if(!(await fetch("/api/players/ban",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({player:p.player.trim(),reason:p.reason.trim()||"Banned by administrator",server:r})})).ok)throw Error("Failed to ban player");U(),await T()}catch(e){c("Failed to ban player"),console.error("Error banning player:",e)}finally{k(!1)}}},D=async e=>{R(e),c(null);try{if(!(await fetch("/api/players/ban?player=".concat(encodeURIComponent(e),"&server=").concat(encodeURIComponent(r)),{method:"DELETE"})).ok)throw Error("Failed to unban player");await T()}catch(e){c("Failed to unban player"),console.error("Error unbanning player:",e)}finally{R(null)}},Q=e=>{try{return new Date(e).toLocaleDateString()}catch(r){return e}};return(0,t.jsx)(j.Z,{"data-testid":"ban-manager",children:(0,t.jsxs)(f.Z,{children:[(0,t.jsxs)(s.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,t.jsx)(i.Z,{variant:"h6",children:"Ban List"}),(0,t.jsx)(w.Z,{variant:"outlined",color:"error",startIcon:(0,t.jsx)($.Z,{}),onClick:()=>{x({player:"",reason:""}),h(!0)},"aria-label":"Ban player",children:"Ban Player"})]}),l&&(0,t.jsx)(O.Z,{severity:"error",sx:{mb:2},children:l}),n&&(0,t.jsx)(s.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,t.jsx)(K.Z,{})}),!n&&0===d.length&&(0,t.jsx)(i.Z,{color:"text.secondary",sx:{textAlign:"center",py:4},children:"No players banned"}),!n&&d.length>0&&(0,t.jsx)(v.Z,{dense:!0,children:d.map(e=>(0,t.jsxs)(Z.ZP,{secondaryAction:(0,t.jsx)(S.Z,{edge:"end","aria-label":"Unban player",onClick:()=>D(e.name),disabled:q===e.name,color:"success",children:q===e.name?(0,t.jsx)(K.Z,{size:20}):(0,t.jsx)(z.Z,{})}),children:[(0,t.jsx)(g.Z,{children:(0,t.jsx)(C.Z,{src:e.uuid?"https://mc-heads.net/avatar/".concat(e.uuid,"/40"):void 0,alt:e.name,sx:{bgcolor:"error.main"},children:(0,t.jsx)(A.Z,{})})}),(0,t.jsx)(b.Z,{primary:e.name,secondary:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(i.Z,{component:"span",variant:"body2",color:"text.secondary",children:["Reason: ",e.reason||"No reason specified"]}),(0,t.jsx)("br",{}),(0,t.jsxs)(i.Z,{component:"span",variant:"caption",color:"text.secondary",children:["Banned: ",Q(e.created)," by ",e.source||"Unknown"]})]})})]},e.uuid||e.name))}),(0,t.jsxs)(E.Z,{open:y,onClose:U,maxWidth:"sm",fullWidth:!0,children:[(0,t.jsx)(F.Z,{children:"Ban Player"}),(0,t.jsx)(I.Z,{children:(0,t.jsxs)(W.Z,{spacing:2,sx:{mt:1},children:[(0,t.jsx)(N.Z,{label:"Player Name",placeholder:"Enter player name",value:p.player,onChange:e=>x({...p,player:e.target.value}),fullWidth:!0,required:!0}),(0,t.jsx)(N.Z,{label:"Reason",placeholder:"Banned by administrator",value:p.reason,onChange:e=>x({...p,reason:e.target.value}),fullWidth:!0,multiline:!0,rows:2})]})}),(0,t.jsxs)(P.Z,{children:[(0,t.jsx)(w.Z,{onClick:U,disabled:m,children:"Cancel"}),(0,t.jsx)(w.Z,{onClick:L,color:"error",variant:"contained",disabled:!p.player.trim()||m,startIcon:m?(0,t.jsx)(K.Z,{size:16}):(0,t.jsx)($.Z,{}),children:"Ban"})]})]})]})})}var G=n(92666);function V(e){let{children:r,value:n,index:a}=e;return(0,t.jsx)("div",{role:"tabpanel",hidden:n!==a,children:n===a&&(0,t.jsx)(s.Z,{sx:{py:3},children:r})})}function X(){let[e,r]=(0,a.useState)(0),[n,j]=(0,a.useState)(""),{data:f,isLoading:v}=(0,G.x$)(),Z=null==f?void 0:f.servers;return(0,a.useEffect)(()=>{!n&&Z&&Z.length>0&&j(Z[0].name)},[Z,n]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.Z,{elevation:0,sx:{mb:4,p:3,background:e=>"linear-gradient(135deg, ".concat((0,x.Fq)(e.palette.info.main,.1)," 0%, ").concat((0,x.Fq)(e.palette.secondary.main,.1)," 100%)"),borderRadius:2,border:e=>"1px solid ".concat((0,x.Fq)(e.palette.info.main,.2))},children:(0,t.jsxs)(s.Z,{sx:{display:"flex",alignItems:"center",gap:2},children:[(0,t.jsx)(s.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:56,height:56,borderRadius:2,bgcolor:"info.main",color:"info.contrastText"},children:(0,t.jsx)(m.Z,{sx:{fontSize:32}})}),(0,t.jsxs)(s.Z,{children:[(0,t.jsx)(i.Z,{variant:"h4",component:"h1",fontWeight:"bold",children:"Player Management"}),(0,t.jsx)(i.Z,{variant:"body1",color:"text.secondary",children:"Manage players, whitelist, operators, and bans across your servers"})]})]})}),(0,t.jsx)(s.Z,{sx:{mb:3},children:(0,t.jsxs)(d.Z,{sx:{minWidth:200},children:[(0,t.jsx)(u.Z,{id:"server-select-label",children:"Server"}),(0,t.jsx)(y.Z,{labelId:"server-select-label",value:n,label:"Server",onChange:e=>j(e.target.value),disabled:v,children:null==Z?void 0:Z.map(e=>(0,t.jsx)(h.Z,{value:e.name,children:e.name},e.name))})]})}),(0,t.jsx)(s.Z,{sx:{borderBottom:1,borderColor:"divider"},children:(0,t.jsxs)(l.Z,{value:e,onChange:(e,n)=>{r(n)},"aria-label":"Player management tabs",children:[(0,t.jsx)(c.Z,{label:"Online Players"}),(0,t.jsx)(c.Z,{label:"Whitelist",disabled:!n}),(0,t.jsx)(c.Z,{label:"Operators",disabled:!n}),(0,t.jsx)(c.Z,{label:"Ban List",disabled:!n})]})}),(0,t.jsx)(V,{value:e,index:0,children:(0,t.jsx)(B,{})}),(0,t.jsx)(V,{value:e,index:1,children:n&&(0,t.jsxs)(o.ZP,{container:!0,spacing:3,children:[(0,t.jsx)(o.ZP,{item:!0,xs:12,md:8,children:(0,t.jsx)(_,{serverName:n})}),(0,t.jsx)(o.ZP,{item:!0,xs:12,md:4,children:(0,t.jsxs)(s.Z,{sx:{p:2,bgcolor:"background.paper",borderRadius:1},children:[(0,t.jsx)(i.Z,{variant:"subtitle2",color:"text.secondary",gutterBottom:!0,children:"About Whitelist"}),(0,t.jsx)(i.Z,{variant:"body2",color:"text.secondary",children:"The whitelist controls which players can join your server. When enabled, only players on the whitelist can connect. Add players by their Minecraft username."})]})})]})}),(0,t.jsx)(V,{value:e,index:2,children:n&&(0,t.jsxs)(o.ZP,{container:!0,spacing:3,children:[(0,t.jsx)(o.ZP,{item:!0,xs:12,md:8,children:(0,t.jsx)(H,{serverName:n})}),(0,t.jsx)(o.ZP,{item:!0,xs:12,md:4,children:(0,t.jsxs)(s.Z,{sx:{p:2,bgcolor:"background.paper",borderRadius:1},children:[(0,t.jsx)(i.Z,{variant:"subtitle2",color:"text.secondary",gutterBottom:!0,children:"About Operators"}),(0,t.jsx)(i.Z,{variant:"body2",color:"text.secondary",children:"Operators (OPs) have elevated permissions on the server. They can use commands like /give, /gamemode, /tp, and more. OP levels range from 1-4, with 4 being the highest."}),(0,t.jsxs)(s.Z,{sx:{mt:2},children:[(0,t.jsx)(i.Z,{variant:"caption",color:"text.secondary",component:"div",children:"Level 1: Can bypass spawn protection"}),(0,t.jsx)(i.Z,{variant:"caption",color:"text.secondary",component:"div",children:"Level 2: Can use /clear, /gamemode, etc."}),(0,t.jsx)(i.Z,{variant:"caption",color:"text.secondary",component:"div",children:"Level 3: Can use /ban, /kick, /op, etc."}),(0,t.jsx)(i.Z,{variant:"caption",color:"text.secondary",component:"div",children:"Level 4: Can use /stop, full access"})]})]})})]})}),(0,t.jsx)(V,{value:e,index:3,children:n&&(0,t.jsxs)(o.ZP,{container:!0,spacing:3,children:[(0,t.jsx)(o.ZP,{item:!0,xs:12,md:8,children:(0,t.jsx)(Y,{serverName:n})}),(0,t.jsx)(o.ZP,{item:!0,xs:12,md:4,children:(0,t.jsxs)(s.Z,{sx:{p:2,bgcolor:"background.paper",borderRadius:1},children:[(0,t.jsx)(i.Z,{variant:"subtitle2",color:"text.secondary",gutterBottom:!0,children:"About Bans"}),(0,t.jsx)(i.Z,{variant:"body2",color:"text.secondary",children:"Banned players cannot connect to your server. You can ban players by username and provide an optional reason. Bans can be removed (pardoned) at any time."})]})})]})})]})}},42936:function(e,r,n){"use strict";async function t(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={...r.headers};r.body&&(n["Content-Type"]="application/json");let t=await fetch(e,{...r,headers:n});if(!t.ok){let e=await t.json().catch(()=>({error:"UnknownError",message:t.statusText})),r=Error(e.message);throw r.statusCode=t.status,r.code=e.error,r}return t.json()}n.d(r,{SC:function(){return t}})},92666:function(e,r,n){"use strict";n.d(r,{$t:function(){return C},Aw:function(){return u},Fv:function(){return j},Hq:function(){return c},Hy:function(){return l},MH:function(){return v},Sr:function(){return h},_I:function(){return y},c5:function(){return S},g2:function(){return m},gx:function(){return Z},hy:function(){return p},iC:function(){return f},jM:function(){return d},mj:function(){return g},nq:function(){return x},nv:function(){return b},s8:function(){return w},x$:function(){return o}});var t=n(5632),a=n(58919),s=n(20367),i=n(42936);function o(){return(0,t.a)({queryKey:["servers"],queryFn:()=>(0,i.SC)("/api/servers"),refetchInterval:6e4})}function l(e,r){return(0,t.a)({queryKey:["servers",e],queryFn:()=>(0,i.SC)("/api/servers/".concat(encodeURIComponent(e))),enabled:(null==r?void 0:r.enabled)!==!1&&!!e,refetchInterval:3e4})}function c(){let e=(0,a.NL)();return(0,s.D)({mutationFn:e=>{let{name:r,force:n}=e;return(0,i.SC)("/api/servers/".concat(encodeURIComponent(r)).concat(n?"?force=true":""),{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:["servers"]})}})}function d(){let e=(0,a.NL)();return(0,s.D)({mutationFn:e=>(0,i.SC)("/api/servers/".concat(encodeURIComponent(e),"/start"),{method:"POST"}),onSuccess:(r,n)=>{e.invalidateQueries({queryKey:["servers"]}),e.invalidateQueries({queryKey:["servers",n]})}})}function u(){let e=(0,a.NL)();return(0,s.D)({mutationFn:e=>(0,i.SC)("/api/servers/".concat(encodeURIComponent(e),"/stop"),{method:"POST"}),onSuccess:(r,n)=>{e.invalidateQueries({queryKey:["servers"]}),e.invalidateQueries({queryKey:["servers",n]})}})}function y(){let e=(0,a.NL)();return(0,s.D)({mutationFn:e=>(0,i.SC)("/api/servers/".concat(encodeURIComponent(e),"/restart"),{method:"POST"}),onSuccess:(r,n)=>{e.invalidateQueries({queryKey:["servers"]}),e.invalidateQueries({queryKey:["servers",n]})}})}function h(){return(0,t.a)({queryKey:["worlds"],queryFn:()=>(0,i.SC)("/api/worlds"),refetchInterval:3e4})}function p(){let e=(0,a.NL)();return(0,s.D)({mutationFn:e=>(0,i.SC)("/api/worlds",{method:"POST",body:JSON.stringify(e)}),onSuccess:()=>{e.invalidateQueries({queryKey:["worlds"]})}})}function x(){let e=(0,a.NL)();return(0,s.D)({mutationFn:e=>{let{worldName:r,serverName:n}=e;return(0,i.SC)("/api/worlds/".concat(encodeURIComponent(r),"/assign"),{method:"POST",body:JSON.stringify({serverName:n})})},onSuccess:()=>{e.invalidateQueries({queryKey:["worlds"]}),e.invalidateQueries({queryKey:["servers"]})}})}function m(){let e=(0,a.NL)();return(0,s.D)({mutationFn:e=>{let{worldName:r,force:n}=e;return(0,i.SC)("/api/worlds/".concat(encodeURIComponent(r),"/release").concat(n?"?force=true":""),{method:"POST"})},onSuccess:()=>{e.invalidateQueries({queryKey:["worlds"]})}})}function j(){let e=(0,a.NL)();return(0,s.D)({mutationFn:e=>{let{name:r,force:n}=e;return(0,i.SC)("/api/worlds/".concat(encodeURIComponent(r)).concat(n?"?force=true":""),{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:["worlds"]})}})}function f(e,r){return(0,t.a)({queryKey:["servers",e,"config"],queryFn:()=>(0,i.SC)("/api/servers/".concat(encodeURIComponent(e),"/config")),enabled:(null==r?void 0:r.enabled)!==!1&&!!e})}function v(){let e=(0,a.NL)();return(0,s.D)({mutationFn:e=>{let{serverName:r,config:n}=e;return(0,i.SC)("/api/servers/".concat(encodeURIComponent(r),"/config"),{method:"PATCH",body:JSON.stringify(n)})},onSuccess:(r,n)=>{let{serverName:t}=n;e.invalidateQueries({queryKey:["servers",t,"config"]}),e.invalidateQueries({queryKey:["servers",t]})}})}function Z(){let e=(0,a.NL)();return(0,s.D)({mutationFn:e=>(0,i.SC)("/api/servers/".concat(encodeURIComponent(e),"/world/reset"),{method:"POST"}),onSuccess:(r,n)=>{e.invalidateQueries({queryKey:["servers",n]}),e.invalidateQueries({queryKey:["worlds"]})}})}function b(){return(0,t.a)({queryKey:["router-status"],queryFn:()=>(0,i.SC)("/api/router/status"),refetchInterval:3e4})}function g(){return(0,t.a)({queryKey:["backup-status"],queryFn:()=>(0,i.SC)("/api/backup"),refetchInterval:6e4})}function C(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20;return(0,t.a)({queryKey:["backup-history",e],queryFn:()=>(0,i.SC)("/api/backup/history?limit=".concat(e)),refetchInterval:6e4})}function S(){let e=(0,a.NL)();return(0,s.D)({mutationFn:e=>{let{message:r}=e;return(0,i.SC)("/api/backup",{method:"POST",body:JSON.stringify({message:r})})},onSuccess:()=>{e.invalidateQueries({queryKey:["backup-status"]}),e.invalidateQueries({queryKey:["backup-history"]})}})}function w(){let e=(0,a.NL)();return(0,s.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"]})}})}}},function(e){e.O(0,[6812,7220,8006,7294,8696,1071,540,6189,4840,310,8347,2149,2022,8657,2093,3669,2757,1744],function(){return e(e.s=31809)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[148],{61943:function(e,n,r){Promise.resolve().then(r.bind(r,73046))},73046:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return E}});var t=r(94655),s=r(7281),i=r(84840),o=r(31317),a=r(10721),c=r(81071),l=r(628),u=r(41565),d=r(69899),x=r(76492),h=r(29983),f=r(92666),m=r(25333),p=r(21138),y=r(84811),j=r(70366),v=r(47001),Z=r(59602);let g={fontWeight:500,color:"text.secondary",border:0,width:"40%",py:1},b={border:0,py:1};function w(e){var n;let{router:r}=e,i=(n=r.mode)?n.includes("in-docker")||n.includes("auto-discovery")?{label:"Auto Discovery",color:"info"}:n.includes("mapping")?{label:"Manual Mapping",color:"warning"}:{label:n,color:"default"}:{label:"Unknown",color:"default"};return(0,t.jsx)(l.Z,{children:(0,t.jsxs)(u.Z,{children:[(0,t.jsxs)(s.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[(0,t.jsx)(Z.Z,{color:"primary"}),(0,t.jsx)(o.Z,{variant:"h6",component:"h2",children:"Platform Information"})]}),(0,t.jsx)(p.Z,{size:"small",children:(0,t.jsxs)(y.Z,{children:[(0,t.jsxs)(j.Z,{children:[(0,t.jsx)(v.Z,{sx:g,children:"Router Name"}),(0,t.jsx)(v.Z,{sx:b,children:r.name})]}),(0,t.jsxs)(j.Z,{children:[(0,t.jsx)(v.Z,{sx:g,children:"Port"}),(0,t.jsx)(v.Z,{sx:b,children:r.port})]}),(0,t.jsxs)(j.Z,{children:[(0,t.jsx)(v.Z,{sx:g,children:"Mode"}),(0,t.jsx)(v.Z,{sx:b,children:(0,t.jsx)(m.Z,{label:i.label,size:"small",color:i.color,variant:"outlined"})})]}),(0,t.jsxs)(j.Z,{children:[(0,t.jsx)(v.Z,{sx:g,children:"Uptime"}),(0,t.jsx)(v.Z,{sx:b,children:r.uptime||"-"})]})]})})]})})}var S=r(95511),C=r(66561),q=r(12795),I=r(96407),K=r(81960);function F(e){switch(e){case"running":return"#4caf50";case"exited":case"dead":case"not_found":case"not_created":return"#f44336";case"created":case"restarting":case"paused":return"#ff9800";default:return"#9e9e9e"}}function N(e){let{status:n}=e;return(0,t.jsx)(S.Z,{title:n,arrow:!0,children:(0,t.jsx)(s.Z,{sx:{width:10,height:10,borderRadius:"50%",bgcolor:F(n),flexShrink:0,boxShadow:"running"===n?"0 0 6px ".concat(F(n)):"none"}})})}function k(e){let{router:n}=e,r=function(e){let n=new Map;for(let r of e){let e=r.target.replace(/^mc-/,"").replace(/:25565$/,""),t=n.get(e);t?t.hostnames.push(r.hostname):n.set(e,{status:r.serverStatus,hostnames:[r.hostname],serverType:r.serverType,serverVersion:r.serverVersion})}return n}(n.routes);return(0,t.jsx)(l.Z,{sx:{height:"100%"},children:(0,t.jsxs)(u.Z,{children:[(0,t.jsxs)(s.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[(0,t.jsx)(h.Z,{color:"primary"}),(0,t.jsx)(o.Z,{variant:"h6",component:"h2",children:"MC-Router Status"}),(0,t.jsxs)(s.Z,{sx:{ml:"auto",display:"flex",gap:1},children:[(0,t.jsx)(m.Z,{label:n.status,size:"small",color:function(e){switch(e){case"running":return"success";case"exited":case"dead":case"not_found":case"not_created":return"error";case"created":case"restarting":case"paused":return"warning";default:return"default"}}(n.status)}),(0,t.jsx)(m.Z,{label:n.health,size:"small",color:function(e){switch(e){case"healthy":return"success";case"unhealthy":return"error";case"starting":return"warning";default:return"default"}}(n.health),variant:"outlined"})]})]}),(0,t.jsx)(o.Z,{variant:"subtitle2",sx:{mb:1,mt:3},children:"Routing Table"}),0===n.routes.length?(0,t.jsx)(o.Z,{variant:"body2",color:"text.secondary",sx:{py:2,textAlign:"center"},children:"No routes configured"}):(0,t.jsx)(s.Z,{sx:{mt:1},children:Array.from(r.entries()).map(e=>{let[n,{status:r,hostnames:i,serverType:a,serverVersion:c}]=e;return(0,t.jsxs)(C.Z,{defaultExpanded:!0,disableGutters:!0,elevation:0,sx:{border:1,borderColor:"divider","&:not(:last-child)":{borderBottom:0},"&::before":{display:"none"}},children:[(0,t.jsx)(q.Z,{expandIcon:(0,t.jsx)(K.Z,{}),children:(0,t.jsxs)(s.Z,{sx:{display:"flex",alignItems:"center",gap:1,width:"100%",pr:1},children:[(0,t.jsx)(N,{status:r}),(0,t.jsx)(o.Z,{variant:"subtitle2",sx:{fontWeight:600},children:n}),(a||c)&&(0,t.jsx)(o.Z,{variant:"caption",color:"text.secondary",children:[a,c].filter(Boolean).join(" ")}),(0,t.jsxs)(o.Z,{variant:"caption",color:"text.secondary",sx:{ml:"auto"},children:[i.length," ",1===i.length?"route":"routes"]})]})}),(0,t.jsx)(I.Z,{sx:{pt:0},children:(0,t.jsx)(s.Z,{sx:{display:"flex",flexDirection:"column",gap:.5},children:i.map(e=>(0,t.jsx)(o.Z,{variant:"body2",sx:{fontFamily:"monospace",fontSize:"0.85rem",color:"text.secondary"},children:e},e))})})]},n)})})]})})}var D=r(21605);let R={fontWeight:500,color:"text.secondary",border:0,width:"40%",py:1},P={border:0,py:1};function Q(e){var n;let{router:r}=e,i=r.routes.filter(e=>"running"===e.serverStatus).length,a=r.routes.length;return(0,t.jsx)(l.Z,{children:(0,t.jsxs)(u.Z,{children:[(0,t.jsxs)(s.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[(0,t.jsx)(D.Z,{color:"primary"}),(0,t.jsx)(o.Z,{variant:"h6",component:"h2",children:"Network Settings"})]}),(0,t.jsx)(p.Z,{size:"small",children:(0,t.jsxs)(y.Z,{children:[(0,t.jsxs)(j.Z,{children:[(0,t.jsx)(v.Z,{sx:R,children:"Listening Port"}),(0,t.jsx)(v.Z,{sx:P,children:(0,t.jsx)(m.Z,{label:r.port,size:"small",variant:"outlined"})})]}),(0,t.jsxs)(j.Z,{children:[(0,t.jsx)(v.Z,{sx:R,children:"Routing Mode"}),(0,t.jsx)(v.Z,{sx:P,children:(0,t.jsx)(m.Z,{label:(n=r.mode)?n.includes("in-docker")||n.includes("auto-discovery")?"Auto Discovery":n.includes("mapping")?"Manual Mapping":n:"Unknown",size:"small",color:"info",variant:"outlined"})})]}),(0,t.jsxs)(j.Z,{children:[(0,t.jsx)(v.Z,{sx:R,children:"Total Routes"}),(0,t.jsx)(v.Z,{sx:P,children:a})]}),(0,t.jsxs)(j.Z,{children:[(0,t.jsx)(v.Z,{sx:R,children:"Active Routes"}),(0,t.jsx)(v.Z,{sx:P,children:(0,t.jsx)(m.Z,{label:"".concat(i," / ").concat(a),size:"small",color:i>0?"success":"default",variant:"outlined"})})]})]})})]})})}var T=r(76544);function O(e){var n;let{avahi:r}=e,i=null!==(n=null==r?void 0:r.status)&&void 0!==n?n:"unknown";return(0,t.jsx)(l.Z,{children:(0,t.jsxs)(u.Z,{children:[(0,t.jsxs)(s.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[(0,t.jsx)(T.Z,{color:"primary"}),(0,t.jsx)(o.Z,{variant:"h6",component:"h2",children:"mDNS (Avahi)"}),(0,t.jsx)(m.Z,{label:i,size:"small",color:"running"===i?"success":i.includes("not running")?"warning":"not installed"===i?"error":"default",sx:{ml:"auto"}})]}),(0,t.jsxs)(o.Z,{variant:"body2",color:"text.secondary",children:["Avahi mDNS daemon enables ",(0,t.jsx)("code",{children:".local"})," hostname resolution for Minecraft servers on the local network."]})]})})}function L(e){let{rows:n}=e;return(0,t.jsx)(l.Z,{children:(0,t.jsxs)(u.Z,{children:[(0,t.jsxs)(s.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[(0,t.jsx)(a.Z,{variant:"circular",width:24,height:24}),(0,t.jsx)(a.Z,{variant:"text",width:"50%",height:32})]}),[...Array(n)].map((e,n)=>(0,t.jsxs)(s.Z,{sx:{display:"flex",justifyContent:"space-between",py:.75},children:[(0,t.jsx)(a.Z,{variant:"text",width:"35%"}),(0,t.jsx)(a.Z,{variant:"text",width:"40%"})]},n))]})})}function U(){return(0,t.jsx)(l.Z,{sx:{height:"100%"},children:(0,t.jsxs)(u.Z,{children:[(0,t.jsxs)(s.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[(0,t.jsx)(a.Z,{variant:"circular",width:24,height:24}),(0,t.jsx)(a.Z,{variant:"text",width:"40%",height:32}),(0,t.jsxs)(s.Z,{sx:{ml:"auto",display:"flex",gap:1},children:[(0,t.jsx)(a.Z,{variant:"rounded",width:70,height:24}),(0,t.jsx)(a.Z,{variant:"rounded",width:70,height:24})]})]}),(0,t.jsx)(a.Z,{variant:"text",width:"30%",sx:{mt:3,mb:1}}),[0,1].map(e=>(0,t.jsxs)(s.Z,{sx:{border:1,borderColor:"divider",p:2,"&:not(:last-child)":{borderBottom:0}},children:[(0,t.jsxs)(s.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:1.5},children:[(0,t.jsx)(a.Z,{variant:"circular",width:10,height:10}),(0,t.jsx)(a.Z,{variant:"text",width:"25%"}),(0,t.jsx)(a.Z,{variant:"text",width:"15%"}),(0,t.jsx)(a.Z,{variant:"text",width:"10%",sx:{ml:"auto"}})]}),[0,1,2].map(e=>(0,t.jsx)(a.Z,{variant:"text",width:"70%",sx:{ml:2.5}},e))]},e))]})})}function E(){let{data:e,isLoading:n,error:r}=(0,f.nv)();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d.Z,{elevation:0,sx:{mb:4,p:3,background:e=>"linear-gradient(135deg, ".concat((0,x.Fq)(e.palette.warning.main,.1)," 0%, ").concat((0,x.Fq)(e.palette.info.main,.1)," 100%)"),borderRadius:2,border:e=>"1px solid ".concat((0,x.Fq)(e.palette.warning.main,.2))},children:(0,t.jsxs)(s.Z,{sx:{display:"flex",alignItems:"center",gap:2},children:[(0,t.jsx)(s.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:56,height:56,borderRadius:2,bgcolor:"warning.main",color:"warning.contrastText"},children:(0,t.jsx)(h.Z,{sx:{fontSize:32}})}),(0,t.jsxs)(s.Z,{children:[(0,t.jsx)(o.Z,{variant:"h4",component:"h1",fontWeight:"bold",children:"Routing"}),(0,t.jsx)(o.Z,{variant:"body1",color:"text.secondary",children:"Server routing and network configuration"})]})]})}),r&&(0,t.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to load router status: ",r.message]}),n?(0,t.jsxs)(i.ZP,{container:!0,spacing:3,children:[(0,t.jsx)(i.ZP,{item:!0,xs:12,md:4,children:(0,t.jsxs)(s.Z,{sx:{display:"flex",flexDirection:"column",gap:3},children:[(0,t.jsx)(L,{rows:4}),(0,t.jsx)(L,{rows:4}),(0,t.jsx)(L,{rows:1})]})}),(0,t.jsx)(i.ZP,{item:!0,xs:12,md:8,children:(0,t.jsx)(U,{})})]}):(null==e?void 0:e.router)?(0,t.jsxs)(i.ZP,{container:!0,spacing:3,children:[(0,t.jsx)(i.ZP,{item:!0,xs:12,md:4,children:(0,t.jsxs)(s.Z,{sx:{display:"flex",flexDirection:"column",gap:3},children:[(0,t.jsx)(w,{router:e.router}),(0,t.jsx)(Q,{router:e.router}),(0,t.jsx)(O,{avahi:e.avahi})]})}),(0,t.jsx)(i.ZP,{item:!0,xs:12,md:8,children:(0,t.jsx)(k,{router:e.router})})]}):null]})}},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 w},Aw:function(){return d},Fv:function(){return y},Hq:function(){return l},Hy:function(){return c},MH:function(){return v},Sr:function(){return h},_I:function(){return x},c5:function(){return S},g2:function(){return p},gx:function(){return Z},hy:function(){return f},iC:function(){return j},jM:function(){return u},mj:function(){return b},nq:function(){return m},nv:function(){return g},s8:function(){return C},x$:function(){return a}});var t=r(5632),s=r(58919),i=r(20367),o=r(42936);function a(){return(0,t.a)({queryKey:["servers"],queryFn:()=>(0,o.SC)("/api/servers"),refetchInterval:6e4})}function c(e,n){return(0,t.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 l(){let e=(0,s.NL)();return(0,i.D)({mutationFn:e=>{let{name:n,force:r}=e;return(0,o.SC)("/api/servers/".concat(encodeURIComponent(n)).concat(r?"?force=true":""),{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:["servers"]})}})}function u(){let e=(0,s.NL)();return(0,i.D)({mutationFn:e=>(0,o.SC)("/api/servers/".concat(encodeURIComponent(e),"/start"),{method:"POST"}),onSuccess:(n,r)=>{e.invalidateQueries({queryKey:["servers"]}),e.invalidateQueries({queryKey:["servers",r]})}})}function d(){let e=(0,s.NL)();return(0,i.D)({mutationFn:e=>(0,o.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,o.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,o.SC)("/api/worlds"),refetchInterval:3e4})}function f(){let e=(0,s.NL)();return(0,i.D)({mutationFn:e=>(0,o.SC)("/api/worlds",{method:"POST",body:JSON.stringify(e)}),onSuccess:()=>{e.invalidateQueries({queryKey:["worlds"]})}})}function m(){let e=(0,s.NL)();return(0,i.D)({mutationFn:e=>{let{worldName:n,serverName:r}=e;return(0,o.SC)("/api/worlds/".concat(encodeURIComponent(n),"/assign"),{method:"POST",body:JSON.stringify({serverName:r})})},onSuccess:()=>{e.invalidateQueries({queryKey:["worlds"]}),e.invalidateQueries({queryKey:["servers"]})}})}function p(){let e=(0,s.NL)();return(0,i.D)({mutationFn:e=>{let{worldName:n,force:r}=e;return(0,o.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,o.SC)("/api/worlds/".concat(encodeURIComponent(n)).concat(r?"?force=true":""),{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:["worlds"]})}})}function j(e,n){return(0,t.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 v(){let e=(0,s.NL)();return(0,i.D)({mutationFn:e=>{let{serverName:n,config:r}=e;return(0,o.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 Z(){let e=(0,s.NL)();return(0,i.D)({mutationFn:e=>(0,o.SC)("/api/servers/".concat(encodeURIComponent(e),"/world/reset"),{method:"POST"}),onSuccess:(n,r)=>{e.invalidateQueries({queryKey:["servers",r]}),e.invalidateQueries({queryKey:["worlds"]})}})}function g(){return(0,t.a)({queryKey:["router-status"],queryFn:()=>(0,o.SC)("/api/router/status"),refetchInterval:3e4})}function b(){return(0,t.a)({queryKey:["backup-status"],queryFn:()=>(0,o.SC)("/api/backup"),refetchInterval:6e4})}function w(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20;return(0,t.a)({queryKey:["backup-history",e],queryFn:()=>(0,o.SC)("/api/backup/history?limit=".concat(e)),refetchInterval:6e4})}function S(){let e=(0,s.NL)();return(0,i.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 C(){let e=(0,s.NL)();return(0,i.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,7220,8006,1071,540,6189,4840,5511,9654,8657,9030,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,6803,7294,1604,4538,6357,5375,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,7220,8006,7294,8696,4538,6645,1476,3669,2757,1744],function(){return e(e.s=32823)}),_N_E=e.O()}]);
|