@minecraft-docker/mcctl-console 2.3.4 → 2.4.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/package.json +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/BUILD_ID +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/app-build-manifest.json +61 -61
- 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)/admin/users/page_client-reference-manifest.js +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_client-reference-manifest.js +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_client-reference-manifest.js +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_client-reference-manifest.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/worlds/page_client-reference-manifest.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/_not-found.rsc +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/mods/search/route.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/mods/search/route.js.nft.json +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/servers/[name]/mods/[slug]/route.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/servers/[name]/mods/[slug]/route.js.nft.json +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/servers/[name]/mods/route.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/servers/[name]/mods/route.js.nft.json +1 -0
- 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 +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/backups.html +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/backups.rsc +1 -1
- 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 +1 -1
- 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_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 +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 +2 -2
- 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 +2 -2
- 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 +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/settings.html +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/settings.rsc +2 -2
- 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 +1 -1
- 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 +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app-paths-manifest.json +23 -20
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/1309.js +2 -2
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/3068.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/5843.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/392-8c54ddef9482164b.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/4219-a84afcb66908141b.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/4682-61f6b7ad99cfd0c9.js +1 -0
- package/.next/{static/chunks/7965-9d8c883e48d2ae13.js → standalone/platform/services/mcctl-console/.next/static/chunks/7965-a31f12b5a5f1519b.js} +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/players/{page-a06b9b52377085b5.js → page-785e0ce7c07f8119.js} +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/servers/[name]/page-c4822f1e941923cd.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/{main-0309b77c14e952d4.js → main-58b18a5a50224bc7.js} +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/css/2a015360a6bc64f3.css +1 -0
- package/.next/standalone/platform/services/mcctl-console/package.json +1 -1
- package/.next/static/chunks/392-8c54ddef9482164b.js +1 -0
- package/.next/static/chunks/4219-a84afcb66908141b.js +1 -0
- package/.next/static/chunks/4682-61f6b7ad99cfd0c9.js +1 -0
- package/.next/{standalone/platform/services/mcctl-console/.next/static/chunks/7965-9d8c883e48d2ae13.js → static/chunks/7965-a31f12b5a5f1519b.js} +1 -1
- package/.next/static/chunks/app/(main)/players/{page-a06b9b52377085b5.js → page-785e0ce7c07f8119.js} +1 -1
- package/.next/static/chunks/app/(main)/servers/[name]/page-c4822f1e941923cd.js +1 -0
- package/.next/static/chunks/{main-0309b77c14e952d4.js → main-58b18a5a50224bc7.js} +1 -1
- package/.next/static/css/2a015360a6bc64f3.css +1 -0
- package/package.json +2 -2
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/2658.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/3468-6b2e00f103a95869.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/7305-17eb783421477032.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/9186-5b49ecbdcac7ddc4.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/servers/[name]/page-00a86e5a4cd95b72.js +0 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/css/8dfdea5f9ccf5da4.css +0 -1
- package/.next/static/chunks/3468-6b2e00f103a95869.js +0 -1
- package/.next/static/chunks/7305-17eb783421477032.js +0 -1
- package/.next/static/chunks/9186-5b49ecbdcac7ddc4.js +0 -1
- package/.next/static/chunks/app/(main)/servers/[name]/page-00a86e5a4cd95b72.js +0 -1
- package/.next/static/css/8dfdea5f9ccf5da4.css +0 -1
- /package/.next/standalone/platform/services/mcctl-console/.next/static/{4NQmVyApP9gpa9vf5rWmA → eY-MudOXmSNPmh213HoT9}/_buildManifest.js +0 -0
- /package/.next/standalone/platform/services/mcctl-console/.next/static/{4NQmVyApP9gpa9vf5rWmA → eY-MudOXmSNPmh213HoT9}/_ssgManifest.js +0 -0
- /package/.next/static/{4NQmVyApP9gpa9vf5rWmA → eY-MudOXmSNPmh213HoT9}/_buildManifest.js +0 -0
- /package/.next/static/{4NQmVyApP9gpa9vf5rWmA → eY-MudOXmSNPmh213HoT9}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7965],{76544:function(e,n,r){var t=r(8091);n.Z=void 0;var s=t(r(66758)),i=r(94655);n.Z=(0,s.default)([(0,i.jsx)("path",{d:"m7.3 14.7 1.2-1.2c-1-1-1.5-2.3-1.5-3.5 0-1.3.5-2.6 1.5-3.5L7.3 5.3c-1.3 1.3-2 3-2 4.7s.7 3.4 2 4.7M19.1 2.9l-1.2 1.2c1.6 1.6 2.4 3.8 2.4 5.9 0 2.1-.8 4.3-2.4 5.9l1.2 1.2c2-2 2.9-4.5 2.9-7.1 0-2.6-1-5.1-2.9-7.1"},"0"),(0,i.jsx)("path",{d:"M6.1 4.1 4.9 2.9C3 4.9 2 7.4 2 10c0 2.6 1 5.1 2.9 7.1l1.2-1.2c-1.6-1.6-2.4-3.8-2.4-5.9 0-2.1.8-4.3 2.4-5.9m10.6 10.6c1.3-1.3 2-3 2-4.7-.1-1.7-.7-3.4-2-4.7l-1.2 1.2c1 1 1.5 2.3 1.5 3.5 0 1.3-.5 2.6-1.5 3.5zM14.5 10c0-1.38-1.12-2.5-2.5-2.5S9.5 8.62 9.5 10c0 .76.34 1.42.87 1.88L7 22h2l.67-2h4.67l.66 2h2l-3.37-10.12c.53-.46.87-1.12.87-1.88m-4.17 8L12 13l1.67 5z"},"1")],"CellTower")},23695:function(e,n,r){var t=r(8091);n.Z=void 0;var s=t(r(66758)),i=r(94655);n.Z=(0,s.default)((0,i.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"}),"Info")},21605:function(e,n,r){var t=r(8091);n.Z=void 0;var s=t(r(66758)),i=r(94655);n.Z=(0,s.default)((0,i.jsx)("path",{d:"M15.9 5c-.17 0-.32.09-.41.23l-.07.15-5.18 11.65c-.16.29-.26.61-.26.96 0 1.11.9 2.01 2.01 2.01.96 0 1.77-.68 1.96-1.59l.01-.03L16.4 5.5c0-.28-.22-.5-.5-.5M1 9l2 2c2.88-2.88 6.79-4.08 10.53-3.62l1.19-2.68C9.89 3.84 4.74 5.27 1 9m20 2 2-2c-1.64-1.64-3.55-2.82-5.59-3.57l-.53 2.82c1.5.62 2.9 1.53 4.12 2.75m-4 4 2-2c-.8-.8-1.7-1.42-2.66-1.89l-.55 2.92c.42.27.83.59 1.21.97M5 13l2 2c1.13-1.13 2.56-1.79 4.03-2l1.28-2.88c-2.63-.08-5.3.87-7.31 2.88"}),"NetworkCheck")},9078:function(e,n,r){var t=r(8091);n.Z=void 0;var s=t(r(66758)),i=r(94655);n.Z=(0,s.default)((0,i.jsx)("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"}),"OpenInNew")},84974:function(e,n,r){var t=r(8091);n.Z=void 0;var s=t(r(66758)),i=r(94655);n.Z=(0,s.default)((0,i.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39"}),"Public")},29983:function(e,n,r){var t=r(8091);n.Z=void 0;var s=t(r(66758)),i=r(94655);n.Z=(0,s.default)((0,i.jsx)("path",{d:"m20.2 5.9.8-.8C19.6 3.7 17.8 3 16 3s-3.6.7-5 2.1l.8.8C13 4.8 14.5 4.2 16 4.2s3 .6 4.2 1.7m-.9.8c-.9-.9-2.1-1.4-3.3-1.4s-2.4.5-3.3 1.4l.8.8c.7-.7 1.6-1 2.5-1 .9 0 1.8.3 2.5 1zM19 13h-2V9h-2v4H5c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-4c0-1.1-.9-2-2-2M8 18H6v-2h2zm3.5 0h-2v-2h2zm3.5 0h-2v-2h2z"}),"Router")},93315:function(e,n,r){var t=r(8091);n.Z=void 0;var s=t(r(66758)),i=r(94655);n.Z=(0,s.default)((0,i.jsx)("path",{d:"M6 6h12v12H6z"}),"Stop")},42730:function(e,n,r){var t=r(8091);n.Z=void 0;var s=t(r(66758)),i=r(94655);n.Z=(0,s.default)((0,i.jsx)("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}),"VisibilityOff")},52082:function(e,n,r){r.d(n,{Z:function(){return w}});var t,s=r(32324),i=r(81500),a=r(35106),l=r(70316),o=r(65951),c=r(38762),d=r(31317),x=r(14406),u=r(85016),h=r(34519),p=r(11379),m=r(9049);function Z(e){return(0,m.ZP)("MuiInputAdornment",e)}let j=(0,p.Z)("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var f=r(28057),v=r(94655);let g=["children","className","component","disablePointerEvents","disableTypography","position","variant"],y=e=>{let{classes:n,disablePointerEvents:r,hiddenLabel:t,position:s,size:i,variant:a}=e,l={root:["root",r&&"disablePointerEvents",s&&"position".concat((0,c.Z)(s)),a,t&&"hiddenLabel",i&&"size".concat((0,c.Z)(i))]};return(0,o.Z)(l,Z,n)},b=(0,h.ZP)("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:(e,n)=>{let{ownerState:r}=e;return[n.root,n["position".concat((0,c.Z)(r.position))],!0===r.disablePointerEvents&&n.disablePointerEvents,n[r.variant]]}})(e=>{let{theme:n,ownerState:r}=e;return(0,i.Z)({display:"flex",height:"0.01em",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(n.vars||n).palette.action.active},"filled"===r.variant&&{["&.".concat(j.positionStart,"&:not(.").concat(j.hiddenLabel,")")]:{marginTop:16}},"start"===r.position&&{marginRight:8},"end"===r.position&&{marginLeft:8},!0===r.disablePointerEvents&&{pointerEvents:"none"})});var w=a.forwardRef(function(e,n){let r=(0,f.i)({props:e,name:"MuiInputAdornment"}),{children:o,className:c,component:h="div",disablePointerEvents:p=!1,disableTypography:m=!1,position:Z,variant:j}=r,w=(0,s.Z)(r,g),S=(0,u.Z)()||{},z=j;j&&S.variant,S&&!z&&(z=S.variant);let P=(0,i.Z)({},r,{hiddenLabel:S.hiddenLabel,size:S.size,disablePointerEvents:p,position:Z,variant:z}),C=y(P);return(0,v.jsx)(x.Z.Provider,{value:null,children:(0,v.jsx)(b,(0,i.Z)({as:h,ownerState:P,className:(0,l.Z)(C.root,c),ref:n},w,{children:"string"!=typeof o||m?(0,v.jsxs)(a.Fragment,{children:["start"===Z?t||(t=(0,v.jsx)("span",{className:"notranslate",children:""})):null,o]}):(0,v.jsx)(d.Z,{color:"text.secondary",children:o})}))})})},57965:function(e,n,r){r.d(n,{eE:function(){return Q},E4:function(){return A},SB:function(){return M},ms:function(){return q},hI:function(){return Z},aY:function(){return ec},zd:function(){return W},Ik:function(){return z}});var t=r(94655),s=r(628),i=r(41565),a=r(31317),l=r(7281),o=r(25333),c=r(21138),d=r(84811),x=r(70366),u=r(47001),h=r(59602);let p={fontWeight:500,color:"text.secondary",border:0,width:"40%",py:1},m={border:0,py:1};function Z(e){var n;let{router:r}=e,Z=(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)(s.Z,{children:(0,t.jsxs)(i.Z,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[(0,t.jsx)(h.Z,{color:"primary"}),(0,t.jsx)(a.Z,{variant:"h6",component:"h2",children:"Platform Information"})]}),(0,t.jsx)(c.Z,{size:"small",children:(0,t.jsxs)(d.Z,{children:[(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(u.Z,{sx:p,children:"Router Name"}),(0,t.jsx)(u.Z,{sx:m,children:r.name})]}),(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(u.Z,{sx:p,children:"Port"}),(0,t.jsx)(u.Z,{sx:m,children:r.port})]}),(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(u.Z,{sx:p,children:"Mode"}),(0,t.jsx)(u.Z,{sx:m,children:(0,t.jsx)(o.Z,{label:Z.label,size:"small",color:Z.color,variant:"outlined"})})]}),(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(u.Z,{sx:p,children:"Uptime"}),(0,t.jsx)(u.Z,{sx:m,children:r.uptime||"-"})]})]})})]})})}var j=r(95511),f=r(66561),v=r(12795),g=r(96407),y=r(29983),b=r(81960);function w(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 S(e){let{status:n}=e;return(0,t.jsx)(j.Z,{title:n,arrow:!0,children:(0,t.jsx)(l.Z,{sx:{width:10,height:10,borderRadius:"50%",bgcolor:w(n),flexShrink:0,boxShadow:"running"===n?"0 0 6px ".concat(w(n)):"none"}})})}function z(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)(s.Z,{sx:{height:"100%"},children:(0,t.jsxs)(i.Z,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[(0,t.jsx)(y.Z,{color:"primary"}),(0,t.jsx)(a.Z,{variant:"h6",component:"h2",children:"MC-Router Status"}),(0,t.jsxs)(l.Z,{sx:{ml:"auto",display:"flex",gap:1},children:[(0,t.jsx)(o.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)(o.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)(a.Z,{variant:"subtitle2",sx:{mb:1,mt:3},children:"Routing Table"}),0===n.routes.length?(0,t.jsx)(a.Z,{variant:"body2",color:"text.secondary",sx:{py:2,textAlign:"center"},children:"No routes configured"}):(0,t.jsx)(l.Z,{sx:{mt:1},children:Array.from(r.entries()).map(e=>{let[n,{status:r,hostnames:s,serverType:i,serverVersion:o}]=e;return(0,t.jsxs)(f.Z,{defaultExpanded:!0,disableGutters:!0,elevation:0,sx:{border:1,borderColor:"divider","&:not(:last-child)":{borderBottom:0},"&::before":{display:"none"}},children:[(0,t.jsx)(v.Z,{expandIcon:(0,t.jsx)(b.Z,{}),children:(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,width:"100%",pr:1},children:[(0,t.jsx)(S,{status:r}),(0,t.jsx)(a.Z,{variant:"subtitle2",sx:{fontWeight:600},children:n}),(i||o)&&(0,t.jsx)(a.Z,{variant:"caption",color:"text.secondary",children:[i,o].filter(Boolean).join(" ")}),(0,t.jsxs)(a.Z,{variant:"caption",color:"text.secondary",sx:{ml:"auto"},children:[s.length," ",1===s.length?"route":"routes"]})]})}),(0,t.jsx)(g.Z,{sx:{pt:0},children:(0,t.jsx)(l.Z,{sx:{display:"flex",flexDirection:"column",gap:.5},children:s.map(e=>(0,t.jsx)(a.Z,{variant:"body2",sx:{fontFamily:"monospace",fontSize:"0.85rem",color:"text.secondary"},children:e},e))})})]},n)})})]})})}var P=r(21605);let C={fontWeight:500,color:"text.secondary",border:0,width:"40%",py:1},I={border:0,py:1};function M(e){var n;let{router:r}=e,h=r.routes.filter(e=>"running"===e.serverStatus).length,p=r.routes.length;return(0,t.jsx)(s.Z,{children:(0,t.jsxs)(i.Z,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[(0,t.jsx)(P.Z,{color:"primary"}),(0,t.jsx)(a.Z,{variant:"h6",component:"h2",children:"Network Settings"})]}),(0,t.jsx)(c.Z,{size:"small",children:(0,t.jsxs)(d.Z,{children:[(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(u.Z,{sx:C,children:"Listening Port"}),(0,t.jsx)(u.Z,{sx:I,children:(0,t.jsx)(o.Z,{label:r.port,size:"small",variant:"outlined"})})]}),(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(u.Z,{sx:C,children:"Routing Mode"}),(0,t.jsx)(u.Z,{sx:I,children:(0,t.jsx)(o.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)(x.Z,{children:[(0,t.jsx)(u.Z,{sx:C,children:"Total Routes"}),(0,t.jsx)(u.Z,{sx:I,children:p})]}),(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(u.Z,{sx:C,children:"Active Routes"}),(0,t.jsx)(u.Z,{sx:I,children:(0,t.jsx)(o.Z,{label:"".concat(h," / ").concat(p),size:"small",color:h>0?"success":"default",variant:"outlined"})})]})]})})]})})}var N=r(76544);function A(e){var n;let{avahi:r}=e,c=null!==(n=null==r?void 0:r.status)&&void 0!==n?n:"unknown";return(0,t.jsx)(s.Z,{children:(0,t.jsxs)(i.Z,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[(0,t.jsx)(N.Z,{color:"primary"}),(0,t.jsx)(a.Z,{variant:"h6",component:"h2",children:"mDNS (Avahi)"}),(0,t.jsx)(o.Z,{label:c,size:"small",color:"running"===c?"success":c.includes("not running")?"warning":"not installed"===c?"error":"default",sx:{ml:"auto"}})]}),(0,t.jsxs)(a.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."]})]})})}var k=r(35106),E=r(97436),L=r(30417),T=r(93017),D=r(30114),R=r(6986);function W(e){var n;let{onSuccess:r,onError:c}=e,{data:d}=(0,R.kP)(),[x,u]=(0,k.useState)((null==d?void 0:null===(n=d.user)||void 0===n?void 0:n.name)||""),[h,p]=(0,k.useState)(!1),[m,Z]=(0,k.useState)(!1),j=null==d?void 0:d.user;(0,k.useEffect)(()=>{(null==j?void 0:j.name)&&!m&&(u(j.name),Z(!0))},[null==j?void 0:j.name,m]);let f=x!==((null==j?void 0:j.name)||""),v=async()=>{if(f&&x.trim()){p(!0);try{let{error:e}=await (0,R.Nq)({name:x.trim()});e?c(e.message||"Failed to update profile"):r("Profile updated successfully")}catch(e){c("Failed to update profile")}finally{p(!1)}}};return j?(0,t.jsx)(s.Z,{sx:{height:"100%"},children:(0,t.jsxs)(i.Z,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:3},children:[(0,t.jsx)(D.Z,{color:"primary"}),(0,t.jsx)(a.Z,{variant:"h6",component:"h2",children:"Profile"})]}),(0,t.jsxs)(l.Z,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[(0,t.jsx)(E.Z,{label:"Name",value:x,onChange:e=>u(e.target.value),fullWidth:!0,size:"small"}),(0,t.jsx)(E.Z,{label:"Email",value:j.email,fullWidth:!0,size:"small",disabled:!0,helperText:"Email cannot be changed"}),(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,t.jsx)(a.Z,{variant:"body2",color:"text.secondary",children:"Role:"}),(0,t.jsx)(o.Z,{label:"admin"===j.role?"Admin":"User",size:"small",color:"admin"===j.role?"primary":"default",variant:"outlined"})]}),(0,t.jsx)(l.Z,{sx:{display:"flex",justifyContent:"flex-end"},children:(0,t.jsx)(L.Z,{variant:"contained",onClick:v,disabled:!f||!x.trim()||h,startIcon:h?(0,t.jsx)(T.Z,{size:16}):null,children:h?"Saving...":"Save Changes"})})]})]})}):null}var F=r(52082),_=r(79983),B=r(70603),U=r(28058),V=r(42730);function q(e){let{onSuccess:n,onError:r}=e,[o,c]=(0,k.useState)(""),[d,x]=(0,k.useState)(""),[u,h]=(0,k.useState)(""),[p,m]=(0,k.useState)(!1),[Z,j]=(0,k.useState)(!1),[f,v]=(0,k.useState)(!1),[g,y]=(0,k.useState)(!1),[b,w]=(0,k.useState)({}),S=()=>{let e={};return o||(e.currentPassword="Current password is required"),d?d.length<8&&(e.newPassword="Password must be at least ".concat(8," characters")):e.newPassword="New password is required",u?d!==u&&(e.confirmPassword="Passwords do not match"):e.confirmPassword="Please confirm your new password",o&&d&&o===d&&(e.newPassword="New password must be different from current password"),w(e),0===Object.keys(e).length},z=async e=>{if(e.preventDefault(),S()){y(!0);try{let{error:e}=await (0,R.Cp)({currentPassword:o,newPassword:d,revokeOtherSessions:!1});e?r(e.message||"Failed to change password"):(n("Password changed successfully"),c(""),x(""),h(""),w({}))}catch(e){r("Failed to change password")}finally{y(!1)}}},P=(e,n)=>(0,t.jsx)(F.Z,{position:"end",children:(0,t.jsx)(_.Z,{"aria-label":e?"hide password":"show password",onClick:()=>n(!e),edge:"end",size:"small",children:e?(0,t.jsx)(V.Z,{fontSize:"small"}):(0,t.jsx)(U.Z,{fontSize:"small"})})});return(0,t.jsx)(s.Z,{children:(0,t.jsxs)(i.Z,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:3},children:[(0,t.jsx)(B.Z,{color:"primary"}),(0,t.jsx)(a.Z,{variant:"h6",component:"h2",children:"Change Password"})]}),(0,t.jsxs)(l.Z,{component:"form",onSubmit:z,sx:{display:"flex",flexDirection:"column",gap:2.5},children:[(0,t.jsx)(E.Z,{label:"Current Password",type:p?"text":"password",value:o,onChange:e=>{c(e.target.value),b.currentPassword&&w(e=>({...e,currentPassword:""}))},error:!!b.currentPassword,helperText:b.currentPassword,fullWidth:!0,size:"small",autoComplete:"current-password",InputProps:{endAdornment:P(p,m)}}),(0,t.jsx)(E.Z,{label:"New Password",type:Z?"text":"password",value:d,onChange:e=>{x(e.target.value),b.newPassword&&w(e=>({...e,newPassword:""}))},error:!!b.newPassword,helperText:b.newPassword||"Minimum ".concat(8," characters"),fullWidth:!0,size:"small",autoComplete:"new-password",InputProps:{endAdornment:P(Z,j)}}),(0,t.jsx)(E.Z,{label:"Confirm New Password",type:f?"text":"password",value:u,onChange:e=>{h(e.target.value),b.confirmPassword&&w(e=>({...e,confirmPassword:""}))},error:!!b.confirmPassword,helperText:b.confirmPassword,fullWidth:!0,size:"small",autoComplete:"new-password",InputProps:{endAdornment:P(f,v)}}),(0,t.jsx)(l.Z,{sx:{display:"flex",justifyContent:"flex-end"},children:(0,t.jsx)(L.Z,{type:"submit",variant:"contained",disabled:g,startIcon:g?(0,t.jsx)(T.Z,{size:16}):null,children:g?"Changing...":"Change Password"})})]})]})})}var H=r(23695);let O={fontWeight:500,color:"text.secondary",border:0,width:"40%",py:1},K={border:0,py:1};function $(e){return e?("string"==typeof e?new Date(e):e).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"}):"-"}function Q(){let{data:e}=(0,R.kP)(),n=null==e?void 0:e.user;return n?(0,t.jsx)(s.Z,{sx:{height:"100%"},children:(0,t.jsxs)(i.Z,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[(0,t.jsx)(H.Z,{color:"primary"}),(0,t.jsx)(a.Z,{variant:"h6",component:"h2",children:"Account Information"})]}),(0,t.jsx)(c.Z,{size:"small",children:(0,t.jsxs)(d.Z,{children:[(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(u.Z,{sx:O,children:"Account ID"}),(0,t.jsx)(u.Z,{sx:K,children:(0,t.jsx)(a.Z,{variant:"body2",sx:{fontFamily:"monospace",fontSize:"0.8rem"},children:n.id})})]}),(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(u.Z,{sx:O,children:"Created"}),(0,t.jsx)(u.Z,{sx:K,children:$(n.createdAt)})]}),(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(u.Z,{sx:O,children:"Last Updated"}),(0,t.jsx)(u.Z,{sx:K,children:$(n.updatedAt)})]})]})})]})}):null}var X=r(11254),Y=r(10721),G=r(81071),J=r(84974),ee=r(5501),en=r(93315),er=r(9078),et=r(10449),es=r(24559),ei=r(37228);let ea={fontWeight:500,color:"text.secondary",border:0,width:"40%",py:1},el={border:0,py:1};function eo(e){let{text:n}=e,[r,s]=(0,k.useState)(!1),i=async()=>{try{await navigator.clipboard.writeText(n),s(!0),setTimeout(()=>s(!1),2e3)}catch(e){console.error("Failed to copy:",e)}};return(0,t.jsx)(_.Z,{size:"small",onClick:i,sx:{ml:1,color:r?"success.main":"text.secondary","&:hover":{bgcolor:"action.hover"}},"aria-label":r?"Copied":"Copy to clipboard",children:r?(0,t.jsx)(es.Z,{sx:{fontSize:16}}):(0,t.jsx)(et.Z,{sx:{fontSize:16}})})}function ec(){let{data:e,isLoading:n,error:r}=(0,ei.UW)(),h=(0,ei.Bc)(),p=(0,ei.N$)();if(r)return(0,t.jsx)(s.Z,{children:(0,t.jsxs)(i.Z,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[(0,t.jsx)(J.Z,{color:"primary"}),(0,t.jsx)(a.Z,{variant:"h6",component:"h2",children:"External Access (playit.gg)"})]}),(0,t.jsxs)(G.Z,{severity:"error",children:["Failed to load playit status: ",r.message]})]})});if(n)return(0,t.jsx)(s.Z,{children:(0,t.jsxs)(i.Z,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[(0,t.jsx)(Y.Z,{variant:"circular",width:24,height:24}),(0,t.jsx)(Y.Z,{variant:"text",width:"40%",height:32})]}),(0,t.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",py:.75},children:[(0,t.jsx)(Y.Z,{variant:"text",width:"35%"}),(0,t.jsx)(Y.Z,{variant:"text",width:"40%"})]}),(0,t.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",py:.75},children:[(0,t.jsx)(Y.Z,{variant:"text",width:"35%"}),(0,t.jsx)(Y.Z,{variant:"text",width:"40%"})]})]})});if(!(null==e?void 0:e.enabled))return(0,t.jsx)(s.Z,{children:(0,t.jsxs)(i.Z,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[(0,t.jsx)(J.Z,{color:"primary"}),(0,t.jsx)(a.Z,{variant:"h6",component:"h2",children:"External Access (playit.gg)"})]}),(0,t.jsxs)(G.Z,{severity:"info",children:[(0,t.jsx)(a.Z,{variant:"body2",fontWeight:500,sx:{mb:.5},children:"Not configured"}),(0,t.jsx)(a.Z,{variant:"body2",color:"text.secondary",children:"playit.gg agent is not set up. Configure PLAYIT_SECRET to enable external access."})]})]})});let m=e.agentRunning&&"running"===e.containerStatus,Z=h.isPending||p.isPending;return(0,t.jsx)(s.Z,{children:(0,t.jsxs)(i.Z,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[(0,t.jsx)(J.Z,{color:"primary"}),(0,t.jsx)(a.Z,{variant:"h6",component:"h2",children:"External Access (playit.gg)"}),(0,t.jsxs)(l.Z,{sx:{ml:"auto",display:"flex",gap:1},children:[(0,t.jsx)(L.Z,{component:"a",href:"https://playit.gg/account/tunnels",target:"_blank",rel:"noopener noreferrer",size:"small",startIcon:(0,t.jsx)(er.Z,{}),sx:{fontSize:12},children:"View Dashboard"}),m?(0,t.jsx)(L.Z,{variant:"outlined",size:"small",color:"error",startIcon:Z?(0,t.jsx)(T.Z,{size:16}):(0,t.jsx)(en.Z,{}),onClick:()=>{p.mutate()},disabled:Z,sx:{fontSize:12},children:Z?"Stopping...":"Stop Agent"}):(0,t.jsx)(L.Z,{variant:"contained",size:"small",color:"success",startIcon:Z?(0,t.jsx)(T.Z,{size:16,color:"inherit"}):(0,t.jsx)(ee.Z,{}),onClick:()=>{h.mutate()},disabled:Z,sx:{fontSize:12},children:Z?"Starting...":"Start Agent"})]})]}),(0,t.jsx)(c.Z,{size:"small",sx:{mb:3},children:(0,t.jsxs)(d.Z,{children:[(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(u.Z,{sx:ea,children:"Agent Status"}),(0,t.jsx)(u.Z,{sx:el,children:(0,t.jsx)(o.Z,{label:m?"Running":"Stopped",size:"small",color:m?"success":"default",variant:"outlined"})})]}),e.uptime&&(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(u.Z,{sx:ea,children:"Uptime"}),(0,t.jsx)(u.Z,{sx:el,children:e.uptime})]})]})}),e.servers&&e.servers.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.Z,{variant:"subtitle2",sx:{mb:1.5,fontWeight:600},children:"Server Domains"}),(0,t.jsxs)(c.Z,{size:"small",children:[(0,t.jsx)(X.Z,{children:(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(u.Z,{sx:{fontWeight:600,borderBottom:2,borderColor:"divider"},children:"Server"}),(0,t.jsx)(u.Z,{sx:{fontWeight:600,borderBottom:2,borderColor:"divider"},children:"External Domain"})]})}),(0,t.jsx)(d.Z,{children:e.servers.map(e=>(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(u.Z,{sx:{py:1.5,borderBottom:1,borderColor:"divider"},children:e.serverName}),(0,t.jsx)(u.Z,{sx:{py:1.5,borderBottom:1,borderColor:"divider"},children:e.playitDomain?(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center"},children:[(0,t.jsx)(a.Z,{variant:"body2",sx:{fontFamily:"monospace"},children:e.playitDomain}),(0,t.jsx)(eo,{text:e.playitDomain})]}):(0,t.jsx)(a.Z,{variant:"body2",color:"text.secondary",children:"Not configured"})})]},e.serverName))})]})]})]})})}},37228:function(e,n,r){r.d(n,{Bc:function(){return o},N$:function(){return c},UW:function(){return l}});var t=r(5632),s=r(58919),i=r(20367),a=r(42936);function l(){return(0,t.a)({queryKey:["playit-status"],queryFn:()=>(0,a.SC)("/api/playit/status"),refetchInterval:3e4})}function o(){let e=(0,s.NL)();return(0,i.D)({mutationFn:()=>(0,a.SC)("/api/playit/start",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["playit-status"]})}})}function c(){let e=(0,s.NL)();return(0,i.D)({mutationFn:()=>(0,a.SC)("/api/playit/stop",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["playit-status"]})}})}},6986:function(e,n,r){r.d(n,{Cp:function(){return u},Nq:function(){return x},cg:function(){return l},kP:function(){return d},w7:function(){return o},y1:function(){return c},zB:function(){return h}});var t=r(77054),s=r(61648),i=r(35016);let a=(0,t.X)({baseURL:i.env.NEXT_PUBLIC_BETTER_AUTH_URL||"",plugins:[(0,s.zB)()]}),{signIn:l,signOut:o,signUp:c,useSession:d,updateUser:x,changePassword:u}=a,h=a.admin}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7965],{76544:function(e,n,r){var t=r(8091);n.Z=void 0;var s=t(r(66758)),i=r(94655);n.Z=(0,s.default)([(0,i.jsx)("path",{d:"m7.3 14.7 1.2-1.2c-1-1-1.5-2.3-1.5-3.5 0-1.3.5-2.6 1.5-3.5L7.3 5.3c-1.3 1.3-2 3-2 4.7s.7 3.4 2 4.7M19.1 2.9l-1.2 1.2c1.6 1.6 2.4 3.8 2.4 5.9 0 2.1-.8 4.3-2.4 5.9l1.2 1.2c2-2 2.9-4.5 2.9-7.1 0-2.6-1-5.1-2.9-7.1"},"0"),(0,i.jsx)("path",{d:"M6.1 4.1 4.9 2.9C3 4.9 2 7.4 2 10c0 2.6 1 5.1 2.9 7.1l1.2-1.2c-1.6-1.6-2.4-3.8-2.4-5.9 0-2.1.8-4.3 2.4-5.9m10.6 10.6c1.3-1.3 2-3 2-4.7-.1-1.7-.7-3.4-2-4.7l-1.2 1.2c1 1 1.5 2.3 1.5 3.5 0 1.3-.5 2.6-1.5 3.5zM14.5 10c0-1.38-1.12-2.5-2.5-2.5S9.5 8.62 9.5 10c0 .76.34 1.42.87 1.88L7 22h2l.67-2h4.67l.66 2h2l-3.37-10.12c.53-.46.87-1.12.87-1.88m-4.17 8L12 13l1.67 5z"},"1")],"CellTower")},23695:function(e,n,r){var t=r(8091);n.Z=void 0;var s=t(r(66758)),i=r(94655);n.Z=(0,s.default)((0,i.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"}),"Info")},21605:function(e,n,r){var t=r(8091);n.Z=void 0;var s=t(r(66758)),i=r(94655);n.Z=(0,s.default)((0,i.jsx)("path",{d:"M15.9 5c-.17 0-.32.09-.41.23l-.07.15-5.18 11.65c-.16.29-.26.61-.26.96 0 1.11.9 2.01 2.01 2.01.96 0 1.77-.68 1.96-1.59l.01-.03L16.4 5.5c0-.28-.22-.5-.5-.5M1 9l2 2c2.88-2.88 6.79-4.08 10.53-3.62l1.19-2.68C9.89 3.84 4.74 5.27 1 9m20 2 2-2c-1.64-1.64-3.55-2.82-5.59-3.57l-.53 2.82c1.5.62 2.9 1.53 4.12 2.75m-4 4 2-2c-.8-.8-1.7-1.42-2.66-1.89l-.55 2.92c.42.27.83.59 1.21.97M5 13l2 2c1.13-1.13 2.56-1.79 4.03-2l1.28-2.88c-2.63-.08-5.3.87-7.31 2.88"}),"NetworkCheck")},9078:function(e,n,r){var t=r(8091);n.Z=void 0;var s=t(r(66758)),i=r(94655);n.Z=(0,s.default)((0,i.jsx)("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"}),"OpenInNew")},84974:function(e,n,r){var t=r(8091);n.Z=void 0;var s=t(r(66758)),i=r(94655);n.Z=(0,s.default)((0,i.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39"}),"Public")},29983:function(e,n,r){var t=r(8091);n.Z=void 0;var s=t(r(66758)),i=r(94655);n.Z=(0,s.default)((0,i.jsx)("path",{d:"m20.2 5.9.8-.8C19.6 3.7 17.8 3 16 3s-3.6.7-5 2.1l.8.8C13 4.8 14.5 4.2 16 4.2s3 .6 4.2 1.7m-.9.8c-.9-.9-2.1-1.4-3.3-1.4s-2.4.5-3.3 1.4l.8.8c.7-.7 1.6-1 2.5-1 .9 0 1.8.3 2.5 1zM19 13h-2V9h-2v4H5c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-4c0-1.1-.9-2-2-2M8 18H6v-2h2zm3.5 0h-2v-2h2zm3.5 0h-2v-2h2z"}),"Router")},93315:function(e,n,r){var t=r(8091);n.Z=void 0;var s=t(r(66758)),i=r(94655);n.Z=(0,s.default)((0,i.jsx)("path",{d:"M6 6h12v12H6z"}),"Stop")},42730:function(e,n,r){var t=r(8091);n.Z=void 0;var s=t(r(66758)),i=r(94655);n.Z=(0,s.default)((0,i.jsx)("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}),"VisibilityOff")},52082:function(e,n,r){r.d(n,{Z:function(){return w}});var t,s=r(32324),i=r(81500),a=r(35106),l=r(70316),o=r(65951),c=r(38762),d=r(31317),x=r(14406),u=r(85016),h=r(34519),p=r(11379),m=r(9049);function Z(e){return(0,m.ZP)("MuiInputAdornment",e)}let j=(0,p.Z)("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var f=r(28057),v=r(94655);let g=["children","className","component","disablePointerEvents","disableTypography","position","variant"],y=e=>{let{classes:n,disablePointerEvents:r,hiddenLabel:t,position:s,size:i,variant:a}=e,l={root:["root",r&&"disablePointerEvents",s&&"position".concat((0,c.Z)(s)),a,t&&"hiddenLabel",i&&"size".concat((0,c.Z)(i))]};return(0,o.Z)(l,Z,n)},b=(0,h.ZP)("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:(e,n)=>{let{ownerState:r}=e;return[n.root,n["position".concat((0,c.Z)(r.position))],!0===r.disablePointerEvents&&n.disablePointerEvents,n[r.variant]]}})(e=>{let{theme:n,ownerState:r}=e;return(0,i.Z)({display:"flex",height:"0.01em",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(n.vars||n).palette.action.active},"filled"===r.variant&&{["&.".concat(j.positionStart,"&:not(.").concat(j.hiddenLabel,")")]:{marginTop:16}},"start"===r.position&&{marginRight:8},"end"===r.position&&{marginLeft:8},!0===r.disablePointerEvents&&{pointerEvents:"none"})});var w=a.forwardRef(function(e,n){let r=(0,f.i)({props:e,name:"MuiInputAdornment"}),{children:o,className:c,component:h="div",disablePointerEvents:p=!1,disableTypography:m=!1,position:Z,variant:j}=r,w=(0,s.Z)(r,g),S=(0,u.Z)()||{},z=j;j&&S.variant,S&&!z&&(z=S.variant);let P=(0,i.Z)({},r,{hiddenLabel:S.hiddenLabel,size:S.size,disablePointerEvents:p,position:Z,variant:z}),C=y(P);return(0,v.jsx)(x.Z.Provider,{value:null,children:(0,v.jsx)(b,(0,i.Z)({as:h,ownerState:P,className:(0,l.Z)(C.root,c),ref:n},w,{children:"string"!=typeof o||m?(0,v.jsxs)(a.Fragment,{children:["start"===Z?t||(t=(0,v.jsx)("span",{className:"notranslate",children:""})):null,o]}):(0,v.jsx)(d.Z,{color:"text.secondary",children:o})}))})})},57965:function(e,n,r){r.d(n,{eE:function(){return Q},E4:function(){return A},SB:function(){return M},ms:function(){return q},hI:function(){return Z},aY:function(){return ec},zd:function(){return W},Ik:function(){return z}});var t=r(94655),s=r(628),i=r(41565),a=r(31317),l=r(7281),o=r(25333),c=r(21138),d=r(84811),x=r(70366),u=r(47001),h=r(59602);let p={fontWeight:500,color:"text.secondary",border:0,width:"40%",py:1},m={border:0,py:1};function Z(e){var n;let{router:r}=e,Z=(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)(s.Z,{children:(0,t.jsxs)(i.Z,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[(0,t.jsx)(h.Z,{color:"primary"}),(0,t.jsx)(a.Z,{variant:"h6",component:"h2",children:"Platform Information"})]}),(0,t.jsx)(c.Z,{size:"small",children:(0,t.jsxs)(d.Z,{children:[(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(u.Z,{sx:p,children:"Router Name"}),(0,t.jsx)(u.Z,{sx:m,children:r.name})]}),(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(u.Z,{sx:p,children:"Port"}),(0,t.jsx)(u.Z,{sx:m,children:r.port})]}),(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(u.Z,{sx:p,children:"Mode"}),(0,t.jsx)(u.Z,{sx:m,children:(0,t.jsx)(o.Z,{label:Z.label,size:"small",color:Z.color,variant:"outlined"})})]}),(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(u.Z,{sx:p,children:"Uptime"}),(0,t.jsx)(u.Z,{sx:m,children:r.uptime||"-"})]})]})})]})})}var j=r(95511),f=r(66561),v=r(12795),g=r(96407),y=r(29983),b=r(81960);function w(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 S(e){let{status:n}=e;return(0,t.jsx)(j.Z,{title:n,arrow:!0,children:(0,t.jsx)(l.Z,{sx:{width:10,height:10,borderRadius:"50%",bgcolor:w(n),flexShrink:0,boxShadow:"running"===n?"0 0 6px ".concat(w(n)):"none"}})})}function z(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)(s.Z,{sx:{height:"100%"},children:(0,t.jsxs)(i.Z,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[(0,t.jsx)(y.Z,{color:"primary"}),(0,t.jsx)(a.Z,{variant:"h6",component:"h2",children:"MC-Router Status"}),(0,t.jsxs)(l.Z,{sx:{ml:"auto",display:"flex",gap:1},children:[(0,t.jsx)(o.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)(o.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)(a.Z,{variant:"subtitle2",sx:{mb:1,mt:3},children:"Routing Table"}),0===n.routes.length?(0,t.jsx)(a.Z,{variant:"body2",color:"text.secondary",sx:{py:2,textAlign:"center"},children:"No routes configured"}):(0,t.jsx)(l.Z,{sx:{mt:1},children:Array.from(r.entries()).map(e=>{let[n,{status:r,hostnames:s,serverType:i,serverVersion:o}]=e;return(0,t.jsxs)(f.Z,{defaultExpanded:!0,disableGutters:!0,elevation:0,sx:{border:1,borderColor:"divider","&:not(:last-child)":{borderBottom:0},"&::before":{display:"none"}},children:[(0,t.jsx)(v.Z,{expandIcon:(0,t.jsx)(b.Z,{}),children:(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,width:"100%",pr:1},children:[(0,t.jsx)(S,{status:r}),(0,t.jsx)(a.Z,{variant:"subtitle2",sx:{fontWeight:600},children:n}),(i||o)&&(0,t.jsx)(a.Z,{variant:"caption",color:"text.secondary",children:[i,o].filter(Boolean).join(" ")}),(0,t.jsxs)(a.Z,{variant:"caption",color:"text.secondary",sx:{ml:"auto"},children:[s.length," ",1===s.length?"route":"routes"]})]})}),(0,t.jsx)(g.Z,{sx:{pt:0},children:(0,t.jsx)(l.Z,{sx:{display:"flex",flexDirection:"column",gap:.5},children:s.map(e=>(0,t.jsx)(a.Z,{variant:"body2",sx:{fontFamily:"monospace",fontSize:"0.85rem",color:"text.secondary"},children:e},e))})})]},n)})})]})})}var P=r(21605);let C={fontWeight:500,color:"text.secondary",border:0,width:"40%",py:1},I={border:0,py:1};function M(e){var n;let{router:r}=e,h=r.routes.filter(e=>"running"===e.serverStatus).length,p=r.routes.length;return(0,t.jsx)(s.Z,{children:(0,t.jsxs)(i.Z,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[(0,t.jsx)(P.Z,{color:"primary"}),(0,t.jsx)(a.Z,{variant:"h6",component:"h2",children:"Network Settings"})]}),(0,t.jsx)(c.Z,{size:"small",children:(0,t.jsxs)(d.Z,{children:[(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(u.Z,{sx:C,children:"Listening Port"}),(0,t.jsx)(u.Z,{sx:I,children:(0,t.jsx)(o.Z,{label:r.port,size:"small",variant:"outlined"})})]}),(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(u.Z,{sx:C,children:"Routing Mode"}),(0,t.jsx)(u.Z,{sx:I,children:(0,t.jsx)(o.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)(x.Z,{children:[(0,t.jsx)(u.Z,{sx:C,children:"Total Routes"}),(0,t.jsx)(u.Z,{sx:I,children:p})]}),(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(u.Z,{sx:C,children:"Active Routes"}),(0,t.jsx)(u.Z,{sx:I,children:(0,t.jsx)(o.Z,{label:"".concat(h," / ").concat(p),size:"small",color:h>0?"success":"default",variant:"outlined"})})]})]})})]})})}var N=r(76544);function A(e){var n;let{avahi:r}=e,c=null!==(n=null==r?void 0:r.status)&&void 0!==n?n:"unknown";return(0,t.jsx)(s.Z,{children:(0,t.jsxs)(i.Z,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[(0,t.jsx)(N.Z,{color:"primary"}),(0,t.jsx)(a.Z,{variant:"h6",component:"h2",children:"mDNS (Avahi)"}),(0,t.jsx)(o.Z,{label:c,size:"small",color:"running"===c?"success":c.includes("not running")?"warning":"not installed"===c?"error":"default",sx:{ml:"auto"}})]}),(0,t.jsxs)(a.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."]})]})})}var k=r(35106),E=r(97436),L=r(30417),T=r(93017),D=r(30114),R=r(6986);function W(e){var n;let{onSuccess:r,onError:c}=e,{data:d}=(0,R.kP)(),[x,u]=(0,k.useState)((null==d?void 0:null===(n=d.user)||void 0===n?void 0:n.name)||""),[h,p]=(0,k.useState)(!1),[m,Z]=(0,k.useState)(!1),j=null==d?void 0:d.user;(0,k.useEffect)(()=>{(null==j?void 0:j.name)&&!m&&(u(j.name),Z(!0))},[null==j?void 0:j.name,m]);let f=x!==((null==j?void 0:j.name)||""),v=async()=>{if(f&&x.trim()){p(!0);try{let{error:e}=await (0,R.Nq)({name:x.trim()});e?c(e.message||"Failed to update profile"):r("Profile updated successfully")}catch(e){c("Failed to update profile")}finally{p(!1)}}};return j?(0,t.jsx)(s.Z,{sx:{height:"100%"},children:(0,t.jsxs)(i.Z,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:3},children:[(0,t.jsx)(D.Z,{color:"primary"}),(0,t.jsx)(a.Z,{variant:"h6",component:"h2",children:"Profile"})]}),(0,t.jsxs)(l.Z,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[(0,t.jsx)(E.Z,{label:"Name",value:x,onChange:e=>u(e.target.value),fullWidth:!0,size:"small"}),(0,t.jsx)(E.Z,{label:"Email",value:j.email,fullWidth:!0,size:"small",disabled:!0,helperText:"Email cannot be changed"}),(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,t.jsx)(a.Z,{variant:"body2",color:"text.secondary",children:"Role:"}),(0,t.jsx)(o.Z,{label:"admin"===j.role?"Admin":"User",size:"small",color:"admin"===j.role?"primary":"default",variant:"outlined"})]}),(0,t.jsx)(l.Z,{sx:{display:"flex",justifyContent:"flex-end"},children:(0,t.jsx)(L.Z,{variant:"contained",onClick:v,disabled:!f||!x.trim()||h,startIcon:h?(0,t.jsx)(T.Z,{size:16}):null,children:h?"Saving...":"Save Changes"})})]})]})}):null}var F=r(52082),U=r(79983),_=r(70603),B=r(28058),V=r(42730);function q(e){let{onSuccess:n,onError:r}=e,[o,c]=(0,k.useState)(""),[d,x]=(0,k.useState)(""),[u,h]=(0,k.useState)(""),[p,m]=(0,k.useState)(!1),[Z,j]=(0,k.useState)(!1),[f,v]=(0,k.useState)(!1),[g,y]=(0,k.useState)(!1),[b,w]=(0,k.useState)({}),S=()=>{let e={};return o||(e.currentPassword="Current password is required"),d?d.length<8&&(e.newPassword="Password must be at least ".concat(8," characters")):e.newPassword="New password is required",u?d!==u&&(e.confirmPassword="Passwords do not match"):e.confirmPassword="Please confirm your new password",o&&d&&o===d&&(e.newPassword="New password must be different from current password"),w(e),0===Object.keys(e).length},z=async e=>{if(e.preventDefault(),S()){y(!0);try{let{error:e}=await (0,R.Cp)({currentPassword:o,newPassword:d,revokeOtherSessions:!1});e?r(e.message||"Failed to change password"):(n("Password changed successfully"),c(""),x(""),h(""),w({}))}catch(e){r("Failed to change password")}finally{y(!1)}}},P=(e,n)=>(0,t.jsx)(F.Z,{position:"end",children:(0,t.jsx)(U.Z,{"aria-label":e?"hide password":"show password",onClick:()=>n(!e),edge:"end",size:"small",children:e?(0,t.jsx)(V.Z,{fontSize:"small"}):(0,t.jsx)(B.Z,{fontSize:"small"})})});return(0,t.jsx)(s.Z,{children:(0,t.jsxs)(i.Z,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:3},children:[(0,t.jsx)(_.Z,{color:"primary"}),(0,t.jsx)(a.Z,{variant:"h6",component:"h2",children:"Change Password"})]}),(0,t.jsxs)(l.Z,{component:"form",onSubmit:z,sx:{display:"flex",flexDirection:"column",gap:2.5},children:[(0,t.jsx)(E.Z,{label:"Current Password",type:p?"text":"password",value:o,onChange:e=>{c(e.target.value),b.currentPassword&&w(e=>({...e,currentPassword:""}))},error:!!b.currentPassword,helperText:b.currentPassword,fullWidth:!0,size:"small",autoComplete:"current-password",InputProps:{endAdornment:P(p,m)}}),(0,t.jsx)(E.Z,{label:"New Password",type:Z?"text":"password",value:d,onChange:e=>{x(e.target.value),b.newPassword&&w(e=>({...e,newPassword:""}))},error:!!b.newPassword,helperText:b.newPassword||"Minimum ".concat(8," characters"),fullWidth:!0,size:"small",autoComplete:"new-password",InputProps:{endAdornment:P(Z,j)}}),(0,t.jsx)(E.Z,{label:"Confirm New Password",type:f?"text":"password",value:u,onChange:e=>{h(e.target.value),b.confirmPassword&&w(e=>({...e,confirmPassword:""}))},error:!!b.confirmPassword,helperText:b.confirmPassword,fullWidth:!0,size:"small",autoComplete:"new-password",InputProps:{endAdornment:P(f,v)}}),(0,t.jsx)(l.Z,{sx:{display:"flex",justifyContent:"flex-end"},children:(0,t.jsx)(L.Z,{type:"submit",variant:"contained",disabled:g,startIcon:g?(0,t.jsx)(T.Z,{size:16}):null,children:g?"Changing...":"Change Password"})})]})]})})}var H=r(23695);let O={fontWeight:500,color:"text.secondary",border:0,width:"40%",py:1},K={border:0,py:1};function $(e){return e?("string"==typeof e?new Date(e):e).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"}):"-"}function Q(){let{data:e}=(0,R.kP)(),n=null==e?void 0:e.user;return n?(0,t.jsx)(s.Z,{sx:{height:"100%"},children:(0,t.jsxs)(i.Z,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[(0,t.jsx)(H.Z,{color:"primary"}),(0,t.jsx)(a.Z,{variant:"h6",component:"h2",children:"Account Information"})]}),(0,t.jsx)(c.Z,{size:"small",children:(0,t.jsxs)(d.Z,{children:[(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(u.Z,{sx:O,children:"Account ID"}),(0,t.jsx)(u.Z,{sx:K,children:(0,t.jsx)(a.Z,{variant:"body2",sx:{fontFamily:"monospace",fontSize:"0.8rem"},children:n.id})})]}),(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(u.Z,{sx:O,children:"Created"}),(0,t.jsx)(u.Z,{sx:K,children:$(n.createdAt)})]}),(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(u.Z,{sx:O,children:"Last Updated"}),(0,t.jsx)(u.Z,{sx:K,children:$(n.updatedAt)})]})]})})]})}):null}var X=r(11254),Y=r(10721),G=r(81071),J=r(84974),ee=r(5501),en=r(93315),er=r(9078),et=r(10449),es=r(24559),ei=r(37228);let ea={fontWeight:500,color:"text.secondary",border:0,width:"40%",py:1},el={border:0,py:1};function eo(e){let{text:n}=e,[r,s]=(0,k.useState)(!1),i=async()=>{try{await navigator.clipboard.writeText(n),s(!0),setTimeout(()=>s(!1),2e3)}catch(e){console.error("Failed to copy:",e)}};return(0,t.jsx)(U.Z,{size:"small",onClick:i,sx:{ml:1,color:r?"success.main":"text.secondary","&:hover":{bgcolor:"action.hover"}},"aria-label":r?"Copied":"Copy to clipboard",children:r?(0,t.jsx)(es.Z,{sx:{fontSize:16}}):(0,t.jsx)(et.Z,{sx:{fontSize:16}})})}function ec(){let{data:e,isLoading:n,error:r}=(0,ei.UW)(),h=(0,ei.Bc)(),p=(0,ei.N$)();if(r)return(0,t.jsx)(s.Z,{children:(0,t.jsxs)(i.Z,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[(0,t.jsx)(J.Z,{color:"primary"}),(0,t.jsx)(a.Z,{variant:"h6",component:"h2",children:"External Access (playit.gg)"})]}),(0,t.jsxs)(G.Z,{severity:"error",children:["Failed to load playit status: ",r.message]})]})});if(n)return(0,t.jsx)(s.Z,{children:(0,t.jsxs)(i.Z,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[(0,t.jsx)(Y.Z,{variant:"circular",width:24,height:24}),(0,t.jsx)(Y.Z,{variant:"text",width:"40%",height:32})]}),(0,t.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",py:.75},children:[(0,t.jsx)(Y.Z,{variant:"text",width:"35%"}),(0,t.jsx)(Y.Z,{variant:"text",width:"40%"})]}),(0,t.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",py:.75},children:[(0,t.jsx)(Y.Z,{variant:"text",width:"35%"}),(0,t.jsx)(Y.Z,{variant:"text",width:"40%"})]})]})});if(!(null==e?void 0:e.enabled))return(0,t.jsx)(s.Z,{children:(0,t.jsxs)(i.Z,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[(0,t.jsx)(J.Z,{color:"primary"}),(0,t.jsx)(a.Z,{variant:"h6",component:"h2",children:"External Access (playit.gg)"})]}),(0,t.jsxs)(G.Z,{severity:"info",children:[(0,t.jsx)(a.Z,{variant:"body2",fontWeight:500,sx:{mb:.5},children:"Not configured"}),(0,t.jsx)(a.Z,{variant:"body2",color:"text.secondary",children:"playit.gg agent is not set up. Configure PLAYIT_SECRET to enable external access."})]})]})});let m=e.agentRunning&&"running"===e.containerStatus,Z=h.isPending||p.isPending,j=h.error||p.error;return(0,t.jsx)(s.Z,{children:(0,t.jsxs)(i.Z,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:1},children:[(0,t.jsx)(J.Z,{color:"primary"}),(0,t.jsx)(a.Z,{variant:"h6",component:"h2",children:"External Access (playit.gg)"})]}),j&&(0,t.jsx)(G.Z,{severity:"error",sx:{mb:2},children:j.message||"Action failed"}),(0,t.jsxs)(l.Z,{sx:{display:"flex",gap:1,mb:2,flexWrap:"wrap"},children:[m?(0,t.jsx)(L.Z,{variant:"outlined",size:"small",color:"error",startIcon:Z?(0,t.jsx)(T.Z,{size:16}):(0,t.jsx)(en.Z,{}),onClick:()=>{p.mutate()},disabled:Z,sx:{fontSize:12},children:Z?"Stopping...":"Stop Agent"}):(0,t.jsx)(L.Z,{variant:"contained",size:"small",color:"success",startIcon:Z?(0,t.jsx)(T.Z,{size:16,color:"inherit"}):(0,t.jsx)(ee.Z,{}),onClick:()=>{h.mutate()},disabled:Z,sx:{fontSize:12},children:Z?"Starting...":"Start Agent"}),(0,t.jsx)(L.Z,{component:"a",href:"https://playit.gg/account/tunnels",target:"_blank",rel:"noopener noreferrer",size:"small",startIcon:(0,t.jsx)(er.Z,{}),sx:{fontSize:12},children:"View Dashboard"})]}),(0,t.jsx)(c.Z,{size:"small",sx:{mb:3},children:(0,t.jsxs)(d.Z,{children:[(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(u.Z,{sx:ea,children:"Agent Status"}),(0,t.jsx)(u.Z,{sx:el,children:(0,t.jsx)(o.Z,{label:m?"Running":"Stopped",size:"small",color:m?"success":"default",variant:"outlined"})})]}),e.uptime&&(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(u.Z,{sx:ea,children:"Uptime"}),(0,t.jsx)(u.Z,{sx:el,children:e.uptime})]})]})}),e.servers&&e.servers.length>0&&(()=>{let n=e.servers.filter(e=>e.playitDomain),r=e.servers.filter(e=>!e.playitDomain);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.Z,{variant:"subtitle2",sx:{mb:1.5,fontWeight:600},children:"Server Domains"}),n.length>0?(0,t.jsxs)(c.Z,{size:"small",sx:{mb:r.length>0?2:0},children:[(0,t.jsx)(X.Z,{children:(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(u.Z,{sx:{fontWeight:600,borderBottom:2,borderColor:"divider"},children:"Server"}),(0,t.jsx)(u.Z,{sx:{fontWeight:600,borderBottom:2,borderColor:"divider"},children:"External Domain"})]})}),(0,t.jsx)(d.Z,{children:n.map(e=>(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(u.Z,{sx:{py:1.5,borderBottom:1,borderColor:"divider"},children:e.serverName}),(0,t.jsx)(u.Z,{sx:{py:1.5,borderBottom:1,borderColor:"divider"},children:(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center"},children:[(0,t.jsx)(a.Z,{variant:"body2",sx:{fontFamily:"monospace"},children:e.playitDomain}),(0,t.jsx)(eo,{text:e.playitDomain})]})})]},e.serverName))})]}):(0,t.jsxs)(a.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:["No servers with external domains configured. Use ",(0,t.jsx)("code",{children:"mcctl create --playit-domain"})," to register a domain."]}),r.length>0&&(0,t.jsxs)(a.Z,{variant:"body2",color:"text.secondary",children:[r.length," server",r.length>1?"s":""," without external domain: ",r.map(e=>e.serverName).join(", ")]})]})})()]})})}},37228:function(e,n,r){r.d(n,{Bc:function(){return o},N$:function(){return c},UW:function(){return l}});var t=r(5632),s=r(58919),i=r(20367),a=r(42936);function l(){return(0,t.a)({queryKey:["playit-status"],queryFn:()=>(0,a.SC)("/api/playit/status"),refetchInterval:3e4})}function o(){let e=(0,s.NL)();return(0,i.D)({mutationFn:()=>(0,a.SC)("/api/playit/start",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["playit-status"]})}})}function c(){let e=(0,s.NL)();return(0,i.D)({mutationFn:()=>(0,a.SC)("/api/playit/stop",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["playit-status"]})}})}},6986:function(e,n,r){r.d(n,{Cp:function(){return u},Nq:function(){return x},cg:function(){return l},kP:function(){return d},w7:function(){return o},y1:function(){return c},zB:function(){return h}});var t=r(77054),s=r(61648),i=r(35016);let a=(0,t.X)({baseURL:i.env.NEXT_PUBLIC_BETTER_AUTH_URL||"",plugins:[(0,s.zB)()]}),{signIn:l,signOut:o,signUp:c,useSession:d,updateUser:x,changePassword:u}=a,h=a.admin}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[781],{31809:function(e,n,a){Promise.resolve().then(a.bind(a,38538))},38538:function(e,n,a){"use strict";a.r(n),a.d(n,{default:function(){return ep}});var r=a(94655),l=a(35106),t=a(7281),s=a(31317),i=a(84840),o=a(33402),c=a(60097),d=a(29793),h=a(75726),x=a(62328),u=a(7178),p=a(69899),m=a(76492),j=a(35847),y=a(628),Z=a(41565),v=a(90158),b=a(58347),g=a(73424),f=a(69783),C=a(86702),w=a(79983),k=a(30417),S=a(25333),E=a(99770),P=a(62508),F=a(5682),I=a(65087),A=a(76678),O=a(97436),W=a(93017),D=a(81071),L=a(66561),N=a(12795),z=a(96407),B=a(69366),R=a(11597),T=a(81960),U=a(30114);function M(e){let{onPlayerKicked:n}=e,[a,i]=(0,l.useState)(!0),[o,c]=(0,l.useState)(null),[d,h]=(0,l.useState)([]),[x,u]=(0,l.useState)(!1),[p,m]=(0,l.useState)(null),[j,M]=(0,l.useState)(""),[_,K]=(0,l.useState)(!1),q=(0,l.useCallback)(async()=>{i(!0),c(null);try{let e=await fetch("/api/players");if(!e.ok)throw Error("Failed to fetch players");let n=await e.json();h(n.servers)}catch(e){c("Failed to load players"),console.error("Error fetching players:",e)}finally{i(!1)}},[]);(0,l.useEffect)(()=>{q()},[q]);let J=(e,n)=>{m({player:e,server:n}),M(""),u(!0)},G=async()=>{if(p){K(!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:j||"Kicked by administrator"})})).ok)throw Error("Failed to kick player");u(!1),m(null),null==n||n(p.player,p.server),await q()}catch(e){console.error("Error kicking player:",e)}finally{K(!1)}}},Y=d.some(e=>e.players.length>0);return(0,r.jsx)(y.Z,{"data-testid":"player-list",children:(0,r.jsxs)(Z.Z,{children:[(0,r.jsxs)(t.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,r.jsx)(s.Z,{variant:"h6",children:"Online Players"}),(0,r.jsx)(w.Z,{onClick:q,disabled:a,"aria-label":"Refresh",children:(0,r.jsx)(B.Z,{})})]}),a&&(0,r.jsx)(t.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,r.jsx)(W.Z,{})}),o&&(0,r.jsx)(D.Z,{severity:"error",sx:{mb:2},children:o}),!a&&!o&&!Y&&(0,r.jsx)(s.Z,{color:"text.secondary",sx:{textAlign:"center",py:4},children:"No players online"}),!a&&!o&&Y&&(0,r.jsx)(t.Z,{children:d.map(e=>(0,r.jsxs)(L.Z,{defaultExpanded:e.players.length>0,children:[(0,r.jsx)(N.Z,{expandIcon:(0,r.jsx)(T.Z,{}),children:(0,r.jsxs)(t.Z,{sx:{display:"flex",alignItems:"center",gap:2,width:"100%"},children:[(0,r.jsx)(s.Z,{variant:"subtitle1",sx:{fontWeight:500},children:e.name}),(0,r.jsx)(S.Z,{label:"".concat(e.players.length," player").concat(1!==e.players.length?"s":""),size:"small",color:e.players.length>0?"success":"default"})]})}),(0,r.jsx)(z.Z,{children:0===e.players.length?(0,r.jsx)(s.Z,{color:"text.secondary",sx:{fontStyle:"italic"},children:"No players online on this server"}):(0,r.jsx)(v.Z,{dense:!0,children:e.players.map(n=>(0,r.jsxs)(b.ZP,{secondaryAction:(0,r.jsx)(w.Z,{edge:"end","aria-label":"Kick player",onClick:()=>J(n,e.name),color:"error",children:(0,r.jsx)(R.Z,{})}),children:[(0,r.jsx)(f.Z,{children:(0,r.jsx)(C.Z,{src:"https://mc-heads.net/avatar/".concat(n.uuid,"/40"),alt:n.name,children:(0,r.jsx)(U.Z,{})})}),(0,r.jsx)(g.Z,{primary:n.name,secondary:n.uuid.substring(0,8)+"..."})]},n.uuid))})})]},e.name))}),(0,r.jsxs)(E.Z,{open:x,onClose:()=>u(!1),children:[(0,r.jsx)(P.Z,{children:"Kick Player"}),(0,r.jsxs)(F.Z,{children:[(0,r.jsxs)(I.Z,{children:["Are you sure you want to kick ",null==p?void 0:p.player.name," from ",null==p?void 0:p.server,"?"]}),(0,r.jsx)(O.Z,{autoFocus:!0,margin:"dense",label:"Reason (optional)",fullWidth:!0,variant:"outlined",value:j,onChange:e=>M(e.target.value),placeholder:"Kicked by administrator"})]}),(0,r.jsxs)(A.Z,{children:[(0,r.jsx)(k.Z,{onClick:()=>u(!1),disabled:_,children:"Cancel"}),(0,r.jsx)(k.Z,{onClick:G,color:"error",variant:"contained",disabled:_,"aria-label":"Confirm kick",children:_?(0,r.jsx)(W.Z,{size:20}):"Confirm"})]})]})]})})}var _=a(70115),K=a(38393),q=a(52082),J=a(21111),G=a(47606),Y=a(42431),H=a(29114),$=a(92666);function Q(e){var n,a;let{serverName:i}=e,[o,c]=(0,l.useState)(""),[d,h]=(0,l.useState)(null),[x,u]=(0,l.useState)(!1),[p,m]=(0,l.useState)(""),[j,E]=(0,l.useState)(null),[P,F]=(0,l.useState)(""),{data:I,isLoading:A,error:L}=(0,$.ox)(i),{data:N}=(0,$.Yo)(i),z=(0,$.zF)(),B=(0,$.Ll)(),R=(0,$.S0)(),T=null!==(n=null==I?void 0:I.players)&&void 0!==n?n:[],M=null==I?void 0:I.source,Q=null!==(a=null==N?void 0:N.enabled)&&void 0!==a&&a,V=(0,l.useMemo)(()=>{if(!P.trim())return T;let e=P.toLowerCase();return T.filter(n=>n.name.toLowerCase().includes(e))},[T,P]),X=(null==L?void 0:L.message)||(B.error?"Failed to add player to whitelist":null)||(R.error&&!d?"Failed to remove player from whitelist":null)||(z.error?"Failed to update whitelist status":null),ee=()=>{o.trim()&&B.mutate({serverName:i,player:o.trim()},{onSuccess:()=>c("")})},en=e=>{h(e),R.mutate({serverName:i,player:e},{onSettled:()=>h(null)})},ea=async()=>{let e=p.split(/[,\n]/).map(e=>e.trim()).filter(Boolean);if(0===e.length)return;E(null);let n=0;for(let a of e)try{await B.mutateAsync({serverName:i,player:a}),n++}catch(e){}E("Added ".concat(n," of ").concat(e.length," players")),n>0&&m("")},er=B.isPending;return(0,r.jsx)(y.Z,{"data-testid":"whitelist-manager",children:(0,r.jsxs)(Z.Z,{children:[(0,r.jsxs)(_.Z,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{mb:2},children:[(0,r.jsxs)(_.Z,{direction:"row",alignItems:"center",spacing:1,children:[(0,r.jsx)(s.Z,{variant:"h6",children:"Whitelist"}),(0,r.jsx)(S.Z,{label:Q?"ON":"OFF",color:Q?"success":"default",size:"small","data-testid":"whitelist-status-chip"})]}),(0,r.jsx)(K.Z,{checked:Q,onChange:()=>{z.mutate({serverName:i,enabled:!Q})},disabled:z.isPending,inputProps:{"aria-label":"Toggle whitelist"},"data-testid":"whitelist-toggle"})]}),X&&(0,r.jsx)(D.Z,{severity:"error",sx:{mb:2},children:X}),!A&&M&&"rcon"!==M&&(0,r.jsxs)(D.Z,{severity:"info",sx:{mb:2},children:["Server is offline. Showing data from ","config"===M?"config.env":"whitelist.json",". Changes will apply on next server start."]}),(0,r.jsxs)(_.Z,{direction:"row",spacing:1,alignItems:"flex-start",sx:{mb:2},children:[x?(0,r.jsxs)(t.Z,{sx:{flex:1},children:[(0,r.jsx)(O.Z,{size:"small",placeholder:"player1, player2, player3",value:p,onChange:e=>m(e.target.value),disabled:er,fullWidth:!0,multiline:!0,rows:3,"data-testid":"bulk-input"}),j&&(0,r.jsx)(D.Z,{severity:"info",sx:{mt:1},"data-testid":"bulk-result",children:j})]}):(0,r.jsx)(O.Z,{size:"small",placeholder:"Player name",value:o,onChange:e=>c(e.target.value),onKeyDown:e=>{"Enter"===e.key&&ee()},disabled:er,fullWidth:!0}),x?(0,r.jsx)(k.Z,{variant:"contained",onClick:ea,disabled:!p.trim()||er,startIcon:er?(0,r.jsx)(W.Z,{size:16}):(0,r.jsx)(H.Z,{}),"aria-label":"Add players in bulk",children:"Add All"}):(0,r.jsx)(k.Z,{variant:"contained",onClick:ee,disabled:!o.trim()||er,startIcon:er?(0,r.jsx)(W.Z,{size:16}):(0,r.jsx)(G.Z,{}),"aria-label":"Add player to whitelist",children:"Add"}),(0,r.jsx)(k.Z,{variant:x?"contained":"outlined",onClick:()=>{u(!x),E(null)},"aria-label":"Toggle bulk mode","data-testid":"bulk-toggle",sx:{whiteSpace:"nowrap"},children:"Bulk"})]}),T.length>=5&&(0,r.jsx)(O.Z,{size:"small",placeholder:"Search players...",value:P,onChange:e=>F(e.target.value),fullWidth:!0,sx:{mb:2},InputProps:{startAdornment:(0,r.jsx)(q.Z,{position:"start",children:(0,r.jsx)(Y.Z,{})})},"data-testid":"search-input"}),A&&(0,r.jsx)(t.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,r.jsx)(W.Z,{})}),!A&&0===T.length&&(0,r.jsx)(s.Z,{color:"text.secondary",sx:{textAlign:"center",py:4},children:"No players whitelisted"}),!A&&T.length>0&&0===V.length&&(0,r.jsx)(s.Z,{color:"text.secondary",sx:{textAlign:"center",py:4},"data-testid":"no-match-message",children:"No matching players"}),!A&&V.length>0&&(0,r.jsx)(v.Z,{dense:!0,children:V.map(e=>(0,r.jsxs)(b.ZP,{secondaryAction:(0,r.jsx)(w.Z,{edge:"end","aria-label":"Remove from whitelist",onClick:()=>en(e.name),disabled:d===e.name,color:"error",children:d===e.name?(0,r.jsx)(W.Z,{size:20}):(0,r.jsx)(J.Z,{})}),children:[(0,r.jsx)(f.Z,{children:(0,r.jsx)(C.Z,{src:e.uuid?"https://mc-heads.net/avatar/".concat(e.uuid,"/40"):void 0,alt:e.name,children:(0,r.jsx)(U.Z,{})})}),(0,r.jsx)(g.Z,{primary:e.name,secondary:e.uuid?e.uuid.substring(0,8)+"...":"UUID not available"})]},e.uuid||e.name))})]})})}var V=a(35694),X=a(37809),ee=a(407),en=a(45813);let ea={1:{color:"info",label:"Moderator",icon:"\uD83D\uDEE1️"},2:{color:"success",label:"Gamemaster",icon:"\uD83C\uDFAE"},3:{color:"warning",label:"Admin",icon:"⚙️"},4:{color:"error",label:"Owner",icon:"\uD83D\uDC51"}};function er(e){let{level:n,showIcon:a=!1,compact:l=!1,size:s="medium",variant:i="filled"}=e,o=ea[n];if(!o)return null;let c=l?n.toString():"Level ".concat(n," - ").concat(o.label),d=a?(0,r.jsx)(t.Z,{component:"span",sx:{mr:.5},children:o.icon}):void 0;return(0,r.jsx)(S.Z,{label:(0,r.jsxs)(r.Fragment,{children:[d,c]}),color:o.color,size:s,variant:i})}var el=a(68038),et=a(34080),es=a(40064),ei=a(39181);let eo=[{value:1,label:"Level 1 - Moderator",description:"Bypass spawn protection",icon:"\uD83D\uDEE1️"},{value:2,label:"Level 2 - Gamemaster",description:"Cheats, command blocks",icon:"\uD83C\uDFAE"},{value:3,label:"Level 3 - Admin",description:"Player management commands",icon:"⚙️"},{value:4,label:"Level 4 - Owner",description:"Full server control",icon:"\uD83D\uDC51"}];function ec(e){let{value:n,onChange:a,label:l,disabled:i=!1}=e;return(0,r.jsxs)(d.Z,{component:"fieldset",fullWidth:!0,disabled:i,children:[l&&(0,r.jsx)(el.Z,{component:"legend",sx:{mb:1},children:l}),(0,r.jsx)(et.Z,{value:n,onChange:e=>{a(parseInt(e.target.value,10))},children:eo.map(e=>(0,r.jsx)(es.Z,{value:e.value,control:(0,r.jsx)(ei.Z,{}),label:(0,r.jsxs)(t.Z,{children:[(0,r.jsxs)(t.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,r.jsx)(s.Z,{component:"span",children:e.icon}),(0,r.jsx)(s.Z,{component:"span",fontWeight:"medium",children:e.label})]}),(0,r.jsx)(s.Z,{variant:"body2",color:"text.secondary",sx:{ml:4},children:e.description})]}),sx:{alignItems:"flex-start",py:1}},e.value))})]})}function ed(e){let{serverName:n}=e,[a,i]=(0,l.useState)(!0),[o,c]=(0,l.useState)(null),[d,h]=(0,l.useState)([]),[x,p]=(0,l.useState)(),[m,j]=(0,l.useState)(""),[S,I]=(0,l.useState)(!1),[L,N]=(0,l.useState)(null),[z,B]=(0,l.useState)(!1),[R,T]=(0,l.useState)(4),[U,M]=(0,l.useState)(!1),[_,K]=(0,l.useState)(null),[q,Y]=(0,l.useState)(4),[H,$]=(0,l.useState)(!1),[Q,ea]=(0,l.useState)(null),[el,et]=(0,l.useState)(null),es=(0,l.useCallback)(async()=>{i(!0),c(null);try{let e=await fetch("/api/players/op?server=".concat(encodeURIComponent(n)));if(!e.ok)throw Error("Failed to fetch operators");let a=await e.json();h(a.operators),p(a.source)}catch(e){c("Failed to load operators"),console.error("Error fetching operators:",e)}finally{i(!1)}},[n]);(0,l.useEffect)(()=>{es()},[es]);let ei=async()=>{if(m.trim()){I(!0),c(null);try{if(!(await fetch("/api/players/op",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({player:m.trim(),server:n,level:R})})).ok)throw Error("Failed to add operator");j(""),T(4),B(!1),await es()}catch(e){c("Failed to add operator"),console.error("Error adding operator:",e)}finally{I(!1)}}},eo=async e=>{N(e),c(null),ea(null),et(null);try{if(!(await fetch("/api/players/op?player=".concat(encodeURIComponent(e),"&server=").concat(encodeURIComponent(n)),{method:"DELETE"})).ok)throw Error("Failed to remove operator");await es()}catch(e){c("Failed to remove operator"),console.error("Error removing operator:",e)}finally{N(null)}},ed=async()=>{if(_){$(!0),c(null);try{if(!(await fetch("/api/players/op/".concat(encodeURIComponent(_.name),"?server=").concat(encodeURIComponent(n)),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({level:q})})).ok)throw Error("Failed to change operator level");M(!1),K(null),await es()}catch(e){c("Failed to change operator level"),console.error("Error changing operator level:",e)}finally{$(!1)}}},eh=(e,n)=>{ea(e.currentTarget),et(n)},ex=()=>{ea(null),et(null)};return(0,r.jsxs)(y.Z,{"data-testid":"op-manager",children:[(0,r.jsxs)(Z.Z,{children:[(0,r.jsx)(s.Z,{variant:"h6",gutterBottom:!0,children:"Operators"}),o&&(0,r.jsx)(D.Z,{severity:"error",sx:{mb:2},children:o}),!a&&x&&"rcon"!==x&&(0,r.jsxs)(D.Z,{severity:"info",sx:{mb:2},children:["Server is offline. Showing data from ","config"===x?"config.env":"ops.json",". Changes will apply on next server start."]}),(0,r.jsx)(t.Z,{sx:{mb:2},children:(0,r.jsx)(k.Z,{variant:"contained",onClick:()=>B(!0),startIcon:(0,r.jsx)(G.Z,{}),"aria-label":"Add operator",fullWidth:!0,children:"Add Operator"})}),a&&(0,r.jsx)(t.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,r.jsx)(W.Z,{})}),!a&&0===d.length&&(0,r.jsx)(s.Z,{color:"text.secondary",sx:{textAlign:"center",py:4},children:"No operators configured"}),!a&&d.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(v.Z,{dense:!0,children:d.map(e=>(0,r.jsxs)(b.ZP,{secondaryAction:(0,r.jsx)(w.Z,{edge:"end","aria-label":"Operator actions",onClick:n=>eh(n,e),disabled:L===e.name,children:L===e.name?(0,r.jsx)(W.Z,{size:20}):(0,r.jsx)(X.Z,{})}),children:[(0,r.jsx)(f.Z,{children:(0,r.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,r.jsx)(ee.Z,{})})}),(0,r.jsx)(g.Z,{primary:(0,r.jsxs)(t.Z,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:[(0,r.jsx)(s.Z,{component:"span",children:e.name}),(0,r.jsx)(er,{level:e.level,showIcon:!0,size:"small"})]}),secondary:e.uuid?e.uuid.substring(0,8)+"...":"UUID not available"})]},e.uuid||e.name))}),(0,r.jsxs)(V.Z,{anchorEl:Q,open:!!Q,onClose:ex,children:[(0,r.jsxs)(u.Z,{onClick:()=>{el&&(K(el),Y(el.level),M(!0),ex())},children:[(0,r.jsx)(en.Z,{sx:{mr:1},fontSize:"small"}),"Change Level"]}),(0,r.jsxs)(u.Z,{onClick:()=>el&&eo(el.name),children:[(0,r.jsx)(J.Z,{sx:{mr:1},fontSize:"small",color:"error"}),"Remove OP"]})]})]})]}),(0,r.jsxs)(E.Z,{open:z,onClose:()=>!S&&B(!1),maxWidth:"sm",fullWidth:!0,children:[(0,r.jsx)(P.Z,{children:"Add Operator"}),(0,r.jsxs)(F.Z,{children:[(0,r.jsx)(O.Z,{autoFocus:!0,margin:"dense",label:"Player Name",placeholder:"Enter player name",fullWidth:!0,value:m,onChange:e=>j(e.target.value),disabled:S,sx:{mb:2}}),(0,r.jsx)(ec,{value:R,onChange:T,label:"OP Level",disabled:S})]}),(0,r.jsxs)(A.Z,{children:[(0,r.jsx)(k.Z,{onClick:()=>B(!1),disabled:S,children:"Cancel"}),(0,r.jsx)(k.Z,{variant:"contained",onClick:ei,disabled:!m.trim()||S,startIcon:S?(0,r.jsx)(W.Z,{size:16}):void 0,children:S?"Adding...":"Add OP"})]})]}),(0,r.jsxs)(E.Z,{open:U,onClose:()=>!H&&M(!1),maxWidth:"sm",fullWidth:!0,children:[(0,r.jsxs)(P.Z,{children:["Change OP Level - ",null==_?void 0:_.name]}),(0,r.jsx)(F.Z,{children:_&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(s.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:["Current: Level ",_.level," (",_.role,")"]}),(0,r.jsx)(ec,{value:q,onChange:Y,label:"New Level",disabled:H})]})}),(0,r.jsxs)(A.Z,{children:[(0,r.jsx)(k.Z,{onClick:()=>M(!1),disabled:H,children:"Cancel"}),(0,r.jsx)(k.Z,{variant:"contained",onClick:ed,disabled:H||q===(null==_?void 0:_.level),startIcon:H?(0,r.jsx)(W.Z,{size:16}):void 0,children:H?"Saving...":"Save Changes"})]})]})]})}var eh=a(397);function ex(e){let{serverName:n}=e,[a,i]=(0,l.useState)(!0),[o,c]=(0,l.useState)(null),[d,h]=(0,l.useState)([]),[x,u]=(0,l.useState)(),[p,m]=(0,l.useState)(!1),[j,S]=(0,l.useState)({player:"",reason:""}),[I,L]=(0,l.useState)(!1),[N,z]=(0,l.useState)(null),B=(0,l.useCallback)(async()=>{i(!0),c(null);try{let e=await fetch("/api/players/ban?server=".concat(encodeURIComponent(n)));if(!e.ok)throw Error("Failed to fetch bans");let a=await e.json();h(a.players),u(a.source)}catch(e){c("Failed to load ban list"),console.error("Error fetching bans:",e)}finally{i(!1)}},[n]);(0,l.useEffect)(()=>{B()},[B]);let R=()=>{m(!1),S({player:"",reason:""})},T=async()=>{if(j.player.trim()){L(!0),c(null);try{if(!(await fetch("/api/players/ban",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({player:j.player.trim(),reason:j.reason.trim()||"Banned by administrator",server:n})})).ok)throw Error("Failed to ban player");R(),await B()}catch(e){c("Failed to ban player"),console.error("Error banning player:",e)}finally{L(!1)}}},M=async e=>{z(e),c(null);try{if(!(await fetch("/api/players/ban?player=".concat(encodeURIComponent(e),"&server=").concat(encodeURIComponent(n)),{method:"DELETE"})).ok)throw Error("Failed to unban player");await B()}catch(e){c("Failed to unban player"),console.error("Error unbanning player:",e)}finally{z(null)}},K=e=>{try{return new Date(e).toLocaleDateString()}catch(n){return e}};return(0,r.jsx)(y.Z,{"data-testid":"ban-manager",children:(0,r.jsxs)(Z.Z,{children:[(0,r.jsxs)(t.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,r.jsx)(s.Z,{variant:"h6",children:"Ban List"}),(0,r.jsx)(k.Z,{variant:"outlined",color:"error",startIcon:(0,r.jsx)(eh.Z,{}),onClick:()=>{S({player:"",reason:""}),m(!0)},"aria-label":"Ban player",children:"Ban Player"})]}),o&&(0,r.jsx)(D.Z,{severity:"error",sx:{mb:2},children:o}),!a&&x&&"rcon"!==x&&(0,r.jsxs)(D.Z,{severity:"info",sx:{mb:2},children:["Server is offline. Showing data from ","config"===x?"config.env":"banned-players.json",". Changes will apply on next server start."]}),a&&(0,r.jsx)(t.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,r.jsx)(W.Z,{})}),!a&&0===d.length&&(0,r.jsx)(s.Z,{color:"text.secondary",sx:{textAlign:"center",py:4},children:"No players banned"}),!a&&d.length>0&&(0,r.jsx)(v.Z,{dense:!0,children:d.map(e=>(0,r.jsxs)(b.ZP,{secondaryAction:(0,r.jsx)(w.Z,{edge:"end","aria-label":"Unban player",onClick:()=>M(e.name),disabled:N===e.name,color:"success",children:N===e.name?(0,r.jsx)(W.Z,{size:20}):(0,r.jsx)(J.Z,{})}),children:[(0,r.jsx)(f.Z,{children:(0,r.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,r.jsx)(U.Z,{})})}),(0,r.jsx)(g.Z,{primary:e.name,secondary:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(s.Z,{component:"span",variant:"body2",color:"text.secondary",children:["Reason: ",e.reason||"No reason specified"]}),(0,r.jsx)("br",{}),(0,r.jsxs)(s.Z,{component:"span",variant:"caption",color:"text.secondary",children:["Banned: ",K(e.created)," by ",e.source||"Unknown"]})]})})]},e.uuid||e.name))}),(0,r.jsxs)(E.Z,{open:p,onClose:R,maxWidth:"sm",fullWidth:!0,children:[(0,r.jsx)(P.Z,{children:"Ban Player"}),(0,r.jsx)(F.Z,{children:(0,r.jsxs)(_.Z,{spacing:2,sx:{mt:1},children:[(0,r.jsx)(O.Z,{label:"Player Name",placeholder:"Enter player name",value:j.player,onChange:e=>S({...j,player:e.target.value}),fullWidth:!0,required:!0}),(0,r.jsx)(O.Z,{label:"Reason",placeholder:"Banned by administrator",value:j.reason,onChange:e=>S({...j,reason:e.target.value}),fullWidth:!0,multiline:!0,rows:2})]})}),(0,r.jsxs)(A.Z,{children:[(0,r.jsx)(k.Z,{onClick:R,disabled:I,children:"Cancel"}),(0,r.jsx)(k.Z,{onClick:T,color:"error",variant:"contained",disabled:!j.player.trim()||I,startIcon:I?(0,r.jsx)(W.Z,{size:16}):(0,r.jsx)(eh.Z,{}),children:"Ban"})]})]})]})})}function eu(e){let{children:n,value:a,index:l}=e;return(0,r.jsx)("div",{role:"tabpanel",hidden:a!==l,children:a===l&&(0,r.jsx)(t.Z,{sx:{py:3},children:n})})}function ep(){let[e,n]=(0,l.useState)(0),[a,y]=(0,l.useState)(""),{data:Z,isLoading:v}=(0,$.x$)(),b=null==Z?void 0:Z.servers;return(0,l.useEffect)(()=>{!a&&b&&b.length>0&&y(b[0].name)},[b,a]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p.Z,{elevation:0,sx:{mb:4,p:3,background:e=>"linear-gradient(135deg, ".concat((0,m.Fq)(e.palette.info.main,.1)," 0%, ").concat((0,m.Fq)(e.palette.secondary.main,.1)," 100%)"),borderRadius:2,border:e=>"1px solid ".concat((0,m.Fq)(e.palette.info.main,.2))},children:(0,r.jsxs)(t.Z,{sx:{display:"flex",alignItems:"center",gap:2},children:[(0,r.jsx)(t.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:56,height:56,borderRadius:2,bgcolor:"info.main",color:"info.contrastText"},children:(0,r.jsx)(j.Z,{sx:{fontSize:32}})}),(0,r.jsxs)(t.Z,{children:[(0,r.jsx)(s.Z,{variant:"h4",component:"h1",fontWeight:"bold",children:"Player Management"}),(0,r.jsx)(s.Z,{variant:"body1",color:"text.secondary",children:"Manage players, whitelist, operators, and bans across your servers"})]})]})}),(0,r.jsx)(t.Z,{sx:{mb:3},children:(0,r.jsxs)(d.Z,{sx:{minWidth:200},children:[(0,r.jsx)(h.Z,{id:"server-select-label",children:"Server"}),(0,r.jsx)(x.Z,{labelId:"server-select-label",value:a,label:"Server",onChange:e=>y(e.target.value),disabled:v,children:null==b?void 0:b.map(e=>(0,r.jsx)(u.Z,{value:e.name,children:e.name},e.name))})]})}),(0,r.jsx)(t.Z,{sx:{borderBottom:1,borderColor:"divider"},children:(0,r.jsxs)(o.Z,{value:e,onChange:(e,a)=>{n(a)},"aria-label":"Player management tabs",children:[(0,r.jsx)(c.Z,{label:"Online Players"}),(0,r.jsx)(c.Z,{label:"Whitelist",disabled:!a}),(0,r.jsx)(c.Z,{label:"Operators",disabled:!a}),(0,r.jsx)(c.Z,{label:"Ban List",disabled:!a})]})}),(0,r.jsx)(eu,{value:e,index:0,children:(0,r.jsx)(M,{})}),(0,r.jsx)(eu,{value:e,index:1,children:a&&(0,r.jsxs)(i.ZP,{container:!0,spacing:3,children:[(0,r.jsx)(i.ZP,{item:!0,xs:12,md:8,children:(0,r.jsx)(Q,{serverName:a})}),(0,r.jsx)(i.ZP,{item:!0,xs:12,md:4,children:(0,r.jsxs)(t.Z,{sx:{p:2,bgcolor:"background.paper",borderRadius:1},children:[(0,r.jsx)(s.Z,{variant:"subtitle2",color:"text.secondary",gutterBottom:!0,children:"About Whitelist"}),(0,r.jsx)(s.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,r.jsx)(eu,{value:e,index:2,children:a&&(0,r.jsxs)(i.ZP,{container:!0,spacing:3,children:[(0,r.jsx)(i.ZP,{item:!0,xs:12,md:8,children:(0,r.jsx)(ed,{serverName:a})}),(0,r.jsx)(i.ZP,{item:!0,xs:12,md:4,children:(0,r.jsxs)(t.Z,{sx:{p:2,bgcolor:"background.paper",borderRadius:1},children:[(0,r.jsx)(s.Z,{variant:"subtitle2",color:"text.secondary",gutterBottom:!0,children:"About Operators"}),(0,r.jsx)(s.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,r.jsxs)(t.Z,{sx:{mt:2},children:[(0,r.jsx)(s.Z,{variant:"caption",color:"text.secondary",component:"div",children:"Level 1: Can bypass spawn protection"}),(0,r.jsx)(s.Z,{variant:"caption",color:"text.secondary",component:"div",children:"Level 2: Can use /clear, /gamemode, etc."}),(0,r.jsx)(s.Z,{variant:"caption",color:"text.secondary",component:"div",children:"Level 3: Can use /ban, /kick, /op, etc."}),(0,r.jsx)(s.Z,{variant:"caption",color:"text.secondary",component:"div",children:"Level 4: Can use /stop, full access"})]})]})})]})}),(0,r.jsx)(eu,{value:e,index:3,children:a&&(0,r.jsxs)(i.ZP,{container:!0,spacing:3,children:[(0,r.jsx)(i.ZP,{item:!0,xs:12,md:8,children:(0,r.jsx)(ex,{serverName:a})}),(0,r.jsx)(i.ZP,{item:!0,xs:12,md:4,children:(0,r.jsxs)(t.Z,{sx:{p:2,bgcolor:"background.paper",borderRadius:1},children:[(0,r.jsx)(s.Z,{variant:"subtitle2",color:"text.secondary",gutterBottom:!0,children:"About Bans"}),(0,r.jsx)(s.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."})]})})]})})]})}}},function(e){e.O(0,[6812,9760,6758,680,1668,7436,1071,540,4416,2538,880,7727,8347,1658,5381,4474,7305,3468,2666,3669,2757,1744],function(){return e(e.s=31809)}),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[781],{31809:function(e,n,a){Promise.resolve().then(a.bind(a,38538))},38538:function(e,n,a){"use strict";a.r(n),a.d(n,{default:function(){return ep}});var r=a(94655),l=a(35106),t=a(7281),s=a(31317),i=a(84840),o=a(33402),c=a(60097),d=a(29793),h=a(75726),x=a(62328),u=a(7178),p=a(69899),m=a(76492),j=a(35847),y=a(628),Z=a(41565),v=a(90158),b=a(58347),g=a(73424),f=a(69783),C=a(86702),w=a(79983),k=a(30417),S=a(25333),E=a(99770),P=a(62508),F=a(5682),I=a(65087),A=a(76678),O=a(97436),W=a(93017),D=a(81071),L=a(66561),N=a(12795),z=a(96407),B=a(69366),R=a(11597),T=a(81960),U=a(30114);function M(e){let{onPlayerKicked:n}=e,[a,i]=(0,l.useState)(!0),[o,c]=(0,l.useState)(null),[d,h]=(0,l.useState)([]),[x,u]=(0,l.useState)(!1),[p,m]=(0,l.useState)(null),[j,M]=(0,l.useState)(""),[_,K]=(0,l.useState)(!1),q=(0,l.useCallback)(async()=>{i(!0),c(null);try{let e=await fetch("/api/players");if(!e.ok)throw Error("Failed to fetch players");let n=await e.json();h(n.servers)}catch(e){c("Failed to load players"),console.error("Error fetching players:",e)}finally{i(!1)}},[]);(0,l.useEffect)(()=>{q()},[q]);let J=(e,n)=>{m({player:e,server:n}),M(""),u(!0)},G=async()=>{if(p){K(!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:j||"Kicked by administrator"})})).ok)throw Error("Failed to kick player");u(!1),m(null),null==n||n(p.player,p.server),await q()}catch(e){console.error("Error kicking player:",e)}finally{K(!1)}}},Y=d.some(e=>e.players.length>0);return(0,r.jsx)(y.Z,{"data-testid":"player-list",children:(0,r.jsxs)(Z.Z,{children:[(0,r.jsxs)(t.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,r.jsx)(s.Z,{variant:"h6",children:"Online Players"}),(0,r.jsx)(w.Z,{onClick:q,disabled:a,"aria-label":"Refresh",children:(0,r.jsx)(B.Z,{})})]}),a&&(0,r.jsx)(t.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,r.jsx)(W.Z,{})}),o&&(0,r.jsx)(D.Z,{severity:"error",sx:{mb:2},children:o}),!a&&!o&&!Y&&(0,r.jsx)(s.Z,{color:"text.secondary",sx:{textAlign:"center",py:4},children:"No players online"}),!a&&!o&&Y&&(0,r.jsx)(t.Z,{children:d.map(e=>(0,r.jsxs)(L.Z,{defaultExpanded:e.players.length>0,children:[(0,r.jsx)(N.Z,{expandIcon:(0,r.jsx)(T.Z,{}),children:(0,r.jsxs)(t.Z,{sx:{display:"flex",alignItems:"center",gap:2,width:"100%"},children:[(0,r.jsx)(s.Z,{variant:"subtitle1",sx:{fontWeight:500},children:e.name}),(0,r.jsx)(S.Z,{label:"".concat(e.players.length," player").concat(1!==e.players.length?"s":""),size:"small",color:e.players.length>0?"success":"default"})]})}),(0,r.jsx)(z.Z,{children:0===e.players.length?(0,r.jsx)(s.Z,{color:"text.secondary",sx:{fontStyle:"italic"},children:"No players online on this server"}):(0,r.jsx)(v.Z,{dense:!0,children:e.players.map(n=>(0,r.jsxs)(b.ZP,{secondaryAction:(0,r.jsx)(w.Z,{edge:"end","aria-label":"Kick player",onClick:()=>J(n,e.name),color:"error",children:(0,r.jsx)(R.Z,{})}),children:[(0,r.jsx)(f.Z,{children:(0,r.jsx)(C.Z,{src:"https://mc-heads.net/avatar/".concat(n.uuid,"/40"),alt:n.name,children:(0,r.jsx)(U.Z,{})})}),(0,r.jsx)(g.Z,{primary:n.name,secondary:n.uuid.substring(0,8)+"..."})]},n.uuid))})})]},e.name))}),(0,r.jsxs)(E.Z,{open:x,onClose:()=>u(!1),children:[(0,r.jsx)(P.Z,{children:"Kick Player"}),(0,r.jsxs)(F.Z,{children:[(0,r.jsxs)(I.Z,{children:["Are you sure you want to kick ",null==p?void 0:p.player.name," from ",null==p?void 0:p.server,"?"]}),(0,r.jsx)(O.Z,{autoFocus:!0,margin:"dense",label:"Reason (optional)",fullWidth:!0,variant:"outlined",value:j,onChange:e=>M(e.target.value),placeholder:"Kicked by administrator"})]}),(0,r.jsxs)(A.Z,{children:[(0,r.jsx)(k.Z,{onClick:()=>u(!1),disabled:_,children:"Cancel"}),(0,r.jsx)(k.Z,{onClick:G,color:"error",variant:"contained",disabled:_,"aria-label":"Confirm kick",children:_?(0,r.jsx)(W.Z,{size:20}):"Confirm"})]})]})]})})}var _=a(70115),K=a(38393),q=a(52082),J=a(21111),G=a(47606),Y=a(42431),H=a(29114),$=a(92666);function Q(e){var n,a;let{serverName:i}=e,[o,c]=(0,l.useState)(""),[d,h]=(0,l.useState)(null),[x,u]=(0,l.useState)(!1),[p,m]=(0,l.useState)(""),[j,E]=(0,l.useState)(null),[P,F]=(0,l.useState)(""),{data:I,isLoading:A,error:L}=(0,$.ox)(i),{data:N}=(0,$.Yo)(i),z=(0,$.zF)(),B=(0,$.Ll)(),R=(0,$.S0)(),T=null!==(n=null==I?void 0:I.players)&&void 0!==n?n:[],M=null==I?void 0:I.source,Q=null!==(a=null==N?void 0:N.enabled)&&void 0!==a&&a,V=(0,l.useMemo)(()=>{if(!P.trim())return T;let e=P.toLowerCase();return T.filter(n=>n.name.toLowerCase().includes(e))},[T,P]),X=(null==L?void 0:L.message)||(B.error?"Failed to add player to whitelist":null)||(R.error&&!d?"Failed to remove player from whitelist":null)||(z.error?"Failed to update whitelist status":null),ee=()=>{o.trim()&&B.mutate({serverName:i,player:o.trim()},{onSuccess:()=>c("")})},en=e=>{h(e),R.mutate({serverName:i,player:e},{onSettled:()=>h(null)})},ea=async()=>{let e=p.split(/[,\n]/).map(e=>e.trim()).filter(Boolean);if(0===e.length)return;E(null);let n=0;for(let a of e)try{await B.mutateAsync({serverName:i,player:a}),n++}catch(e){}E("Added ".concat(n," of ").concat(e.length," players")),n>0&&m("")},er=B.isPending;return(0,r.jsx)(y.Z,{"data-testid":"whitelist-manager",children:(0,r.jsxs)(Z.Z,{children:[(0,r.jsxs)(_.Z,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{mb:2},children:[(0,r.jsxs)(_.Z,{direction:"row",alignItems:"center",spacing:1,children:[(0,r.jsx)(s.Z,{variant:"h6",children:"Whitelist"}),(0,r.jsx)(S.Z,{label:Q?"ON":"OFF",color:Q?"success":"default",size:"small","data-testid":"whitelist-status-chip"})]}),(0,r.jsx)(K.Z,{checked:Q,onChange:()=>{z.mutate({serverName:i,enabled:!Q})},disabled:z.isPending,inputProps:{"aria-label":"Toggle whitelist"},"data-testid":"whitelist-toggle"})]}),X&&(0,r.jsx)(D.Z,{severity:"error",sx:{mb:2},children:X}),!A&&M&&"rcon"!==M&&(0,r.jsxs)(D.Z,{severity:"info",sx:{mb:2},children:["Server is offline. Showing data from ","config"===M?"config.env":"whitelist.json",". Changes will apply on next server start."]}),(0,r.jsxs)(_.Z,{direction:"row",spacing:1,alignItems:"flex-start",sx:{mb:2},children:[x?(0,r.jsxs)(t.Z,{sx:{flex:1},children:[(0,r.jsx)(O.Z,{size:"small",placeholder:"player1, player2, player3",value:p,onChange:e=>m(e.target.value),disabled:er,fullWidth:!0,multiline:!0,rows:3,"data-testid":"bulk-input"}),j&&(0,r.jsx)(D.Z,{severity:"info",sx:{mt:1},"data-testid":"bulk-result",children:j})]}):(0,r.jsx)(O.Z,{size:"small",placeholder:"Player name",value:o,onChange:e=>c(e.target.value),onKeyDown:e=>{"Enter"===e.key&&ee()},disabled:er,fullWidth:!0}),x?(0,r.jsx)(k.Z,{variant:"contained",onClick:ea,disabled:!p.trim()||er,startIcon:er?(0,r.jsx)(W.Z,{size:16}):(0,r.jsx)(H.Z,{}),"aria-label":"Add players in bulk",children:"Add All"}):(0,r.jsx)(k.Z,{variant:"contained",onClick:ee,disabled:!o.trim()||er,startIcon:er?(0,r.jsx)(W.Z,{size:16}):(0,r.jsx)(G.Z,{}),"aria-label":"Add player to whitelist",children:"Add"}),(0,r.jsx)(k.Z,{variant:x?"contained":"outlined",onClick:()=>{u(!x),E(null)},"aria-label":"Toggle bulk mode","data-testid":"bulk-toggle",sx:{whiteSpace:"nowrap"},children:"Bulk"})]}),T.length>=5&&(0,r.jsx)(O.Z,{size:"small",placeholder:"Search players...",value:P,onChange:e=>F(e.target.value),fullWidth:!0,sx:{mb:2},InputProps:{startAdornment:(0,r.jsx)(q.Z,{position:"start",children:(0,r.jsx)(Y.Z,{})})},"data-testid":"search-input"}),A&&(0,r.jsx)(t.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,r.jsx)(W.Z,{})}),!A&&0===T.length&&(0,r.jsx)(s.Z,{color:"text.secondary",sx:{textAlign:"center",py:4},children:"No players whitelisted"}),!A&&T.length>0&&0===V.length&&(0,r.jsx)(s.Z,{color:"text.secondary",sx:{textAlign:"center",py:4},"data-testid":"no-match-message",children:"No matching players"}),!A&&V.length>0&&(0,r.jsx)(v.Z,{dense:!0,children:V.map(e=>(0,r.jsxs)(b.ZP,{secondaryAction:(0,r.jsx)(w.Z,{edge:"end","aria-label":"Remove from whitelist",onClick:()=>en(e.name),disabled:d===e.name,color:"error",children:d===e.name?(0,r.jsx)(W.Z,{size:20}):(0,r.jsx)(J.Z,{})}),children:[(0,r.jsx)(f.Z,{children:(0,r.jsx)(C.Z,{src:e.uuid?"https://mc-heads.net/avatar/".concat(e.uuid,"/40"):void 0,alt:e.name,children:(0,r.jsx)(U.Z,{})})}),(0,r.jsx)(g.Z,{primary:e.name,secondary:e.uuid?e.uuid.substring(0,8)+"...":"UUID not available"})]},e.uuid||e.name))})]})})}var V=a(35694),X=a(37809),ee=a(407),en=a(45813);let ea={1:{color:"info",label:"Moderator",icon:"\uD83D\uDEE1️"},2:{color:"success",label:"Gamemaster",icon:"\uD83C\uDFAE"},3:{color:"warning",label:"Admin",icon:"⚙️"},4:{color:"error",label:"Owner",icon:"\uD83D\uDC51"}};function er(e){let{level:n,showIcon:a=!1,compact:l=!1,size:s="medium",variant:i="filled"}=e,o=ea[n];if(!o)return null;let c=l?n.toString():"Level ".concat(n," - ").concat(o.label),d=a?(0,r.jsx)(t.Z,{component:"span",sx:{mr:.5},children:o.icon}):void 0;return(0,r.jsx)(S.Z,{label:(0,r.jsxs)(r.Fragment,{children:[d,c]}),color:o.color,size:s,variant:i})}var el=a(68038),et=a(34080),es=a(40064),ei=a(39181);let eo=[{value:1,label:"Level 1 - Moderator",description:"Bypass spawn protection",icon:"\uD83D\uDEE1️"},{value:2,label:"Level 2 - Gamemaster",description:"Cheats, command blocks",icon:"\uD83C\uDFAE"},{value:3,label:"Level 3 - Admin",description:"Player management commands",icon:"⚙️"},{value:4,label:"Level 4 - Owner",description:"Full server control",icon:"\uD83D\uDC51"}];function ec(e){let{value:n,onChange:a,label:l,disabled:i=!1}=e;return(0,r.jsxs)(d.Z,{component:"fieldset",fullWidth:!0,disabled:i,children:[l&&(0,r.jsx)(el.Z,{component:"legend",sx:{mb:1},children:l}),(0,r.jsx)(et.Z,{value:n,onChange:e=>{a(parseInt(e.target.value,10))},children:eo.map(e=>(0,r.jsx)(es.Z,{value:e.value,control:(0,r.jsx)(ei.Z,{}),label:(0,r.jsxs)(t.Z,{children:[(0,r.jsxs)(t.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,r.jsx)(s.Z,{component:"span",children:e.icon}),(0,r.jsx)(s.Z,{component:"span",fontWeight:"medium",children:e.label})]}),(0,r.jsx)(s.Z,{variant:"body2",color:"text.secondary",sx:{ml:4},children:e.description})]}),sx:{alignItems:"flex-start",py:1}},e.value))})]})}function ed(e){let{serverName:n}=e,[a,i]=(0,l.useState)(!0),[o,c]=(0,l.useState)(null),[d,h]=(0,l.useState)([]),[x,p]=(0,l.useState)(),[m,j]=(0,l.useState)(""),[S,I]=(0,l.useState)(!1),[L,N]=(0,l.useState)(null),[z,B]=(0,l.useState)(!1),[R,T]=(0,l.useState)(4),[U,M]=(0,l.useState)(!1),[_,K]=(0,l.useState)(null),[q,Y]=(0,l.useState)(4),[H,$]=(0,l.useState)(!1),[Q,ea]=(0,l.useState)(null),[el,et]=(0,l.useState)(null),es=(0,l.useCallback)(async()=>{i(!0),c(null);try{let e=await fetch("/api/players/op?server=".concat(encodeURIComponent(n)));if(!e.ok)throw Error("Failed to fetch operators");let a=await e.json();h(a.operators),p(a.source)}catch(e){c("Failed to load operators"),console.error("Error fetching operators:",e)}finally{i(!1)}},[n]);(0,l.useEffect)(()=>{es()},[es]);let ei=async()=>{if(m.trim()){I(!0),c(null);try{if(!(await fetch("/api/players/op",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({player:m.trim(),server:n,level:R})})).ok)throw Error("Failed to add operator");j(""),T(4),B(!1),await es()}catch(e){c("Failed to add operator"),console.error("Error adding operator:",e)}finally{I(!1)}}},eo=async e=>{N(e),c(null),ea(null),et(null);try{if(!(await fetch("/api/players/op?player=".concat(encodeURIComponent(e),"&server=").concat(encodeURIComponent(n)),{method:"DELETE"})).ok)throw Error("Failed to remove operator");await es()}catch(e){c("Failed to remove operator"),console.error("Error removing operator:",e)}finally{N(null)}},ed=async()=>{if(_){$(!0),c(null);try{if(!(await fetch("/api/players/op/".concat(encodeURIComponent(_.name),"?server=").concat(encodeURIComponent(n)),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({level:q})})).ok)throw Error("Failed to change operator level");M(!1),K(null),await es()}catch(e){c("Failed to change operator level"),console.error("Error changing operator level:",e)}finally{$(!1)}}},eh=(e,n)=>{ea(e.currentTarget),et(n)},ex=()=>{ea(null),et(null)};return(0,r.jsxs)(y.Z,{"data-testid":"op-manager",children:[(0,r.jsxs)(Z.Z,{children:[(0,r.jsx)(s.Z,{variant:"h6",gutterBottom:!0,children:"Operators"}),o&&(0,r.jsx)(D.Z,{severity:"error",sx:{mb:2},children:o}),!a&&x&&"rcon"!==x&&(0,r.jsxs)(D.Z,{severity:"info",sx:{mb:2},children:["Server is offline. Showing data from ","config"===x?"config.env":"ops.json",". Changes will apply on next server start."]}),(0,r.jsx)(t.Z,{sx:{mb:2},children:(0,r.jsx)(k.Z,{variant:"contained",onClick:()=>B(!0),startIcon:(0,r.jsx)(G.Z,{}),"aria-label":"Add operator",fullWidth:!0,children:"Add Operator"})}),a&&(0,r.jsx)(t.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,r.jsx)(W.Z,{})}),!a&&0===d.length&&(0,r.jsx)(s.Z,{color:"text.secondary",sx:{textAlign:"center",py:4},children:"No operators configured"}),!a&&d.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(v.Z,{dense:!0,children:d.map(e=>(0,r.jsxs)(b.ZP,{secondaryAction:(0,r.jsx)(w.Z,{edge:"end","aria-label":"Operator actions",onClick:n=>eh(n,e),disabled:L===e.name,children:L===e.name?(0,r.jsx)(W.Z,{size:20}):(0,r.jsx)(X.Z,{})}),children:[(0,r.jsx)(f.Z,{children:(0,r.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,r.jsx)(ee.Z,{})})}),(0,r.jsx)(g.Z,{primary:(0,r.jsxs)(t.Z,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:[(0,r.jsx)(s.Z,{component:"span",children:e.name}),(0,r.jsx)(er,{level:e.level,showIcon:!0,size:"small"})]}),secondary:e.uuid?e.uuid.substring(0,8)+"...":"UUID not available"})]},e.uuid||e.name))}),(0,r.jsxs)(V.Z,{anchorEl:Q,open:!!Q,onClose:ex,children:[(0,r.jsxs)(u.Z,{onClick:()=>{el&&(K(el),Y(el.level),M(!0),ex())},children:[(0,r.jsx)(en.Z,{sx:{mr:1},fontSize:"small"}),"Change Level"]}),(0,r.jsxs)(u.Z,{onClick:()=>el&&eo(el.name),children:[(0,r.jsx)(J.Z,{sx:{mr:1},fontSize:"small",color:"error"}),"Remove OP"]})]})]})]}),(0,r.jsxs)(E.Z,{open:z,onClose:()=>!S&&B(!1),maxWidth:"sm",fullWidth:!0,children:[(0,r.jsx)(P.Z,{children:"Add Operator"}),(0,r.jsxs)(F.Z,{children:[(0,r.jsx)(O.Z,{autoFocus:!0,margin:"dense",label:"Player Name",placeholder:"Enter player name",fullWidth:!0,value:m,onChange:e=>j(e.target.value),disabled:S,sx:{mb:2}}),(0,r.jsx)(ec,{value:R,onChange:T,label:"OP Level",disabled:S})]}),(0,r.jsxs)(A.Z,{children:[(0,r.jsx)(k.Z,{onClick:()=>B(!1),disabled:S,children:"Cancel"}),(0,r.jsx)(k.Z,{variant:"contained",onClick:ei,disabled:!m.trim()||S,startIcon:S?(0,r.jsx)(W.Z,{size:16}):void 0,children:S?"Adding...":"Add OP"})]})]}),(0,r.jsxs)(E.Z,{open:U,onClose:()=>!H&&M(!1),maxWidth:"sm",fullWidth:!0,children:[(0,r.jsxs)(P.Z,{children:["Change OP Level - ",null==_?void 0:_.name]}),(0,r.jsx)(F.Z,{children:_&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(s.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:["Current: Level ",_.level," (",_.role,")"]}),(0,r.jsx)(ec,{value:q,onChange:Y,label:"New Level",disabled:H})]})}),(0,r.jsxs)(A.Z,{children:[(0,r.jsx)(k.Z,{onClick:()=>M(!1),disabled:H,children:"Cancel"}),(0,r.jsx)(k.Z,{variant:"contained",onClick:ed,disabled:H||q===(null==_?void 0:_.level),startIcon:H?(0,r.jsx)(W.Z,{size:16}):void 0,children:H?"Saving...":"Save Changes"})]})]})]})}var eh=a(397);function ex(e){let{serverName:n}=e,[a,i]=(0,l.useState)(!0),[o,c]=(0,l.useState)(null),[d,h]=(0,l.useState)([]),[x,u]=(0,l.useState)(),[p,m]=(0,l.useState)(!1),[j,S]=(0,l.useState)({player:"",reason:""}),[I,L]=(0,l.useState)(!1),[N,z]=(0,l.useState)(null),B=(0,l.useCallback)(async()=>{i(!0),c(null);try{let e=await fetch("/api/players/ban?server=".concat(encodeURIComponent(n)));if(!e.ok)throw Error("Failed to fetch bans");let a=await e.json();h(a.players),u(a.source)}catch(e){c("Failed to load ban list"),console.error("Error fetching bans:",e)}finally{i(!1)}},[n]);(0,l.useEffect)(()=>{B()},[B]);let R=()=>{m(!1),S({player:"",reason:""})},T=async()=>{if(j.player.trim()){L(!0),c(null);try{if(!(await fetch("/api/players/ban",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({player:j.player.trim(),reason:j.reason.trim()||"Banned by administrator",server:n})})).ok)throw Error("Failed to ban player");R(),await B()}catch(e){c("Failed to ban player"),console.error("Error banning player:",e)}finally{L(!1)}}},M=async e=>{z(e),c(null);try{if(!(await fetch("/api/players/ban?player=".concat(encodeURIComponent(e),"&server=").concat(encodeURIComponent(n)),{method:"DELETE"})).ok)throw Error("Failed to unban player");await B()}catch(e){c("Failed to unban player"),console.error("Error unbanning player:",e)}finally{z(null)}},K=e=>{try{return new Date(e).toLocaleDateString()}catch(n){return e}};return(0,r.jsx)(y.Z,{"data-testid":"ban-manager",children:(0,r.jsxs)(Z.Z,{children:[(0,r.jsxs)(t.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,r.jsx)(s.Z,{variant:"h6",children:"Ban List"}),(0,r.jsx)(k.Z,{variant:"outlined",color:"error",startIcon:(0,r.jsx)(eh.Z,{}),onClick:()=>{S({player:"",reason:""}),m(!0)},"aria-label":"Ban player",children:"Ban Player"})]}),o&&(0,r.jsx)(D.Z,{severity:"error",sx:{mb:2},children:o}),!a&&x&&"rcon"!==x&&(0,r.jsxs)(D.Z,{severity:"info",sx:{mb:2},children:["Server is offline. Showing data from ","config"===x?"config.env":"banned-players.json",". Changes will apply on next server start."]}),a&&(0,r.jsx)(t.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,r.jsx)(W.Z,{})}),!a&&0===d.length&&(0,r.jsx)(s.Z,{color:"text.secondary",sx:{textAlign:"center",py:4},children:"No players banned"}),!a&&d.length>0&&(0,r.jsx)(v.Z,{dense:!0,children:d.map(e=>(0,r.jsxs)(b.ZP,{secondaryAction:(0,r.jsx)(w.Z,{edge:"end","aria-label":"Unban player",onClick:()=>M(e.name),disabled:N===e.name,color:"success",children:N===e.name?(0,r.jsx)(W.Z,{size:20}):(0,r.jsx)(J.Z,{})}),children:[(0,r.jsx)(f.Z,{children:(0,r.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,r.jsx)(U.Z,{})})}),(0,r.jsx)(g.Z,{primary:e.name,secondary:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(s.Z,{component:"span",variant:"body2",color:"text.secondary",children:["Reason: ",e.reason||"No reason specified"]}),(0,r.jsx)("br",{}),(0,r.jsxs)(s.Z,{component:"span",variant:"caption",color:"text.secondary",children:["Banned: ",K(e.created)," by ",e.source||"Unknown"]})]})})]},e.uuid||e.name))}),(0,r.jsxs)(E.Z,{open:p,onClose:R,maxWidth:"sm",fullWidth:!0,children:[(0,r.jsx)(P.Z,{children:"Ban Player"}),(0,r.jsx)(F.Z,{children:(0,r.jsxs)(_.Z,{spacing:2,sx:{mt:1},children:[(0,r.jsx)(O.Z,{label:"Player Name",placeholder:"Enter player name",value:j.player,onChange:e=>S({...j,player:e.target.value}),fullWidth:!0,required:!0}),(0,r.jsx)(O.Z,{label:"Reason",placeholder:"Banned by administrator",value:j.reason,onChange:e=>S({...j,reason:e.target.value}),fullWidth:!0,multiline:!0,rows:2})]})}),(0,r.jsxs)(A.Z,{children:[(0,r.jsx)(k.Z,{onClick:R,disabled:I,children:"Cancel"}),(0,r.jsx)(k.Z,{onClick:T,color:"error",variant:"contained",disabled:!j.player.trim()||I,startIcon:I?(0,r.jsx)(W.Z,{size:16}):(0,r.jsx)(eh.Z,{}),children:"Ban"})]})]})]})})}function eu(e){let{children:n,value:a,index:l}=e;return(0,r.jsx)("div",{role:"tabpanel",hidden:a!==l,children:a===l&&(0,r.jsx)(t.Z,{sx:{py:3},children:n})})}function ep(){let[e,n]=(0,l.useState)(0),[a,y]=(0,l.useState)(""),{data:Z,isLoading:v}=(0,$.x$)(),b=null==Z?void 0:Z.servers;return(0,l.useEffect)(()=>{!a&&b&&b.length>0&&y(b[0].name)},[b,a]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p.Z,{elevation:0,sx:{mb:4,p:3,background:e=>"linear-gradient(135deg, ".concat((0,m.Fq)(e.palette.info.main,.1)," 0%, ").concat((0,m.Fq)(e.palette.secondary.main,.1)," 100%)"),borderRadius:2,border:e=>"1px solid ".concat((0,m.Fq)(e.palette.info.main,.2))},children:(0,r.jsxs)(t.Z,{sx:{display:"flex",alignItems:"center",gap:2},children:[(0,r.jsx)(t.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:56,height:56,borderRadius:2,bgcolor:"info.main",color:"info.contrastText"},children:(0,r.jsx)(j.Z,{sx:{fontSize:32}})}),(0,r.jsxs)(t.Z,{children:[(0,r.jsx)(s.Z,{variant:"h4",component:"h1",fontWeight:"bold",children:"Player Management"}),(0,r.jsx)(s.Z,{variant:"body1",color:"text.secondary",children:"Manage players, whitelist, operators, and bans across your servers"})]})]})}),(0,r.jsx)(t.Z,{sx:{mb:3},children:(0,r.jsxs)(d.Z,{sx:{minWidth:200},children:[(0,r.jsx)(h.Z,{id:"server-select-label",children:"Server"}),(0,r.jsx)(x.Z,{labelId:"server-select-label",value:a,label:"Server",onChange:e=>y(e.target.value),disabled:v,children:null==b?void 0:b.map(e=>(0,r.jsx)(u.Z,{value:e.name,children:e.name},e.name))})]})}),(0,r.jsx)(t.Z,{sx:{borderBottom:1,borderColor:"divider"},children:(0,r.jsxs)(o.Z,{value:e,onChange:(e,a)=>{n(a)},"aria-label":"Player management tabs",children:[(0,r.jsx)(c.Z,{label:"Online Players"}),(0,r.jsx)(c.Z,{label:"Whitelist",disabled:!a}),(0,r.jsx)(c.Z,{label:"Operators",disabled:!a}),(0,r.jsx)(c.Z,{label:"Ban List",disabled:!a})]})}),(0,r.jsx)(eu,{value:e,index:0,children:(0,r.jsx)(M,{})}),(0,r.jsx)(eu,{value:e,index:1,children:a&&(0,r.jsxs)(i.ZP,{container:!0,spacing:3,children:[(0,r.jsx)(i.ZP,{item:!0,xs:12,md:8,children:(0,r.jsx)(Q,{serverName:a})}),(0,r.jsx)(i.ZP,{item:!0,xs:12,md:4,children:(0,r.jsxs)(t.Z,{sx:{p:2,bgcolor:"background.paper",borderRadius:1},children:[(0,r.jsx)(s.Z,{variant:"subtitle2",color:"text.secondary",gutterBottom:!0,children:"About Whitelist"}),(0,r.jsx)(s.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,r.jsx)(eu,{value:e,index:2,children:a&&(0,r.jsxs)(i.ZP,{container:!0,spacing:3,children:[(0,r.jsx)(i.ZP,{item:!0,xs:12,md:8,children:(0,r.jsx)(ed,{serverName:a})}),(0,r.jsx)(i.ZP,{item:!0,xs:12,md:4,children:(0,r.jsxs)(t.Z,{sx:{p:2,bgcolor:"background.paper",borderRadius:1},children:[(0,r.jsx)(s.Z,{variant:"subtitle2",color:"text.secondary",gutterBottom:!0,children:"About Operators"}),(0,r.jsx)(s.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,r.jsxs)(t.Z,{sx:{mt:2},children:[(0,r.jsx)(s.Z,{variant:"caption",color:"text.secondary",component:"div",children:"Level 1: Can bypass spawn protection"}),(0,r.jsx)(s.Z,{variant:"caption",color:"text.secondary",component:"div",children:"Level 2: Can use /clear, /gamemode, etc."}),(0,r.jsx)(s.Z,{variant:"caption",color:"text.secondary",component:"div",children:"Level 3: Can use /ban, /kick, /op, etc."}),(0,r.jsx)(s.Z,{variant:"caption",color:"text.secondary",component:"div",children:"Level 4: Can use /stop, full access"})]})]})})]})}),(0,r.jsx)(eu,{value:e,index:3,children:a&&(0,r.jsxs)(i.ZP,{container:!0,spacing:3,children:[(0,r.jsx)(i.ZP,{item:!0,xs:12,md:8,children:(0,r.jsx)(ex,{serverName:a})}),(0,r.jsx)(i.ZP,{item:!0,xs:12,md:4,children:(0,r.jsxs)(t.Z,{sx:{p:2,bgcolor:"background.paper",borderRadius:1},children:[(0,r.jsx)(s.Z,{variant:"subtitle2",color:"text.secondary",gutterBottom:!0,children:"About Bans"}),(0,r.jsx)(s.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."})]})})]})})]})}}},function(e){e.O(0,[6812,9760,6758,680,1668,7436,1071,540,4416,2538,880,7727,8347,1658,5381,4474,4219,392,2666,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([[278],{59616:function(e,r,s){Promise.resolve().then(s.bind(s,55816))},55816:function(e,r,s){"use strict";s.r(r),s.d(r,{default:function(){return e6}});var t=s(94655),n=s(35106),i=s(74228),a=s(31358),o=s(7281),l=s(30417),d=s(79983),c=s(81071),x=s(93017),u=s(10721),h=s(628),m=s(41565),p=s(31317),j=s(35694),v=s(7178),g=s(17820),Z=s(73424),y=s(99770),f=s(62508),b=s(5682),C=s(76678),w=s(97436),S=s(84840),k=s(76492),I=s(10117),R=s(5501),z=s(37809),P=s(21111),W=s(17978),F=s(89573),T=s(96292),A=s(33104),D=s(25333),M=s(52082),O=s(69123),E=s(71185),N=s(30165),B=s(97293),U=s(11259),q=s(66615),L=s(89161),K=s(34071),H=s(4405);function G(e){let{value:r,unit:s,label:n,icon:i,progress:a,progressMax:l,color:d="#1bd96a"}=e;return(0,t.jsxs)(h.Z,{"data-testid":"resource-stat-card",sx:{p:2.5,bgcolor:"background.paper",border:"1px solid",borderColor:"divider",borderRadius:3},children:[(0,t.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:2},children:[(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"baseline",gap:.75,flexWrap:"wrap",minWidth:0},children:[(0,t.jsx)(p.Z,{variant:"h4",component:"span",sx:{fontWeight:700,color:"text.primary",fontFamily:"'JetBrains Mono', 'Fira Code', monospace",letterSpacing:"-0.5px"},children:r}),(0,t.jsx)(p.Z,{variant:"body2",component:"span",sx:{color:"text.secondary",fontWeight:500},children:s})]}),(0,t.jsx)(o.Z,{sx:{color:"text.secondary",flexShrink:0},children:i})]}),(0,t.jsx)(p.Z,{variant:"body2",sx:{color:"text.secondary",fontWeight:500,mt:.5},children:n}),(0,t.jsx)(H.Z,{variant:"determinate",value:Math.min(a/l*100,100),sx:{mt:1,height:6,borderRadius:1.5,bgcolor:"#2a2d3a","& .MuiLinearProgress-bar":{borderRadius:1.5,background:"linear-gradient(90deg, ".concat(d," 0%, ").concat(d,"cc 100%)")}}})]})}var Q=s(163),V=s(73660),J=s(90158),_=s(58347),$=s(95511),Y=s(46725),X=s(26577),ee=s(56813),er=s(26892),es=s(84509);function et(e){var r;let{serverName:s}=e,{data:n,isLoading:i,error:a}=(0,es.HZ)(s,{limit:20});if(i)return(0,t.jsx)(o.Z,{children:[void 0,void 0,void 0,void 0,void 0].map((e,r)=>(0,t.jsxs)(o.Z,{sx:{display:"flex",gap:2,py:1.5},children:[(0,t.jsx)(u.Z,{variant:"rounded",width:60,height:24}),(0,t.jsx)(u.Z,{variant:"text",width:"60%"}),(0,t.jsx)(u.Z,{variant:"text",width:50})]},r))});if(a)return(0,t.jsxs)(c.Z,{severity:"error",children:["Failed to load activity: ",a.message]});let d=null!==(r=null==n?void 0:n.logs)&&void 0!==r?r:[];if(0===d.length)return(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",sx:{py:4,textAlign:"center"},children:"No activity recorded for this server yet."});let x="/audit-logs?targetType=server&targetName=".concat(encodeURIComponent(s));return(0,t.jsxs)(o.Z,{children:[(0,t.jsx)(J.Z,{sx:{py:0},children:d.map(e=>{var r;return(0,t.jsx)(_.ZP,{sx:{px:0,py:1.5,"&:not(:last-child)":{borderBottom:"1px solid",borderColor:"divider"}},children:(0,t.jsx)(Z.Z,{primary:(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,t.jsx)(ee.I,{action:e.action,size:"small"}),(0,t.jsxs)(p.Z,{variant:"body2",color:"text.secondary",children:["by ",e.actor.replace("api:","").replace("cli:","")]}),(0,t.jsx)(er.c,{status:e.status,size:"small"})]}),secondary:(0,t.jsx)($.Z,{title:(r=e.timestamp,new Intl.DateTimeFormat(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:"short"}).format(new Date(r))),arrow:!0,children:(0,t.jsx)(p.Z,{variant:"caption",component:"span",color:"text.disabled",children:function(e){let r=new Date,s=new Date(e),t=Math.floor((r.getTime()-s.getTime())/6e4),n=Math.floor(t/60);return t<1?"just now":t<60?"".concat(t,"m ago"):n<24?"".concat(n,"h ago"):"".concat(Math.floor(n/24),"d ago")}(e.timestamp)})})})},e.id)})}),(0,t.jsx)(o.Z,{sx:{mt:2,textAlign:"center"},children:(0,t.jsx)(l.Z,{component:Y.default,href:x,size:"small",endIcon:(0,t.jsx)(X.Z,{}),sx:{textTransform:"none"},children:"View Full History"})})]})}var en=s(62328),ei=s(29793),ea=s(75726),eo=s(40064),el=s(38393),ed=s(37530),ec=s(5942),ex=s(84420),eu=s(46121),eh=s(84775),em=s(92666),ep=s(70115),ej=s(70603),ev=s(32366),eg=s(25523);function eZ(e){let{serverName:r}=e,{data:s,isLoading:i}=(0,em.Js)(r),a=(0,em.Bx)(),[u,j]=(0,n.useState)([]),[v,g]=(0,n.useState)(!1),[Z,y]=(0,n.useState)(!1),[f,b]=(0,n.useState)(""),[C,S]=(0,n.useState)(""),[k,I]=(0,n.useState)(!1),[R,z]=(0,n.useState)({open:!1,message:"",severity:"success"});(0,n.useEffect)(()=>{(null==s?void 0:s.customHostnames)&&(j(s.customHostnames),g(!1),I(!1))},[s]);let W=e=>{let r=e.trim().toLowerCase();return r?r.length>253?"Domain exceeds 253 characters":/^[a-z0-9]([a-z0-9\-.]*[a-z0-9])?$/.test(r)?r.endsWith(".local")?"Cannot use .local system domain":r.endsWith(".nip.io")?"Cannot use .nip.io system domain":u.includes(r)?"Domain already exists":"":"Invalid domain format":"Domain cannot be empty"},F=()=>{let e=f.trim().toLowerCase(),r=W(e);if(r){S(r);return}j(r=>[...r,e]),b(""),S(""),y(!1),g(!0)},T=e=>{j(r=>r.filter(r=>r!==e)),g(!0)},A=async()=>{try{await a.mutateAsync({serverName:r,customHostnames:u}),g(!1),I(!0),z({open:!0,message:"Hostnames saved. Container recreation required to apply changes.",severity:"warning"})}catch(e){z({open:!0,message:e instanceof Error?e.message:"Failed to save hostnames",severity:"error"})}},M=()=>{y(!1),b(""),S("")};return i?(0,t.jsx)(h.Z,{sx:{mb:3,borderRadius:3},children:(0,t.jsx)(m.Z,{children:(0,t.jsx)(o.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,t.jsx)(x.Z,{size:24})})})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(h.Z,{sx:{mb:3,borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:1},children:[(0,t.jsx)(eg.Z,{color:"primary"}),(0,t.jsx)(p.Z,{variant:"h6",fontWeight:600,children:"Hostnames / Domains"})]}),(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"Manage hostnames used by mc-router to route connections to this server."}),(0,t.jsx)(O.Z,{sx:{mb:3}}),(null==s?void 0:s.systemHostnames)&&s.systemHostnames.length>0&&(0,t.jsxs)(o.Z,{sx:{mb:3},children:[(0,t.jsx)(p.Z,{variant:"subtitle2",color:"text.secondary",sx:{mb:1},children:"System Hostnames (read-only)"}),(0,t.jsx)(ep.Z,{direction:"row",flexWrap:"wrap",gap:1,children:s.systemHostnames.map(e=>(0,t.jsx)(D.Z,{icon:(0,t.jsx)(ej.Z,{sx:{fontSize:16}}),label:e.hostname,title:e.description,variant:"outlined",color:"default",size:"small"},e.hostname))})]}),(0,t.jsxs)(o.Z,{sx:{mb:2},children:[(0,t.jsx)(p.Z,{variant:"subtitle2",color:"text.secondary",sx:{mb:1},children:"Custom Domains"}),0===u.length&&!Z&&(0,t.jsx)(p.Z,{variant:"body2",color:"text.disabled",sx:{mb:1},children:"No custom domains configured."}),(0,t.jsx)(ep.Z,{spacing:1,children:u.map(e=>(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",py:.5,px:1.5,borderRadius:1,bgcolor:"action.hover"},children:[(0,t.jsx)(p.Z,{variant:"body2",fontFamily:"monospace",children:e}),(0,t.jsx)(d.Z,{size:"small",color:"error",onClick:()=>T(e),title:"Remove domain",children:(0,t.jsx)(P.Z,{fontSize:"small"})})]},e))}),Z?(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"flex-start",gap:1,mt:1},children:[(0,t.jsx)(w.Z,{size:"small",placeholder:"e.g. play.example.com",value:f,onChange:e=>{b(e.target.value),S("")},onKeyDown:e=>{"Enter"===e.key&&F(),"Escape"===e.key&&M()},error:!!C,helperText:C,autoFocus:!0,sx:{flex:1}}),(0,t.jsx)(l.Z,{size:"small",variant:"contained",onClick:F,children:"Add"}),(0,t.jsx)(d.Z,{size:"small",onClick:M,children:(0,t.jsx)(E.Z,{fontSize:"small"})})]}):(0,t.jsx)(l.Z,{size:"small",startIcon:(0,t.jsx)(ev.Z,{}),onClick:()=>y(!0),sx:{mt:1},children:"Add Domain"})]}),k&&(0,t.jsxs)(c.Z,{severity:"warning",sx:{mb:2},children:["Container recreation is required for hostname changes to take effect. Run ",(0,t.jsx)("code",{children:"docker compose up -d"})," or restart the server from the dashboard."]}),(0,t.jsx)(o.Z,{sx:{display:"flex",justifyContent:"flex-end"},children:(0,t.jsx)(l.Z,{variant:"contained",size:"small",startIcon:(0,t.jsx)(ec.Z,{}),onClick:A,disabled:!v||a.isPending,children:a.isPending?"Saving...":"Save Hostnames"})})]})}),(0,t.jsx)(ed.Z,{open:R.open,autoHideDuration:6e3,onClose:()=>z({...R,open:!1}),anchorOrigin:{vertical:"bottom",horizontal:"right"},children:(0,t.jsx)(c.Z,{onClose:()=>z({...R,open:!1}),severity:R.severity,sx:{width:"100%"},children:R.message})})]})}function ey(e){var r,s;let{serverName:i,isRunning:a}=e,{data:d,isLoading:u}=(0,em.iC)(i),j=(0,em.MH)(),g=(0,em.gx)(),[Z,k]=(0,n.useState)({}),[I,R]=(0,n.useState)(!1),[z,P]=(0,n.useState)(!1),[W,F]=(0,n.useState)(!1),[T,A]=(0,n.useState)(""),[D,M]=(0,n.useState)({open:!1,message:"",severity:"info"});(0,n.useEffect)(()=>{(null==d?void 0:d.config)&&k(d.config)},[d]);let E=(e,r)=>{k(s=>({...s,[e]:r})),R(!0),("memory"===e||"useAikarFlags"===e)&&P(!0)},N=async()=>{try{let e=await j.mutateAsync({serverName:i,config:Z});M({open:!0,message:e.restartRequired?"Settings saved. Restart required for some changes to take effect.":"Settings saved successfully.",severity:e.restartRequired?"warning":"success"}),R(!1),P(!1)}catch(e){M({open:!0,message:e instanceof Error?e.message:"Failed to save settings",severity:"error"})}},B=async()=>{if("RESET"!==T){M({open:!0,message:"Please type RESET to confirm",severity:"warning"});return}try{await g.mutateAsync(i),M({open:!0,message:"World reset successfully",severity:"success"}),F(!1),A("")}catch(e){M({open:!0,message:e instanceof Error?e.message:"Failed to reset world",severity:"error"})}};return u?(0,t.jsx)(o.Z,{sx:{display:"flex",justifyContent:"center",py:8},children:(0,t.jsx)(x.Z,{})}):(0,t.jsxs)(o.Z,{children:[(0,t.jsx)(eZ,{serverName:i}),z&&(0,t.jsx)(c.Z,{severity:"warning",icon:(0,t.jsx)(ex.Z,{}),sx:{mb:3},children:"Performance settings require a server restart to take effect."}),(0,t.jsx)(h.Z,{sx:{mb:3,borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(p.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,children:"Server Properties"}),(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"These settings can be changed without restarting the server."}),(0,t.jsx)(O.Z,{sx:{mb:3}}),(0,t.jsxs)(S.ZP,{container:!0,spacing:3,children:[(0,t.jsx)(S.ZP,{item:!0,xs:12,children:(0,t.jsx)(w.Z,{fullWidth:!0,label:"MOTD (Message of the Day)",value:Z.motd||"",onChange:e=>E("motd",e.target.value),helperText:"The message displayed in the server list"})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsx)(w.Z,{fullWidth:!0,type:"number",label:"Max Players",value:Z.maxPlayers||20,onChange:e=>E("maxPlayers",parseInt(e.target.value,10)),inputProps:{min:1,max:100}})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsxs)(ei.Z,{fullWidth:!0,children:[(0,t.jsx)(ea.Z,{children:"Difficulty"}),(0,t.jsxs)(en.Z,{value:Z.difficulty||"normal",label:"Difficulty",onChange:e=>E("difficulty",e.target.value),children:[(0,t.jsx)(v.Z,{value:"peaceful",children:"Peaceful"}),(0,t.jsx)(v.Z,{value:"easy",children:"Easy"}),(0,t.jsx)(v.Z,{value:"normal",children:"Normal"}),(0,t.jsx)(v.Z,{value:"hard",children:"Hard"})]})]})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsxs)(ei.Z,{fullWidth:!0,children:[(0,t.jsx)(ea.Z,{children:"Game Mode"}),(0,t.jsxs)(en.Z,{value:Z.gameMode||"survival",label:"Game Mode",onChange:e=>E("gameMode",e.target.value),children:[(0,t.jsx)(v.Z,{value:"survival",children:"Survival"}),(0,t.jsx)(v.Z,{value:"creative",children:"Creative"}),(0,t.jsx)(v.Z,{value:"adventure",children:"Adventure"}),(0,t.jsx)(v.Z,{value:"spectator",children:"Spectator"})]})]})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsx)(eo.Z,{control:(0,t.jsx)(el.Z,{checked:null===(r=Z.pvp)||void 0===r||r,onChange:e=>E("pvp",e.target.checked)}),label:"Enable PvP"})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsx)(w.Z,{fullWidth:!0,type:"number",label:"View Distance (chunks)",value:Z.viewDistance||10,onChange:e=>E("viewDistance",parseInt(e.target.value,10)),inputProps:{min:3,max:32}})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsx)(w.Z,{fullWidth:!0,type:"number",label:"Spawn Protection (blocks)",value:Z.spawnProtection||16,onChange:e=>E("spawnProtection",parseInt(e.target.value,10)),inputProps:{min:0,max:128}})})]})]})}),(0,t.jsx)(h.Z,{sx:{mb:3,borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(p.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,children:"Performance Settings"}),(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"These settings require a server restart to take effect."}),(0,t.jsx)(O.Z,{sx:{mb:3}}),(0,t.jsxs)(S.ZP,{container:!0,spacing:3,children:[(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsx)(w.Z,{fullWidth:!0,label:"Memory Allocation",value:Z.memory||"4G",onChange:e=>E("memory",e.target.value),helperText:"Format: 4G, 8G, etc."})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsx)(eo.Z,{control:(0,t.jsx)(el.Z,{checked:null!==(s=Z.useAikarFlags)&&void 0!==s&&s,onChange:e=>E("useAikarFlags",e.target.checked)}),label:"Use Aikar's Flags (Optimized GC)"})})]})]})}),(0,t.jsx)(o.Z,{sx:{display:"flex",justifyContent:"flex-end",mb:3},children:(0,t.jsx)(l.Z,{variant:"contained",size:"large",startIcon:(0,t.jsx)(ec.Z,{}),onClick:N,disabled:!I||j.isPending,sx:{px:4},children:j.isPending?"Saving...":"Save Changes"})}),(0,t.jsx)(h.Z,{sx:{borderRadius:3,borderColor:"error.main",borderWidth:1,borderStyle:"solid"},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(p.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,color:"error",children:"Danger Zone"}),(0,t.jsx)(O.Z,{sx:{mb:3}}),(0,t.jsxs)(o.Z,{sx:{mb:3},children:[(0,t.jsx)(p.Z,{variant:"subtitle1",fontWeight:600,gutterBottom:!0,children:"Reset World"}),(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"This will permanently delete the current world and generate a new one. This action cannot be undone."}),(0,t.jsx)(l.Z,{variant:"outlined",color:"error",startIcon:(0,t.jsx)(eh.Z,{}),onClick:()=>F(!0),disabled:a,children:"Reset World"}),a&&(0,t.jsx)(p.Z,{variant:"caption",color:"text.secondary",sx:{ml:2},children:"Stop the server first"})]})]})}),(0,t.jsxs)(y.Z,{open:W,onClose:()=>F(!1),maxWidth:"sm",fullWidth:!0,children:[(0,t.jsx)(f.Z,{children:(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,t.jsx)(ex.Z,{color:"error"}),(0,t.jsx)(p.Z,{variant:"h6",fontWeight:600,children:"Reset World"})]})}),(0,t.jsxs)(b.Z,{children:[(0,t.jsxs)(p.Z,{variant:"body1",gutterBottom:!0,children:["This will permanently delete the world for ",(0,t.jsx)("strong",{children:i})," and generate a new one."]}),(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",gutterBottom:!0,children:"This action cannot be undone. All player progress and builds will be lost."}),(0,t.jsx)(w.Z,{fullWidth:!0,label:"Type RESET to confirm",value:T,onChange:e=>A(e.target.value),sx:{mt:3},autoFocus:!0})]}),(0,t.jsxs)(C.Z,{children:[(0,t.jsx)(l.Z,{onClick:()=>F(!1),children:"Cancel"}),(0,t.jsx)(l.Z,{variant:"contained",color:"error",onClick:B,disabled:"RESET"!==T||g.isPending,startIcon:g.isPending?(0,t.jsx)(x.Z,{size:16}):(0,t.jsx)(eu.Z,{}),children:g.isPending?"Resetting...":"Reset World"})]})]}),(0,t.jsx)(ed.Z,{open:D.open,autoHideDuration:6e3,onClose:()=>M({...D,open:!1}),anchorOrigin:{vertical:"bottom",horizontal:"right"},children:(0,t.jsx)(c.Z,{onClose:()=>M({...D,open:!1}),severity:D.severity,sx:{width:"100%"},children:D.message})})]})}var ef=s(86702),eb=s(47606),eC=s(407),ew=s(56056),eS=s(28058),ek=s(11597),eI=s(59602);let eR={admin:{label:"Owner",color:"primary",variant:"filled"},manage:{label:"Operator",color:"info",variant:"outlined"},view:{label:"Viewer",color:"default",variant:"outlined"}};function ez(e){let{permission:r,size:s="medium"}=e,n=eR[r];return(0,t.jsx)(D.Z,{label:n.label,color:n.color,variant:n.variant,size:s})}var eP=s(99046),eW=s(68038),eF=s(34080),eT=s(39181),eA=s(5632),eD=s(58919),eM=s(20367),eO=s(42936);function eE(e){var r,s;let{open:i,onClose:a,serverId:d}=e,[u,h]=(0,n.useState)(""),[m,j]=(0,n.useState)(null),[v,g]=(0,n.useState)("view"),{data:Z,isLoading:S}=(s={enabled:i},(0,eA.a)({queryKey:["users","search",u],queryFn:()=>(0,eO.SC)("/api/users?q=".concat(encodeURIComponent(u))),enabled:(null==s?void 0:s.enabled)!==!1&&u.length>=2,staleTime:3e4})),k=function(){let e=(0,eD.NL)();return(0,eM.D)({mutationFn:e=>(0,eO.SC)("/api/user-servers",{method:"POST",body:JSON.stringify(e)}),onSuccess:(r,s)=>{e.invalidateQueries({queryKey:["user-servers",s.serverId]}),e.invalidateQueries({queryKey:["user-servers"]})}})}(),I=(0,n.useMemo)(()=>{var e;return null!==(e=null==Z?void 0:Z.users)&&void 0!==e?e:[]},[Z]),R=()=>{h(""),j(null),g("view"),k.reset(),a()};return(0,t.jsxs)(y.Z,{open:i,onClose:R,maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{borderRadius:3}},children:[(0,t.jsx)(f.Z,{sx:{fontWeight:600},children:"Add User Access"}),(0,t.jsxs)(b.Z,{sx:{display:"flex",flexDirection:"column",gap:3,pt:"8px !important"},children:[k.isError&&(0,t.jsx)(c.Z,{severity:"error",sx:{mb:1},children:(null===(r=k.error)||void 0===r?void 0:r.message)||"Failed to grant access"}),(0,t.jsx)(eP.Z,{options:I,getOptionLabel:e=>e.name||e.email,isOptionEqualToValue:(e,r)=>e.id===r.id,value:m,onChange:(e,r)=>j(r),inputValue:u,onInputChange:(e,r)=>h(r),loading:S,filterOptions:e=>e,noOptionsText:u.length<2?"Type at least 2 characters":"No users found",renderInput:e=>(0,t.jsx)(w.Z,{...e,label:"Search User",placeholder:"Search by name or email...",InputProps:{...e.InputProps,endAdornment:(0,t.jsxs)(t.Fragment,{children:[S&&(0,t.jsx)(x.Z,{size:20}),e.InputProps.endAdornment]})}}),renderOption:(e,r)=>{var s,n,i;let{key:a,...l}=e;return(0,t.jsxs)(o.Z,{component:"li",...l,sx:{display:"flex",gap:1.5,py:1},children:[(0,t.jsx)(ef.Z,{src:null!==(i=r.image)&&void 0!==i?i:void 0,sx:{width:32,height:32,bgcolor:"primary.main",fontSize:14},children:((null===(s=r.name)||void 0===s?void 0:s[0])||(null===(n=r.email)||void 0===n?void 0:n[0])||"?").toUpperCase()}),(0,t.jsxs)(o.Z,{children:[(0,t.jsx)(p.Z,{variant:"body2",fontWeight:500,children:r.name||"Unknown"}),(0,t.jsx)(p.Z,{variant:"caption",color:"text.secondary",children:r.email})]})]},a)}}),(0,t.jsxs)(ei.Z,{children:[(0,t.jsx)(eW.Z,{sx:{fontWeight:500,mb:1},children:"Permission Level"}),(0,t.jsxs)(eF.Z,{value:v,onChange:e=>g(e.target.value),children:[(0,t.jsx)(eo.Z,{value:"view",control:(0,t.jsx)(eT.Z,{size:"small"}),label:(0,t.jsxs)(o.Z,{children:[(0,t.jsx)(p.Z,{variant:"body2",fontWeight:500,children:"Viewer"}),(0,t.jsx)(p.Z,{variant:"caption",color:"text.secondary",children:"Can view server status and logs"})]})}),(0,t.jsx)(eo.Z,{value:"manage",control:(0,t.jsx)(eT.Z,{size:"small"}),label:(0,t.jsxs)(o.Z,{children:[(0,t.jsx)(p.Z,{variant:"body2",fontWeight:500,children:"Operator"}),(0,t.jsx)(p.Z,{variant:"caption",color:"text.secondary",children:"Can start, stop, and configure the server"})]})}),(0,t.jsx)(eo.Z,{value:"admin",control:(0,t.jsx)(eT.Z,{size:"small"}),label:(0,t.jsxs)(o.Z,{children:[(0,t.jsx)(p.Z,{variant:"body2",fontWeight:500,children:"Owner"}),(0,t.jsx)(p.Z,{variant:"caption",color:"text.secondary",children:"Full control including managing other users"})]})})]})]})]}),(0,t.jsxs)(C.Z,{sx:{px:3,pb:2},children:[(0,t.jsx)(l.Z,{onClick:R,color:"inherit",children:"Cancel"}),(0,t.jsx)(l.Z,{onClick:()=>{m&&k.mutate({userId:m.id,serverId:d,permission:v},{onSuccess:R})},variant:"contained",disabled:!m||k.isPending,sx:{borderRadius:2},children:k.isPending?"Adding...":"Add User"})]})]})}function eN(e){var r,s;let{serverId:i}=e,{data:a,isLoading:x,error:y}=(0,eA.a)({queryKey:["user-servers",i],queryFn:()=>(0,eO.SC)("/api/user-servers?serverId=".concat(encodeURIComponent(i))),enabled:!!i}),f=function(){let e=(0,eD.NL)();return(0,eM.D)({mutationFn:e=>{let{id:r,permission:s}=e;return(0,eO.SC)("/api/user-servers/".concat(encodeURIComponent(r)),{method:"PATCH",body:JSON.stringify({permission:s})})},onSuccess:()=>{e.invalidateQueries({queryKey:["user-servers"]})}})}(),b=function(){let e=(0,eD.NL)();return(0,eM.D)({mutationFn:e=>(0,eO.SC)("/api/user-servers/".concat(encodeURIComponent(e)),{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["user-servers"]})}})}(),[C,w]=(0,n.useState)(!1),[S,k]=(0,n.useState)(null),[I,R]=(0,n.useState)(null),P=(e,r)=>{k(e.currentTarget),R(r)},W=()=>{k(null),R(null)},F=e=>{if(!I||I.permission===e){W();return}f.mutate({id:I.id,permission:e},{onSettled:W})},T=null!==(r=null==a?void 0:a.users.filter(e=>"admin"===e.permission).length)&&void 0!==r?r:0,A=(null==I?void 0:I.permission)==="admin"&&T<=1;if(x)return(0,t.jsx)(h.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,t.jsx)(u.Z,{variant:"text",width:"30%",height:32}),(0,t.jsx)(u.Z,{variant:"rounded",width:120,height:36,sx:{borderRadius:2}})]}),(0,t.jsx)(O.Z,{sx:{mb:2}}),[0,1,2].map(e=>(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:2,py:1.5,borderBottom:"1px solid",borderColor:"divider"},children:[(0,t.jsx)(u.Z,{variant:"circular",width:40,height:40}),(0,t.jsxs)(o.Z,{sx:{flex:1},children:[(0,t.jsx)(u.Z,{variant:"text",width:"40%"}),(0,t.jsx)(u.Z,{variant:"text",width:"60%"})]}),(0,t.jsx)(u.Z,{variant:"rounded",width:80,height:28,sx:{borderRadius:10}}),(0,t.jsx)(u.Z,{variant:"circular",width:32,height:32})]},e))]})});if(y)return(0,t.jsxs)(c.Z,{severity:"error",children:["Failed to load access list: ",y.message]});let D=null!==(s=null==a?void 0:a.users)&&void 0!==s?s:[];return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(h.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,t.jsx)(p.Z,{variant:"h6",fontWeight:600,children:"Server Access"}),(0,t.jsx)(l.Z,{variant:"contained",size:"small",startIcon:(0,t.jsx)(eb.Z,{}),onClick:()=>w(!0),sx:{borderRadius:2},children:"Add User"})]}),(0,t.jsx)(O.Z,{sx:{mb:1}}),0===D.length?(0,t.jsx)(o.Z,{sx:{py:4,textAlign:"center"},children:(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",children:"No users have been granted access to this server yet."})}):D.map(e=>{var r,s,n,i,a,l,c,x;return(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:2,py:1.5,"&:not(:last-child)":{borderBottom:"1px solid",borderColor:"divider"}},children:[(0,t.jsx)(ef.Z,{src:null!==(x=null===(r=e.user)||void 0===r?void 0:r.image)&&void 0!==x?x:void 0,sx:{width:40,height:40,bgcolor:"primary.main",fontSize:16},children:((null===(n=e.user)||void 0===n?void 0:null===(s=n.name)||void 0===s?void 0:s[0])||(null===(a=e.user)||void 0===a?void 0:null===(i=a.email)||void 0===i?void 0:i[0])||"?").toUpperCase()}),(0,t.jsxs)(o.Z,{sx:{flex:1,minWidth:0},children:[(0,t.jsx)(p.Z,{variant:"body2",fontWeight:500,noWrap:!0,children:(null===(l=e.user)||void 0===l?void 0:l.name)||"Unknown User"}),(0,t.jsx)(p.Z,{variant:"caption",color:"text.secondary",noWrap:!0,children:(null===(c=e.user)||void 0===c?void 0:c.email)||e.userId})]}),(0,t.jsx)(ez,{permission:e.permission,size:"small"}),(0,t.jsx)(d.Z,{size:"small",onClick:r=>P(r,e),sx:{color:"text.secondary"},children:(0,t.jsx)(z.Z,{fontSize:"small"})})]},e.id)}),(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:1,mt:2,pt:1},children:[(0,t.jsx)(eI.Z,{sx:{fontSize:16,color:"text.disabled"}}),(0,t.jsx)(p.Z,{variant:"caption",color:"text.disabled",children:"Only platform admins and server owners can manage access."})]})]})}),(0,t.jsxs)(j.Z,{anchorEl:S,open:!!S,onClose:W,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},disableScrollLock:!0,children:[(0,t.jsxs)(v.Z,{onClick:()=>F("admin"),disabled:(null==I?void 0:I.permission)==="admin",children:[(0,t.jsx)(g.Z,{children:(0,t.jsx)(eC.Z,{fontSize:"small"})}),(0,t.jsx)(Z.Z,{children:"Change to Owner"})]}),(0,t.jsxs)(v.Z,{onClick:()=>F("manage"),disabled:(null==I?void 0:I.permission)==="manage"||A,children:[(0,t.jsx)(g.Z,{children:(0,t.jsx)(ew.Z,{fontSize:"small"})}),(0,t.jsx)(Z.Z,{children:"Change to Operator"})]}),(0,t.jsxs)(v.Z,{onClick:()=>F("view"),disabled:(null==I?void 0:I.permission)==="view"||A,children:[(0,t.jsx)(g.Z,{children:(0,t.jsx)(eS.Z,{fontSize:"small"})}),(0,t.jsx)(Z.Z,{children:"Change to Viewer"})]}),(0,t.jsx)(O.Z,{}),(0,t.jsxs)(v.Z,{onClick:()=>{I&&b.mutate(I.id,{onSettled:W})},disabled:A,sx:{color:"error.main"},children:[(0,t.jsx)(g.Z,{children:(0,t.jsx)(ek.Z,{fontSize:"small",sx:{color:"error.main"}})}),(0,t.jsx)(Z.Z,{children:"Remove Access"})]})]}),(0,t.jsx)(eE,{open:C,onClose:()=>w(!1),serverId:i})]})}var eB=s(10449),eU=s(24559),eq=s(37228);function eL(e){let{text:r}=e,[s,i]=(0,n.useState)(!1),a=async()=>{try{await navigator.clipboard.writeText(r),i(!0),setTimeout(()=>i(!1),2e3)}catch(e){console.error("Failed to copy:",e)}};return(0,t.jsx)(d.Z,{size:"small",onClick:a,sx:{ml:1,color:s?"success.main":"text.secondary","&:hover":{bgcolor:"action.hover"}},"aria-label":s?"Copied":"Copy to clipboard",children:s?(0,t.jsx)(eU.Z,{sx:{fontSize:16}}):(0,t.jsx)(eB.Z,{sx:{fontSize:16}})})}function eK(e){let{label:r,value:s,copyText:n}=e;return(0,t.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",py:1},children:[(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",children:r}),(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center"},children:[(0,t.jsx)(p.Z,{variant:"body2",sx:{fontFamily:n?"monospace":"inherit",color:n?"text.primary":"text.secondary"},children:s}),n&&(0,t.jsx)(eL,{text:n})]})]})}function eH(e){let{serverName:r,hostname:s}=e,{data:n,isLoading:i}=(0,eq.UW)();if(i)return(0,t.jsx)(h.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(u.Z,{variant:"text",width:"40%",height:28,sx:{mb:1}}),(0,t.jsx)(u.Z,{variant:"rectangular",height:1,sx:{mb:2}}),(0,t.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",py:1},children:[(0,t.jsx)(u.Z,{variant:"text",width:"30%"}),(0,t.jsx)(u.Z,{variant:"text",width:"40%"})]}),(0,t.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",py:1},children:[(0,t.jsx)(u.Z,{variant:"text",width:"30%"}),(0,t.jsx)(u.Z,{variant:"text",width:"40%"})]})]})});let a=s?"".concat(s,":25565"):"Not configured",l=(null==n?void 0:n.enabled)&&n.servers.length>0,d=null==n?void 0:n.servers.find(e=>e.serverName===r),c=(null==d?void 0:d.playitDomain)||"Not configured",x=!!(null==d?void 0:d.playitDomain);return(0,t.jsx)(h.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(p.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,children:"Connection"}),(0,t.jsx)(O.Z,{sx:{mb:2}}),(0,t.jsx)(eK,{label:"LAN Address",value:a,copyText:s?a:void 0}),l&&(0,t.jsx)(eK,{label:"External Address",value:c,copyText:x?c:void 0})]})})}var eG=s(42431),eQ=s(76777),eV=s(15761);function eJ(e){let{serverName:r}=e,{data:s,isLoading:i,error:a}=(0,eA.a)({queryKey:["servers",r,"mods"],queryFn:()=>(0,eO.SC)("/api/servers/".concat(encodeURIComponent(r),"/mods")),enabled:!!r}),u=function(){let e=(0,eD.NL)();return(0,eM.D)({mutationFn:e=>{let{serverName:r,slugs:s,source:t}=e;return(0,eO.SC)("/api/servers/".concat(encodeURIComponent(r),"/mods"),{method:"POST",body:JSON.stringify({slugs:s,source:t})})},onSuccess:(r,s)=>{let{serverName:t}=s;e.invalidateQueries({queryKey:["servers",t,"mods"]})}})}(),j=function(){let e=(0,eD.NL)();return(0,eM.D)({mutationFn:e=>{let{serverName:r,slug:s}=e;return(0,eO.SC)("/api/servers/".concat(encodeURIComponent(r),"/mods/").concat(encodeURIComponent(s)),{method:"DELETE"})},onSuccess:(r,s)=>{let{serverName:t}=s;e.invalidateQueries({queryKey:["servers",t,"mods"]})}})}(),[v,g]=(0,n.useState)(!1),[Z,C]=(0,n.useState)(""),[S,k]=(0,n.useState)(""),[I,R]=(0,n.useState)(!1),[z,W]=(0,n.useState)({open:!1,message:"",severity:"info"}),{data:F,isLoading:T}=function(e,r){let s=new URLSearchParams;return e&&s.set("q",e),(null==r?void 0:r.limit)!=null&&s.set("limit",String(r.limit)),(null==r?void 0:r.offset)!=null&&s.set("offset",String(r.offset)),(0,eA.a)({queryKey:["mods","search",e,null==r?void 0:r.limit,null==r?void 0:r.offset],queryFn:()=>(0,eO.SC)("/api/mods/search?".concat(s)),enabled:(null==r?void 0:r.enabled)!==!1&&!!e.trim()})}(S,{limit:10,enabled:v&&S.length>0});(0,n.useEffect)(()=>{let e=setTimeout(()=>{k(Z)},300);return()=>clearTimeout(e)},[Z]);let A=(0,n.useCallback)(async e=>{try{await j.mutateAsync({serverName:r,slug:e}),R(!0),W({open:!0,message:"Removed ".concat(e),severity:"success"})}catch(e){W({open:!0,message:e instanceof Error?e.message:"Failed to remove mod",severity:"error"})}},[j,r]),N=(0,n.useCallback)(async e=>{try{await u.mutateAsync({serverName:r,slugs:[e]}),R(!0),W({open:!0,message:"Added ".concat(e),severity:"success"})}catch(e){W({open:!0,message:e instanceof Error?e.message:"Failed to add mod",severity:"error"})}},[u,r]),B=new Set;if(null==s?void 0:s.mods)for(let e of Object.values(s.mods))for(let r of e)B.add(r);if(i)return(0,t.jsx)(o.Z,{sx:{display:"flex",justifyContent:"center",py:6},children:(0,t.jsx)(x.Z,{})});if(a)return(0,t.jsxs)(c.Z,{severity:"error",sx:{mt:2},children:["Failed to load mods: ",a.message]});let U=B.size>0;return(0,t.jsxs)(o.Z,{children:[I&&(0,t.jsx)(c.Z,{severity:"info",sx:{mb:2},children:"Restart the server to apply mod changes."}),(0,t.jsx)(h.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,t.jsx)(p.Z,{variant:"h6",fontWeight:600,children:"Installed Mods"}),(0,t.jsx)(l.Z,{variant:"contained",size:"small",startIcon:(0,t.jsx)(ev.Z,{}),onClick:()=>{C(""),k(""),g(!0)},children:"Add Mods"})]}),(0,t.jsx)(O.Z,{sx:{mb:2}}),U?Object.entries(s.mods).map(e=>{let[r,s]=e;return(0,t.jsxs)(o.Z,{sx:{mb:2},children:[(0,t.jsx)(p.Z,{variant:"subtitle2",color:"text.secondary",sx:{mb:1,textTransform:"capitalize"},children:r}),(0,t.jsx)(o.Z,{sx:{display:"flex",flexWrap:"wrap",gap:1},children:s.map(e=>(0,t.jsx)(D.Z,{label:e,icon:(0,t.jsx)(eQ.Z,{}),onDelete:()=>A(e),deleteIcon:(0,t.jsx)(P.Z,{}),variant:"outlined"},e))})]},r)}):(0,t.jsxs)(o.Z,{sx:{textAlign:"center",py:4},children:[(0,t.jsx)(eQ.Z,{sx:{fontSize:48,color:"text.disabled",mb:1}}),(0,t.jsx)(p.Z,{variant:"body1",color:"text.secondary",children:"No mods installed"}),(0,t.jsx)(p.Z,{variant:"body2",color:"text.disabled",sx:{mt:.5},children:'Click "Add Mods" to search and install mods from Modrinth'})]})]})}),(0,t.jsxs)(y.Z,{open:v,onClose:()=>g(!1),maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{minHeight:400}},children:[(0,t.jsxs)(f.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:["Search Mods",(0,t.jsx)(d.Z,{onClick:()=>g(!1),size:"small",children:(0,t.jsx)(E.Z,{})})]}),(0,t.jsxs)(b.Z,{children:[(0,t.jsx)(w.Z,{fullWidth:!0,autoFocus:!0,placeholder:"Search Modrinth...",value:Z,onChange:e=>C(e.target.value),InputProps:{startAdornment:(0,t.jsx)(M.Z,{position:"start",children:(0,t.jsx)(eG.Z,{})})},sx:{mb:2}}),T&&(0,t.jsx)(o.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,t.jsx)(x.Z,{size:28})}),!T&&F&&0===F.hits.length&&S&&(0,t.jsxs)(p.Z,{variant:"body2",color:"text.secondary",sx:{textAlign:"center",py:4},children:['No mods found for "',S,'"']}),!T&&F&&F.hits.length>0&&(0,t.jsx)(o.Z,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:F.hits.map(e=>{var r;let s=B.has(e.slug);return(0,t.jsx)(h.Z,{variant:"outlined",sx:{borderRadius:2},children:(0,t.jsx)(m.Z,{sx:{py:1.5,px:2,"&:last-child":{pb:1.5}},children:(0,t.jsxs)(o.Z,{sx:{display:"flex",gap:1.5,alignItems:"flex-start"},children:[(0,t.jsx)(ef.Z,{src:e.iconUrl||void 0,variant:"rounded",sx:{width:40,height:40,bgcolor:"action.hover"},children:(0,t.jsx)(eQ.Z,{})}),(0,t.jsxs)(o.Z,{sx:{flex:1,minWidth:0},children:[(0,t.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,t.jsx)(p.Z,{variant:"subtitle2",noWrap:!0,children:e.title}),(0,t.jsx)(l.Z,{size:"small",variant:s?"outlined":"contained",disabled:s||u.isPending,onClick:()=>N(e.slug),sx:{ml:1,minWidth:80,flexShrink:0},children:s?"Installed":"Add"})]}),(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",sx:{mt:.25,overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},children:e.description}),(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:1,mt:.5},children:[(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:.25},children:[(0,t.jsx)(eV.Z,{sx:{fontSize:14,color:"text.disabled"}}),(0,t.jsx)(p.Z,{variant:"caption",color:"text.disabled",children:(r=e.downloads)>=1e6?"".concat((r/1e6).toFixed(1),"M"):r>=1e3?"".concat((r/1e3).toFixed(1),"K"):String(r)})]}),e.author&&(0,t.jsxs)(p.Z,{variant:"caption",color:"text.disabled",children:["by ",e.author]})]})]})]})})},e.slug)})})]})]}),(0,t.jsx)(ed.Z,{open:z.open,autoHideDuration:4e3,onClose:()=>W(e=>({...e,open:!1})),anchorOrigin:{vertical:"bottom",horizontal:"center"},children:(0,t.jsx)(c.Z,{onClose:()=>W(e=>({...e,open:!1})),severity:z.severity,variant:"filled",children:z.message})})]})}let e_=["Overview","Activity","Mods","Files","Backups","Access","Options"];function e$(e){return e.replace(/\x1b\[\?[\d;]*[a-zA-Z]/g,"").replace(/\x1b\[[0-9;]*[a-zA-Z]/g,"").replace(/\x1b=/g,"").replace(/\[\?[\d;]*[a-zA-Z]/g,"").replace(/\[[0-9;]*[a-zA-Z]/g,"").replace(/\[m/g,"").replace(/>\.\.\.\.\r?/g,"").replace(/\r/g,"").trim()}function eY(e){var r,s,i,a,c;let{server:x,onSendCommand:u}=e,[j,v]=(0,n.useState)("Overview"),[g,Z]=(0,n.useState)(""),[f,C]=(0,n.useState)(!0),[I,R]=(0,n.useState)(!1),z=(0,n.useRef)(null),{logs:P,isConnected:W}=(0,Q.Y)({serverName:x.name}),F=(0,n.useMemo)(()=>P.filter(e=>!e.includes("RCON Listener")&&!e.includes("RCON Client")&&!e.includes("RconClient")),[P]);(0,n.useEffect)(()=>{z.current&&f&&(z.current.scrollTop=z.current.scrollHeight)},[F,f]);let T=async()=>{g.trim()&&u&&(await u(g.trim()),Z(""))},A=null!==(a=null===(r=x.stats)||void 0===r?void 0:r.cpuPercent)&&void 0!==a?a:0;(null===(s=x.stats)||void 0===s?void 0:s.memoryUsage)&&x.stats.memoryUsage,function(e){if(!e)return;let r=e.match(/^(\d+)\s*(M|G)?$/i);if(r)parseInt(r[1],10),(r[2]||"M").toUpperCase()}(x.memory);let H=null!==(c=null===(i=x.stats)||void 0===i?void 0:i.memoryPercent)&&void 0!==c?c:0;return(0,t.jsxs)(o.Z,{children:[(0,t.jsx)(o.Z,{sx:{display:"flex",gap:.5,mb:3},children:e_.map(e=>(0,t.jsx)(l.Z,{onClick:()=>v(e),sx:{px:2,py:1,borderRadius:5,fontSize:14,fontWeight:500,textTransform:"none",bgcolor:j===e?"primary.main":"transparent",color:j===e?"#0a0e14":"text.secondary","&:hover":{bgcolor:j===e?"primary.main":(0,k.Fq)("#1bd96a",.1)}},children:e},e))}),(0,t.jsxs)(o.Z,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(3, 1fr)"},gap:2,mb:2.5},children:[(0,t.jsx)(G,{value:"".concat(A.toFixed(2),"%"),unit:"/ 100%",label:"CPU usage",icon:(0,t.jsx)(N.Z,{sx:{fontSize:28}}),progress:A,progressMax:100,color:"#1bd96a"}),(0,t.jsx)(G,{value:"".concat(H.toFixed(2),"%"),unit:"/ 100%",label:"Memory usage",icon:(0,t.jsx)(B.Z,{sx:{fontSize:28}}),progress:H,progressMax:100,color:"#1bd96a"}),(0,t.jsx)(G,{value:x.worldSize||"0 B",unit:"/ 10 GB",label:"World size",icon:(0,t.jsx)(U.Z,{sx:{fontSize:28}}),progress:function(e){if(!e)return 0;let r=e.match(/^([\d.]+)\s*(B|KB|MB|MiB|GB|GiB)?$/i);if(!r)return 0;let s=parseFloat(r[1]);switch((r[2]||"B").toUpperCase()){case"GB":case"GIB":return 1024*s;case"MB":case"MIB":return s;case"KB":return s/1024;default:return s/1048576}}(x.worldSize),progressMax:10240,color:"#1bd96a"})]}),(0,t.jsxs)(h.Z,{sx:{bgcolor:"background.paper",borderRadius:3,border:"1px solid",borderColor:"divider",overflow:"hidden"},children:[(0,t.jsxs)(o.Z,{sx:{px:3,py:2,borderBottom:"1px solid",borderColor:"divider",display:"flex",alignItems:"center",gap:1.25},children:[(0,t.jsx)(p.Z,{variant:"h6",sx:{fontWeight:700,color:"text.primary"},children:"Console"}),(0,t.jsx)(o.Z,{sx:{width:10,height:10,borderRadius:"50%",bgcolor:W?"primary.main":"error.main",boxShadow:W?"0 0 8px rgba(27, 217, 106, 0.4)":"0 0 8px rgba(239, 68, 68, 0.4)"}})]}),(0,t.jsxs)(o.Z,{sx:{position:"relative"},children:[(0,t.jsx)(o.Z,{ref:z,onScroll:()=>{if(!z.current)return;let{scrollTop:e,scrollHeight:r,clientHeight:s}=z.current;C(r-e-s<30)},sx:{height:360,overflowY:"auto",px:2.5,py:2,fontFamily:"'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace",fontSize:13,lineHeight:1.85,color:"#b4b6c4",bgcolor:"#0a0a0a",scrollbarWidth:"thin",scrollbarColor:"#3a3d4e #0a0a0a","&::-webkit-scrollbar":{width:8},"&::-webkit-scrollbar-track":{bgcolor:"#0a0a0a"},"&::-webkit-scrollbar-thumb":{bgcolor:"#3a3d4e",borderRadius:4}},children:0===F.length?(0,t.jsx)(p.Z,{sx:{color:"text.secondary",textAlign:"center",py:8},children:"Waiting for logs..."}):F.map((e,r)=>{let s=function(e){let r=e$(e).match(/\[(\d{2}:\d{2}:\d{2})\]\s*\[([^/]+)\/(\w+)\]:\s*(.+)/);return r?{time:r[1],thread:r[2],level:r[3]||"INFO",msg:r[4]}:null}(e);return s?(0,t.jsxs)(o.Z,{sx:{display:"flex",gap:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[(0,t.jsxs)(o.Z,{component:"span",sx:{color:"#4a4d60"},children:["[",s.time,"]"]}),(0,t.jsxs)(o.Z,{component:"span",sx:{color:"#4a4d60"},children:["\xa0[",s.thread,"/",(0,t.jsx)(o.Z,{component:"span",sx:{color:"WARN"===s.level?"#e8a848":"#6b6e80"},children:s.level}),"]:\xa0"]}),(0,t.jsx)(o.Z,{component:"span",sx:{color:"WARN"===s.level?"#c4a45a":"#b4b6c4"},children:s.msg})]},r):(0,t.jsx)(o.Z,{sx:{color:"#b4b6c4"},children:e$(e)},r)})}),(0,t.jsx)(d.Z,{onClick:()=>R(!0),sx:{position:"absolute",top:12,right:12,width:36,height:36,borderRadius:2,bgcolor:"#282a3a",border:"1px solid #3a3d4e",color:"#8b8da0","&:hover":{bgcolor:"#313440"}},children:(0,t.jsx)(q.Z,{sx:{fontSize:18}})}),!f&&(0,t.jsx)(d.Z,{onClick:()=>{z.current&&z.current.scrollTo({top:z.current.scrollHeight,behavior:"smooth"})},sx:{position:"absolute",bottom:12,right:12,width:36,height:36,borderRadius:2,bgcolor:"#282a3a",border:"1px solid #3a3d4e",color:"#8b8da0","&:hover":{bgcolor:"#313440"}},children:(0,t.jsx)(L.Z,{sx:{fontSize:18}})})]}),(0,t.jsx)(o.Z,{sx:{px:2.5,py:1.5,borderTop:"1px solid",borderColor:"divider"},children:(0,t.jsx)(w.Z,{fullWidth:!0,size:"small",placeholder:"Send a command",value:g,onChange:e=>Z(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),T())},disabled:!W,InputProps:{startAdornment:(0,t.jsx)(M.Z,{position:"start",children:(0,t.jsx)(K.Z,{sx:{fontSize:16,color:"#999"}})}),sx:{bgcolor:"#13141c",borderRadius:2,fontFamily:"'JetBrains Mono', 'Fira Code', monospace",fontSize:14,"& .MuiOutlinedInput-notchedOutline":{borderColor:"#2a2d3e"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#3a3d4e"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"primary.main"}}}})})]}),"Overview"===j&&(0,t.jsxs)(S.ZP,{container:!0,spacing:3,sx:{mt:1},children:[(0,t.jsx)(S.ZP,{item:!0,xs:12,md:6,children:(0,t.jsx)(h.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(p.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,children:"Server Information"}),(0,t.jsx)(O.Z,{sx:{mb:2}}),(0,t.jsx)(eX,{label:"Name",value:x.name}),(0,t.jsx)(eX,{label:"Container",value:x.container}),(0,t.jsx)(eX,{label:"Hostname",value:x.hostname}),(0,t.jsx)(eX,{label:"Type",value:x.type}),(0,t.jsx)(eX,{label:"Version",value:x.version}),(0,t.jsx)(eX,{label:"Memory",value:x.memory}),(0,t.jsx)(eX,{label:"Uptime",value:x.uptime||function(e){if(!e||e<0)return"0s";let r=Math.floor(e/3600),s=Math.floor(e%3600/60),t=e%60;return r>0?"".concat(r,"h ").concat(s,"m"):s>0?"".concat(s,"m ").concat(t,"s"):"".concat(t,"s")}(x.uptimeSeconds)})]})})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,md:6,children:(0,t.jsx)(h.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(p.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,children:"Players"}),(0,t.jsx)(O.Z,{sx:{mb:2}}),x.players?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eX,{label:"Online",value:"".concat(x.players.online," / ").concat(x.players.max)}),x.players.list&&x.players.list.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",sx:{mt:2,mb:1},children:"Online Players"}),(0,t.jsx)(o.Z,{sx:{display:"flex",flexWrap:"wrap",gap:1},children:x.players.list.map(e=>(0,t.jsx)(D.Z,{label:e,size:"small"},e))})]})]}):(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",children:"Player information unavailable"})]})})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,md:6,children:(0,t.jsx)(eH,{serverName:x.name,hostname:x.hostname})})]}),"Activity"===j&&(0,t.jsx)(o.Z,{sx:{mt:3},children:(0,t.jsx)(h.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(p.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,children:"Server Activity"}),(0,t.jsx)(O.Z,{sx:{mb:2}}),(0,t.jsx)(et,{serverName:x.name})]})})}),"Mods"===j&&(0,t.jsx)(o.Z,{sx:{mt:3},children:(0,t.jsx)(eJ,{serverName:x.name})}),"Files"===j&&(0,t.jsx)(o.Z,{sx:{mt:3},children:(0,t.jsx)(p.Z,{variant:"body1",color:"text.secondary",children:"File browser coming soon"})}),"Backups"===j&&(0,t.jsx)(o.Z,{sx:{mt:3},children:(0,t.jsx)(p.Z,{variant:"body1",color:"text.secondary",children:"Backup management coming soon"})}),"Access"===j&&(0,t.jsx)(o.Z,{sx:{mt:3},children:(0,t.jsx)(eN,{serverId:x.name})}),"Options"===j&&(0,t.jsx)(o.Z,{sx:{mt:3},children:(0,t.jsx)(ey,{serverName:x.name,isRunning:"running"===x.status})}),(0,t.jsxs)(y.Z,{open:I,onClose:()=>R(!1),maxWidth:"xl",fullWidth:!0,PaperProps:{sx:{height:"90vh",bgcolor:"background.paper"}},children:[(0,t.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",p:2,borderBottom:1,borderColor:"divider"},children:[(0,t.jsxs)(p.Z,{variant:"h6",sx:{fontFamily:'"Minecraft", sans-serif',fontWeight:400,letterSpacing:"0.05em"},children:["Console - ",x.name]}),(0,t.jsx)(d.Z,{onClick:()=>R(!1),children:(0,t.jsx)(E.Z,{})})]}),(0,t.jsx)(b.Z,{sx:{p:0,display:"flex",flexDirection:"column"},children:(0,t.jsx)(V.K,{serverName:x.name})})]})]})}function eX(e){let{label:r,value:s}=e;return s?(0,t.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",py:1},children:[(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",children:r}),(0,t.jsx)(p.Z,{variant:"body2",sx:{fontWeight:500},children:s})]}):null}var e0=s(93757);function e1(){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,t.jsx)("line",{x1:"8",y1:"12",x2:"16",y2:"12"})]})}function e2(){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("path",{d:"M21 2v6h-6"}),(0,t.jsx)("path",{d:"M3 12a9 9 0 0115.36-6.36L21 8"}),(0,t.jsx)("path",{d:"M3 22v-6h6"}),(0,t.jsx)("path",{d:"M21 12a9 9 0 01-15.36 6.36L3 16"})]})}function e6(){var e,r,s,D;let M=(0,i.useParams)(),O=(0,a.x)(),E=decodeURIComponent(M.name),{data:N,isLoading:B,error:U}=(0,em.Hy)(E),{status:q,health:L}=function(e){let{serverName:r,onStatusChange:s,enabled:t=!0,reconnectInterval:i=3e3}=e,[a,o]=(0,n.useState)(null),[l,d]=(0,n.useState)(null);(0,n.useEffect)(()=>{o(null),d(null)},[r]);let c=(0,n.useCallback)(e=>{if("server-status"===e.type){let r=e.data.status,t=e.data.health;o(r),d(t),null==s||s(r,t)}},[s]),{isConnected:x,reconnect:u,retryCount:h}=(0,e0.D)({url:"/api/sse/servers/".concat(encodeURIComponent(r),"/status"),onMessage:c,enabled:t,reconnectInterval:i});return{status:a,health:l,isConnected:x,reconnect:u,retryCount:h}}({serverName:E,enabled:!!E}),[K,H]=(0,n.useState)(null),[G,Q]=(0,n.useState)(!1),[V,J]=(0,n.useState)(""),_=(0,em.jM)(),$=(0,em.Aw)(),Y=(0,em._I)(),X=(0,em.Hq)(),ee=async()=>{try{await _.mutateAsync(E)}catch(e){console.error("Failed to start server:",e)}},er=async()=>{try{await $.mutateAsync(E)}catch(e){console.error("Failed to stop server:",e)}},es=async()=>{try{await Y.mutateAsync(E)}catch(e){console.error("Failed to restart server:",e)}},et=async e=>{try{await fetch("/api/servers/".concat(encodeURIComponent(E),"/exec"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:e})})}catch(e){console.error("Failed to send command:",e)}},en=q||(null==N?void 0:N.server.status),ei=_.isPending||$.isPending||Y.isPending,ea=null==N?void 0:N.server;return(0,t.jsxs)(t.Fragment,{children:[U&&(0,t.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to load server: ",U.message]}),_.isError&&(0,t.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to start server: ",null===(e=_.error)||void 0===e?void 0:e.message]}),$.isError&&(0,t.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to stop server: ",null===(r=$.error)||void 0===r?void 0:r.message]}),Y.isError&&(0,t.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to restart server: ",null===(s=Y.error)||void 0===s?void 0:s.message]}),X.isError&&(0,t.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to delete server: ",null===(D=X.error)||void 0===D?void 0:D.message]}),B?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:2,mb:2.5},children:[(0,t.jsx)(u.Z,{variant:"rounded",width:64,height:64,sx:{borderRadius:3,flexShrink:0}}),(0,t.jsxs)(o.Z,{sx:{flex:1},children:[(0,t.jsx)(u.Z,{variant:"text",width:80,height:18,sx:{mb:.5}}),(0,t.jsx)(u.Z,{variant:"text",width:"40%",height:40}),(0,t.jsxs)(o.Z,{sx:{display:"flex",gap:2,mt:.75},children:[(0,t.jsx)(u.Z,{variant:"text",width:100}),(0,t.jsx)(u.Z,{variant:"text",width:60}),(0,t.jsx)(u.Z,{variant:"text",width:140}),(0,t.jsx)(u.Z,{variant:"text",width:50})]})]}),(0,t.jsxs)(o.Z,{sx:{display:"flex",gap:1,flexShrink:0},children:[(0,t.jsx)(u.Z,{variant:"rounded",width:90,height:40,sx:{borderRadius:2}}),(0,t.jsx)(u.Z,{variant:"rounded",width:36,height:36,sx:{borderRadius:2}})]})]}),(0,t.jsx)(o.Z,{sx:{display:"flex",gap:.5,mb:3},children:[80,70,65,50,65,65].map((e,r)=>(0,t.jsx)(u.Z,{variant:"rounded",width:e,height:36,sx:{borderRadius:5}},r))}),(0,t.jsx)(o.Z,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(3, 1fr)"},gap:2,mb:2.5},children:[0,1,2].map(e=>(0,t.jsx)(h.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:1.5},children:[(0,t.jsx)(u.Z,{variant:"text",width:"50%"}),(0,t.jsx)(u.Z,{variant:"circular",width:28,height:28})]}),(0,t.jsx)(u.Z,{variant:"text",width:"60%",height:36}),(0,t.jsx)(u.Z,{variant:"rounded",width:"100%",height:6,sx:{borderRadius:3,mt:1}})]})},e))}),(0,t.jsxs)(h.Z,{sx:{borderRadius:3,border:"1px solid",borderColor:"divider"},children:[(0,t.jsxs)(o.Z,{sx:{px:3,py:2,borderBottom:"1px solid",borderColor:"divider",display:"flex",alignItems:"center",gap:1.25},children:[(0,t.jsx)(u.Z,{variant:"text",width:80,height:28}),(0,t.jsx)(u.Z,{variant:"circular",width:10,height:10})]}),(0,t.jsx)(u.Z,{variant:"rectangular",height:360,sx:{bgcolor:"#0a0a0a"}}),(0,t.jsx)(o.Z,{sx:{px:2.5,py:1.5,borderTop:"1px solid",borderColor:"divider"},children:(0,t.jsx)(u.Z,{variant:"rounded",width:"100%",height:40,sx:{borderRadius:2}})})]}),(0,t.jsxs)(S.ZP,{container:!0,spacing:3,sx:{mt:1},children:[(0,t.jsx)(S.ZP,{item:!0,xs:12,md:6,children:(0,t.jsx)(h.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(u.Z,{variant:"text",width:"40%",height:28,sx:{mb:1}}),(0,t.jsx)(u.Z,{variant:"rectangular",height:1,sx:{mb:2}}),[0,1,2,3,4,5,6].map(e=>(0,t.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",py:1},children:[(0,t.jsx)(u.Z,{variant:"text",width:"30%"}),(0,t.jsx)(u.Z,{variant:"text",width:"40%"})]},e))]})})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,md:6,children:(0,t.jsx)(h.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(u.Z,{variant:"text",width:"30%",height:28,sx:{mb:1}}),(0,t.jsx)(u.Z,{variant:"rectangular",height:1,sx:{mb:2}}),(0,t.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",py:1},children:[(0,t.jsx)(u.Z,{variant:"text",width:"25%"}),(0,t.jsx)(u.Z,{variant:"text",width:"20%"})]})]})})})]})]}):ea?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:2,mb:2.5},children:[(0,t.jsx)(o.Z,{sx:{width:64,height:64,borderRadius:3,overflow:"hidden",bgcolor:"background.paper",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,border:"1px solid",borderColor:"divider",fontSize:36},children:function(e){if(!e)return"\uD83C\uDFAE";let r=e.toUpperCase();return["PAPER","SPIGOT","BUKKIT","PURPUR"].includes(r)?"\uD83D\uDD0C":["FORGE","NEOFORGE","FABRIC","QUILT"].includes(r)?"\uD83D\uDD27":"\uD83C\uDFAE"}(ea.type)}),(0,t.jsxs)(o.Z,{sx:{flex:1},children:[(0,t.jsxs)(p.Z,{onClick:()=>O.push("/servers"),sx:{fontSize:12,color:"primary.main",cursor:"pointer",mb:.25,display:"flex",alignItems:"center",gap:.5,"&:hover":{textDecoration:"underline"}},children:[(0,t.jsx)(I.Z,{sx:{fontSize:14}})," All servers"]}),(0,t.jsx)(p.Z,{variant:"h4",component:"h1",sx:{fontFamily:'"Minecraft", sans-serif',fontWeight:400,color:"text.primary",letterSpacing:"0.5px",m:0,textTransform:"uppercase"},children:E}),(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:0,mt:.75,flexWrap:"wrap",fontSize:13,color:"text.secondary"},children:[ea.version&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:.5},children:[(0,t.jsx)(W.Z,{sx:{fontSize:14}}),"Minecraft ",ea.version]}),(0,t.jsx)(o.Z,{component:"span",sx:{mx:1.25,color:"#3a3d4e"},children:"|"})]}),ea.type&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:.5},children:[(0,t.jsx)(F.Z,{sx:{fontSize:14}}),ea.type]}),(0,t.jsx)(o.Z,{component:"span",sx:{mx:1.25,color:"#3a3d4e"},children:"|"})]}),ea.hostname&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:.5},children:[(0,t.jsx)(T.Z,{sx:{fontSize:14}}),ea.hostname]}),(0,t.jsx)(o.Z,{component:"span",sx:{mx:1.25,color:"#3a3d4e"},children:"|"})]}),(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:.5},children:[(0,t.jsx)(A.Z,{sx:{fontSize:14}}),ea.uptime||function(e){if(!e||e<0)return"0s";let r=Math.floor(e/3600),s=Math.floor(e%3600/60),t=e%60;return r>0?"".concat(r,"h ").concat(s,"m"):s>0?"".concat(s,"m ").concat(t,"s"):"".concat(t,"s")}(ea.uptimeSeconds)||"0s"]})]})]}),(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:1.25,flexShrink:0},children:[("stopped"===en||"exited"===en||"not_created"===en)&&(0,t.jsx)(l.Z,{variant:"contained",color:"success",startIcon:ei?(0,t.jsx)(x.Z,{size:16,color:"inherit"}):(0,t.jsx)(R.Z,{}),onClick:ee,disabled:ei,sx:{px:2,py:1,borderRadius:2,fontSize:14,fontWeight:600},children:"Start"}),"running"===en&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.Z,{variant:"outlined",startIcon:ei?(0,t.jsx)(x.Z,{size:16}):(0,t.jsx)(e1,{}),onClick:er,disabled:ei,sx:{px:2,py:1,borderRadius:2,fontSize:14,fontWeight:500,borderColor:"divider",color:"text.secondary","&:hover":{borderColor:"text.secondary",bgcolor:(0,k.Fq)("#fff",.05)}},children:"Stop"}),(0,t.jsx)(l.Z,{variant:"contained",startIcon:ei?(0,t.jsx)(x.Z,{size:16,color:"inherit"}):(0,t.jsx)(e2,{}),onClick:es,disabled:ei,sx:{px:2,py:1,borderRadius:2,fontSize:14,fontWeight:600,bgcolor:"primary.main",color:"#0a0e14","&:hover":{bgcolor:"primary.dark"}},children:"Restart"})]}),(0,t.jsx)(d.Z,{onClick:e=>H(e.currentTarget),sx:{width:36,height:36,borderRadius:2,border:"1px solid",borderColor:"divider",color:"text.secondary"},children:(0,t.jsx)(z.Z,{sx:{fontSize:18}})}),(0,t.jsx)(j.Z,{anchorEl:K,open:!!K,onClose:()=>H(null),children:(0,t.jsxs)(v.Z,{onClick:()=>{H(null),Q(!0),J("")},sx:{color:"error.main"},children:[(0,t.jsx)(g.Z,{children:(0,t.jsx)(P.Z,{fontSize:"small",sx:{color:"error.main"}})}),(0,t.jsx)(Z.Z,{children:"Delete Server"})]})})]})]}),(0,t.jsx)(eY,{server:ea,onSendCommand:et})]}):(0,t.jsx)(c.Z,{severity:"warning",children:"Server not found"}),(0,t.jsxs)(y.Z,{open:G,onClose:()=>{Q(!1),J("")},maxWidth:"sm",fullWidth:!0,children:[(0,t.jsx)(f.Z,{children:"Delete Server"}),(0,t.jsxs)(b.Z,{children:[(0,t.jsxs)(p.Z,{sx:{mb:2},children:["This action cannot be undone. Type ",(0,t.jsx)("strong",{children:E})," to confirm deletion."]}),(0,t.jsx)(w.Z,{label:"Server name",value:V,onChange:e=>J(e.target.value),fullWidth:!0,autoFocus:!0})]}),(0,t.jsxs)(C.Z,{sx:{px:3,pb:2},children:[(0,t.jsx)(l.Z,{onClick:()=>{Q(!1),J("")},children:"Cancel"}),(0,t.jsx)(l.Z,{variant:"contained",color:"error",onClick:()=>{V===E&&X.mutate({name:E,force:!0},{onSuccess:()=>{O.push("/servers")}})},disabled:V!==E||X.isPending,startIcon:X.isPending?(0,t.jsx)(x.Z,{size:16}):null,children:X.isPending?"Deleting...":"Delete"})]})]})]})}},56813:function(e,r,s){"use strict";s.d(r,{I:function(){return a}});var t=s(94655),n=s(25333),i=s(82925);function a(e){let{action:r,size:s="small"}=e,a=i.Lu[r]||"default",o=i.n3[r]||r;return(0,t.jsx)(n.Z,{label:o,color:a,size:s,variant:"filled",sx:{fontWeight:600,fontSize:"small"===s?"0.7rem":"0.8rem"}})}},26892:function(e,r,s){"use strict";s.d(r,{c:function(){return o}});var t=s(94655),n=s(25333),i=s(46207),a=s(43436);function o(e){let{status:r,size:s="small"}=e;return(0,t.jsx)(n.Z,{icon:"success"===r?(0,t.jsx)(i.Z,{}):(0,t.jsx)(a.Z,{}),label:"success"===r?"OK":"Error",color:"success"===r?"success":"error",size:s,variant:"outlined",sx:{fontWeight:500,fontSize:"small"===s?"0.7rem":"0.8rem"}})}},84509:function(e,r,s){"use strict";s.d(r,{DM:function(){return a},HZ:function(){return l},VM:function(){return o},hT:function(){return i},oL:function(){return d}});var t=s(5632),n=s(42936);function i(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,s=function(e){let r=new URLSearchParams;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),void 0!==e.limit&&r.set("limit",String(e.limit)),void 0!==e.offset&&r.set("offset",String(e.offset)),e.sort&&r.set("sort",e.sort);let s=r.toString();return s?"?".concat(s):""}(e);return(0,t.a)({queryKey:["audit-logs",e],queryFn:()=>(0,n.SC)("/api/audit-logs".concat(s)),enabled:(null==r?void 0:r.enabled)!==!1})}function a(e){return(0,t.a)({queryKey:["audit-logs","stats"],queryFn:()=>(0,n.SC)("/api/audit-logs/stats"),enabled:(null==e?void 0:e.enabled)!==!1,refetchInterval:3e4})}function o(e,r){return(0,t.a)({queryKey:["audit-logs",e],queryFn:()=>(0,n.SC)("/api/audit-logs/".concat(encodeURIComponent(e))),enabled:(null==r?void 0:r.enabled)!==!1&&!!e})}function l(e,r){var s;return i({targetType:"server",targetName:e,limit:null!==(s=null==r?void 0:r.limit)&&void 0!==s?s:20},{enabled:(null==r?void 0:r.enabled)!==!1&&!!e})}function d(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return i({limit:e,sort:"timestamp:desc"})}},37228:function(e,r,s){"use strict";s.d(r,{Bc:function(){return l},N$:function(){return d},UW:function(){return o}});var t=s(5632),n=s(58919),i=s(20367),a=s(42936);function o(){return(0,t.a)({queryKey:["playit-status"],queryFn:()=>(0,a.SC)("/api/playit/status"),refetchInterval:3e4})}function l(){let e=(0,n.NL)();return(0,i.D)({mutationFn:()=>(0,a.SC)("/api/playit/start",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["playit-status"]})}})}function d(){let e=(0,n.NL)();return(0,i.D)({mutationFn:()=>(0,a.SC)("/api/playit/stop",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["playit-status"]})}})}},82925:function(e,r,s){"use strict";s.d(r,{KK:function(){return o},Lu:function(){return t},Xn:function(){return a},n3:function(){return n},xg:function(){return i}});let t={"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"},n={"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,9760,6758,680,1668,7436,1071,540,4416,2538,5511,880,55,7727,8347,1658,9951,6727,6645,4219,4596,4682,2666,5787,3669,2757,1744],function(){return e(e.s=59616)}),_N_E=e.O()}]);
|