@minecraft-docker/mcctl-console 2.17.1 → 2.19.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 +49 -49
- 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 +2 -2
- package/.next/standalone/platform/services/mcctl-console/.next/prerender-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_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_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/audit-logs.html +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/audit-logs.rsc +2 -2
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/backups.html +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/backups.rsc +3 -3
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/dashboard.html +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/app/dashboard.rsc +2 -2
- 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 +2 -2
- 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 +2 -2
- package/.next/standalone/platform/services/mcctl-console/.next/server/app-paths-manifest.json +23 -23
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/354.js +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/5841.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/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/{static/chunks/6831-3fe5e1273ac38e5f.js → standalone/platform/services/mcctl-console/.next/static/chunks/6831-81d20c7bc7bd1e76.js} +1 -1
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/layout-06fb39812ec76869.js +1 -0
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/servers/[name]/{page-09665a800696c8a9.js → page-019db18bf2925a68.js} +1 -1
- package/.next/standalone/platform/services/mcctl-console/package.json +1 -1
- package/.next/{standalone/platform/services/mcctl-console/.next/static/chunks/6831-3fe5e1273ac38e5f.js → static/chunks/6831-81d20c7bc7bd1e76.js} +1 -1
- package/.next/static/chunks/app/(main)/layout-06fb39812ec76869.js +1 -0
- package/.next/static/chunks/app/(main)/servers/[name]/{page-09665a800696c8a9.js → page-019db18bf2925a68.js} +1 -1
- package/package.json +2 -2
- package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/layout-25723393b563b0b5.js +0 -1
- package/.next/static/chunks/app/(main)/layout-25723393b563b0b5.js +0 -1
- /package/.next/standalone/platform/services/mcctl-console/.next/static/{EWK4Ri6i-_5rtqio-jikH → MN_3u7o3GfgwT0ep21yPN}/_buildManifest.js +0 -0
- /package/.next/standalone/platform/services/mcctl-console/.next/static/{EWK4Ri6i-_5rtqio-jikH → MN_3u7o3GfgwT0ep21yPN}/_ssgManifest.js +0 -0
- /package/.next/static/{EWK4Ri6i-_5rtqio-jikH → MN_3u7o3GfgwT0ep21yPN}/_buildManifest.js +0 -0
- /package/.next/static/{EWK4Ri6i-_5rtqio-jikH → MN_3u7o3GfgwT0ep21yPN}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><title>500: Internal Server Error</title><meta name="next-head-count" content="3"/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-a47ff07ca7471347.js" defer=""></script><script src="/_next/static/chunks/framework-dd2365ff6fe7347f.js" defer=""></script><script src="/_next/static/chunks/main-b1805c976aebe9ce.js" defer=""></script><script src="/_next/static/chunks/pages/_app-afb15f99d73f71b7.js" defer=""></script><script src="/_next/static/chunks/pages/_error-3a37b634c5a26fe6.js" defer=""></script><script src="/_next/static/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><title>500: Internal Server Error</title><meta name="next-head-count" content="3"/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-a47ff07ca7471347.js" defer=""></script><script src="/_next/static/chunks/framework-dd2365ff6fe7347f.js" defer=""></script><script src="/_next/static/chunks/main-b1805c976aebe9ce.js" defer=""></script><script src="/_next/static/chunks/pages/_app-afb15f99d73f71b7.js" defer=""></script><script src="/_next/static/chunks/pages/_error-3a37b634c5a26fe6.js" defer=""></script><script src="/_next/static/MN_3u7o3GfgwT0ep21yPN/_buildManifest.js" defer=""></script><script src="/_next/static/MN_3u7o3GfgwT0ep21yPN/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":500}},"page":"/_error","query":{},"buildId":"MN_3u7o3GfgwT0ep21yPN","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
|
package/.next/standalone/platform/services/mcctl-console/.next/server/server-reference-manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"node":{},"edge":{},"encryptionKey":"
|
|
1
|
+
{"node":{},"edge":{},"encryptionKey":"XD4kMw1XBzjQm/EniCNd04iKo+3j+m1n/Jnv41kYJaI="}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6831],{6516:function(e,n,t){t.d(n,{e:function(){return Z}});var s=t(94655),a=t(35106),l=t(99770),i=t(62508),r=t(5682),o=t(76678),c=t(30417),d=t(97436),u=t(29793),h=t(75726),x=t(62328),m=t(7178),p=t(81071),f=t(93017),j=t(7281),g=t(12063);function Z(e){var n;let{open:t,onClose:Z,serverNames:v,defaultServer:y}=e,[b,C]=(0,a.useState)(y||""),[S,k]=(0,a.useState)(""),w=(0,g.t)(),z=async()=>{if(b)try{await w.mutateAsync({serverName:b,description:S.trim()||void 0}),D()}catch(e){}},D=()=>{w.isPending||(C(y||""),k(""),w.reset(),Z())};return(0,s.jsxs)(l.Z,{open:t,onClose:D,maxWidth:"sm",fullWidth:!0,children:[(0,s.jsx)(i.Z,{children:"Create Config Snapshot"}),(0,s.jsx)(r.Z,{children:(0,s.jsxs)(j.Z,{sx:{display:"flex",flexDirection:"column",gap:2,mt:1},children:[(0,s.jsxs)(u.Z,{fullWidth:!0,required:!0,children:[(0,s.jsx)(h.Z,{children:"Server"}),(0,s.jsx)(x.Z,{value:b,onChange:e=>C(e.target.value),label:"Server",disabled:w.isPending||!!y,children:v.map(e=>(0,s.jsx)(m.Z,{value:e,children:e},e))})]}),(0,s.jsx)(d.Z,{label:"Description (optional)",value:S,onChange:e=>k(e.target.value),placeholder:"e.g., Before modpack update",fullWidth:!0,disabled:w.isPending}),w.isError&&(0,s.jsx)(p.Z,{severity:"error",children:(null===(n=w.error)||void 0===n?void 0:n.message)||"Failed to create snapshot"}),w.isPending&&(0,s.jsx)(p.Z,{severity:"info",icon:(0,s.jsx)(f.Z,{size:20}),children:"Creating snapshot... This may take a moment."})]})}),(0,s.jsxs)(o.Z,{children:[(0,s.jsx)(c.Z,{onClick:D,disabled:w.isPending,children:"Cancel"}),(0,s.jsx)(c.Z,{onClick:z,variant:"contained",disabled:!b||w.isPending,children:w.isPending?"Creating...":"Create Snapshot"})]})]})}},84728:function(e,n,t){t.d(n,{YN:function(){return V}});var s=t(94655),a=t(35106),l=t(30417),i=t(99770),r=t(62508),o=t(5682),c=t(76678),d=t(7281),u=t(31317),h=t(81071),x=t(93017),m=t(79983),p=t(69123),f=t(44059),j=t(83855),g=t(71185),Z=t(97731),v=t(86071),y=t(72205),b=t(90158),C=t(49954),S=t(17820),k=t(73424),w=t(95511),z=t(73517),D=t(47254),A=t(43214);function B(e){let{changes:n,selectedFile:t,onSelectFile:l}=e,i=(0,a.useCallback)((e,t,s)=>{"ArrowUp"===e.key&&s>0?(e.preventDefault(),l(n[s-1].path)):"ArrowDown"===e.key&&s<n.length-1?(e.preventDefault(),l(n[s+1].path)):("Enter"===e.key||" "===e.key)&&(e.preventDefault(),l(t))},[n,l]);return 0===n.length?(0,s.jsx)(d.Z,{sx:{p:2},children:(0,s.jsx)(u.Z,{variant:"body2",color:"text.secondary",children:"No changes"})}):(0,s.jsxs)(d.Z,{sx:{height:"100%",overflow:"auto",borderRight:1,borderColor:"divider"},role:"tree","aria-label":"Changed files",children:[(0,s.jsxs)(u.Z,{variant:"caption",sx:{display:"block",px:2,py:1,color:"text.secondary",fontWeight:"medium",letterSpacing:"0.08em",textTransform:"uppercase",borderBottom:1,borderColor:"divider",bgcolor:"background.paper"},children:["Changed Files (",n.length,")"]}),(0,s.jsx)(b.Z,{dense:!0,disablePadding:!0,role:"group",children:n.map((e,n)=>{let a=function(e){switch(e){case"added":return{icon:(0,s.jsx)(z.Z,{fontSize:"small"}),color:"success.main",label:"Added"};case"modified":return{icon:(0,s.jsx)(D.Z,{fontSize:"small"}),color:"warning.main",label:"Modified"};case"deleted":return{icon:(0,s.jsx)(A.Z,{fontSize:"small"}),color:"error.main",label:"Deleted"}}}(e.status),r=function(e){let n=e.split("/");return n[n.length-1]}(e.path),o=function(e){let n=e.split("/");return n.length<=1?"":n.slice(0,-1).join("/")}(e.path),c=t===e.path;return(0,s.jsx)(w.Z,{title:"".concat(a.label,": ").concat(e.path),placement:"right",children:(0,s.jsxs)(C.Z,{selected:c,onClick:()=>l(e.path),onKeyDown:t=>i(t,e.path,n),role:"treeitem","aria-selected":c,"aria-label":"".concat(e.path," - ").concat(a.label),sx:{py:.75,"&.Mui-selected":{bgcolor:"action.selected"}},children:[(0,s.jsx)(S.Z,{sx:{minWidth:32,color:a.color},children:a.icon}),(0,s.jsx)(k.Z,{primary:r,secondary:o||void 0,primaryTypographyProps:{variant:"body2",sx:{fontFamily:"monospace",fontSize:"0.8rem",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},secondaryTypographyProps:{variant:"caption",sx:{fontFamily:"monospace",fontSize:"0.7rem",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}})]})},e.path)})})]})}var P=t(20876),F=t(25333);let I=(0,P.default)(()=>t.e(271).then(t.bind(t,40271)),{loadableGenerated:{webpack:()=>[null]},ssr:!1});function W(e){var n,t;let{change:a,viewMode:l,fileRef:i}=e,r="added"===a.status?"":null!==(n=a.oldContent)&&void 0!==n?n:"",o="deleted"===a.status?"":null!==(t=a.newContent)&&void 0!==t?t:"";return(0,s.jsxs)(d.Z,{ref:i,sx:{mb:3},"data-file-path":a.path,id:"diff-file-".concat(a.path.replace(/[^a-zA-Z0-9]/g,"-")),children:[(0,s.jsxs)(d.Z,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1,bgcolor:"background.default",borderTop:1,borderBottom:1,borderColor:"divider",position:"sticky",top:0,zIndex:1},children:[function(e){switch(e){case"added":return(0,s.jsx)(z.Z,{fontSize:"small",sx:{color:"success.main"}});case"modified":return(0,s.jsx)(D.Z,{fontSize:"small",sx:{color:"warning.main"}});case"deleted":return(0,s.jsx)(A.Z,{fontSize:"small",sx:{color:"error.main"}})}}(a.status),(0,s.jsx)(u.Z,{variant:"body2",sx:{fontFamily:"monospace",fontWeight:"bold",flex:1},children:a.path}),(0,s.jsx)(F.Z,{label:function(e){switch(e){case"added":return"added";case"modified":return"modified";case"deleted":return"deleted"}}(a.status),size:"small",color:function(e){switch(e){case"added":return"success";case"modified":return"warning";case"deleted":return"error"}}(a.status),variant:"outlined"})]}),(0,s.jsx)(d.Z,{sx:{fontSize:"0.8rem",overflow:"auto"},children:(0,s.jsx)(I,{oldValue:r,newValue:o,splitView:"split"===l,useDarkTheme:!0,hideLineNumbers:!1,showDiffOnly:!0,styles:{variables:{dark:{diffViewerBackground:"#1a1a1a",addedBackground:"#1a3a1a",addedColor:"#4caf50",removedBackground:"#3a1a1a",removedColor:"#f44336",wordAddedBackground:"#2d5a2d",wordRemovedBackground:"#5a2d2d",emptyLineBackground:"#1a1a1a",gutterBackground:"#111",gutterColor:"#555",codeFoldBackground:"#111",codeFoldGutterBackground:"#111"}}}})})]})}function T(e){let{changes:n,selectedFile:t,viewMode:l}=e,i=(0,a.useRef)(new Map),r=(0,a.useRef)(null);return((0,a.useEffect)(()=>{if(t&&i.current.has(t)){let e=i.current.get(t);null==e||e.scrollIntoView({behavior:"smooth",block:"start"})}},[t]),0===n.length)?(0,s.jsx)(d.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",p:4},children:(0,s.jsx)(u.Z,{variant:"body1",color:"text.secondary",children:"No differences between these snapshots"})}):(0,s.jsx)(d.Z,{ref:r,sx:{height:"100%",overflow:"auto","& table":{width:"100%"}},children:n.map((e,t)=>(0,s.jsxs)(d.Z,{children:[(0,s.jsx)(W,{change:e,viewMode:l,fileRef:n=>{n?i.current.set(e.path,n):i.current.delete(e.path)}}),t<n.length-1&&(0,s.jsx)(p.Z,{})]},e.path))})}var E=t(89923),N=t(10297),R=t(98874),M=t(23345);function q(e){let{value:n,onChange:t}=e;return(0,s.jsxs)(N.Z,{value:n,exclusive:!0,onChange:(e,n)=>{null!==n&&t(n)},"aria-label":"Diff view mode",size:"small",children:[(0,s.jsx)(w.Z,{title:"Unified diff view",children:(0,s.jsx)(E.Z,{value:"unified","aria-label":"Unified view",children:(0,s.jsx)(R.Z,{fontSize:"small"})})}),(0,s.jsx)(w.Z,{title:"Side-by-side diff view",children:(0,s.jsx)(E.Z,{value:"split","aria-label":"Split view",children:(0,s.jsx)(M.Z,{fontSize:"small"})})})]})}var L=t(32366),U=t(45813),H=t(21111);function O(e){let{summary:n}=e,{added:t,modified:a,deleted:l}=n;return 0===t+a+l?(0,s.jsx)(d.Z,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1,borderTop:1,borderColor:"divider",bgcolor:"background.paper"},children:(0,s.jsx)(u.Z,{variant:"body2",color:"text.secondary",children:"No differences found between snapshots"})}):(0,s.jsxs)(d.Z,{sx:{display:"flex",alignItems:"center",gap:1.5,px:2,py:1,borderTop:1,borderColor:"divider",bgcolor:"background.paper",flexWrap:"wrap"},role:"status","aria-label":"Summary: ".concat(t," added, ").concat(a," modified, ").concat(l," deleted"),children:[(0,s.jsx)(u.Z,{variant:"caption",color:"text.secondary",sx:{fontWeight:"medium"},children:"Summary:"}),a>0&&(0,s.jsx)(F.Z,{icon:(0,s.jsx)(U.Z,{sx:{fontSize:"0.875rem"}}),label:"".concat(a," modified"),size:"small",sx:{bgcolor:"warning.dark",color:"warning.contrastText","& .MuiChip-icon":{color:"warning.contrastText"}}}),t>0&&(0,s.jsx)(F.Z,{icon:(0,s.jsx)(L.Z,{sx:{fontSize:"0.875rem"}}),label:"".concat(t," added"),size:"small",sx:{bgcolor:"success.dark",color:"success.contrastText","& .MuiChip-icon":{color:"success.contrastText"}}}),l>0&&(0,s.jsx)(F.Z,{icon:(0,s.jsx)(H.Z,{sx:{fontSize:"0.875rem"}}),label:"".concat(l," deleted"),size:"small",sx:{bgcolor:"error.dark",color:"error.contrastText","& .MuiChip-icon":{color:"error.contrastText"}}})]})}function K(e){return new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(e))}function V(e){var n;let{open:t,snapshotA:b,snapshotB:C,onClose:S,onRestoreA:k}=e,w=(0,j.Z)(),z=(0,f.Z)(w.breakpoints.down("md")),[D,A]=(0,a.useState)(void 0),[P,F]=(0,a.useState)("unified"),{data:I,isLoading:W,isError:E,error:N}=(0,y.m)(b.id,C.id,{enabled:t});(0,a.useEffect)(()=>{t&&(A(void 0),F("unified"))},[t,z]),(0,a.useEffect)(()=>{(null==I?void 0:I.changes)&&I.changes.length>0&&!D&&A(I.changes[0].path)},[I,D]);let R=(0,a.useCallback)(e=>{"Escape"===e.key&&S()},[S]);(0,a.useEffect)(()=>{if(t)return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[t,R]);let M=(0,a.useCallback)(e=>{A(e)},[]),L=(0,a.useCallback)(()=>{null==k||k(b),S()},[k,b,S]);return(0,s.jsxs)(i.Z,{open:t,onClose:S,maxWidth:"xl",fullWidth:!0,fullScreen:z,"aria-labelledby":"config-diff-dialog-title",PaperProps:{sx:{height:z?"100%":"90vh",maxHeight:z?"100%":"90vh",display:"flex",flexDirection:"column"}},children:[(0,s.jsxs)(r.Z,{id:"config-diff-dialog-title",sx:{display:"flex",alignItems:"center",gap:1,pb:1,flexShrink:0},children:[(0,s.jsx)(v.Z,{color:"primary"}),(0,s.jsxs)(d.Z,{sx:{flex:1},children:[(0,s.jsx)(u.Z,{variant:"h6",component:"span",children:"Config Diff"}),(0,s.jsxs)(u.Z,{variant:"body2",color:"text.secondary",sx:{display:"block",mt:.25},children:["Snapshot A: ",K(b.createdAt),(0,s.jsx)(d.Z,{component:"span",sx:{mx:1},children:"vs"}),"Snapshot B: ",K(C.createdAt)]})]}),(0,s.jsx)(q,{value:P,onChange:F}),(0,s.jsx)(m.Z,{onClick:S,"aria-label":"Close diff dialog",size:"small",sx:{ml:1},children:(0,s.jsx)(g.Z,{})})]}),(0,s.jsx)(p.Z,{}),(0,s.jsxs)(o.Z,{sx:{flex:1,overflow:"hidden",display:"flex",flexDirection:"column",p:0},children:[W&&(0,s.jsxs)(d.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center",flex:1,gap:2},children:[(0,s.jsx)(x.Z,{size:24}),(0,s.jsx)(u.Z,{variant:"body2",color:"text.secondary",children:"Loading diff..."})]}),E&&(0,s.jsx)(d.Z,{sx:{p:2},children:(0,s.jsxs)(h.Z,{severity:"error",children:["Failed to load diff: ",null!==(n=null==N?void 0:N.message)&&void 0!==n?n:"Unknown error"]})}),I&&(0,s.jsxs)(d.Z,{sx:{flex:1,display:"flex",flexDirection:{xs:"column",md:"row"},overflow:"hidden"},children:[(0,s.jsx)(d.Z,{sx:{width:{xs:"100%",md:220},flexShrink:0,height:{xs:"auto",md:"100%"},maxHeight:{xs:160,md:"none"},overflow:"auto"},children:(0,s.jsx)(B,{changes:I.changes,selectedFile:D,onSelectFile:M})}),(0,s.jsx)(p.Z,{orientation:z?"horizontal":"vertical"}),(0,s.jsx)(d.Z,{sx:{flex:1,overflow:"auto"},children:(0,s.jsx)(T,{changes:I.changes,selectedFile:D,viewMode:P})})]})]}),I&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(p.Z,{}),(0,s.jsx)(O,{summary:I.summary})]}),(0,s.jsx)(p.Z,{}),(0,s.jsxs)(c.Z,{sx:{px:2,py:1.5,flexShrink:0},children:[k&&(0,s.jsx)(l.Z,{onClick:L,variant:"outlined",color:"warning",startIcon:(0,s.jsx)(Z.Z,{}),disabled:W,children:"Restore to Snapshot A"}),(0,s.jsx)(d.Z,{sx:{flex:1}}),(0,s.jsx)(l.Z,{onClick:S,variant:"contained",children:"Close"})]})]})}},56831:function(e,n,t){t.d(n,{zO:function(){return P},Fb:function(){return et},JZ:function(){return W},Ff:function(){return G},Xj:function(){return h},zg:function(){return eZ},Dm:function(){return ed},gE:function(){return ey},ed:function(){return eh.e}});var s=t(94655),a=t(628),l=t(41565),i=t(31317),r=t(7281),o=t(25333),c=t(46207),d=t(43436),u=t(92666);function h(){let{data:e,isLoading:n,error:t}=(0,u.mj)();if(n)return(0,s.jsx)(a.Z,{children:(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(i.Z,{variant:"h6",gutterBottom:!0,children:"Backup Status"}),(0,s.jsx)(i.Z,{color:"text.secondary",children:"Loading..."})]})});if(t)return(0,s.jsx)(a.Z,{children:(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(i.Z,{variant:"h6",gutterBottom:!0,children:"Backup Status"}),(0,s.jsx)(i.Z,{color:"error",children:"Failed to load backup status"})]})});let{configured:h,lastBackup:x,repository:m}=e||{};return(0,s.jsx)(a.Z,{children:(0,s.jsxs)(l.Z,{children:[(0,s.jsxs)(r.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,s.jsx)(i.Z,{variant:"h6",children:"Backup Status"}),(0,s.jsx)(o.Z,{icon:h?(0,s.jsx)(c.Z,{}):(0,s.jsx)(d.Z,{}),label:h?"Configured":"Not Configured",color:h?"success":"error",size:"small"})]}),h?(0,s.jsxs)(r.Z,{sx:{display:"flex",flexDirection:"column",gap:1},children:[m&&(0,s.jsxs)(r.Z,{children:[(0,s.jsx)(i.Z,{variant:"caption",color:"text.secondary",children:"Repository"}),(0,s.jsx)(i.Z,{variant:"body2",sx:{fontFamily:"monospace",fontSize:"0.875rem"},children:m})]}),x&&(0,s.jsxs)(r.Z,{children:[(0,s.jsx)(i.Z,{variant:"caption",color:"text.secondary",children:"Last Backup"}),(0,s.jsx)(i.Z,{variant:"body2",children:function(e){let n=new Date,t=new Date(e),s=Math.floor((n.getTime()-t.getTime())/6e4),a=Math.floor(s/60);return s<1?"just now":s<60?"".concat(s," minutes ago"):a<24?"".concat(a," hours ago"):"".concat(Math.floor(a/24)," days ago")}(x)})]}),!x&&(0,s.jsx)(i.Z,{variant:"body2",color:"text.secondary",children:"No backups yet"})]}):(0,s.jsx)(i.Z,{variant:"body2",color:"text.secondary",children:"GitHub backup is not configured. Please configure BACKUP_REPO_URL in your environment."})]})})}var x=t(35106),m=t(21138),p=t(84811),f=t(47001),j=t(53281),g=t(11254),Z=t(70366),v=t(79983),y=t(97731),b=t(30417),C=t(99770),S=t(76678),k=t(5682),w=t(65087),z=t(62508),D=t(81071),A=t(93017);function B(e){var n;let{open:t,commit:a,onClose:l}=e,{mutate:o,isPending:c}=(0,u.s8)(),[d,h]=(0,x.useState)(""),[m,p]=(0,x.useState)(""),f=()=>{c||(h(""),p(""),l())};return(0,s.jsxs)(C.Z,{open:t,onClose:f,maxWidth:"sm",fullWidth:!0,children:[(0,s.jsx)(z.Z,{children:"Restore Backup"}),(0,s.jsxs)(k.Z,{children:[(0,s.jsx)(D.Z,{severity:"warning",sx:{mb:2},children:"This will restore all worlds from the selected backup. Current world data will be overwritten."}),d&&(0,s.jsx)(D.Z,{severity:"success",sx:{mb:2},children:d}),m&&(0,s.jsx)(D.Z,{severity:"error",sx:{mb:2},children:m}),(0,s.jsx)(w.Z,{sx:{mb:2},children:"Are you sure you want to restore from this backup?"}),(0,s.jsxs)(r.Z,{sx:{display:"flex",flexDirection:"column",gap:1},children:[(0,s.jsxs)(r.Z,{children:[(0,s.jsx)(i.Z,{variant:"caption",color:"text.secondary",children:"Commit Hash"}),(0,s.jsx)(i.Z,{variant:"body2",sx:{fontFamily:"monospace",fontSize:"0.875rem"},children:a.hash})]}),(0,s.jsxs)(r.Z,{children:[(0,s.jsx)(i.Z,{variant:"caption",color:"text.secondary",children:"Date"}),(0,s.jsx)(i.Z,{variant:"body2",children:(n=a.date,new Intl.DateTimeFormat(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date(n)))})]}),(0,s.jsxs)(r.Z,{children:[(0,s.jsx)(i.Z,{variant:"caption",color:"text.secondary",children:"Message"}),(0,s.jsx)(i.Z,{variant:"body2",children:a.message})]}),(0,s.jsxs)(r.Z,{children:[(0,s.jsx)(i.Z,{variant:"caption",color:"text.secondary",children:"Author"}),(0,s.jsx)(i.Z,{variant:"body2",children:a.author})]})]})]}),(0,s.jsxs)(S.Z,{children:[(0,s.jsx)(b.Z,{onClick:f,disabled:c,children:"Cancel"}),(0,s.jsx)(b.Z,{onClick:()=>{h(""),p(""),o(a.hash,{onSuccess:()=>{h("Backup restored successfully from ".concat(a.hash.substring(0,7))),setTimeout(()=>{l()},2e3)},onError:e=>{p("Failed to restore backup: ".concat(e.message))}})},variant:"contained",color:"warning",disabled:c,startIcon:c?(0,s.jsx)(A.Z,{size:16}):(0,s.jsx)(y.Z,{}),children:c?"Restoring...":"Restore"})]})]})}function P(){let{data:e,isLoading:n,error:t}=(0,u.$t)(20),[r,c]=(0,x.useState)(null),d=e=>{c(e)};if(n)return(0,s.jsx)(a.Z,{children:(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(i.Z,{variant:"h6",gutterBottom:!0,children:"Backup History"}),(0,s.jsx)(i.Z,{color:"text.secondary",children:"Loading..."})]})});if(t)return(0,s.jsx)(a.Z,{children:(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(i.Z,{variant:"h6",gutterBottom:!0,children:"Backup History"}),(0,s.jsx)(i.Z,{color:"error",children:"Failed to load backup history"})]})});let h=(null==e?void 0:e.commits)||[];return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a.Z,{children:(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(i.Z,{variant:"h6",gutterBottom:!0,children:"Backup History"}),0===h.length?(0,s.jsx)(i.Z,{color:"text.secondary",children:"No backup history available"}):(0,s.jsx)(j.Z,{children:(0,s.jsxs)(m.Z,{children:[(0,s.jsx)(g.Z,{children:(0,s.jsxs)(Z.Z,{children:[(0,s.jsx)(f.Z,{children:"Commit"}),(0,s.jsx)(f.Z,{children:"Date"}),(0,s.jsx)(f.Z,{children:"Message"}),(0,s.jsx)(f.Z,{children:"Author"}),(0,s.jsx)(f.Z,{align:"right",children:"Actions"})]})}),(0,s.jsx)(p.Z,{children:h.map(e=>{var n;return(0,s.jsxs)(Z.Z,{children:[(0,s.jsx)(f.Z,{children:(0,s.jsx)(o.Z,{label:e.hash.substring(0,7),size:"small",variant:"outlined",sx:{fontFamily:"monospace"}})}),(0,s.jsx)(f.Z,{children:(0,s.jsx)(i.Z,{variant:"body2",children:(n=e.date,new Intl.DateTimeFormat(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(new Date(n)))})}),(0,s.jsx)(f.Z,{children:(0,s.jsx)(i.Z,{variant:"body2",children:e.message})}),(0,s.jsx)(f.Z,{children:(0,s.jsx)(i.Z,{variant:"body2",color:"text.secondary",children:e.author})}),(0,s.jsx)(f.Z,{align:"right",children:(0,s.jsx)(v.Z,{size:"small",color:"primary",onClick:()=>d(e),title:"Restore this backup",children:(0,s.jsx)(y.Z,{})})})]},e.hash)})})]})})]})}),r&&(0,s.jsx)(B,{open:!!r,commit:r,onClose:()=>{c(null)}})]})}var F=t(97436),I=t(34675);function W(e){let{disabled:n}=e,[t,a]=(0,x.useState)(!1),[l,i]=(0,x.useState)(""),[r,o]=(0,x.useState)(""),[c,d]=(0,x.useState)(""),{mutate:h,isPending:m}=(0,u.c5)(),p=()=>{m||(a(!1),i(""),o(""),d(""))};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(b.Z,{variant:"contained",startIcon:(0,s.jsx)(I.Z,{}),onClick:()=>{a(!0),o(""),d(""),i("Backup ".concat(new Date().toISOString().split("T")[0]))},disabled:n||m,children:"Push Backup"}),(0,s.jsxs)(C.Z,{open:t,onClose:p,maxWidth:"sm",fullWidth:!0,children:[(0,s.jsx)(z.Z,{children:"Push Backup"}),(0,s.jsxs)(k.Z,{children:[r&&(0,s.jsx)(D.Z,{severity:"success",sx:{mb:2},children:r}),c&&(0,s.jsx)(D.Z,{severity:"error",sx:{mb:2},children:c}),(0,s.jsx)(F.Z,{autoFocus:!0,margin:"dense",label:"Commit Message",type:"text",fullWidth:!0,variant:"outlined",value:l,onChange:e=>i(e.target.value),disabled:m,helperText:"Optional message describing this backup"})]}),(0,s.jsxs)(S.Z,{children:[(0,s.jsx)(b.Z,{onClick:p,disabled:m,children:"Cancel"}),(0,s.jsx)(b.Z,{onClick:()=>{o(""),d(""),h({message:l||void 0},{onSuccess:e=>{o(e.commitHash?"Backup pushed successfully (".concat(e.commitHash.substring(0,7),")"):"Backup pushed successfully"),setTimeout(()=>{p()},2e3)},onError:e=>{d("Failed to push backup: ".concat(e.message))}})},variant:"contained",disabled:m,startIcon:m?(0,s.jsx)(A.Z,{size:16}):(0,s.jsx)(I.Z,{}),children:m?"Pushing...":"Push"})]})]})]})}var T=t(38393),E=t(70115),N=t(95511),R=t(69123),M=t(32366),q=t(45813),L=t(21111),U=t(54211),H=t(29793),O=t(75726),K=t(62328),V=t(7178);let $=[{label:"Every hour",value:"0 * * * *"},{label:"Every 6 hours",value:"0 */6 * * *"},{label:"Every 12 hours",value:"0 */12 * * *"},{label:"Daily at 3 AM",value:"0 3 * * *"},{label:"Weekly (Sunday 3 AM)",value:"0 3 * * 0"},{label:"Custom",value:"custom"}];function J(e){let{open:n,schedule:t,onClose:a}=e,l=(0,u.tT)(),c=(0,u.CA)(),d=!!t,[h,m]=(0,x.useState)(""),[p,f]=(0,x.useState)(""),[j,g]=(0,x.useState)(""),[Z,v]=(0,x.useState)(""),[y,w]=(0,x.useState)(""),[A,B]=(0,x.useState)("");(0,x.useEffect)(()=>{if(n){if(t){var e,s,a,l;m(t.name);let n=$.find(e=>e.value===t.cronExpression);n?(f(n.value),g("")):(f("custom"),g(t.cronExpression)),v(null!==(a=null===(e=t.retentionPolicy.maxCount)||void 0===e?void 0:e.toString())&&void 0!==a?a:""),w(null!==(l=null===(s=t.retentionPolicy.maxAgeDays)||void 0===s?void 0:s.toString())&&void 0!==l?l:"")}else m(""),f("0 3 * * *"),g(""),v("10"),w("30");B("")}},[n,t]);let P=()=>"custom"===p?j.trim():p,I=async()=>{B("");let e=P();if(!h.trim()){B("Name is required");return}if(!e){B("Cron expression is required");return}try{d&&t?await c.mutateAsync({id:t.id,data:{name:h.trim(),cron:e,...Z?{maxCount:parseInt(Z,10)}:{},...y?{maxAgeDays:parseInt(y,10)}:{}}}):await l.mutateAsync({name:h.trim(),cron:e,...Z?{maxCount:parseInt(Z,10)}:{},...y?{maxAgeDays:parseInt(y,10)}:{},enabled:!0}),a()}catch(e){B(e.message||"Failed to save schedule")}},W=l.isPending||c.isPending;return(0,s.jsxs)(C.Z,{open:n,onClose:a,maxWidth:"sm",fullWidth:!0,children:[(0,s.jsx)(z.Z,{children:d?"Edit Backup Schedule":"Create Backup Schedule"}),(0,s.jsx)(k.Z,{children:(0,s.jsxs)(E.Z,{spacing:2.5,sx:{mt:1},children:[A&&(0,s.jsx)(D.Z,{severity:"error",onClose:()=>B(""),children:A}),(0,s.jsx)(F.Z,{label:"Schedule Name",value:h,onChange:e=>m(e.target.value),fullWidth:!0,required:!0,placeholder:"e.g., Daily backup, Hourly snapshot",autoFocus:!0}),(0,s.jsxs)(H.Z,{fullWidth:!0,children:[(0,s.jsx)(O.Z,{children:"Schedule Frequency"}),(0,s.jsx)(K.Z,{value:p,onChange:e=>f(e.target.value),label:"Schedule Frequency",children:$.map(e=>(0,s.jsxs)(V.Z,{value:e.value,children:[e.label,"custom"!==e.value&&(0,s.jsx)(o.Z,{label:e.value,size:"small",variant:"outlined",sx:{ml:1,fontFamily:"monospace",fontSize:"0.75rem"}})]},e.value))})]}),"custom"===p&&(0,s.jsx)(F.Z,{label:"Cron Expression",value:j,onChange:e=>g(e.target.value),fullWidth:!0,required:!0,placeholder:"e.g., 0 */6 * * *",helperText:"Format: minute hour day-of-month month day-of-week",InputProps:{sx:{fontFamily:"monospace"}}}),(0,s.jsx)(i.Z,{variant:"subtitle2",color:"text.secondary",sx:{mt:1},children:"Retention Policy (optional)"}),(0,s.jsxs)(r.Z,{sx:{display:"flex",gap:2},children:[(0,s.jsx)(F.Z,{label:"Max Backup Count",type:"number",value:Z,onChange:e=>v(e.target.value),fullWidth:!0,placeholder:"e.g., 10",inputProps:{min:1},helperText:"Keep at most N backups"}),(0,s.jsx)(F.Z,{label:"Max Age (days)",type:"number",value:y,onChange:e=>w(e.target.value),fullWidth:!0,placeholder:"e.g., 30",inputProps:{min:1},helperText:"Delete backups older than N days"})]})]})}),(0,s.jsxs)(S.Z,{children:[(0,s.jsx)(b.Z,{onClick:a,disabled:W,children:"Cancel"}),(0,s.jsx)(b.Z,{onClick:I,variant:"contained",disabled:W,children:W?"Saving...":d?"Update":"Create"})]})]})}function Q(e){let n=new Date,t=new Date(e),s=Math.floor((n.getTime()-t.getTime())/6e4),a=Math.floor(s/60);return s<1?"just now":s<60?"".concat(s,"m ago"):a<24?"".concat(a,"h ago"):"".concat(Math.floor(a/24),"d ago")}function _(e){let{schedule:n,onEdit:t,onDelete:a,onToggle:l,toggleLoading:u}=e;return(0,s.jsxs)(r.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",py:1.5,px:1,"&:hover":{bgcolor:"action.hover",borderRadius:1}},children:[(0,s.jsxs)(r.Z,{sx:{display:"flex",alignItems:"center",gap:2,flex:1,minWidth:0},children:[(0,s.jsx)(U.Z,{color:n.enabled?"primary":"disabled"}),(0,s.jsxs)(r.Z,{sx:{minWidth:0},children:[(0,s.jsx)(i.Z,{variant:"body1",fontWeight:"medium",noWrap:!0,children:n.name}),(0,s.jsxs)(i.Z,{variant:"caption",color:"text.secondary",noWrap:!0,children:[n.cronHumanReadable," (",n.cronExpression,")"]})]})]}),(0,s.jsxs)(r.Z,{sx:{display:"flex",alignItems:"center",gap:1.5,flexShrink:0},children:[n.lastRunStatus&&(0,s.jsx)(N.Z,{title:n.lastRunMessage?"".concat(n.lastRunAt?Q(n.lastRunAt):"",": ").concat(n.lastRunMessage):n.lastRunAt?Q(n.lastRunAt):"",children:(0,s.jsx)(o.Z,{icon:"success"===n.lastRunStatus?(0,s.jsx)(c.Z,{sx:{fontSize:16}}):(0,s.jsx)(d.Z,{sx:{fontSize:16}}),label:"success"===n.lastRunStatus?"OK":"Failed",size:"small",color:"success"===n.lastRunStatus?"success":"error",variant:"outlined"})}),(n.retentionPolicy.maxCount||n.retentionPolicy.maxAgeDays)&&(0,s.jsx)(N.Z,{title:[n.retentionPolicy.maxCount&&"Max ".concat(n.retentionPolicy.maxCount," backups"),n.retentionPolicy.maxAgeDays&&"Max ".concat(n.retentionPolicy.maxAgeDays," days")].filter(Boolean).join(", "),children:(0,s.jsx)(o.Z,{label:"Retention",size:"small",variant:"outlined",color:"info"})}),(0,s.jsx)(N.Z,{title:n.enabled?"Disable schedule":"Enable schedule",children:(0,s.jsx)(T.Z,{size:"small",checked:n.enabled,onChange:(e,t)=>l(n,t),disabled:u})}),(0,s.jsx)(N.Z,{title:"Edit schedule",children:(0,s.jsx)(v.Z,{size:"small",onClick:()=>t(n),children:(0,s.jsx)(q.Z,{fontSize:"small"})})}),(0,s.jsx)(N.Z,{title:"Delete schedule",children:(0,s.jsx)(v.Z,{size:"small",color:"error",onClick:()=>a(n),children:(0,s.jsx)(L.Z,{fontSize:"small"})})})]})]})}function G(){var e;let{data:n,isLoading:t,error:o}=(0,u.d)(),c=(0,u.c1)(),d=(0,u.JV)(),[h,m]=(0,x.useState)(!1),[p,f]=(0,x.useState)(null),[j,g]=(0,x.useState)(!1),[Z,v]=(0,x.useState)(null),y=e=>{f(e),m(!0)},w=e=>{v(e),g(!0)},A=async()=>{if(Z)try{await d.mutateAsync(Z.id)}catch(e){}g(!1),v(null)},B=(e,n)=>{c.mutate({id:e.id,enabled:n})};if(t)return(0,s.jsx)(a.Z,{children:(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(i.Z,{variant:"h6",gutterBottom:!0,children:"Backup Schedules"}),(0,s.jsx)(i.Z,{color:"text.secondary",children:"Loading..."})]})});if(o)return(0,s.jsx)(a.Z,{children:(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(i.Z,{variant:"h6",gutterBottom:!0,children:"Backup Schedules"}),(0,s.jsx)(D.Z,{severity:"error",children:"Failed to load backup schedules"})]})});let P=null!==(e=null==n?void 0:n.schedules)&&void 0!==e?e:[];return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a.Z,{children:(0,s.jsxs)(l.Z,{children:[(0,s.jsxs)(r.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,s.jsxs)(r.Z,{children:[(0,s.jsx)(i.Z,{variant:"h6",children:"Backup Schedules"}),(0,s.jsx)(i.Z,{variant:"caption",color:"text.secondary",children:"Automated cron-based backup scheduling"})]}),(0,s.jsx)(b.Z,{variant:"contained",size:"small",startIcon:(0,s.jsx)(M.Z,{}),onClick:()=>{f(null),m(!0)},children:"Add Schedule"})]}),0===P.length?(0,s.jsxs)(r.Z,{sx:{textAlign:"center",py:4},children:[(0,s.jsx)(U.Z,{sx:{fontSize:48,color:"text.disabled",mb:1}}),(0,s.jsx)(i.Z,{color:"text.secondary",children:"No backup schedules configured"}),(0,s.jsx)(i.Z,{variant:"caption",color:"text.secondary",children:"Create a schedule to automatically back up your worlds"})]}):(0,s.jsx)(E.Z,{divider:(0,s.jsx)(R.Z,{}),children:P.map(e=>(0,s.jsx)(_,{schedule:e,onEdit:y,onDelete:w,onToggle:B,toggleLoading:c.isPending},e.id))})]})}),(0,s.jsx)(J,{open:h,schedule:p,onClose:()=>{m(!1),f(null)}}),(0,s.jsxs)(C.Z,{open:j,onClose:()=>g(!1),children:[(0,s.jsx)(z.Z,{children:"Delete Backup Schedule"}),(0,s.jsx)(k.Z,{children:(0,s.jsxs)(i.Z,{children:['Are you sure you want to delete the schedule "',null==Z?void 0:Z.name,'"? This action cannot be undone.']})}),(0,s.jsxs)(S.Z,{children:[(0,s.jsx)(b.Z,{onClick:()=>g(!1),children:"Cancel"}),(0,s.jsx)(b.Z,{onClick:A,color:"error",variant:"contained",disabled:d.isPending,children:d.isPending?"Deleting...":"Delete"})]})]})]})}var Y=t(33402),X=t(60097),ee=t(91606),en=t(45420);function et(e){let{value:n,onChange:t}=e;return(0,s.jsx)(r.Z,{sx:{borderBottom:1,borderColor:"divider",mb:3},children:(0,s.jsxs)(Y.Z,{value:n,onChange:(e,n)=>t(n),"aria-label":"Backup management tabs",children:[(0,s.jsx)(X.Z,{value:"world-backups",label:"World Backups",icon:(0,s.jsx)(ee.Z,{}),iconPosition:"start",sx:{textTransform:"none",fontWeight:"medium"}}),(0,s.jsx)(X.Z,{value:"config-snapshots",label:"Config Snapshots",icon:(0,s.jsx)(en.Z,{}),iconPosition:"start",sx:{textTransform:"none",fontWeight:"medium"}})]})})}var es=t(73517),ea=t(87739),el=t(12063),ei=t(88978),er=t(27171),eo=t(80620),ec=t(86071);function ed(e){let{serverName:n,snapshots:t,totalCount:d,schedule:u,onViewHistory:h,onCreateSnapshot:x,onViewDiff:m}=e,p=t.length>0?t[0]:null,f=t.length>=2;return(0,s.jsx)(a.Z,{variant:"outlined",sx:{"&:hover":{borderColor:"primary.main"}},children:(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(r.Z,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between"},children:(0,s.jsxs)(r.Z,{sx:{display:"flex",alignItems:"center",gap:1.5,mb:1},children:[(0,s.jsx)(er.Z,{color:"primary"}),(0,s.jsx)(i.Z,{variant:"h6",component:"h3",fontWeight:"bold",children:n})]})}),(0,s.jsxs)(E.Z,{direction:"row",spacing:2,sx:{mb:2,flexWrap:"wrap",gap:1},children:[p?(0,s.jsx)(N.Z,{title:"Latest: ".concat(new Date(p.createdAt).toLocaleString()),children:(0,s.jsx)(o.Z,{icon:(0,s.jsx)(eo.Z,{sx:{fontSize:16}}),label:"Latest: ".concat(function(e){let n=new Date,t=new Date(e),s=Math.floor((n.getTime()-t.getTime())/6e4),a=Math.floor(s/60),l=Math.floor(a/24);return s<1?"just now":s<60?"".concat(s,"m ago"):a<24?"".concat(a,"h ago"):l<30?"".concat(l,"d ago"):t.toLocaleDateString()}(p.createdAt)),size:"small",variant:"outlined"})}):(0,s.jsx)(o.Z,{label:"No snapshots yet",size:"small",variant:"outlined",color:"default"}),p&&(0,s.jsx)(o.Z,{label:"".concat(p.files.length," files"),size:"small",variant:"outlined",color:"info"}),(0,s.jsx)(o.Z,{label:"".concat(d," snapshot").concat(1!==d?"s":""," total"),size:"small",variant:"outlined"}),u?(0,s.jsx)(N.Z,{title:"Schedule: ".concat(u.name," (").concat(u.cronExpression,")"),children:(0,s.jsx)(o.Z,{icon:u.enabled?(0,s.jsx)(c.Z,{sx:{fontSize:16}}):(0,s.jsx)(U.Z,{sx:{fontSize:16}}),label:u.enabled?"Schedule: Active":"Schedule: Paused",size:"small",variant:"outlined",color:u.enabled?"success":"default"})}):(0,s.jsx)(o.Z,{label:"No schedule",size:"small",variant:"outlined",color:"default"})]}),(0,s.jsxs)(E.Z,{direction:"row",spacing:1,children:[(0,s.jsx)(b.Z,{size:"small",variant:"outlined",startIcon:(0,s.jsx)(eo.Z,{}),onClick:()=>h(n),disabled:0===d,children:"View History"}),(0,s.jsx)(b.Z,{size:"small",variant:"outlined",startIcon:(0,s.jsx)(es.Z,{}),onClick:()=>x(n),children:"Create Snapshot"}),f&&(0,s.jsx)(b.Z,{size:"small",variant:"outlined",startIcon:(0,s.jsx)(ec.Z,{}),onClick:()=>m(n),children:"View Diff"})]})]})})}function eu(e){let{servers:n,snapshotsByServer:t,schedules:a,isLoading:l,error:o,onViewHistory:c,onCreateSnapshot:d,onViewDiff:u}=e,h=(0,x.useMemo)(()=>n.map(e=>{var n,s;let l=t.get(e.name),i=a.find(n=>n.serverName===e.name);return{serverName:e.name,snapshots:null!==(n=null==l?void 0:l.snapshots)&&void 0!==n?n:[],totalCount:null!==(s=null==l?void 0:l.total)&&void 0!==s?s:0,schedule:i}}),[n,t,a]);return l?(0,s.jsx)(r.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,s.jsx)(A.Z,{})}):o?(0,s.jsxs)(D.Z,{severity:"error",children:["Failed to load config snapshots: ",o.message]}):0===n.length?(0,s.jsxs)(r.Z,{sx:{textAlign:"center",py:6},children:[(0,s.jsx)(en.Z,{sx:{fontSize:48,color:"text.disabled",mb:1}}),(0,s.jsx)(i.Z,{color:"text.secondary",children:"No servers found"}),(0,s.jsx)(i.Z,{variant:"caption",color:"text.secondary",children:"Create a server to start taking config snapshots"})]}):(0,s.jsx)(E.Z,{spacing:2,children:h.map(e=>(0,s.jsx)(ed,{serverName:e.serverName,snapshots:e.snapshots,totalCount:e.totalCount,schedule:e.schedule,onViewHistory:c,onCreateSnapshot:d,onViewDiff:u},e.serverName))})}var eh=t(6516),ex=t(62142),em=t(71185);function ep(e){let{schedule:n,onEdit:t,onDelete:a,onToggle:l,toggleLoading:u}=e;return(0,s.jsxs)(r.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",py:1.5,px:1,"&:hover":{bgcolor:"action.hover",borderRadius:1}},children:[(0,s.jsxs)(r.Z,{sx:{display:"flex",alignItems:"center",gap:2,flex:1,minWidth:0},children:[(0,s.jsx)(U.Z,{color:n.enabled?"primary":"disabled"}),(0,s.jsxs)(r.Z,{sx:{minWidth:0},children:[(0,s.jsx)(i.Z,{variant:"body2",fontWeight:"medium",noWrap:!0,children:n.name}),(0,s.jsxs)(i.Z,{variant:"caption",color:"text.secondary",noWrap:!0,children:[n.serverName," | ",n.cronExpression," | Retain: ",n.retentionCount]})]})]}),(0,s.jsxs)(r.Z,{sx:{display:"flex",alignItems:"center",gap:1,flexShrink:0},children:[n.lastRunStatus&&(0,s.jsx)(N.Z,{title:n.lastRunAt?"Last run: ".concat(function(e){let n=new Date,t=new Date(e),s=Math.floor((n.getTime()-t.getTime())/6e4),a=Math.floor(s/60);return s<1?"just now":s<60?"".concat(s,"m ago"):a<24?"".concat(a,"h ago"):"".concat(Math.floor(a/24),"d ago")}(n.lastRunAt)," (").concat(n.lastRunStatus,")"):n.lastRunStatus,children:(0,s.jsx)(o.Z,{icon:"success"===n.lastRunStatus?(0,s.jsx)(c.Z,{sx:{fontSize:16}}):(0,s.jsx)(d.Z,{sx:{fontSize:16}}),label:"success"===n.lastRunStatus?"OK":"Failed",size:"small",color:"success"===n.lastRunStatus?"success":"error",variant:"outlined"})}),(0,s.jsx)(N.Z,{title:n.enabled?"Disable schedule":"Enable schedule",children:(0,s.jsx)(T.Z,{size:"small",checked:n.enabled,onChange:(e,t)=>l(n,t),disabled:u})}),(0,s.jsx)(N.Z,{title:"Edit schedule",children:(0,s.jsx)(v.Z,{size:"small",onClick:()=>t(n),children:(0,s.jsx)(q.Z,{fontSize:"small"})})}),(0,s.jsx)(N.Z,{title:"Delete schedule",children:(0,s.jsx)(v.Z,{size:"small",color:"error",onClick:()=>a(n),children:(0,s.jsx)(L.Z,{fontSize:"small"})})})]})]})}function ef(e){let{schedules:n,onEdit:t,onDelete:a,onToggle:l,toggleLoading:o}=e;return 0===n.length?(0,s.jsxs)(r.Z,{sx:{textAlign:"center",py:3},children:[(0,s.jsx)(U.Z,{sx:{fontSize:40,color:"text.disabled",mb:1}}),(0,s.jsx)(i.Z,{color:"text.secondary",variant:"body2",children:"No config snapshot schedules configured"})]}):(0,s.jsx)(E.Z,{divider:(0,s.jsx)(R.Z,{}),children:n.map(e=>(0,s.jsx)(ep,{schedule:e,onEdit:t,onDelete:a,onToggle:l,toggleLoading:o},e.id))})}let ej=[{label:"Every hour",value:"0 * * * *"},{label:"Every 6 hours",value:"0 */6 * * *"},{label:"Daily at midnight",value:"0 0 * * *"},{label:"Daily at 3 AM",value:"0 3 * * *"},{label:"Weekly (Sunday midnight)",value:"0 0 * * 0"},{label:"Custom",value:""}];function eg(e){var n;let{serverNames:t,editingSchedule:a,onSubmit:l,onUpdate:o,onCancel:c,isSubmitting:d,error:u}=e,h=!!a,[m,p]=(0,x.useState)((null==a?void 0:a.serverName)||""),[f,j]=(0,x.useState)((null==a?void 0:a.name)||""),[g,Z]=(0,x.useState)(""),[v,y]=(0,x.useState)((null==a?void 0:a.cronExpression)||"0 0 * * *"),[C,S]=(0,x.useState)(null!==(n=null==a?void 0:a.retentionCount)&&void 0!==n?n:10);(0,x.useEffect)(()=>{let e=ej.find(e=>e.value===v);Z(e?e.value:"")},[v]),(0,x.useEffect)(()=>{a?(p(a.serverName),j(a.name),y(a.cronExpression),S(a.retentionCount)):(p(""),j(""),y("0 0 * * *"),S(10))},[a]);let k=e=>{Z(e),e&&y(e)},w=(h||m)&&f.trim()&&v.trim();return(0,s.jsxs)(r.Z,{sx:{display:"flex",flexDirection:"column",gap:2},children:[(0,s.jsx)(i.Z,{variant:"subtitle2",color:"text.secondary",children:h?"Edit Schedule":"Create New Schedule"}),!h&&(0,s.jsxs)(H.Z,{fullWidth:!0,size:"small",required:!0,children:[(0,s.jsx)(O.Z,{children:"Server"}),(0,s.jsx)(K.Z,{value:m,onChange:e=>p(e.target.value),label:"Server",disabled:d,children:t.map(e=>(0,s.jsx)(V.Z,{value:e,children:e},e))})]}),(0,s.jsx)(F.Z,{label:"Schedule Name",value:f,onChange:e=>j(e.target.value),placeholder:"e.g., Daily config backup",size:"small",fullWidth:!0,required:!0,disabled:d}),(0,s.jsxs)(H.Z,{fullWidth:!0,size:"small",children:[(0,s.jsx)(O.Z,{children:"Cron Preset"}),(0,s.jsx)(K.Z,{value:g,onChange:e=>k(e.target.value),label:"Cron Preset",disabled:d,children:ej.map(e=>(0,s.jsx)(V.Z,{value:e.value,children:e.label},e.label))})]}),(0,s.jsx)(F.Z,{label:"Cron Expression",value:v,onChange:e=>y(e.target.value),placeholder:"0 0 * * *",size:"small",fullWidth:!0,required:!0,disabled:d,helperText:"Standard cron format: minute hour day month weekday"}),(0,s.jsx)(F.Z,{label:"Retention Count",type:"number",value:C,onChange:e=>S(Math.max(1,parseInt(e.target.value)||1)),size:"small",fullWidth:!0,disabled:d,helperText:"Maximum number of scheduled snapshots to keep per server",inputProps:{min:1,max:100}}),u&&(0,s.jsx)(D.Z,{severity:"error",sx:{py:0},children:u}),(0,s.jsxs)(r.Z,{sx:{display:"flex",gap:1,justifyContent:"flex-end"},children:[(0,s.jsx)(b.Z,{size:"small",onClick:c,disabled:d,children:"Cancel"}),(0,s.jsx)(b.Z,{size:"small",variant:"contained",onClick:()=>{h&&o?o({name:f.trim(),cronExpression:v,retentionCount:C}):l({serverName:m,name:f.trim(),cronExpression:v,retentionCount:C})},disabled:!w||d,children:d?"Saving...":h?"Update":"Create"})]})]})}function eZ(e){var n,t,a;let{open:l,onClose:o,serverNames:c,filterServerName:d}=e,{data:u,isLoading:h,error:m}=(0,ei.F$)(d),p=(0,ei.wh)(),f=(0,ei.Uw)(),j=(0,ei.DW)(),g=(0,ei.$C)(),[Z,y]=(0,x.useState)(!1),[w,B]=(0,x.useState)(null),[P,F]=(0,x.useState)(!1),[I,W]=(0,x.useState)(null),T=null!==(a=null==u?void 0:u.schedules)&&void 0!==a?a:[],E=async()=>{if(I)try{await g.mutateAsync(I.id)}catch(e){}F(!1),W(null)},N=async e=>{try{await p.mutateAsync({serverName:e.serverName,name:e.name,cronExpression:e.cronExpression,retentionCount:e.retentionCount}),y(!1)}catch(e){}},q=async e=>{if(w)try{await f.mutateAsync({id:w.id,data:e}),y(!1),B(null)}catch(e){}},L=(null===(n=p.error)||void 0===n?void 0:n.message)||(null===(t=f.error)||void 0===t?void 0:t.message)||null;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(ex.ZP,{anchor:"right",open:l,onClose:o,PaperProps:{sx:{width:{xs:"100%",sm:480},p:3}},children:[(0,s.jsxs)(r.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,s.jsx)(i.Z,{variant:"h6",fontWeight:"bold",children:"Config Snapshot Schedules"}),(0,s.jsx)(v.Z,{onClick:o,size:"small",children:(0,s.jsx)(em.Z,{})})]}),(0,s.jsx)(R.Z,{sx:{mb:2}}),!Z&&(0,s.jsx)(b.Z,{variant:"outlined",startIcon:(0,s.jsx)(M.Z,{}),onClick:()=>{B(null),y(!0)},fullWidth:!0,sx:{mb:2},children:"Add Schedule"}),Z&&(0,s.jsxs)(r.Z,{sx:{mb:2},children:[(0,s.jsx)(eg,{serverNames:c,editingSchedule:w,onSubmit:N,onUpdate:q,onCancel:()=>{y(!1),B(null),p.reset(),f.reset()},isSubmitting:p.isPending||f.isPending,error:L}),(0,s.jsx)(R.Z,{sx:{mt:2}})]}),h?(0,s.jsx)(r.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,s.jsx)(A.Z,{})}):m?(0,s.jsx)(D.Z,{severity:"error",children:"Failed to load schedules"}):(0,s.jsx)(ef,{schedules:T,onEdit:e=>{B(e),y(!0)},onDelete:e=>{W(e),F(!0)},onToggle:(e,n)=>{j.mutate({id:e.id,enabled:n})},toggleLoading:j.isPending})]}),(0,s.jsxs)(C.Z,{open:P,onClose:()=>F(!1),children:[(0,s.jsx)(z.Z,{children:"Delete Config Snapshot Schedule"}),(0,s.jsx)(k.Z,{children:(0,s.jsxs)(i.Z,{children:['Are you sure you want to delete the schedule "',null==I?void 0:I.name,'"? Existing snapshots created by this schedule will be preserved.']})}),(0,s.jsxs)(S.Z,{children:[(0,s.jsx)(b.Z,{onClick:()=>F(!1),children:"Cancel"}),(0,s.jsx)(b.Z,{onClick:E,color:"error",variant:"contained",disabled:g.isPending,children:g.isPending?"Deleting...":"Delete"})]})]})]})}var ev=t(84728);function ey(){var e,n;let{data:t,isLoading:a}=(0,u.x$)(),l=null!==(e=null==t?void 0:t.servers)&&void 0!==e?e:[],o=l.map(e=>e.name),{snapshotsByServer:c,isLoading:d,error:h}=function(e){var n;let t=e.map(e=>({name:e,query:(0,el.m)(e,5,0,{enabled:!!e})})),s=t.some(e=>e.query.isLoading),a=(null===(n=t.find(e=>e.query.error))||void 0===n?void 0:n.query.error)||null;return{snapshotsByServer:(0,x.useMemo)(()=>{let e=new Map;for(let n of t)n.query.data&&e.set(n.name,{snapshots:n.query.data.snapshots,total:n.query.data.total});return e},[t]),isLoading:s,error:a}}(o),{data:m}=(0,ei.F$)(),p=null!==(n=null==m?void 0:m.schedules)&&void 0!==n?n:[],[f,j]=(0,x.useState)(!1),[g,Z]=(0,x.useState)(void 0),[v,y]=(0,x.useState)(!1),[C,S]=(0,x.useState)(!1),[k,w]=(0,x.useState)(""),z=(0,x.useMemo)(()=>{if(!k)return{snapshotA:null,snapshotB:null};let e=c.get(k);return!e||e.snapshots.length<2?{snapshotA:null,snapshotB:null}:{snapshotA:e.snapshots[1],snapshotB:e.snapshots[0]}},[k,c]);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(r.Z,{sx:{display:"flex",justifyContent:"flex-end",gap:1,mb:2},children:[(0,s.jsx)(b.Z,{variant:"outlined",size:"small",startIcon:(0,s.jsx)(ea.Z,{}),onClick:()=>y(!0),children:"Manage Schedules"}),(0,s.jsx)(b.Z,{variant:"contained",size:"small",startIcon:(0,s.jsx)(es.Z,{}),onClick:()=>{Z(void 0),j(!0)},children:"Create Snapshot"})]}),(0,s.jsx)(i.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"Config snapshots capture server configuration files (server.properties, config.env, etc.) for versioning, comparison, and restore operations."}),(0,s.jsx)(eu,{servers:l,snapshotsByServer:c,schedules:p,isLoading:a||d,error:h,onViewHistory:e=>{let n=c.get(e);n&&n.snapshots.length>0&&(w(e),S(!0))},onCreateSnapshot:e=>{Z(e),j(!0)},onViewDiff:e=>{w(e),S(!0)}}),(0,s.jsx)(eh.e,{open:f,onClose:()=>{j(!1),Z(void 0)},serverNames:o,defaultServer:g}),(0,s.jsx)(eZ,{open:v,onClose:()=>y(!1),serverNames:o}),C&&z.snapshotA&&z.snapshotB&&(0,s.jsx)(ev.YN,{open:C,onClose:()=>{S(!1),w("")},snapshotA:z.snapshotA,snapshotB:z.snapshotB})]})}},72205:function(e,n,t){t.d(n,{m:function(){return l}});var s=t(98324),a=t(42936);function l(e,n,t){return(0,s.a)({queryKey:["config-snapshots","diff",e,n],queryFn:()=>(0,a.SC)("/api/config-snapshots/".concat(encodeURIComponent(e),"/diff/").concat(encodeURIComponent(n))),enabled:(null==t?void 0:t.enabled)!==!1&&!!e&&!!n,staleTime:3e5})}},88978:function(e,n,t){t.d(n,{$C:function(){return u},DW:function(){return d},F$:function(){return r},Uw:function(){return c},wh:function(){return o}});var s=t(98324),a=t(58919),l=t(20367),i=t(42936);function r(e){let n=e?"?serverName=".concat(encodeURIComponent(e)):"";return(0,s.a)({queryKey:["config-snapshot-schedules",e||"all"],queryFn:()=>(0,i.SC)("/api/config-snapshot-schedules".concat(n)),refetchInterval:6e4})}function o(){let e=(0,a.NL)();return(0,l.D)({mutationFn:e=>(0,i.SC)("/api/config-snapshot-schedules",{method:"POST",body:JSON.stringify(e)}),onSuccess:()=>{e.invalidateQueries({queryKey:["config-snapshot-schedules"]})}})}function c(){let e=(0,a.NL)();return(0,l.D)({mutationFn:e=>{let{id:n,data:t}=e;return(0,i.SC)("/api/config-snapshot-schedules/".concat(encodeURIComponent(n)),{method:"PUT",body:JSON.stringify(t)})},onSuccess:()=>{e.invalidateQueries({queryKey:["config-snapshot-schedules"]})}})}function d(){let e=(0,a.NL)();return(0,l.D)({mutationFn:e=>{let{id:n,enabled:t}=e;return(0,i.SC)("/api/config-snapshot-schedules/".concat(encodeURIComponent(n),"/toggle"),{method:"PATCH",body:JSON.stringify({enabled:t})})},onSuccess:()=>{e.invalidateQueries({queryKey:["config-snapshot-schedules"]})}})}function u(){let e=(0,a.NL)();return(0,l.D)({mutationFn:e=>(0,i.SC)("/api/config-snapshot-schedules/".concat(encodeURIComponent(e)),{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["config-snapshot-schedules"]})}})}},12063:function(e,n,t){t.d(n,{m:function(){return r},t:function(){return o}});var s=t(98324),a=t(58919),l=t(20367),i=t(42936);function r(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3?arguments[3]:void 0;return(0,s.a)({queryKey:["config-snapshots","list",e,n,t],queryFn:()=>(0,i.SC)("/api/servers/".concat(encodeURIComponent(e),"/config-snapshots?limit=").concat(n,"&offset=").concat(t)),enabled:(null==a?void 0:a.enabled)!==!1&&!!e,refetchInterval:6e4})}function o(){let e=(0,a.NL)();return(0,l.D)({mutationFn:e=>{let{serverName:n,description:t}=e;return(0,i.SC)("/api/servers/".concat(encodeURIComponent(n),"/config-snapshots"),{method:"POST",body:JSON.stringify({description:t})})},onSuccess:(n,t)=>{let{serverName:s}=t;e.invalidateQueries({queryKey:["config-snapshots","list",s]}),e.invalidateQueries({queryKey:["config-snapshots"]})}})}}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6831],{6516:function(e,n,t){t.d(n,{e:function(){return Z}});var s=t(94655),a=t(35106),l=t(99770),i=t(62508),r=t(5682),o=t(76678),c=t(30417),d=t(97436),u=t(29793),h=t(75726),x=t(62328),m=t(7178),p=t(81071),f=t(93017),j=t(7281),g=t(12063);function Z(e){var n;let{open:t,onClose:Z,serverNames:v,defaultServer:y}=e,[b,C]=(0,a.useState)(y||""),[S,k]=(0,a.useState)(""),w=(0,g.t)(),z=async()=>{if(b)try{await w.mutateAsync({serverName:b,description:S.trim()||void 0}),D()}catch(e){}},D=()=>{w.isPending||(C(y||""),k(""),w.reset(),Z())};return(0,s.jsxs)(l.Z,{open:t,onClose:D,maxWidth:"sm",fullWidth:!0,children:[(0,s.jsx)(i.Z,{children:"Create Config Snapshot"}),(0,s.jsx)(r.Z,{children:(0,s.jsxs)(j.Z,{sx:{display:"flex",flexDirection:"column",gap:2,mt:1},children:[(0,s.jsxs)(u.Z,{fullWidth:!0,required:!0,children:[(0,s.jsx)(h.Z,{children:"Server"}),(0,s.jsx)(x.Z,{value:b,onChange:e=>C(e.target.value),label:"Server",disabled:w.isPending||!!y,children:v.map(e=>(0,s.jsx)(m.Z,{value:e,children:e},e))})]}),(0,s.jsx)(d.Z,{label:"Description (optional)",value:S,onChange:e=>k(e.target.value),placeholder:"e.g., Before modpack update",fullWidth:!0,disabled:w.isPending}),w.isError&&(0,s.jsx)(p.Z,{severity:"error",children:(null===(n=w.error)||void 0===n?void 0:n.message)||"Failed to create snapshot"}),w.isPending&&(0,s.jsx)(p.Z,{severity:"info",icon:(0,s.jsx)(f.Z,{size:20}),children:"Creating snapshot... This may take a moment."})]})}),(0,s.jsxs)(o.Z,{children:[(0,s.jsx)(c.Z,{onClick:D,disabled:w.isPending,children:"Cancel"}),(0,s.jsx)(c.Z,{onClick:z,variant:"contained",disabled:!b||w.isPending,children:w.isPending?"Creating...":"Create Snapshot"})]})]})}},84728:function(e,n,t){t.d(n,{YN:function(){return V}});var s=t(94655),a=t(35106),l=t(30417),i=t(99770),r=t(62508),o=t(5682),c=t(76678),d=t(7281),u=t(31317),h=t(81071),x=t(93017),m=t(79983),p=t(69123),f=t(44059),j=t(83855),g=t(71185),Z=t(97731),v=t(86071),y=t(72205),b=t(90158),C=t(49954),S=t(17820),k=t(73424),w=t(95511),z=t(73517),D=t(47254),A=t(43214);function B(e){let{changes:n,selectedFile:t,onSelectFile:l}=e,i=(0,a.useCallback)((e,t,s)=>{"ArrowUp"===e.key&&s>0?(e.preventDefault(),l(n[s-1].path)):"ArrowDown"===e.key&&s<n.length-1?(e.preventDefault(),l(n[s+1].path)):("Enter"===e.key||" "===e.key)&&(e.preventDefault(),l(t))},[n,l]);return 0===n.length?(0,s.jsx)(d.Z,{sx:{p:2},children:(0,s.jsx)(u.Z,{variant:"body2",color:"text.secondary",children:"No changes"})}):(0,s.jsxs)(d.Z,{sx:{height:"100%",overflow:"auto",borderRight:1,borderColor:"divider"},role:"tree","aria-label":"Changed files",children:[(0,s.jsxs)(u.Z,{variant:"caption",sx:{display:"block",px:2,py:1,color:"text.secondary",fontWeight:"medium",letterSpacing:"0.08em",textTransform:"uppercase",borderBottom:1,borderColor:"divider",bgcolor:"background.paper"},children:["Changed Files (",n.length,")"]}),(0,s.jsx)(b.Z,{dense:!0,disablePadding:!0,role:"group",children:n.map((e,n)=>{let a=function(e){switch(e){case"added":return{icon:(0,s.jsx)(z.Z,{fontSize:"small"}),color:"success.main",label:"Added"};case"modified":return{icon:(0,s.jsx)(D.Z,{fontSize:"small"}),color:"warning.main",label:"Modified"};case"deleted":return{icon:(0,s.jsx)(A.Z,{fontSize:"small"}),color:"error.main",label:"Deleted"}}}(e.status),r=function(e){let n=e.split("/");return n[n.length-1]}(e.path),o=function(e){let n=e.split("/");return n.length<=1?"":n.slice(0,-1).join("/")}(e.path),c=t===e.path;return(0,s.jsx)(w.Z,{title:"".concat(a.label,": ").concat(e.path),placement:"right",children:(0,s.jsxs)(C.Z,{selected:c,onClick:()=>l(e.path),onKeyDown:t=>i(t,e.path,n),role:"treeitem","aria-selected":c,"aria-label":"".concat(e.path," - ").concat(a.label),sx:{py:.75,"&.Mui-selected":{bgcolor:"action.selected"}},children:[(0,s.jsx)(S.Z,{sx:{minWidth:32,color:a.color},children:a.icon}),(0,s.jsx)(k.Z,{primary:r,secondary:o||void 0,primaryTypographyProps:{variant:"body2",sx:{fontFamily:"monospace",fontSize:"0.8rem",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},secondaryTypographyProps:{variant:"caption",sx:{fontFamily:"monospace",fontSize:"0.7rem",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}})]})},e.path)})})]})}var P=t(20876),F=t(25333);let I=(0,P.default)(()=>t.e(271).then(t.bind(t,40271)),{loadableGenerated:{webpack:()=>[null]},ssr:!1});function W(e){var n,t;let{change:a,viewMode:l,fileRef:i}=e,r="added"===a.status?"":null!==(n=a.oldContent)&&void 0!==n?n:"",o="deleted"===a.status?"":null!==(t=a.newContent)&&void 0!==t?t:"";return(0,s.jsxs)(d.Z,{ref:i,sx:{mb:3},"data-file-path":a.path,id:"diff-file-".concat(a.path.replace(/[^a-zA-Z0-9]/g,"-")),children:[(0,s.jsxs)(d.Z,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1,bgcolor:"background.default",borderTop:1,borderBottom:1,borderColor:"divider",position:"sticky",top:0,zIndex:1},children:[function(e){switch(e){case"added":return(0,s.jsx)(z.Z,{fontSize:"small",sx:{color:"success.main"}});case"modified":return(0,s.jsx)(D.Z,{fontSize:"small",sx:{color:"warning.main"}});case"deleted":return(0,s.jsx)(A.Z,{fontSize:"small",sx:{color:"error.main"}})}}(a.status),(0,s.jsx)(u.Z,{variant:"body2",sx:{fontFamily:"monospace",fontWeight:"bold",flex:1},children:a.path}),(0,s.jsx)(F.Z,{label:function(e){switch(e){case"added":return"added";case"modified":return"modified";case"deleted":return"deleted"}}(a.status),size:"small",color:function(e){switch(e){case"added":return"success";case"modified":return"warning";case"deleted":return"error"}}(a.status),variant:"outlined"})]}),(0,s.jsx)(d.Z,{sx:{fontSize:"0.8rem",overflow:"auto"},children:(0,s.jsx)(I,{oldValue:r,newValue:o,splitView:"split"===l,useDarkTheme:!0,hideLineNumbers:!1,showDiffOnly:!0,styles:{variables:{dark:{diffViewerBackground:"#1a1a1a",addedBackground:"#1a3a1a",addedColor:"#4caf50",removedBackground:"#3a1a1a",removedColor:"#f44336",wordAddedBackground:"#2d5a2d",wordRemovedBackground:"#5a2d2d",emptyLineBackground:"#1a1a1a",gutterBackground:"#111",gutterColor:"#555",codeFoldBackground:"#111",codeFoldGutterBackground:"#111"}}}})})]})}function T(e){let{changes:n,selectedFile:t,viewMode:l}=e,i=(0,a.useRef)(new Map),r=(0,a.useRef)(null);return((0,a.useEffect)(()=>{if(t&&i.current.has(t)){let e=i.current.get(t);null==e||e.scrollIntoView({behavior:"smooth",block:"start"})}},[t]),0===n.length)?(0,s.jsx)(d.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",p:4},children:(0,s.jsx)(u.Z,{variant:"body1",color:"text.secondary",children:"No differences between these snapshots"})}):(0,s.jsx)(d.Z,{ref:r,sx:{height:"100%",overflow:"auto","& table":{width:"100%"}},children:n.map((e,t)=>(0,s.jsxs)(d.Z,{children:[(0,s.jsx)(W,{change:e,viewMode:l,fileRef:n=>{n?i.current.set(e.path,n):i.current.delete(e.path)}}),t<n.length-1&&(0,s.jsx)(p.Z,{})]},e.path))})}var E=t(89923),N=t(10297),R=t(98874),M=t(23345);function q(e){let{value:n,onChange:t}=e;return(0,s.jsxs)(N.Z,{value:n,exclusive:!0,onChange:(e,n)=>{null!==n&&t(n)},"aria-label":"Diff view mode",size:"small",children:[(0,s.jsx)(w.Z,{title:"Unified diff view",children:(0,s.jsx)(E.Z,{value:"unified","aria-label":"Unified view",children:(0,s.jsx)(R.Z,{fontSize:"small"})})}),(0,s.jsx)(w.Z,{title:"Side-by-side diff view",children:(0,s.jsx)(E.Z,{value:"split","aria-label":"Split view",children:(0,s.jsx)(M.Z,{fontSize:"small"})})})]})}var L=t(32366),U=t(45813),H=t(21111);function O(e){let{summary:n}=e,{added:t,modified:a,deleted:l}=n;return 0===t+a+l?(0,s.jsx)(d.Z,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1,borderTop:1,borderColor:"divider",bgcolor:"background.paper"},children:(0,s.jsx)(u.Z,{variant:"body2",color:"text.secondary",children:"No differences found between snapshots"})}):(0,s.jsxs)(d.Z,{sx:{display:"flex",alignItems:"center",gap:1.5,px:2,py:1,borderTop:1,borderColor:"divider",bgcolor:"background.paper",flexWrap:"wrap"},role:"status","aria-label":"Summary: ".concat(t," added, ").concat(a," modified, ").concat(l," deleted"),children:[(0,s.jsx)(u.Z,{variant:"caption",color:"text.secondary",sx:{fontWeight:"medium"},children:"Summary:"}),a>0&&(0,s.jsx)(F.Z,{icon:(0,s.jsx)(U.Z,{sx:{fontSize:"0.875rem"}}),label:"".concat(a," modified"),size:"small",sx:{bgcolor:"warning.dark",color:"warning.contrastText","& .MuiChip-icon":{color:"warning.contrastText"}}}),t>0&&(0,s.jsx)(F.Z,{icon:(0,s.jsx)(L.Z,{sx:{fontSize:"0.875rem"}}),label:"".concat(t," added"),size:"small",sx:{bgcolor:"success.dark",color:"success.contrastText","& .MuiChip-icon":{color:"success.contrastText"}}}),l>0&&(0,s.jsx)(F.Z,{icon:(0,s.jsx)(H.Z,{sx:{fontSize:"0.875rem"}}),label:"".concat(l," deleted"),size:"small",sx:{bgcolor:"error.dark",color:"error.contrastText","& .MuiChip-icon":{color:"error.contrastText"}}})]})}function K(e){return new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(e))}function V(e){var n;let{open:t,snapshotA:b,snapshotB:C,onClose:S,onRestoreA:k}=e,w=(0,j.Z)(),z=(0,f.Z)(w.breakpoints.down("md")),[D,A]=(0,a.useState)(void 0),[P,F]=(0,a.useState)("unified"),{data:I,isLoading:W,isError:E,error:N}=(0,y.m)(b.id,C.id,{enabled:t});(0,a.useEffect)(()=>{t&&(A(void 0),F("unified"))},[t,z]),(0,a.useEffect)(()=>{(null==I?void 0:I.changes)&&I.changes.length>0&&!D&&A(I.changes[0].path)},[I,D]);let R=(0,a.useCallback)(e=>{"Escape"===e.key&&S()},[S]);(0,a.useEffect)(()=>{if(t)return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[t,R]);let M=(0,a.useCallback)(e=>{A(e)},[]),L=(0,a.useCallback)(()=>{null==k||k(b),S()},[k,b,S]);return(0,s.jsxs)(i.Z,{open:t,onClose:S,maxWidth:"xl",fullWidth:!0,fullScreen:z,"aria-labelledby":"config-diff-dialog-title",PaperProps:{sx:{height:z?"100%":"90vh",maxHeight:z?"100%":"90vh",display:"flex",flexDirection:"column"}},children:[(0,s.jsxs)(r.Z,{id:"config-diff-dialog-title",sx:{display:"flex",alignItems:"center",gap:1,pb:1,flexShrink:0},children:[(0,s.jsx)(v.Z,{color:"primary"}),(0,s.jsxs)(d.Z,{sx:{flex:1},children:[(0,s.jsx)(u.Z,{variant:"h6",component:"span",children:"Config Diff"}),(0,s.jsxs)(u.Z,{variant:"body2",color:"text.secondary",sx:{display:"block",mt:.25},children:["Snapshot A: ",K(b.createdAt),(0,s.jsx)(d.Z,{component:"span",sx:{mx:1},children:"vs"}),"Snapshot B: ",K(C.createdAt)]})]}),(0,s.jsx)(q,{value:P,onChange:F}),(0,s.jsx)(m.Z,{onClick:S,"aria-label":"Close diff dialog",size:"small",sx:{ml:1},children:(0,s.jsx)(g.Z,{})})]}),(0,s.jsx)(p.Z,{}),(0,s.jsxs)(o.Z,{sx:{flex:1,overflow:"hidden",display:"flex",flexDirection:"column",p:0},children:[W&&(0,s.jsxs)(d.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center",flex:1,gap:2},children:[(0,s.jsx)(x.Z,{size:24}),(0,s.jsx)(u.Z,{variant:"body2",color:"text.secondary",children:"Loading diff..."})]}),E&&(0,s.jsx)(d.Z,{sx:{p:2},children:(0,s.jsxs)(h.Z,{severity:"error",children:["Failed to load diff: ",null!==(n=null==N?void 0:N.message)&&void 0!==n?n:"Unknown error"]})}),I&&(0,s.jsxs)(d.Z,{sx:{flex:1,display:"flex",flexDirection:{xs:"column",md:"row"},overflow:"hidden"},children:[(0,s.jsx)(d.Z,{sx:{width:{xs:"100%",md:220},flexShrink:0,height:{xs:"auto",md:"100%"},maxHeight:{xs:160,md:"none"},overflow:"auto"},children:(0,s.jsx)(B,{changes:I.changes,selectedFile:D,onSelectFile:M})}),(0,s.jsx)(p.Z,{orientation:z?"horizontal":"vertical"}),(0,s.jsx)(d.Z,{sx:{flex:1,overflow:"auto"},children:(0,s.jsx)(T,{changes:I.changes,selectedFile:D,viewMode:P})})]})]}),I&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(p.Z,{}),(0,s.jsx)(O,{summary:I.summary})]}),(0,s.jsx)(p.Z,{}),(0,s.jsxs)(c.Z,{sx:{px:2,py:1.5,flexShrink:0},children:[k&&(0,s.jsx)(l.Z,{onClick:L,variant:"outlined",color:"warning",startIcon:(0,s.jsx)(Z.Z,{}),disabled:W,children:"Restore to Snapshot A"}),(0,s.jsx)(d.Z,{sx:{flex:1}}),(0,s.jsx)(l.Z,{onClick:S,variant:"contained",children:"Close"})]})]})}},56831:function(e,n,t){t.d(n,{zO:function(){return P},Fb:function(){return et},JZ:function(){return W},Ff:function(){return G},Xj:function(){return h},zg:function(){return eZ},Dm:function(){return ed},gE:function(){return ey},ed:function(){return eh.e}});var s=t(94655),a=t(628),l=t(41565),i=t(31317),r=t(7281),o=t(25333),c=t(46207),d=t(43436),u=t(92666);function h(){let{data:e,isLoading:n,error:t}=(0,u.mj)();if(n)return(0,s.jsx)(a.Z,{children:(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(i.Z,{variant:"h6",gutterBottom:!0,children:"Backup Status"}),(0,s.jsx)(i.Z,{color:"text.secondary",children:"Loading..."})]})});if(t)return(0,s.jsx)(a.Z,{children:(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(i.Z,{variant:"h6",gutterBottom:!0,children:"Backup Status"}),(0,s.jsx)(i.Z,{color:"error",children:"Failed to load backup status"})]})});let{configured:h,lastBackup:x,repository:m}=e||{};return(0,s.jsx)(a.Z,{children:(0,s.jsxs)(l.Z,{children:[(0,s.jsxs)(r.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,s.jsx)(i.Z,{variant:"h6",children:"Backup Status"}),(0,s.jsx)(o.Z,{icon:h?(0,s.jsx)(c.Z,{}):(0,s.jsx)(d.Z,{}),label:h?"Configured":"Not Configured",color:h?"success":"error",size:"small"})]}),h?(0,s.jsxs)(r.Z,{sx:{display:"flex",flexDirection:"column",gap:1},children:[m&&(0,s.jsxs)(r.Z,{children:[(0,s.jsx)(i.Z,{variant:"caption",color:"text.secondary",children:"Repository"}),(0,s.jsx)(i.Z,{variant:"body2",sx:{fontFamily:"monospace",fontSize:"0.875rem"},children:m})]}),x&&(0,s.jsxs)(r.Z,{children:[(0,s.jsx)(i.Z,{variant:"caption",color:"text.secondary",children:"Last Backup"}),(0,s.jsx)(i.Z,{variant:"body2",children:function(e){let n=new Date,t=new Date(e),s=Math.floor((n.getTime()-t.getTime())/6e4),a=Math.floor(s/60);return s<1?"just now":s<60?"".concat(s," minutes ago"):a<24?"".concat(a," hours ago"):"".concat(Math.floor(a/24)," days ago")}(x)})]}),!x&&(0,s.jsx)(i.Z,{variant:"body2",color:"text.secondary",children:"No backups yet"})]}):(0,s.jsx)(i.Z,{variant:"body2",color:"text.secondary",children:"GitHub backup is not configured. Please configure BACKUP_REPO_URL in your environment."})]})})}var x=t(35106),m=t(21138),p=t(84811),f=t(47001),j=t(53281),g=t(11254),Z=t(70366),v=t(79983),y=t(97731),b=t(30417),C=t(99770),S=t(76678),k=t(5682),w=t(65087),z=t(62508),D=t(81071),A=t(93017);function B(e){var n;let{open:t,commit:a,onClose:l}=e,{mutate:o,isPending:c}=(0,u.s8)(),[d,h]=(0,x.useState)(""),[m,p]=(0,x.useState)(""),f=()=>{c||(h(""),p(""),l())};return(0,s.jsxs)(C.Z,{open:t,onClose:f,maxWidth:"sm",fullWidth:!0,children:[(0,s.jsx)(z.Z,{children:"Restore Backup"}),(0,s.jsxs)(k.Z,{children:[(0,s.jsx)(D.Z,{severity:"warning",sx:{mb:2},children:"This will restore all worlds from the selected backup. Current world data will be overwritten."}),d&&(0,s.jsx)(D.Z,{severity:"success",sx:{mb:2},children:d}),m&&(0,s.jsx)(D.Z,{severity:"error",sx:{mb:2},children:m}),(0,s.jsx)(w.Z,{sx:{mb:2},children:"Are you sure you want to restore from this backup?"}),(0,s.jsxs)(r.Z,{sx:{display:"flex",flexDirection:"column",gap:1},children:[(0,s.jsxs)(r.Z,{children:[(0,s.jsx)(i.Z,{variant:"caption",color:"text.secondary",children:"Commit Hash"}),(0,s.jsx)(i.Z,{variant:"body2",sx:{fontFamily:"monospace",fontSize:"0.875rem"},children:a.hash})]}),(0,s.jsxs)(r.Z,{children:[(0,s.jsx)(i.Z,{variant:"caption",color:"text.secondary",children:"Date"}),(0,s.jsx)(i.Z,{variant:"body2",children:(n=a.date,new Intl.DateTimeFormat(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date(n)))})]}),(0,s.jsxs)(r.Z,{children:[(0,s.jsx)(i.Z,{variant:"caption",color:"text.secondary",children:"Message"}),(0,s.jsx)(i.Z,{variant:"body2",children:a.message})]}),(0,s.jsxs)(r.Z,{children:[(0,s.jsx)(i.Z,{variant:"caption",color:"text.secondary",children:"Author"}),(0,s.jsx)(i.Z,{variant:"body2",children:a.author})]})]})]}),(0,s.jsxs)(S.Z,{children:[(0,s.jsx)(b.Z,{onClick:f,disabled:c,children:"Cancel"}),(0,s.jsx)(b.Z,{onClick:()=>{h(""),p(""),o(a.hash,{onSuccess:()=>{h("Backup restored successfully from ".concat(a.hash.substring(0,7))),setTimeout(()=>{l()},2e3)},onError:e=>{p("Failed to restore backup: ".concat(e.message))}})},variant:"contained",color:"warning",disabled:c,startIcon:c?(0,s.jsx)(A.Z,{size:16}):(0,s.jsx)(y.Z,{}),children:c?"Restoring...":"Restore"})]})]})}function P(){let{data:e,isLoading:n,error:t}=(0,u.$t)(20),[r,c]=(0,x.useState)(null),d=e=>{c(e)};if(n)return(0,s.jsx)(a.Z,{children:(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(i.Z,{variant:"h6",gutterBottom:!0,children:"Backup History"}),(0,s.jsx)(i.Z,{color:"text.secondary",children:"Loading..."})]})});if(t)return(0,s.jsx)(a.Z,{children:(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(i.Z,{variant:"h6",gutterBottom:!0,children:"Backup History"}),(0,s.jsx)(i.Z,{color:"error",children:"Failed to load backup history"})]})});let h=(null==e?void 0:e.commits)||[];return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a.Z,{children:(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(i.Z,{variant:"h6",gutterBottom:!0,children:"Backup History"}),0===h.length?(0,s.jsx)(i.Z,{color:"text.secondary",children:"No backup history available"}):(0,s.jsx)(j.Z,{children:(0,s.jsxs)(m.Z,{children:[(0,s.jsx)(g.Z,{children:(0,s.jsxs)(Z.Z,{children:[(0,s.jsx)(f.Z,{children:"Commit"}),(0,s.jsx)(f.Z,{children:"Date"}),(0,s.jsx)(f.Z,{children:"Message"}),(0,s.jsx)(f.Z,{children:"Author"}),(0,s.jsx)(f.Z,{align:"right",children:"Actions"})]})}),(0,s.jsx)(p.Z,{children:h.map(e=>{var n;return(0,s.jsxs)(Z.Z,{children:[(0,s.jsx)(f.Z,{children:(0,s.jsx)(o.Z,{label:e.hash.substring(0,7),size:"small",variant:"outlined",sx:{fontFamily:"monospace"}})}),(0,s.jsx)(f.Z,{children:(0,s.jsx)(i.Z,{variant:"body2",children:(n=e.date,new Intl.DateTimeFormat(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(new Date(n)))})}),(0,s.jsx)(f.Z,{children:(0,s.jsx)(i.Z,{variant:"body2",children:e.message})}),(0,s.jsx)(f.Z,{children:(0,s.jsx)(i.Z,{variant:"body2",color:"text.secondary",children:e.author})}),(0,s.jsx)(f.Z,{align:"right",children:(0,s.jsx)(v.Z,{size:"small",color:"primary",onClick:()=>d(e),title:"Restore this backup",children:(0,s.jsx)(y.Z,{})})})]},e.hash)})})]})})]})}),r&&(0,s.jsx)(B,{open:!!r,commit:r,onClose:()=>{c(null)}})]})}var F=t(97436),I=t(34675);function W(e){let{disabled:n}=e,[t,a]=(0,x.useState)(!1),[l,i]=(0,x.useState)(""),[r,o]=(0,x.useState)(""),[c,d]=(0,x.useState)(""),{mutate:h,isPending:m}=(0,u.c5)(),p=()=>{m||(a(!1),i(""),o(""),d(""))};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(b.Z,{variant:"contained",startIcon:(0,s.jsx)(I.Z,{}),onClick:()=>{a(!0),o(""),d(""),i("Backup ".concat(new Date().toISOString().split("T")[0]))},disabled:n||m,children:"Push Backup"}),(0,s.jsxs)(C.Z,{open:t,onClose:p,maxWidth:"sm",fullWidth:!0,children:[(0,s.jsx)(z.Z,{children:"Push Backup"}),(0,s.jsxs)(k.Z,{children:[r&&(0,s.jsx)(D.Z,{severity:"success",sx:{mb:2},children:r}),c&&(0,s.jsx)(D.Z,{severity:"error",sx:{mb:2},children:c}),(0,s.jsx)(F.Z,{autoFocus:!0,margin:"dense",label:"Commit Message",type:"text",fullWidth:!0,variant:"outlined",value:l,onChange:e=>i(e.target.value),disabled:m,helperText:"Optional message describing this backup"})]}),(0,s.jsxs)(S.Z,{children:[(0,s.jsx)(b.Z,{onClick:p,disabled:m,children:"Cancel"}),(0,s.jsx)(b.Z,{onClick:()=>{o(""),d(""),h({message:l||void 0},{onSuccess:e=>{o(e.commitHash?"Backup pushed successfully (".concat(e.commitHash.substring(0,7),")"):"Backup pushed successfully"),setTimeout(()=>{p()},2e3)},onError:e=>{d("Failed to push backup: ".concat(e.message))}})},variant:"contained",disabled:m,startIcon:m?(0,s.jsx)(A.Z,{size:16}):(0,s.jsx)(I.Z,{}),children:m?"Pushing...":"Push"})]})]})]})}var T=t(38393),E=t(70115),N=t(95511),R=t(69123),M=t(32366),q=t(45813),L=t(21111),U=t(54211),H=t(29793),O=t(75726),K=t(62328),V=t(7178);let $=[{label:"Every hour",value:"0 * * * *"},{label:"Every 6 hours",value:"0 */6 * * *"},{label:"Every 12 hours",value:"0 */12 * * *"},{label:"Daily at 3 AM",value:"0 3 * * *"},{label:"Weekly (Sunday 3 AM)",value:"0 3 * * 0"},{label:"Custom",value:"custom"}];function J(e){let{open:n,schedule:t,onClose:a}=e,l=(0,u.tT)(),c=(0,u.CA)(),d=!!t,[h,m]=(0,x.useState)(""),[p,f]=(0,x.useState)(""),[j,g]=(0,x.useState)(""),[Z,v]=(0,x.useState)(""),[y,w]=(0,x.useState)(""),[A,B]=(0,x.useState)("");(0,x.useEffect)(()=>{if(n){if(t){var e,s,a,l;m(t.name);let n=$.find(e=>e.value===t.cronExpression);n?(f(n.value),g("")):(f("custom"),g(t.cronExpression)),v(null!==(a=null===(e=t.retentionPolicy.maxCount)||void 0===e?void 0:e.toString())&&void 0!==a?a:""),w(null!==(l=null===(s=t.retentionPolicy.maxAgeDays)||void 0===s?void 0:s.toString())&&void 0!==l?l:"")}else m(""),f("0 3 * * *"),g(""),v("10"),w("30");B("")}},[n,t]);let P=()=>"custom"===p?j.trim():p,I=async()=>{B("");let e=P();if(!h.trim()){B("Name is required");return}if(!e){B("Cron expression is required");return}try{d&&t?await c.mutateAsync({id:t.id,data:{name:h.trim(),cron:e,...Z?{maxCount:parseInt(Z,10)}:{},...y?{maxAgeDays:parseInt(y,10)}:{}}}):await l.mutateAsync({name:h.trim(),cron:e,...Z?{maxCount:parseInt(Z,10)}:{},...y?{maxAgeDays:parseInt(y,10)}:{},enabled:!0}),a()}catch(e){B(e.message||"Failed to save schedule")}},W=l.isPending||c.isPending;return(0,s.jsxs)(C.Z,{open:n,onClose:a,maxWidth:"sm",fullWidth:!0,children:[(0,s.jsx)(z.Z,{children:d?"Edit Backup Schedule":"Create Backup Schedule"}),(0,s.jsx)(k.Z,{children:(0,s.jsxs)(E.Z,{spacing:2.5,sx:{mt:1},children:[A&&(0,s.jsx)(D.Z,{severity:"error",onClose:()=>B(""),children:A}),(0,s.jsx)(F.Z,{label:"Schedule Name",value:h,onChange:e=>m(e.target.value),fullWidth:!0,required:!0,placeholder:"e.g., Daily backup, Hourly snapshot",autoFocus:!0}),(0,s.jsxs)(H.Z,{fullWidth:!0,children:[(0,s.jsx)(O.Z,{children:"Schedule Frequency"}),(0,s.jsx)(K.Z,{value:p,onChange:e=>f(e.target.value),label:"Schedule Frequency",children:$.map(e=>(0,s.jsxs)(V.Z,{value:e.value,children:[e.label,"custom"!==e.value&&(0,s.jsx)(o.Z,{label:e.value,size:"small",variant:"outlined",sx:{ml:1,fontFamily:"monospace",fontSize:"0.75rem"}})]},e.value))})]}),"custom"===p&&(0,s.jsx)(F.Z,{label:"Cron Expression",value:j,onChange:e=>g(e.target.value),fullWidth:!0,required:!0,placeholder:"e.g., 0 */6 * * *",helperText:"Format: minute hour day-of-month month day-of-week",InputProps:{sx:{fontFamily:"monospace"}}}),(0,s.jsx)(i.Z,{variant:"subtitle2",color:"text.secondary",sx:{mt:1},children:"Retention Policy (optional)"}),(0,s.jsxs)(r.Z,{sx:{display:"flex",gap:2},children:[(0,s.jsx)(F.Z,{label:"Max Backup Count",type:"number",value:Z,onChange:e=>v(e.target.value),fullWidth:!0,placeholder:"e.g., 10",inputProps:{min:1},helperText:"Keep at most N backups"}),(0,s.jsx)(F.Z,{label:"Max Age (days)",type:"number",value:y,onChange:e=>w(e.target.value),fullWidth:!0,placeholder:"e.g., 30",inputProps:{min:1},helperText:"Delete backups older than N days"})]})]})}),(0,s.jsxs)(S.Z,{children:[(0,s.jsx)(b.Z,{onClick:a,disabled:W,children:"Cancel"}),(0,s.jsx)(b.Z,{onClick:I,variant:"contained",disabled:W,children:W?"Saving...":d?"Update":"Create"})]})]})}function Q(e){let n=new Date,t=new Date(e),s=Math.floor((n.getTime()-t.getTime())/6e4),a=Math.floor(s/60);return s<1?"just now":s<60?"".concat(s,"m ago"):a<24?"".concat(a,"h ago"):"".concat(Math.floor(a/24),"d ago")}function _(e){let{schedule:n,onEdit:t,onDelete:a,onToggle:l,toggleLoading:u}=e;return(0,s.jsxs)(r.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",py:1.5,px:1,"&:hover":{bgcolor:"action.hover",borderRadius:1}},children:[(0,s.jsxs)(r.Z,{sx:{display:"flex",alignItems:"center",gap:2,flex:1,minWidth:0},children:[(0,s.jsx)(U.Z,{color:n.enabled?"primary":"disabled"}),(0,s.jsxs)(r.Z,{sx:{minWidth:0},children:[(0,s.jsx)(i.Z,{variant:"body1",fontWeight:"medium",noWrap:!0,children:n.name}),(0,s.jsxs)(i.Z,{variant:"caption",color:"text.secondary",noWrap:!0,children:[n.cronHumanReadable," (",n.cronExpression,")"]})]})]}),(0,s.jsxs)(r.Z,{sx:{display:"flex",alignItems:"center",gap:1.5,flexShrink:0},children:[n.lastRunStatus&&(0,s.jsx)(N.Z,{title:n.lastRunMessage?"".concat(n.lastRunAt?Q(n.lastRunAt):"",": ").concat(n.lastRunMessage):n.lastRunAt?Q(n.lastRunAt):"",children:(0,s.jsx)(o.Z,{icon:"success"===n.lastRunStatus?(0,s.jsx)(c.Z,{sx:{fontSize:16}}):(0,s.jsx)(d.Z,{sx:{fontSize:16}}),label:"success"===n.lastRunStatus?"OK":"Failed",size:"small",color:"success"===n.lastRunStatus?"success":"error",variant:"outlined"})}),(n.retentionPolicy.maxCount||n.retentionPolicy.maxAgeDays)&&(0,s.jsx)(N.Z,{title:[n.retentionPolicy.maxCount&&"Max ".concat(n.retentionPolicy.maxCount," backups"),n.retentionPolicy.maxAgeDays&&"Max ".concat(n.retentionPolicy.maxAgeDays," days")].filter(Boolean).join(", "),children:(0,s.jsx)(o.Z,{label:"Retention",size:"small",variant:"outlined",color:"info"})}),(0,s.jsx)(N.Z,{title:n.enabled?"Disable schedule":"Enable schedule",children:(0,s.jsx)(T.Z,{size:"small",checked:n.enabled,onChange:(e,t)=>l(n,t),disabled:u})}),(0,s.jsx)(N.Z,{title:"Edit schedule",children:(0,s.jsx)(v.Z,{size:"small",onClick:()=>t(n),children:(0,s.jsx)(q.Z,{fontSize:"small"})})}),(0,s.jsx)(N.Z,{title:"Delete schedule",children:(0,s.jsx)(v.Z,{size:"small",color:"error",onClick:()=>a(n),children:(0,s.jsx)(L.Z,{fontSize:"small"})})})]})]})}function G(){var e;let{data:n,isLoading:t,error:o}=(0,u.d)(),c=(0,u.c1)(),d=(0,u.JV)(),[h,m]=(0,x.useState)(!1),[p,f]=(0,x.useState)(null),[j,g]=(0,x.useState)(!1),[Z,v]=(0,x.useState)(null),y=e=>{f(e),m(!0)},w=e=>{v(e),g(!0)},A=async()=>{if(Z)try{await d.mutateAsync(Z.id)}catch(e){}g(!1),v(null)},B=(e,n)=>{c.mutate({id:e.id,enabled:n})};if(t)return(0,s.jsx)(a.Z,{children:(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(i.Z,{variant:"h6",gutterBottom:!0,children:"Backup Schedules"}),(0,s.jsx)(i.Z,{color:"text.secondary",children:"Loading..."})]})});if(o)return(0,s.jsx)(a.Z,{children:(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(i.Z,{variant:"h6",gutterBottom:!0,children:"Backup Schedules"}),(0,s.jsx)(D.Z,{severity:"error",children:"Failed to load backup schedules"})]})});let P=null!==(e=null==n?void 0:n.schedules)&&void 0!==e?e:[];return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a.Z,{children:(0,s.jsxs)(l.Z,{children:[(0,s.jsxs)(r.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,s.jsxs)(r.Z,{children:[(0,s.jsx)(i.Z,{variant:"h6",children:"Backup Schedules"}),(0,s.jsx)(i.Z,{variant:"caption",color:"text.secondary",children:"Automated cron-based backup scheduling"})]}),(0,s.jsx)(b.Z,{variant:"contained",size:"small",startIcon:(0,s.jsx)(M.Z,{}),onClick:()=>{f(null),m(!0)},children:"Add Schedule"})]}),0===P.length?(0,s.jsxs)(r.Z,{sx:{textAlign:"center",py:4},children:[(0,s.jsx)(U.Z,{sx:{fontSize:48,color:"text.disabled",mb:1}}),(0,s.jsx)(i.Z,{color:"text.secondary",children:"No backup schedules configured"}),(0,s.jsx)(i.Z,{variant:"caption",color:"text.secondary",children:"Create a schedule to automatically back up your worlds"})]}):(0,s.jsx)(E.Z,{divider:(0,s.jsx)(R.Z,{}),children:P.map(e=>(0,s.jsx)(_,{schedule:e,onEdit:y,onDelete:w,onToggle:B,toggleLoading:c.isPending},e.id))})]})}),(0,s.jsx)(J,{open:h,schedule:p,onClose:()=>{m(!1),f(null)}}),(0,s.jsxs)(C.Z,{open:j,onClose:()=>g(!1),children:[(0,s.jsx)(z.Z,{children:"Delete Backup Schedule"}),(0,s.jsx)(k.Z,{children:(0,s.jsxs)(i.Z,{children:['Are you sure you want to delete the schedule "',null==Z?void 0:Z.name,'"? This action cannot be undone.']})}),(0,s.jsxs)(S.Z,{children:[(0,s.jsx)(b.Z,{onClick:()=>g(!1),children:"Cancel"}),(0,s.jsx)(b.Z,{onClick:A,color:"error",variant:"contained",disabled:d.isPending,children:d.isPending?"Deleting...":"Delete"})]})]})]})}var Y=t(33402),X=t(60097),ee=t(91606),en=t(45420);function et(e){let{value:n,onChange:t}=e;return(0,s.jsx)(r.Z,{sx:{borderBottom:1,borderColor:"divider",mb:3},children:(0,s.jsxs)(Y.Z,{value:n,onChange:(e,n)=>t(n),"aria-label":"Backup management tabs",children:[(0,s.jsx)(X.Z,{value:"world-backups",label:"World Backups",icon:(0,s.jsx)(ee.Z,{}),iconPosition:"start",sx:{textTransform:"none",fontWeight:"medium"}}),(0,s.jsx)(X.Z,{value:"config-snapshots",label:"Config Snapshots",icon:(0,s.jsx)(en.Z,{}),iconPosition:"start",sx:{textTransform:"none",fontWeight:"medium"}})]})})}var es=t(73517),ea=t(87739),el=t(12063),ei=t(88978),er=t(27171),eo=t(80620),ec=t(86071);function ed(e){let{serverName:n,snapshots:t,totalCount:d,schedule:u,onViewHistory:h,onCreateSnapshot:x,onViewDiff:m}=e,p=t.length>0?t[0]:null,f=t.length>=2;return(0,s.jsx)(a.Z,{variant:"outlined",sx:{"&:hover":{borderColor:"primary.main"}},children:(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(r.Z,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between"},children:(0,s.jsxs)(r.Z,{sx:{display:"flex",alignItems:"center",gap:1.5,mb:1},children:[(0,s.jsx)(er.Z,{color:"primary"}),(0,s.jsx)(i.Z,{variant:"h6",component:"h3",fontWeight:"bold",children:n})]})}),(0,s.jsxs)(E.Z,{direction:"row",spacing:2,sx:{mb:2,flexWrap:"wrap",gap:1},children:[p?(0,s.jsx)(N.Z,{title:"Latest: ".concat(new Date(p.createdAt).toLocaleString()),children:(0,s.jsx)(o.Z,{icon:(0,s.jsx)(eo.Z,{sx:{fontSize:16}}),label:"Latest: ".concat(function(e){let n=new Date,t=new Date(e),s=Math.floor((n.getTime()-t.getTime())/6e4),a=Math.floor(s/60),l=Math.floor(a/24);return s<1?"just now":s<60?"".concat(s,"m ago"):a<24?"".concat(a,"h ago"):l<30?"".concat(l,"d ago"):t.toLocaleDateString()}(p.createdAt)),size:"small",variant:"outlined"})}):(0,s.jsx)(o.Z,{label:"No snapshots yet",size:"small",variant:"outlined",color:"default"}),p&&(0,s.jsx)(o.Z,{label:"".concat(p.files.length," files"),size:"small",variant:"outlined",color:"info"}),(0,s.jsx)(o.Z,{label:"".concat(d," snapshot").concat(1!==d?"s":""," total"),size:"small",variant:"outlined"}),u?(0,s.jsx)(N.Z,{title:"Schedule: ".concat(u.name," (").concat(u.cronExpression,")"),children:(0,s.jsx)(o.Z,{icon:u.enabled?(0,s.jsx)(c.Z,{sx:{fontSize:16}}):(0,s.jsx)(U.Z,{sx:{fontSize:16}}),label:u.enabled?"Schedule: Active":"Schedule: Paused",size:"small",variant:"outlined",color:u.enabled?"success":"default"})}):(0,s.jsx)(o.Z,{label:"No schedule",size:"small",variant:"outlined",color:"default"})]}),(0,s.jsxs)(E.Z,{direction:"row",spacing:1,children:[(0,s.jsx)(N.Z,{title:d<2?"Need at least 2 snapshots to compare history":"",arrow:!0,children:(0,s.jsx)("span",{children:(0,s.jsx)(b.Z,{size:"small",variant:"outlined",startIcon:(0,s.jsx)(eo.Z,{}),onClick:()=>h(n),disabled:d<2,children:"View History"})})}),(0,s.jsx)(b.Z,{size:"small",variant:"outlined",startIcon:(0,s.jsx)(es.Z,{}),onClick:()=>x(n),children:"Create Snapshot"}),f&&(0,s.jsx)(b.Z,{size:"small",variant:"outlined",startIcon:(0,s.jsx)(ec.Z,{}),onClick:()=>m(n),children:"View Diff"})]})]})})}function eu(e){let{servers:n,snapshotsByServer:t,schedules:a,isLoading:l,error:o,onViewHistory:c,onCreateSnapshot:d,onViewDiff:u}=e,h=(0,x.useMemo)(()=>n.map(e=>{var n,s;let l=t.get(e.name),i=a.find(n=>n.serverName===e.name);return{serverName:e.name,snapshots:null!==(n=null==l?void 0:l.snapshots)&&void 0!==n?n:[],totalCount:null!==(s=null==l?void 0:l.total)&&void 0!==s?s:0,schedule:i}}),[n,t,a]);return l?(0,s.jsx)(r.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,s.jsx)(A.Z,{})}):o?(0,s.jsxs)(D.Z,{severity:"error",children:["Failed to load config snapshots: ",o.message]}):0===n.length?(0,s.jsxs)(r.Z,{sx:{textAlign:"center",py:6},children:[(0,s.jsx)(en.Z,{sx:{fontSize:48,color:"text.disabled",mb:1}}),(0,s.jsx)(i.Z,{color:"text.secondary",children:"No servers found"}),(0,s.jsx)(i.Z,{variant:"caption",color:"text.secondary",children:"Create a server to start taking config snapshots"})]}):(0,s.jsx)(E.Z,{spacing:2,children:h.map(e=>(0,s.jsx)(ed,{serverName:e.serverName,snapshots:e.snapshots,totalCount:e.totalCount,schedule:e.schedule,onViewHistory:c,onCreateSnapshot:d,onViewDiff:u},e.serverName))})}var eh=t(6516),ex=t(62142),em=t(71185);function ep(e){let{schedule:n,onEdit:t,onDelete:a,onToggle:l,toggleLoading:u}=e;return(0,s.jsxs)(r.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",py:1.5,px:1,"&:hover":{bgcolor:"action.hover",borderRadius:1}},children:[(0,s.jsxs)(r.Z,{sx:{display:"flex",alignItems:"center",gap:2,flex:1,minWidth:0},children:[(0,s.jsx)(U.Z,{color:n.enabled?"primary":"disabled"}),(0,s.jsxs)(r.Z,{sx:{minWidth:0},children:[(0,s.jsx)(i.Z,{variant:"body2",fontWeight:"medium",noWrap:!0,children:n.name}),(0,s.jsxs)(i.Z,{variant:"caption",color:"text.secondary",noWrap:!0,children:[n.serverName," | ",n.cronExpression," | Retain: ",n.retentionCount]})]})]}),(0,s.jsxs)(r.Z,{sx:{display:"flex",alignItems:"center",gap:1,flexShrink:0},children:[n.lastRunStatus&&(0,s.jsx)(N.Z,{title:n.lastRunAt?"Last run: ".concat(function(e){let n=new Date,t=new Date(e),s=Math.floor((n.getTime()-t.getTime())/6e4),a=Math.floor(s/60);return s<1?"just now":s<60?"".concat(s,"m ago"):a<24?"".concat(a,"h ago"):"".concat(Math.floor(a/24),"d ago")}(n.lastRunAt)," (").concat(n.lastRunStatus,")"):n.lastRunStatus,children:(0,s.jsx)(o.Z,{icon:"success"===n.lastRunStatus?(0,s.jsx)(c.Z,{sx:{fontSize:16}}):(0,s.jsx)(d.Z,{sx:{fontSize:16}}),label:"success"===n.lastRunStatus?"OK":"Failed",size:"small",color:"success"===n.lastRunStatus?"success":"error",variant:"outlined"})}),(0,s.jsx)(N.Z,{title:n.enabled?"Disable schedule":"Enable schedule",children:(0,s.jsx)(T.Z,{size:"small",checked:n.enabled,onChange:(e,t)=>l(n,t),disabled:u})}),(0,s.jsx)(N.Z,{title:"Edit schedule",children:(0,s.jsx)(v.Z,{size:"small",onClick:()=>t(n),children:(0,s.jsx)(q.Z,{fontSize:"small"})})}),(0,s.jsx)(N.Z,{title:"Delete schedule",children:(0,s.jsx)(v.Z,{size:"small",color:"error",onClick:()=>a(n),children:(0,s.jsx)(L.Z,{fontSize:"small"})})})]})]})}function ef(e){let{schedules:n,onEdit:t,onDelete:a,onToggle:l,toggleLoading:o}=e;return 0===n.length?(0,s.jsxs)(r.Z,{sx:{textAlign:"center",py:3},children:[(0,s.jsx)(U.Z,{sx:{fontSize:40,color:"text.disabled",mb:1}}),(0,s.jsx)(i.Z,{color:"text.secondary",variant:"body2",children:"No config snapshot schedules configured"})]}):(0,s.jsx)(E.Z,{divider:(0,s.jsx)(R.Z,{}),children:n.map(e=>(0,s.jsx)(ep,{schedule:e,onEdit:t,onDelete:a,onToggle:l,toggleLoading:o},e.id))})}let ej=[{label:"Every hour",value:"0 * * * *"},{label:"Every 6 hours",value:"0 */6 * * *"},{label:"Daily at midnight",value:"0 0 * * *"},{label:"Daily at 3 AM",value:"0 3 * * *"},{label:"Weekly (Sunday midnight)",value:"0 0 * * 0"},{label:"Custom",value:""}];function eg(e){var n;let{serverNames:t,editingSchedule:a,onSubmit:l,onUpdate:o,onCancel:c,isSubmitting:d,error:u}=e,h=!!a,[m,p]=(0,x.useState)((null==a?void 0:a.serverName)||""),[f,j]=(0,x.useState)((null==a?void 0:a.name)||""),[g,Z]=(0,x.useState)(""),[v,y]=(0,x.useState)((null==a?void 0:a.cronExpression)||"0 0 * * *"),[C,S]=(0,x.useState)(null!==(n=null==a?void 0:a.retentionCount)&&void 0!==n?n:10);(0,x.useEffect)(()=>{let e=ej.find(e=>e.value===v);Z(e?e.value:"")},[v]),(0,x.useEffect)(()=>{a?(p(a.serverName),j(a.name),y(a.cronExpression),S(a.retentionCount)):(p(""),j(""),y("0 0 * * *"),S(10))},[a]);let k=e=>{Z(e),e&&y(e)},w=(h||m)&&f.trim()&&v.trim();return(0,s.jsxs)(r.Z,{sx:{display:"flex",flexDirection:"column",gap:2},children:[(0,s.jsx)(i.Z,{variant:"subtitle2",color:"text.secondary",children:h?"Edit Schedule":"Create New Schedule"}),!h&&(0,s.jsxs)(H.Z,{fullWidth:!0,size:"small",required:!0,children:[(0,s.jsx)(O.Z,{children:"Server"}),(0,s.jsx)(K.Z,{value:m,onChange:e=>p(e.target.value),label:"Server",disabled:d,children:t.map(e=>(0,s.jsx)(V.Z,{value:e,children:e},e))})]}),(0,s.jsx)(F.Z,{label:"Schedule Name",value:f,onChange:e=>j(e.target.value),placeholder:"e.g., Daily config backup",size:"small",fullWidth:!0,required:!0,disabled:d}),(0,s.jsxs)(H.Z,{fullWidth:!0,size:"small",children:[(0,s.jsx)(O.Z,{children:"Cron Preset"}),(0,s.jsx)(K.Z,{value:g,onChange:e=>k(e.target.value),label:"Cron Preset",disabled:d,children:ej.map(e=>(0,s.jsx)(V.Z,{value:e.value,children:e.label},e.label))})]}),(0,s.jsx)(F.Z,{label:"Cron Expression",value:v,onChange:e=>y(e.target.value),placeholder:"0 0 * * *",size:"small",fullWidth:!0,required:!0,disabled:d,helperText:"Standard cron format: minute hour day month weekday"}),(0,s.jsx)(F.Z,{label:"Retention Count",type:"number",value:C,onChange:e=>S(Math.max(1,parseInt(e.target.value)||1)),size:"small",fullWidth:!0,disabled:d,helperText:"Maximum number of scheduled snapshots to keep per server",inputProps:{min:1,max:100}}),u&&(0,s.jsx)(D.Z,{severity:"error",sx:{py:0},children:u}),(0,s.jsxs)(r.Z,{sx:{display:"flex",gap:1,justifyContent:"flex-end"},children:[(0,s.jsx)(b.Z,{size:"small",onClick:c,disabled:d,children:"Cancel"}),(0,s.jsx)(b.Z,{size:"small",variant:"contained",onClick:()=>{h&&o?o({name:f.trim(),cronExpression:v,retentionCount:C}):l({serverName:m,name:f.trim(),cronExpression:v,retentionCount:C})},disabled:!w||d,children:d?"Saving...":h?"Update":"Create"})]})]})}function eZ(e){var n,t,a;let{open:l,onClose:o,serverNames:c,filterServerName:d}=e,{data:u,isLoading:h,error:m}=(0,ei.F$)(d),p=(0,ei.wh)(),f=(0,ei.Uw)(),j=(0,ei.DW)(),g=(0,ei.$C)(),[Z,y]=(0,x.useState)(!1),[w,B]=(0,x.useState)(null),[P,F]=(0,x.useState)(!1),[I,W]=(0,x.useState)(null),T=null!==(a=null==u?void 0:u.schedules)&&void 0!==a?a:[],E=async()=>{if(I)try{await g.mutateAsync(I.id)}catch(e){}F(!1),W(null)},N=async e=>{try{await p.mutateAsync({serverName:e.serverName,name:e.name,cronExpression:e.cronExpression,retentionCount:e.retentionCount}),y(!1)}catch(e){}},q=async e=>{if(w)try{await f.mutateAsync({id:w.id,data:e}),y(!1),B(null)}catch(e){}},L=(null===(n=p.error)||void 0===n?void 0:n.message)||(null===(t=f.error)||void 0===t?void 0:t.message)||null;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(ex.ZP,{anchor:"right",open:l,onClose:o,PaperProps:{sx:{width:{xs:"100%",sm:480},p:3}},children:[(0,s.jsxs)(r.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,s.jsx)(i.Z,{variant:"h6",fontWeight:"bold",children:"Config Snapshot Schedules"}),(0,s.jsx)(v.Z,{onClick:o,size:"small",children:(0,s.jsx)(em.Z,{})})]}),(0,s.jsx)(R.Z,{sx:{mb:2}}),!Z&&(0,s.jsx)(b.Z,{variant:"outlined",startIcon:(0,s.jsx)(M.Z,{}),onClick:()=>{B(null),y(!0)},fullWidth:!0,sx:{mb:2},children:"Add Schedule"}),Z&&(0,s.jsxs)(r.Z,{sx:{mb:2},children:[(0,s.jsx)(eg,{serverNames:c,editingSchedule:w,onSubmit:N,onUpdate:q,onCancel:()=>{y(!1),B(null),p.reset(),f.reset()},isSubmitting:p.isPending||f.isPending,error:L}),(0,s.jsx)(R.Z,{sx:{mt:2}})]}),h?(0,s.jsx)(r.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,s.jsx)(A.Z,{})}):m?(0,s.jsx)(D.Z,{severity:"error",children:"Failed to load schedules"}):(0,s.jsx)(ef,{schedules:T,onEdit:e=>{B(e),y(!0)},onDelete:e=>{W(e),F(!0)},onToggle:(e,n)=>{j.mutate({id:e.id,enabled:n})},toggleLoading:j.isPending})]}),(0,s.jsxs)(C.Z,{open:P,onClose:()=>F(!1),children:[(0,s.jsx)(z.Z,{children:"Delete Config Snapshot Schedule"}),(0,s.jsx)(k.Z,{children:(0,s.jsxs)(i.Z,{children:['Are you sure you want to delete the schedule "',null==I?void 0:I.name,'"? Existing snapshots created by this schedule will be preserved.']})}),(0,s.jsxs)(S.Z,{children:[(0,s.jsx)(b.Z,{onClick:()=>F(!1),children:"Cancel"}),(0,s.jsx)(b.Z,{onClick:E,color:"error",variant:"contained",disabled:g.isPending,children:g.isPending?"Deleting...":"Delete"})]})]})]})}var ev=t(84728);function ey(){var e,n;let{data:t,isLoading:a}=(0,u.x$)(),l=null!==(e=null==t?void 0:t.servers)&&void 0!==e?e:[],o=l.map(e=>e.name),{snapshotsByServer:c,isLoading:d,error:h}=function(e){var n;let t=e.map(e=>({name:e,query:(0,el.m)(e,5,0,{enabled:!!e})})),s=t.some(e=>e.query.isLoading),a=(null===(n=t.find(e=>e.query.error))||void 0===n?void 0:n.query.error)||null;return{snapshotsByServer:(0,x.useMemo)(()=>{let e=new Map;for(let n of t)n.query.data&&e.set(n.name,{snapshots:n.query.data.snapshots,total:n.query.data.total});return e},[t]),isLoading:s,error:a}}(o),{data:m}=(0,ei.F$)(),p=null!==(n=null==m?void 0:m.schedules)&&void 0!==n?n:[],[f,j]=(0,x.useState)(!1),[g,Z]=(0,x.useState)(void 0),[v,y]=(0,x.useState)(!1),[C,S]=(0,x.useState)(!1),[k,w]=(0,x.useState)(""),z=(0,x.useMemo)(()=>{if(!k)return{snapshotA:null,snapshotB:null};let e=c.get(k);return!e||e.snapshots.length<2?{snapshotA:null,snapshotB:null}:{snapshotA:e.snapshots[1],snapshotB:e.snapshots[0]}},[k,c]);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(r.Z,{sx:{display:"flex",justifyContent:"flex-end",gap:1,mb:2},children:[(0,s.jsx)(b.Z,{variant:"outlined",size:"small",startIcon:(0,s.jsx)(ea.Z,{}),onClick:()=>y(!0),children:"Manage Schedules"}),(0,s.jsx)(b.Z,{variant:"contained",size:"small",startIcon:(0,s.jsx)(es.Z,{}),onClick:()=>{Z(void 0),j(!0)},children:"Create Snapshot"})]}),(0,s.jsx)(i.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"Config snapshots capture server configuration files (server.properties, config.env, etc.) for versioning, comparison, and restore operations."}),(0,s.jsx)(eu,{servers:l,snapshotsByServer:c,schedules:p,isLoading:a||d,error:h,onViewHistory:e=>{let n=c.get(e);n&&n.snapshots.length>0&&(w(e),S(!0))},onCreateSnapshot:e=>{Z(e),j(!0)},onViewDiff:e=>{w(e),S(!0)}}),(0,s.jsx)(eh.e,{open:f,onClose:()=>{j(!1),Z(void 0)},serverNames:o,defaultServer:g}),(0,s.jsx)(eZ,{open:v,onClose:()=>y(!1),serverNames:o}),C&&z.snapshotA&&z.snapshotB&&(0,s.jsx)(ev.YN,{open:C,onClose:()=>{S(!1),w("")},snapshotA:z.snapshotA,snapshotB:z.snapshotB})]})}},72205:function(e,n,t){t.d(n,{m:function(){return l}});var s=t(98324),a=t(42936);function l(e,n,t){return(0,s.a)({queryKey:["config-snapshots","diff",e,n],queryFn:()=>(0,a.SC)("/api/config-snapshots/".concat(encodeURIComponent(e),"/diff/").concat(encodeURIComponent(n))),enabled:(null==t?void 0:t.enabled)!==!1&&!!e&&!!n,staleTime:3e5})}},88978:function(e,n,t){t.d(n,{$C:function(){return u},DW:function(){return d},F$:function(){return r},Uw:function(){return c},wh:function(){return o}});var s=t(98324),a=t(58919),l=t(20367),i=t(42936);function r(e){let n=e?"?serverName=".concat(encodeURIComponent(e)):"";return(0,s.a)({queryKey:["config-snapshot-schedules",e||"all"],queryFn:()=>(0,i.SC)("/api/config-snapshot-schedules".concat(n)),refetchInterval:6e4})}function o(){let e=(0,a.NL)();return(0,l.D)({mutationFn:e=>(0,i.SC)("/api/config-snapshot-schedules",{method:"POST",body:JSON.stringify(e)}),onSuccess:()=>{e.invalidateQueries({queryKey:["config-snapshot-schedules"]})}})}function c(){let e=(0,a.NL)();return(0,l.D)({mutationFn:e=>{let{id:n,data:t}=e;return(0,i.SC)("/api/config-snapshot-schedules/".concat(encodeURIComponent(n)),{method:"PUT",body:JSON.stringify(t)})},onSuccess:()=>{e.invalidateQueries({queryKey:["config-snapshot-schedules"]})}})}function d(){let e=(0,a.NL)();return(0,l.D)({mutationFn:e=>{let{id:n,enabled:t}=e;return(0,i.SC)("/api/config-snapshot-schedules/".concat(encodeURIComponent(n),"/toggle"),{method:"PATCH",body:JSON.stringify({enabled:t})})},onSuccess:()=>{e.invalidateQueries({queryKey:["config-snapshot-schedules"]})}})}function u(){let e=(0,a.NL)();return(0,l.D)({mutationFn:e=>(0,i.SC)("/api/config-snapshot-schedules/".concat(encodeURIComponent(e)),{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["config-snapshot-schedules"]})}})}},12063:function(e,n,t){t.d(n,{m:function(){return r},t:function(){return o}});var s=t(98324),a=t(58919),l=t(20367),i=t(42936);function r(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3?arguments[3]:void 0;return(0,s.a)({queryKey:["config-snapshots","list",e,n,t],queryFn:()=>(0,i.SC)("/api/servers/".concat(encodeURIComponent(e),"/config-snapshots?limit=").concat(n,"&offset=").concat(t)),enabled:(null==a?void 0:a.enabled)!==!1&&!!e,refetchInterval:6e4})}function o(){let e=(0,a.NL)();return(0,l.D)({mutationFn:e=>{let{serverName:n,description:t}=e;return(0,i.SC)("/api/servers/".concat(encodeURIComponent(n),"/config-snapshots"),{method:"POST",body:JSON.stringify({description:t})})},onSuccess:(n,t)=>{let{serverName:s}=t;e.invalidateQueries({queryKey:["config-snapshots","list",s]}),e.invalidateQueries({queryKey:["config-snapshots"]})}})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4095],{16387:function(e,r,t){Promise.resolve().then(t.bind(t,6453))},6453:function(e,r,t){"use strict";t.r(r),t.d(r,{default:function(){return B}});var n=t(94655),a=t(35106),i=t(7281),s=t(74228),l=t(46725),o=t(56275),c=t(62108),d=t(79983),h=t(31317),x=t(62142),m=t(90158),u=t(58347),p=t(49954),f=t(17820),g=t(73424),b=t(61505),j=t(71185),y=t(76176),v=t(27171),Z=t(35847),w=t(29983),C=t(80620),k=t(84974),S=t(34675),P=t(85480),z=t(64779);function I(e){return(0,n.jsxs)(z.Z,{...e,viewBox:"0 0 32 32",children:[(0,n.jsx)("rect",{width:"32",height:"32",fill:"#5DA840"}),(0,n.jsx)("rect",{x:"4",y:"8",width:"8",height:"8",fill:"#000"}),(0,n.jsx)("rect",{x:"20",y:"8",width:"8",height:"8",fill:"#000"}),(0,n.jsx)("rect",{x:"12",y:"16",width:"8",height:"4",fill:"#000"}),(0,n.jsx)("rect",{x:"8",y:"20",width:"16",height:"8",fill:"#000"}),(0,n.jsx)("rect",{x:"8",y:"28",width:"4",height:"4",fill:"#000"}),(0,n.jsx)("rect",{x:"20",y:"28",width:"4",height:"4",fill:"#000"}),(0,n.jsx)("rect",{x:"0",y:"0",width:"4",height:"4",fill:"#4A9030",opacity:"0.5"}),(0,n.jsx)("rect",{x:"8",y:"4",width:"4",height:"4",fill:"#4A9030",opacity:"0.5"}),(0,n.jsx)("rect",{x:"24",y:"0",width:"4",height:"4",fill:"#4A9030",opacity:"0.5"}),(0,n.jsx)("rect",{x:"28",y:"8",width:"4",height:"4",fill:"#4A9030",opacity:"0.5"}),(0,n.jsx)("rect",{x:"0",y:"24",width:"4",height:"4",fill:"#4A9030",opacity:"0.5"})]})}var W=t(8690),A=t(6986);let D=[{label:"Dashboard",href:"/dashboard",icon:(0,n.jsx)(y.Z,{})},{label:"Servers",href:"/servers",icon:(0,n.jsx)(v.Z,{})},{label:"Worlds",href:"/worlds",icon:(0,n.jsx)(k.Z,{})},{label:"Players",href:"/players",icon:(0,n.jsx)(Z.Z,{})},{label:"Audit",href:"/audit-logs",icon:(0,n.jsx)(C.Z,{})},{label:"Backups",href:"/backups",icon:(0,n.jsx)(S.Z,{})},{label:"Routing",href:"/routing",icon:(0,n.jsx)(w.Z,{})}];function T(e){let{mobileOpen:r,onMenuToggle:t}=e,a=(0,s.usePathname)(),{data:y}=(0,A.kP)(),v=e=>"/dashboard"===e?"/dashboard"===a||"/"===a:a.startsWith(e);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.Z,{position:"fixed",elevation:0,sx:{backgroundColor:"background.paper",borderBottom:"1px solid",borderColor:"divider",zIndex:e=>e.zIndex.drawer+1},children:(0,n.jsxs)(c.Z,{sx:{maxWidth:"1400px",width:"100%",mx:"auto",px:{xs:2,sm:3}},children:[(0,n.jsx)(d.Z,{color:"inherit","aria-label":"open menu",edge:"start",onClick:t,sx:{mr:2,display:{md:"none"}},children:(0,n.jsx)(b.Z,{})}),(0,n.jsxs)(l.default,{href:"/",style:{textDecoration:"none",display:"flex",alignItems:"center"},children:[(0,n.jsx)(I,{sx:{fontSize:28,color:"primary.main",mr:1}}),(0,n.jsx)(h.Z,{variant:"h6",component:"span",sx:{fontFamily:'"Minecraft", sans-serif',fontWeight:400,color:"common.white",letterSpacing:"0.05em",fontSize:"1.1rem"},children:"Minecraft Console"})]}),(0,n.jsx)(i.Z,{component:"nav",sx:{display:{xs:"none",md:"flex"},alignItems:"center",gap:1,ml:4,flex:1},children:D.map(e=>{let r=v(e.href);return(0,n.jsx)(l.default,{href:e.href,style:{textDecoration:"none"},onClick:()=>!r&&(0,W.Av)(),children:(0,n.jsxs)(i.Z,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1,borderRadius:2,color:r?"primary.main":"text.secondary",backgroundColor:r?"action.selected":"transparent",transition:"all 0.2s ease","&:hover":{backgroundColor:"action.hover",color:r?"primary.main":"text.primary"}},children:[(0,n.jsx)(i.Z,{component:"span",sx:{display:"flex",alignItems:"center","& svg":{fontSize:20}},children:e.icon}),(0,n.jsx)(h.Z,{variant:"body2",sx:{fontWeight:r?600:400},children:e.label})]})},e.href)})}),(0,n.jsx)(i.Z,{sx:{display:"flex",alignItems:"center",gap:2},children:(0,n.jsx)(P.Ie,{})})]})}),(0,n.jsx)(x.ZP,{variant:"temporary",anchor:"left",open:r,onClose:t,ModalProps:{keepMounted:!0},sx:{display:{xs:"block",md:"none"},"& .MuiDrawer-paper":{boxSizing:"border-box",width:280,backgroundColor:"background.paper"}},children:(0,n.jsxs)(i.Z,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[(0,n.jsxs)(i.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:2,py:2,minHeight:64,borderBottom:"1px solid",borderColor:"divider"},children:[(0,n.jsxs)(i.Z,{sx:{display:"flex",alignItems:"center"},children:[(0,n.jsx)(I,{sx:{fontSize:24,color:"primary.main",mr:1}}),(0,n.jsx)(h.Z,{variant:"h6",component:"span",sx:{fontFamily:'"Minecraft", sans-serif',fontWeight:400,color:"primary.main",letterSpacing:"0.05em",fontSize:"1rem"},children:"Minecraft Console"})]}),(0,n.jsx)(d.Z,{onClick:t,"aria-label":"close menu",children:(0,n.jsx)(j.Z,{})})]}),(0,n.jsx)(m.Z,{sx:{flex:1,px:1,py:2},children:D.map(e=>{let r=v(e.href);return(0,n.jsx)(u.ZP,{disablePadding:!0,sx:{mb:.5},children:(0,n.jsxs)(p.Z,{component:l.default,href:e.href,onClick:()=>{t(),r||(0,W.Av)()},"aria-current":r?"page":void 0,sx:{borderRadius:2,backgroundColor:r?"action.selected":"transparent","&:hover":{backgroundColor:"action.hover"}},children:[(0,n.jsx)(f.Z,{sx:{color:r?"primary.main":"text.secondary",minWidth:40},children:e.icon}),(0,n.jsx)(g.Z,{primary:e.label,primaryTypographyProps:{fontWeight:r?600:400,color:r?"primary.main":"text.primary"}})]})},e.href)})})]})})]})}var _=t(67337),q=t(41261),E=t(69123),M=t(75845),R=t(43880);function L(e){return(0,n.jsx)(z.Z,{...e,viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M13.983 11.078h2.119a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.119a.185.185 0 00-.185.185v1.888c0 .102.083.185.185.185m-2.954-5.43h2.118a.186.186 0 00.186-.186V3.574a.186.186 0 00-.186-.185h-2.118a.185.185 0 00-.185.185v1.888c0 .102.082.185.185.186m0 2.716h2.118a.187.187 0 00.186-.186V6.29a.186.186 0 00-.186-.185h-2.118a.185.185 0 00-.185.185v1.887c0 .102.082.185.185.186m-2.93 0h2.12a.186.186 0 00.184-.186V6.29a.185.185 0 00-.185-.185H8.1a.185.185 0 00-.185.185v1.887c0 .102.083.185.185.186m-2.964 0h2.119a.186.186 0 00.185-.186V6.29a.185.185 0 00-.185-.185H5.136a.186.186 0 00-.186.185v1.887c0 .102.084.185.186.186m5.893 2.715h2.118a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.118a.185.185 0 00-.185.185v1.888c0 .102.082.185.185.185m-2.93 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.185.185 0 00-.184.185v1.888c0 .102.083.185.185.185m-2.964 0h2.119a.185.185 0 00.185-.185V9.006a.185.185 0 00-.184-.186h-2.12a.186.186 0 00-.186.186v1.887c0 .102.084.185.186.185m-2.92 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.185.185 0 00-.184.185v1.888c0 .102.082.185.185.185M23.763 9.89c-.065-.051-.672-.51-1.954-.51-.338.001-.676.03-1.01.087-.248-1.7-1.653-2.53-1.716-2.566l-.344-.199-.226.327c-.284.438-.49.922-.612 1.43-.23.97-.09 1.882.403 2.661-.595.332-1.55.413-1.744.42H.751a.751.751 0 00-.75.748 11.376 11.376 0 00.692 4.062c.545 1.428 1.355 2.48 2.41 3.124 1.18.723 3.1 1.137 5.275 1.137.983.003 1.963-.086 2.93-.266a12.248 12.248 0 003.823-1.389c.98-.567 1.86-1.288 2.61-2.136 1.252-1.418 1.998-2.997 2.553-4.4h.221c1.372 0 2.215-.549 2.68-1.009.309-.293.55-.65.707-1.046l.098-.288z"})})}let U=[{title:"Resources",links:[{label:"Getting Started",href:"https://minecraft-server-manager.readthedocs.io/en/latest/getting-started/",external:!0},{label:"Configuration",href:"https://minecraft-server-manager.readthedocs.io/en/latest/configuration/",external:!0},{label:"Troubleshooting",href:"https://minecraft-server-manager.readthedocs.io/en/latest/troubleshooting/",external:!0}]},{title:"Documentation",links:[{label:"CLI Commands",href:"https://minecraft-server-manager.readthedocs.io/en/latest/cli/",external:!0},{label:"API Reference",href:"https://minecraft-server-manager.readthedocs.io/en/latest/console/",external:!0},{label:"itzg Reference",href:"https://minecraft-server-manager.readthedocs.io/en/latest/itzg-reference/",external:!0}]},{title:"Community",links:[{label:"GitHub",href:"https://github.com/smallmiro/minecraft-server-manager",external:!0},{label:"Issues",href:"https://github.com/smallmiro/minecraft-server-manager/issues",external:!0},{label:"Q&A / Support",href:"https://github.com/smallmiro/minecraft-server-manager/discussions/categories/q-a",external:!0},{label:"Ideas / Feature Requests",href:"https://github.com/smallmiro/minecraft-server-manager/discussions/categories/ideas",external:!0}]},{title:"About",links:[{label:"License",href:"https://github.com/smallmiro/minecraft-server-manager/blob/main/LICENSE",external:!0},{label:"Docker Hub",href:"https://hub.docker.com/r/itzg/minecraft-server",external:!0}]}];function H(){let e=new Date().getFullYear();return(0,n.jsx)(i.Z,{component:"footer",sx:{backgroundColor:"background.paper",borderTop:"1px solid",borderColor:"divider",mt:"auto"},children:(0,n.jsxs)(_.Z,{maxWidth:"lg",sx:{py:6},children:[(0,n.jsx)(i.Z,{sx:{display:"grid",gridTemplateColumns:{xs:"repeat(2, 1fr)",sm:"repeat(4, 1fr)"},gap:4,mb:4},children:U.map(e=>(0,n.jsxs)(i.Z,{children:[(0,n.jsx)(h.Z,{variant:"subtitle2",sx:{fontWeight:600,color:"text.primary",mb:2},children:e.title}),(0,n.jsx)(i.Z,{component:"ul",sx:{listStyle:"none",p:0,m:0},children:e.links.map(e=>(0,n.jsx)(i.Z,{component:"li",sx:{mb:1},children:(0,n.jsx)(q.Z,{href:e.href,target:e.external?"_blank":void 0,rel:e.external?"noopener noreferrer":void 0,underline:"hover",sx:{color:"text.secondary",fontSize:"0.875rem",transition:"color 0.2s ease","&:hover":{color:"primary.main"}},children:e.label})},e.label))})]},e.title))}),(0,n.jsx)(E.Z,{sx:{mb:3}}),(0,n.jsxs)(i.Z,{sx:{display:"flex",flexDirection:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",sm:"center"},gap:2},children:[(0,n.jsxs)(h.Z,{variant:"body2",sx:{color:"text.tertiary"},children:[e," \xa9"," ",(0,n.jsx)(q.Z,{href:"https://github.com/smallmiro/minecraft-server-manager",target:"_blank",rel:"noopener noreferrer",underline:"hover",sx:{color:"primary.main"},children:"Minecraft Server Management Console"})]}),(0,n.jsxs)(i.Z,{sx:{display:"flex",gap:2},children:[(0,n.jsx)(q.Z,{href:"https://github.com/smallmiro/minecraft-server-manager",target:"_blank",rel:"noopener noreferrer","aria-label":"GitHub",sx:{color:"text.secondary",transition:"color 0.2s ease","&:hover":{color:"text.primary"}},children:(0,n.jsx)(M.Z,{fontSize:"small"})}),(0,n.jsx)(q.Z,{href:"https://minecraft-server-manager.readthedocs.io/",target:"_blank",rel:"noopener noreferrer","aria-label":"Documentation",sx:{color:"text.secondary",transition:"color 0.2s ease","&:hover":{color:"text.primary"}},children:(0,n.jsx)(R.Z,{fontSize:"small"})}),(0,n.jsx)(q.Z,{href:"https://hub.docker.com/r/itzg/minecraft-server",target:"_blank",rel:"noopener noreferrer","aria-label":"Docker Hub",sx:{color:"text.secondary",transition:"color 0.2s ease","&:hover":{color:"text.primary"}},children:(0,n.jsx)(L,{fontSize:"small"})})]})]})]})})}function B(e){let{children:r}=e,[t,s]=(0,a.useState)(!1);return(0,n.jsxs)(i.Z,{sx:{display:"flex",flexDirection:"column",minHeight:"100vh",backgroundColor:"background.default"},children:[(0,n.jsx)(T,{mobileOpen:t,onMenuToggle:()=>{s(!t)}}),(0,n.jsx)(i.Z,{component:"main",sx:{flexGrow:1,display:"flex",flexDirection:"column",pt:{xs:"".concat(88,"px"),sm:"".concat(96,"px")},pb:{xs:3,sm:4},px:{xs:2,sm:3,md:4},maxWidth:"1400px",width:"100%",mx:"auto"},children:r}),(0,n.jsx)(H,{})]})}},85480:function(e,r,t){"use strict";t.d(r,{U0:function(){return u},WS:function(){return p},Ie:function(){return I}});var n=t(94655),a=t(35106),i=t(7281),s=t(81071),l=t(97436),o=t(52082),c=t(79983),d=t(30417),h=t(36848),x=t(554),m=t(6986);function u(e){let{onSuccess:r}=e,[t,u]=(0,a.useState)(""),[p,f]=(0,a.useState)(""),[g,b]=(0,a.useState)(!1),[j,y]=(0,a.useState)({}),[v,Z]=(0,a.useState)(null),[w,C]=(0,a.useState)(!1),k=()=>{let e={};return t?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)||(e.email="Invalid email address"):e.email="Email is required",p||(e.password="Password is required"),y(e),0===Object.keys(e).length},S=async e=>{if(e.preventDefault(),Z(null),k()){C(!0);try{let e=await m.cg.email({email:t,password:p});if(e.error){Z(e.error.message||"Invalid credentials"),C(!1);return}r&&r()}catch(e){Z("An unexpected error occurred. Please try again."),C(!1)}}};return(0,n.jsxs)(i.Z,{component:"form",onSubmit:S,sx:{display:"flex",flexDirection:"column",gap:2},children:[v&&(0,n.jsx)(s.Z,{severity:"error",onClose:()=>Z(null),children:v}),(0,n.jsx)(l.Z,{label:"Email",type:"email",value:t,onChange:e=>u(e.target.value),error:!!j.email,helperText:j.email,disabled:w,fullWidth:!0,required:!0}),(0,n.jsx)(l.Z,{label:"Password",type:g?"text":"password",value:p,onChange:e=>f(e.target.value),error:!!j.password,helperText:j.password,disabled:w,fullWidth:!0,required:!0,InputProps:{endAdornment:(0,n.jsx)(o.Z,{position:"end",children:(0,n.jsx)(c.Z,{"aria-label":"toggle password visibility",onClick:()=>{b(!g)},edge:"end",children:g?(0,n.jsx)(h.Z,{}):(0,n.jsx)(x.Z,{})})})}}),(0,n.jsx)(d.Z,{type:"submit",variant:"contained",color:"primary",disabled:w,fullWidth:!0,size:"large",children:w?"Signing in...":"Sign In"})]})}function p(e){let{onSuccess:r}=e,[t,u]=(0,a.useState)(""),[p,f]=(0,a.useState)(""),[g,b]=(0,a.useState)(""),[j,y]=(0,a.useState)(""),[v,Z]=(0,a.useState)(!1),[w,C]=(0,a.useState)(!1),[k,S]=(0,a.useState)({}),[P,z]=(0,a.useState)(null),[I,W]=(0,a.useState)(!1),A=()=>{let e={};return t||(e.name="Name is required"),p?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(p)||(e.email="Invalid email address"):e.email="Email is required",g?g.length<8&&(e.password="Password must be at least 8 characters"):e.password="Password is required",j?g!==j&&(e.confirmPassword="Passwords do not match"):e.confirmPassword="Please confirm your password",S(e),0===Object.keys(e).length},D=async e=>{if(e.preventDefault(),z(null),A()){W(!0);try{let e=await m.y1.email({email:p,password:g,name:t});if(e.error){z(e.error.message||"Registration failed"),W(!1);return}r&&r()}catch(e){z("An unexpected error occurred. Please try again."),W(!1)}}};return(0,n.jsxs)(i.Z,{component:"form",onSubmit:D,sx:{display:"flex",flexDirection:"column",gap:2},children:[P&&(0,n.jsx)(s.Z,{severity:"error",onClose:()=>z(null),children:P}),(0,n.jsx)(l.Z,{label:"Name",type:"text",value:t,onChange:e=>u(e.target.value),error:!!k.name,helperText:k.name,disabled:I,fullWidth:!0,required:!0}),(0,n.jsx)(l.Z,{label:"Email",type:"email",value:p,onChange:e=>f(e.target.value),error:!!k.email,helperText:k.email,disabled:I,fullWidth:!0,required:!0}),(0,n.jsx)(l.Z,{label:"Password",type:v?"text":"password",value:g,onChange:e=>b(e.target.value),error:!!k.password,helperText:k.password,disabled:I,fullWidth:!0,required:!0,InputProps:{endAdornment:(0,n.jsx)(o.Z,{position:"end",children:(0,n.jsx)(c.Z,{"aria-label":"toggle password visibility",onClick:()=>{Z(!v)},edge:"end",children:v?(0,n.jsx)(h.Z,{}):(0,n.jsx)(x.Z,{})})})}}),(0,n.jsx)(l.Z,{label:"Confirm Password",type:w?"text":"password",value:j,onChange:e=>y(e.target.value),error:!!k.confirmPassword,helperText:k.confirmPassword,disabled:I,fullWidth:!0,required:!0,InputProps:{endAdornment:(0,n.jsx)(o.Z,{position:"end",children:(0,n.jsx)(c.Z,{"aria-label":"toggle password visibility",onClick:()=>{C(!w)},edge:"end",children:w?(0,n.jsx)(h.Z,{}):(0,n.jsx)(x.Z,{})})})}}),(0,n.jsx)(d.Z,{type:"submit",variant:"contained",color:"primary",disabled:I,fullWidth:!0,size:"large",children:I?"Creating account...":"Sign Up"})]})}var f=t(74228),g=t(93017),b=t(86702),j=t(88812),y=t(31317),v=t(25333),Z=t(69123),w=t(7178),C=t(17820),k=t(73424),S=t(25169),P=t(41094),z=t(78319);function I(){let e=(0,f.useRouter)(),{data:r,isPending:t}=(0,m.kP)(),[s,l]=(0,a.useState)(null),o=()=>{l(null)},h=async()=>{o(),await (0,m.w7)(),e.push("/login")};if(t)return(0,n.jsx)(i.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:(0,n.jsx)(g.Z,{size:24})});if(!(null==r?void 0:r.user))return(0,n.jsx)(d.Z,{variant:"contained",color:"primary",onClick:()=>{e.push("/login")},children:"Sign In"});let{user:x}=r,u=((e,r)=>{if(e){let r=e.split(" ");return r.length>=2?"".concat(r[0][0]).concat(r[1][0]).toUpperCase():e.substring(0,2).toUpperCase()}return r?r[0].toUpperCase():"?"})(x.name,x.email);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.Z,{onClick:e=>{l(e.currentTarget)},"aria-label":"user menu",children:(0,n.jsx)(b.Z,{sx:{bgcolor:"primary.main"},children:u})}),(0,n.jsxs)(j.Z,{anchorEl:s,open:!!s,onClose:o,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},sx:{mt:1},children:[(0,n.jsxs)(i.Z,{sx:{px:2,py:1.5,minWidth:200},children:[(0,n.jsx)(y.Z,{variant:"subtitle1",fontWeight:"600",children:x.name||"User"}),(0,n.jsx)(y.Z,{variant:"body2",color:"text.secondary",children:x.email}),"admin"===x.role&&(0,n.jsx)(v.Z,{label:"Admin",size:"small",color:"primary",sx:{mt:1}})]}),(0,n.jsx)(Z.Z,{}),"admin"===x.role&&(0,n.jsxs)(w.Z,{onClick:()=>{o(),e.push("/admin/users")},children:[(0,n.jsx)(C.Z,{children:(0,n.jsx)(S.Z,{fontSize:"small"})}),(0,n.jsx)(k.Z,{children:"Users"})]}),(0,n.jsxs)(w.Z,{onClick:()=>{o(),e.push("/settings")},children:[(0,n.jsx)(C.Z,{children:(0,n.jsx)(P.Z,{fontSize:"small"})}),(0,n.jsx)(k.Z,{children:"Settings"})]}),(0,n.jsxs)(w.Z,{onClick:h,children:[(0,n.jsx)(C.Z,{children:(0,n.jsx)(z.Z,{fontSize:"small"})}),(0,n.jsx)(k.Z,{children:"Logout"})]})]})]})}},3454:function(e,r,t){"use strict";t.d(r,{LoadingProvider:function(){return o},startLoading:function(){return c},stopLoading:function(){return d}});var n=t(94655),a=t(35106),i=t(74228),s=t(31477),l=t.n(s);function o(e){let{children:r}=e,t=(0,i.usePathname)(),s=(0,i.useSearchParams)();return(0,a.useEffect)(()=>{l().done()},[t,s]),(0,n.jsx)(n.Fragment,{children:r})}function c(){l().start()}function d(){l().done()}l().configure({showSpinner:!1,speed:300,minimum:.1})},8690:function(e,r,t){"use strict";t.d(r,{Av:function(){return n.startLoading}});var n=t(3454)},6986:function(e,r,t){"use strict";t.d(r,{Cp:function(){return x},Nq:function(){return h},cg:function(){return l},kP:function(){return d},w7:function(){return o},y1:function(){return c},zB:function(){return m}});var n=t(77054),a=t(61648),i=t(35016);let s=(0,n.X)({baseURL:i.env.NEXT_PUBLIC_BETTER_AUTH_URL||"",plugins:[(0,a.zB)()]}),{signIn:l,signOut:o,signUp:c,useSession:d,updateUser:h,changePassword:x}=s,m=s.admin}},function(e){e.O(0,[6812,9760,5004,7296,7436,1071,2542,55,4219,8347,4848,1400,5560,3669,2757,1744],function(){return e(e.s=16387)}),_N_E=e.O()}]);
|