@weppy/roblox-mcp 2.8.2 → 2.9.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/CHANGELOG.md +15 -0
- package/README.md +46 -14
- package/dashboard/dist/assets/AssetsPage-Be5aZDhj.css +1 -0
- package/dashboard/dist/assets/AssetsPage-Bg2-L4ZA.js +46 -0
- package/dashboard/dist/assets/ChangelogDetailPage-BfKpoGXf.js +1 -0
- package/dashboard/dist/assets/ChangelogPage-CJgsI7aS.js +1 -0
- package/dashboard/dist/assets/ConfirmModal-C9EhZCHZ.js +1 -0
- package/dashboard/dist/assets/ConfirmModal-D1kfK31C.css +1 -0
- package/dashboard/dist/assets/ConfirmModal.module-NrFlfTWy.js +1 -0
- package/dashboard/dist/assets/ConnectionPage-D1GWlHZP.css +1 -0
- package/dashboard/dist/assets/ConnectionPage-DGUYptQR.js +11 -0
- package/dashboard/dist/assets/ControlsPage-rqArYVq2.js +1 -0
- package/dashboard/dist/assets/CurrentPlaceScope-BMyP2w7Z.js +1 -0
- package/dashboard/dist/assets/CurrentPlaceScope-v3pl1mLI.css +1 -0
- package/dashboard/dist/assets/{GameChangeDetail-CghOvUm8.js → GameChangeDetail-DKAKmyGF.js} +1 -1
- package/dashboard/dist/assets/{InfoLabel-Cyz7d4Kc.js → InfoLabel-ZfsTcz5c.js} +1 -1
- package/dashboard/dist/assets/{OverviewPage-B6ZL_JXU.js → OverviewPage-C9OL33DV.js} +1 -1
- package/dashboard/dist/assets/PageHeader-Cqg4GMtU.js +6 -0
- package/dashboard/dist/assets/PlaytestPage-CczAQ-A8.js +11 -0
- package/dashboard/dist/assets/SettingsPage-DNp4oJDT.js +1 -0
- package/dashboard/dist/assets/SettingsPage-DSipzuEo.css +1 -0
- package/dashboard/dist/assets/{StatusBadge-CkLieULy.js → StatusBadge-BSFzbkXM.js} +1 -1
- package/dashboard/dist/assets/SyncPage-DzOONMOM.js +4 -0
- package/dashboard/dist/assets/{Tabs-BhkhdCvF.js → Tabs-B8mbzhmZ.js} +1 -1
- package/dashboard/dist/assets/ToolsPage-DFh7yyab.js +1 -0
- package/dashboard/dist/assets/TooltipText-ZamrETeK.js +1 -0
- package/dashboard/dist/assets/UiStudioPage-D7awEU2z.js +11 -0
- package/dashboard/dist/assets/{WhatsNewPage-CBUk7WTn.js → WhatsNewPage-CTZEuf65.js} +1 -1
- package/dashboard/dist/assets/copy-Cey6jv67.js +6 -0
- package/dashboard/dist/assets/index-B9LVK3-K.js +606 -0
- package/dashboard/dist/assets/index-Dd1aCYFM.css +1 -0
- package/dashboard/dist/assets/{sample-requests-D1b5Z8FU.js → sample-requests-CS0o0F7H.js} +1 -1
- package/dashboard/dist/assets/{useLiveUptime-BHqJirBV.js → useLiveUptime-BGlwL1Q-.js} +1 -1
- package/dashboard/dist/assets/useSettings-Bsfu70PT.css +1 -0
- package/dashboard/dist/assets/useSettings-mbARvRgI.js +1 -0
- package/dashboard/dist/index.html +2 -2
- package/dist/index.js +93 -93
- package/package.json +1 -1
- package/roblox-plugin/WeppyRobloxMCP.rbxm +0 -0
- package/dashboard/dist/assets/AssetsPage-BQGliX7Q.css +0 -1
- package/dashboard/dist/assets/AssetsPage-yddSUaZg.js +0 -51
- package/dashboard/dist/assets/ChangelogDetailPage-BiiG5ZpO.js +0 -1
- package/dashboard/dist/assets/ChangelogPage-oIxW8_VE.js +0 -1
- package/dashboard/dist/assets/ConfirmModal-CpImpY9c.js +0 -1
- package/dashboard/dist/assets/ConnectionPage-CNtjimlm.css +0 -1
- package/dashboard/dist/assets/ConnectionPage-zGBwRnwi.js +0 -1
- package/dashboard/dist/assets/PageHeader-CThGgsAt.js +0 -6
- package/dashboard/dist/assets/PlaytestPage-CQqE8m04.js +0 -11
- package/dashboard/dist/assets/SettingsPage-DX6vgUTw.js +0 -1
- package/dashboard/dist/assets/SettingsPage-d0wOFs8U.css +0 -1
- package/dashboard/dist/assets/SyncPage-cfQ-4IDk.js +0 -4
- package/dashboard/dist/assets/ToolsPage-B004HHzX.js +0 -1
- package/dashboard/dist/assets/TooltipText-H3YSCbob.js +0 -1
- package/dashboard/dist/assets/UiStudioPage-CwURRVO9.js +0 -11
- package/dashboard/dist/assets/index-CjzKb5lS.css +0 -1
- package/dashboard/dist/assets/index-DG2RrKOl.js +0 -532
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{i as Z,u as ee,r as d,j as e,f as te,a as D,D as ne,L as se,M as ce,k as V,e as ie,l as le,s as ae}from"./index-B9LVK3-K.js";import{I as h}from"./InfoLabel-ZfsTcz5c.js";import{P as re}from"./PageHeader-Cqg4GMtU.js";import{S as oe}from"./StatusBadge-BSFzbkXM.js";import{T as de}from"./TooltipText-ZamrETeK.js";import{C as X}from"./ConfirmModal-C9EhZCHZ.js";import{u as ge,f as pe}from"./useLiveUptime-BGlwL1Q-.js";import{C as K}from"./copy-Cey6jv67.js";import"./ConfirmModal.module-NrFlfTWy.js";/**
|
|
2
|
+
* @license lucide-react v1.8.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const ue=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],he=Z("bot",ue);/**
|
|
7
|
+
* @license lucide-react v1.8.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const ye=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],me=Z("server",ye),xe="_container_1h084_2",_e="_entry_1h084_14",fe="_timestamp_1h084_21",je="_message_1h084_27",ve="_warn_1h084_34",Ce="_error_1h084_39",Se="_empty_1h084_44",O={container:xe,entry:_e,timestamp:fe,message:je,warn:ve,error:Ce,empty:Se};function be(o){const s=new Date(o);return Number.isNaN(s.getTime())?o:`${String(s.getHours()).padStart(2,"0")}:${String(s.getMinutes()).padStart(2,"0")}`}function Ne({entries:o}){const{t:s}=ee(),n=d.useRef(null);return d.useEffect(()=>{const i=n.current;i&&(i.scrollTop=i.scrollHeight)},[o.length]),e.jsx("div",{ref:n,className:O.container,children:o.length===0?e.jsx("div",{className:O.empty,children:s("connection.log.empty","No events yet")}):o.map((i,r)=>e.jsxs("div",{className:`${O.entry} ${i.type?O[i.type]:""}`,children:[e.jsx("span",{className:O.timestamp,children:be(i.timestamp)}),e.jsx("span",{className:O.message,children:i.message})]},r))})}const J=50;function we(){const o=new Date;return`${String(o.getHours()).padStart(2,"0")}:${String(o.getMinutes()).padStart(2,"0")}`}function Ie(){const{level:o,status:s,error:n}=te(),[i,r]=d.useState(null),[f,g]=d.useState(null),[c,L]=d.useState([]),b=d.useRef(null),A=d.useCallback((p,j)=>{L(w=>{const _=[...w,{timestamp:we(),message:p,type:j}];return _.length>J?_.slice(-J):_})},[]),y=d.useCallback(async()=>{try{const p=await D.get("/connection-info");r(p)}catch{r(null)}},[]),M=d.useCallback(async()=>{try{const p=await D.get("/api/dashboard/studio-routing");g(p)}catch{g(null)}},[]),I=d.useCallback(async p=>{const j=await D.patch("/api/dashboard/studio-routing",p);return g(j),await y(),j},[y]),B=d.useCallback(async()=>{try{const p=await D.get("/api/dashboard/connection-log");L(p.entries??[])}catch{L([])}},[]),E=d.useCallback(async()=>{await D.post("/api/dashboard/connection-log/clear"),L([])},[]),N=d.useCallback(async p=>{await D.post("/api/dashboard/kill-agent",{instanceId:p}),await y()},[y]);return d.useEffect(()=>{o!=="disconnected"&&s?(y(),M()):g(null),B()},[o,s,y,B,M]),d.useEffect(()=>{const p=new ne;b.current=p,p.connect();const j=p.on("connection",_=>{const u=_;u.status!=="updated"&&u.clientId&&A(`Plugin ${u.status} — ${u.clientId}`,u.status==="disconnected"?"warn":"info"),y(),M()}),w=p.on("mcp_status",_=>{const u=_,z=u.status==="registered"?"registered":"unregistered";A(`MCP ${z} — ${u.aiClientName}`,u.status==="registered"?"info":"warn"),y(),M()});return()=>{j(),w(),p.disconnect(),b.current=null}},[A,y,M]),{status:s,connectionInfo:i,studioRouting:f,connectionLog:c,level:o,error:n,clearConnectionLog:E,killAgent:N,updateStudioRouting:I}}const ke="_page_17f6d_2",Le="_card_17f6d_11",Ae="_topologyCard_17f6d_19",Me="_topologyDisconnected_17f6d_26",Pe="_topologyHeader_17f6d_30",Be="_topologyIntro_17f6d_38",$e="_topologyNetwork_17f6d_45",Ee="_topologyLinks_17f6d_49",Te="_topologyLink_17f6d_49",He="_topologyLink_agent_17f6d_66",De="_topologyLink_studio_17f6d_70",Oe="_topologyGrid_17f6d_74",Fe="_topologyColumn_17f6d_83",ze="_topologyColumnHeader_17f6d_90",Ue="_topologyColumnHeaderSpacer_17f6d_101",Ge="_topologyCount_17f6d_105",qe="_topologyList_17f6d_120",We="_topologyListCentered_17f6d_128",Ve="_topologyNode_17f6d_132",Ke="_topologyNodeTitle_17f6d_140",Ye="_topologyNodeMeta_17f6d_156",Re="_topologyNodeSubtle_17f6d_157",Xe="_topologyState_17f6d_170",Je="_topologyEmpty_17f6d_183",Qe="_topologyOverflow_17f6d_198",Ze="_topologyOverflowButton_17f6d_213",eo="_topologyServerColumn_17f6d_236",oo="_topologyServer_17f6d_236",to="_topologyServerIcon_17f6d_254",no="_topologyServerBody_17f6d_267",so="_topologyServerTitle_17f6d_276",co="_topologyServerMeta_17f6d_283",io="_routingSummaryCompact_17f6d_290",lo="_disabled_17f6d_298",ao="_cardHeader_17f6d_304",ro="_cardHint_17f6d_317",go="_clearButton_17f6d_324",po="_serverGrid_17f6d_334",uo="_statusRow_17f6d_352",ho="_metaItem_17f6d_359",yo="_table_17f6d_366",mo="_tableWrap_17f6d_386",xo="_routingSummary_17f6d_290",_o="_manageLink_17f6d_402",fo="_segment_17f6d_428",jo="_segmentActive_17f6d_429",vo="_targetPrimary_17f6d_463",Co="_monoMuted_17f6d_467",So="_copyIconButton_17f6d_471",bo="_routingBadge_17f6d_496",No="_toggleBtn_17f6d_511",wo="_disconnected_17f6d_526",Io="_disconnectedActions_17f6d_543",ko="_btn_17f6d_550",Lo="_activity_active_17f6d_568",Ao="_activity_stale_17f6d_569",Mo="_activity_unknown_17f6d_570",Po="_killBtn_17f6d_594",Bo="_emptyRow_17f6d_614",t={page:ke,card:Le,topologyCard:Ae,topologyDisconnected:Me,topologyHeader:Pe,topologyIntro:Be,topologyNetwork:$e,topologyLinks:Ee,topologyLink:Te,topologyLink_agent:He,topologyLink_studio:De,topologyGrid:Oe,topologyColumn:Fe,topologyColumnHeader:ze,topologyColumnHeaderSpacer:Ue,topologyCount:Ge,topologyList:qe,topologyListCentered:We,topologyNode:Ve,topologyNodeTitle:Ke,topologyNodeMeta:Ye,topologyNodeSubtle:Re,topologyState:Xe,topologyEmpty:Je,topologyOverflow:Qe,topologyOverflowButton:Ze,topologyServerColumn:eo,topologyServer:oo,topologyServerIcon:to,topologyServerBody:no,topologyServerTitle:so,topologyServerMeta:co,routingSummaryCompact:io,disabled:lo,cardHeader:ao,cardHint:ro,clearButton:go,serverGrid:po,statusRow:uo,metaItem:ho,table:yo,tableWrap:mo,routingSummary:xo,manageLink:_o,segment:fo,segmentActive:jo,targetPrimary:vo,monoMuted:Co,copyIconButton:So,routingBadge:bo,toggleBtn:No,disconnected:wo,disconnectedActions:Io,btn:ko,activity_active:Lo,activity_stale:Ao,activity_unknown:Mo,killBtn:Po,emptyRow:Bo},W=5;function $o(o){return o?Date.now()-o<3e4?"active":"stale":"unknown"}function Eo(o,s){return o==="active"?s("connection.topology.active","Active"):o==="stale"?s("connection.topology.stale","Stale"):s("connection.topology.unknown","Unknown")}function To(o){return o.length>10?o.slice(0,10):o}function Q(o,s){return o.replace("{count}",String(s))}function Ho(o,s){return o.length!==s.length?!1:o.every((n,i)=>{const r=s[i];return r!==void 0&&n.id===r.id&&n.side===r.side&&Math.abs(n.x1-r.x1)<.5&&Math.abs(n.y1-r.y1)<.5&&Math.abs(n.x2-r.x2)<.5&&Math.abs(n.y2-r.y2)<.5})}function S(o,s,n){return{x:s-o.left,y:n-o.top}}function Do(o,s,n,i){if(s.right<=n.left){const g=S(i,s.right,s.top+s.height/2),c=S(i,n.left,n.top+n.height/2);return{id:o,side:"agent",x1:g.x,y1:g.y,x2:c.x,y2:c.y}}if(s.bottom<=n.top){const g=S(i,s.left+s.width/2,s.bottom),c=S(i,n.left+n.width/2,n.top);return{id:o,side:"agent",x1:g.x,y1:g.y,x2:c.x,y2:c.y}}const r=S(i,s.left+s.width/2,s.top),f=S(i,n.left+n.width/2,n.bottom);return{id:o,side:"agent",x1:r.x,y1:r.y,x2:f.x,y2:f.y}}function Oo(o,s,n,i){if(n.right<=s.left){const g=S(i,s.left,s.top+s.height/2),c=S(i,n.right,n.top+n.height/2);return{id:o,side:"studio",x1:g.x,y1:g.y,x2:c.x,y2:c.y}}if(n.bottom<=s.top){const g=S(i,s.left+s.width/2,s.top),c=S(i,n.left+n.width/2,n.bottom);return{id:o,side:"studio",x1:g.x,y1:g.y,x2:c.x,y2:c.y}}const r=S(i,s.left+s.width/2,s.bottom),f=S(i,n.left+n.width/2,n.top);return{id:o,side:"studio",x1:r.x,y1:r.y,x2:f.x,y2:f.y}}function Fo({agents:o,isDisconnected:s,pinnedTargetClientId:n,priorityTarget:i,status:r,studioRoutingMode:f,studioTargets:g,t:c,timeAgo:L,onCopySelector:b,onManageRouting:A}){const[y,M]=d.useState(!1),[I,B]=d.useState(!1),[E,N]=d.useState([]),p=d.useRef(null),j=d.useRef(null),w=d.useRef(new Map),_=d.useRef(new Map),u=f==="pinned"?c("connection.routing.pinned","Manual: Pinned Studio"):c("connection.routing.recentPriority","Automatic: Recent priority"),z=s?"offline":"online",C=d.useMemo(()=>y?o:o.slice(0,W),[o,y]),T=Math.max(0,o.length-C.length),v=d.useMemo(()=>I?g:g.slice(0,W),[g,I]),$=Math.max(0,g.length-v.length),Y=[t.topologyList,C.length<=1?t.topologyListCentered:""].filter(Boolean).join(" "),R=[t.topologyList,v.length<=1?t.topologyListCentered:""].filter(Boolean).join(" "),H=d.useCallback(a=>m=>{if(m){w.current.set(a,m);return}w.current.delete(a)},[]),l=d.useCallback(a=>m=>{if(m){_.current.set(a,m);return}_.current.delete(a)},[]),k=d.useCallback(()=>{const a=p.current,m=j.current;if(!a||!m){N([]);return}const x=a.getBoundingClientRect(),U=m.getBoundingClientRect(),q=[];C.forEach(P=>{const G=w.current.get(P.instanceId);G&&q.push(Do(`agent-${P.instanceId}`,G.getBoundingClientRect(),U,x))}),v.forEach(P=>{const G=_.current.get(P.clientId);G&&q.push(Oo(`studio-${P.clientId}`,G.getBoundingClientRect(),U,x))}),N(P=>Ho(P,q)?P:q)},[C,v]);return d.useLayoutEffect(()=>{k();const a=[p.current,j.current,...C.map(x=>w.current.get(x.instanceId)),...v.map(x=>_.current.get(x.clientId))].filter(x=>x!=null);if(window.addEventListener("resize",k),typeof ResizeObserver>"u")return()=>{window.removeEventListener("resize",k)};const m=new ResizeObserver(k);return a.forEach(x=>m.observe(x)),()=>{window.removeEventListener("resize",k),m.disconnect()}},[k,C,v]),e.jsxs("section",{className:`${t.topologyCard} ${s?t.topologyDisconnected:""}`,"aria-label":c("connection.topology.ariaLabel","Connection topology"),children:[e.jsxs("div",{className:t.topologyHeader,children:[e.jsxs("div",{children:[e.jsx("div",{className:t.cardHeader,children:c("connection.topology.title","Connection topology")}),e.jsx("p",{className:t.topologyIntro,children:c("connection.topology.description","AI agents and Roblox Studio windows connect through one WEPPY MCP Server.")})]}),e.jsx(se,{to:"/controls?section=studio-routing",className:t.manageLink,onClick:A,children:c("connection.routing.manage","Manage routing")})]}),e.jsxs("div",{className:t.topologyNetwork,ref:p,children:[e.jsx("svg",{"aria-hidden":"true",className:t.topologyLinks,"data-testid":"topology-connection-lines",focusable:"false",children:E.map(a=>e.jsx("line",{className:`${t.topologyLink} ${t[`topologyLink_${a.side}`]}`,"data-side":a.side,vectorEffect:"non-scaling-stroke",x1:a.x1,x2:a.x2,y1:a.y1,y2:a.y2},a.id))}),e.jsxs("div",{className:t.topologyGrid,children:[e.jsxs("div",{className:t.topologyColumn,children:[e.jsxs("div",{className:t.topologyColumnHeader,children:[e.jsx(he,{size:15,"aria-hidden":"true"}),e.jsx("span",{children:c("connection.agents.title","AI Agents")}),e.jsx("span",{className:t.topologyCount,children:o.length})]}),e.jsxs("div",{className:Y,children:[o.length>0?C.map(a=>{const m=$o(a.lastSeen),x=a.aiClientName??To(a.instanceId),U=a.lastSeen??a.lastCommandAt??a.connectedAt;return e.jsxs("div",{className:t.topologyNode,ref:H(a.instanceId),children:[e.jsxs("div",{className:t.topologyNodeTitle,children:[e.jsx("span",{className:t[`activity_${m}`]}),e.jsx("strong",{children:x}),e.jsx("span",{className:t.topologyState,children:Eo(m,c)})]}),e.jsx("div",{className:t.topologyNodeMeta,children:U?`${c("connection.topology.lastActivity","Last activity")} ${L(U)}`:c("connection.topology.noActivity","No recent activity")})]},a.instanceId)}):e.jsx("div",{className:t.topologyEmpty,children:c("connection.agents.none","No agents connected")}),o.length>W?e.jsxs("div",{className:t.topologyOverflow,children:[T>0?e.jsx("span",{children:Q(c("connection.topology.moreAgents","+{count} more agents"),T)}):e.jsx("span",{children:c("connection.topology.allAgentsVisible","All agents visible")}),e.jsx("button",{type:"button",className:t.topologyOverflowButton,"aria-label":y?c("connection.topology.showLessAgents","Show less AI agents"):c("connection.topology.showAllAgents","Show all AI agents"),onClick:()=>M(a=>!a),children:y?c("connection.topology.showLess","Show less"):c("connection.topology.showAll","Show all")})]}):null]})]}),e.jsxs("div",{className:t.topologyServerColumn,children:[e.jsx("div",{className:t.topologyColumnHeaderSpacer,"aria-hidden":"true"}),e.jsxs("div",{className:`${t.topologyNode} ${t.topologyServer}`,ref:j,children:[e.jsx("div",{className:t.topologyServerIcon,children:e.jsx(me,{size:18,"aria-hidden":"true"})}),e.jsxs("div",{className:t.topologyServerBody,children:[e.jsx("div",{className:t.topologyServerTitle,children:c("connection.topology.serverTitle","MCP Server")}),e.jsx(oe,{status:z}),e.jsxs("div",{className:t.topologyServerMeta,children:[r!=null&&r.version?`v${r.version}`:c("connection.topology.versionUnknown","Version unknown"),r!=null&&r.sessionId?` · ${c("connection.server.session","Session")} ${r.sessionId.slice(0,8)}`:""]}),e.jsx("div",{className:t.routingSummaryCompact,children:e.jsx("span",{className:t.routingBadge,children:u})})]})]})]}),e.jsxs("div",{className:t.topologyColumn,children:[e.jsxs("div",{className:t.topologyColumnHeader,children:[e.jsx(ce,{size:15,"aria-hidden":"true"}),e.jsx("span",{children:c("connection.targets.title","Studio Targets")}),e.jsx("span",{className:t.topologyCount,children:g.length})]}),e.jsxs("div",{className:R,children:[g.length>0?v.map(a=>{const m=f==="pinned"&&n===a.clientId,x=f==="recentPriority"&&(i==null?void 0:i.clientId)===a.clientId;return e.jsxs("div",{className:t.topologyNode,ref:l(a.clientId),children:[e.jsxs("div",{className:t.topologyNodeTitle,children:[e.jsx("span",{className:t.targetPrimary,children:a.targetAlias}),e.jsx(V,{text:c("connection.targets.copyTargetAlias","Copy Studio ID"),children:e.jsx("button",{type:"button",className:t.copyIconButton,"aria-label":c("connection.targets.copyTargetAlias","Copy Studio ID"),onClick:()=>b(a.targetAlias,"target_alias"),children:e.jsx(K,{size:13,"aria-hidden":"true"})})}),m?e.jsx("span",{className:t.routingBadge,children:c("connection.routing.pinnedBadge","Pinned")}):x?e.jsx("span",{className:t.routingBadge,children:c("connection.routing.priorityBadge","Priority")}):null]}),e.jsxs("div",{className:t.topologyNodeMeta,children:[e.jsx("span",{children:a.placeName??c("connection.topology.placeUnknown","Place unknown")}),a.placeId!==void 0?` · ${a.placeId}`:""]}),e.jsxs("div",{className:t.topologyNodeSubtle,children:[a.connectionState," · ",c("connection.targets.lastSeen","Last Seen")," ",L(a.lastSeen)]})]},a.clientId)}):e.jsx("div",{className:t.topologyEmpty,children:c("connection.targets.none","No Studio targets connected. Open Roblox Studio and connect WEPPY Plugin.")}),g.length>W?e.jsxs("div",{className:t.topologyOverflow,children:[$>0?e.jsx("span",{children:Q(c("connection.topology.moreStudios","+{count} more studios"),$)}):e.jsx("span",{children:c("connection.topology.allStudiosVisible","All studios visible")}),e.jsx("button",{type:"button",className:t.topologyOverflowButton,"aria-label":I?c("connection.topology.showLessStudios","Show less Studio targets"):c("connection.topology.showAllStudios","Show all Studio targets"),onClick:()=>B(a=>!a),children:I?c("connection.topology.showLess","Show less"):c("connection.topology.showAll","Show all")})]}):null]})]})]})]})]})}function F(o,s){const n=Math.max(0,Math.floor((Date.now()-o)/1e3));return n<60?`${n}${s("connection.time.secondsAgo","s ago")}`:n<3600?`${Math.floor(n/60)}${s("connection.time.minutesAgo","m ago")}`:`${Math.floor(n/3600)}${s("connection.time.hoursAgo","h ago")}`}function zo(o){return o?Date.now()-o<3e4?"active":"stale":"unknown"}function Jo(){const{t:o}=ee(),{trackEvent:s}=ie(),{status:n,connectionInfo:i,studioRouting:r,connectionLog:f,level:g,clearConnectionLog:c,killAgent:L}=Ie(),{show:b}=le(),[A,y]=d.useState(!0),[M,I]=d.useState(!1),[B,E]=d.useState(!1),[N,p]=d.useState(null),[j,w]=d.useState(!1),_=ge(n==null?void 0:n.uptime),u=g==="disconnected",z=u?"offline":"online",C=(r==null?void 0:r.studioRoutingMode)??(n==null?void 0:n.studioRoutingMode)??"recentPriority",T=(r==null?void 0:r.pinnedTargetClientId)??(n==null?void 0:n.pinnedTargetClientId)??null,v=ae((r==null?void 0:r.targets)??(n==null?void 0:n.pluginClients)??[],C,T),$=(r==null?void 0:r.priorityTarget)??v[0],Y=async()=>{if(N){w(!0);try{await L(N.instanceId),b(o("connection.agents.killed","Agent killed"),"success"),p(null)}catch{b(o("connection.agents.killFailed","Failed to kill agent"),"error")}finally{w(!1)}}},R=async()=>{E(!0);try{await c(),b(o("toast.clearSuccess","Cleared successfully"),"success"),I(!1)}catch{b(o("toast.clearFailed","Failed to clear data"),"error")}finally{E(!1)}},H=async(l,k)=>{try{await navigator.clipboard.writeText(l),b(o("connection.targets.copied","Copied value"),"success"),s("dashboard_click_event",{click_target:`connection_copy_${k}`,page:"connection"})}catch{b(o("connection.targets.copyFailed","Failed to copy value"),"error")}};return e.jsxs("div",{className:t.page,children:[e.jsx(re,{title:o("page.connection.title","Connection"),description:o("page.connection.description","Inspect MCP server, AI agent, Studio plugin, and connection log status."),helpTopicId:"connection",helpState:{connectionLevel:g}}),e.jsx(Fo,{agents:(i==null?void 0:i.mcpInstances)??[],isDisconnected:u,pinnedTargetClientId:T,priorityTarget:$,status:n??null,studioRoutingMode:C,studioTargets:v,t:o,timeAgo:l=>F(l,o),onCopySelector:H,onManageRouting:()=>s("dashboard_click_event",{click_target:"connection_manage_routing",page:"connection"})}),e.jsxs("div",{className:t.card,children:[e.jsx("div",{className:t.cardHeader,children:o("connection.server.title","Server Status")}),u?e.jsxs("div",{className:t.disconnected,children:[e.jsx("h3",{children:o("level.l0.title")}),e.jsx("p",{children:o("level.l0.message")}),e.jsx("p",{children:o("common.reconnecting")}),e.jsxs("div",{className:t.disconnectedActions,children:[e.jsx("button",{className:t.btn,onClick:()=>window.location.reload(),children:o("connection.reconnect","Reconnect")}),e.jsx("button",{className:t.btn,onClick:()=>{window.location.hash="#/settings"},children:o("connection.checkSettings","Check Settings")})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:t.statusRow,children:e.jsx(oe,{status:z})}),e.jsxs("dl",{className:t.serverGrid,children:[(n==null?void 0:n.version)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(h,{label:o("connection.server.version","Version"),tooltip:o("connection.server.version.tooltip","Installed MCP server version")})}),e.jsx("dd",{children:e.jsx(de,{text:o("connection.server.version.tooltip","Installed MCP server version"),children:`v${n.version}`})})]}),(n==null?void 0:n.pid)!=null&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(h,{label:o("connection.server.pid","PID"),tooltip:o("connection.server.pid.tooltip","Operating system process identifier")})}),e.jsx("dd",{children:n.pid})]}),(n==null?void 0:n.uptime)!=null&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(h,{label:o("connection.server.uptime","Uptime"),tooltip:o("connection.server.uptime.tooltip","Time elapsed since the MCP server started")})}),e.jsx("dd",{children:pe(_??n.uptime)})]}),(n==null?void 0:n.sessionId)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(h,{label:o("connection.server.session","Session"),tooltip:o("connection.server.session.tooltip","Current MCP session identifier")})}),e.jsx("dd",{children:n.sessionId.slice(0,8)})]}),(i==null?void 0:i.serverExecutable)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(h,{label:o("connection.server.exec","Exec"),tooltip:o("connection.server.exec.tooltip","Executable path used to launch the MCP server")})}),e.jsx("dd",{children:i.serverExecutable})]})]})]})]}),e.jsxs("div",{className:`${t.card} ${u?t.disabled:""}`,children:[e.jsxs("div",{className:t.cardHeader,children:[e.jsxs("span",{children:[o("connection.agents.title","AI Agents")," ","(",(i==null?void 0:i.mcpInstanceCount)??0,")"]}),e.jsx("button",{className:t.toggleBtn,onClick:()=>y(l=>!l),"aria-label":A?o("common.collapse","Collapse"):o("common.expand","Expand"),children:A?"▾":"▸"})]}),A&&e.jsxs("table",{className:t.table,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:o("connection.agents.name","Agent")}),e.jsx("th",{children:e.jsx(h,{label:o("connection.server.pid","PID"),tooltip:o("connection.server.pid.tooltip","Operating system process identifier")})}),e.jsx("th",{children:e.jsx(h,{label:o("connection.agents.projectRoot","Project Root"),tooltip:o("connection.agents.projectRoot.tooltip","Authoritative project root for sync ownership")})}),e.jsx("th",{children:o("connection.agents.connected","Connected")}),e.jsx("th",{children:e.jsx(h,{label:o("connection.agents.lastSeen","Last Seen"),tooltip:o("connection.agents.lastSeen.tooltip","Most recent heartbeat or activity from this agent")})}),e.jsx("th",{children:e.jsx(h,{label:o("connection.agents.lastCommand","Last Command"),tooltip:o("connection.agents.lastCommand.tooltip","Most recent tool call executed by this agent")})}),e.jsx("th",{})]})}),e.jsx("tbody",{children:i!=null&&i.mcpInstances&&i.mcpInstances.length>0?i.mcpInstances.map(l=>e.jsxs("tr",{children:[e.jsxs("td",{children:[e.jsx("span",{className:t[`activity_${zo(l.lastSeen)}`]}),l.aiClientName??o("connection.agents.unknown","Unknown")]}),e.jsx("td",{children:l.pid}),e.jsx("td",{children:l.projectRoot??l.cwd??o("connection.agents.projectRoot.unresolved","Unresolved")}),e.jsx("td",{children:F(l.connectedAt,o)}),e.jsx("td",{children:l.lastSeen?F(l.lastSeen,o):"-"}),e.jsx("td",{children:l.lastCommandAt?F(l.lastCommandAt,o):"-"}),e.jsx("td",{children:!l.isServer&&e.jsx("button",{className:t.killBtn,onClick:()=>{s("dashboard_click_event",{click_target:"connection_kill_agent",page:"connection"}),p({instanceId:l.instanceId,name:l.aiClientName??l.instanceId.slice(0,8)})},children:o("connection.agents.kill","Kill")})})]},l.instanceId)):e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:t.emptyRow,children:o("connection.agents.none","No agents connected")})})})]})]}),e.jsxs("div",{className:`${t.card} ${u?t.disabled:""}`,children:[e.jsxs("div",{className:t.cardHeader,children:[o("connection.targets.title","Studio Targets")," ","(",v.length,")"]}),e.jsx("p",{className:t.cardHint,children:o("connection.targets.help","When multiple Studio windows are connected, tell the agent to use Studio ID studio-1 to choose one.")}),e.jsx("div",{className:t.tableWrap,children:e.jsxs("table",{className:t.table,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:e.jsx(h,{label:o("connection.targets.target","Studio ID"),tooltip:o("connection.targets.target.tooltip","Short name for this Roblox Studio window")})}),e.jsx("th",{children:o("connection.targets.place","Place")}),e.jsx("th",{children:e.jsx(h,{label:o("connection.targets.placeId","Place ID"),tooltip:o("connection.targets.placeId.tooltip","Roblox Place ID for this Studio window")})}),e.jsx("th",{children:e.jsx(h,{label:o("connection.targets.clientId","Connection ID"),tooltip:o("connection.targets.clientId.tooltip","Full connection ID for diagnostics. Usually use Studio ID instead.")})}),e.jsx("th",{children:e.jsx(h,{label:o("connection.targets.session","Session"),tooltip:o("connection.targets.session.tooltip","Command channel state for this Studio target")})}),e.jsx("th",{children:e.jsx(h,{label:o("connection.targets.lastUsed","Last Used"),tooltip:o("connection.targets.lastUsed.tooltip","Most recent plugin-route request routed to this Studio target")})}),e.jsx("th",{children:e.jsx(h,{label:o("connection.targets.lastSeen","Last Seen"),tooltip:o("connection.targets.lastSeen.tooltip","Most recent heartbeat received from this Studio target")})}),e.jsx("th",{children:e.jsx(h,{label:o("connection.targets.version","Version"),tooltip:o("connection.targets.version.tooltip","Installed plugin version reported by Studio")})}),e.jsx("th",{children:e.jsx(h,{label:o("connection.targets.routing","Routing"),tooltip:o("connection.targets.routing.tooltip","Routing priority for requests without a named Studio target")})}),e.jsx("th",{children:e.jsx(h,{label:o("connection.targets.inFlight","In Flight"),tooltip:o("connection.targets.inFlight.tooltip","Active command request currently routed to this Studio target")})})]})}),e.jsx("tbody",{children:v.length>0?v.map(l=>{const k=l.clientId.slice(0,10);return e.jsxs("tr",{children:[e.jsxs("td",{children:[e.jsx("span",{className:t.monoMuted,title:l.clientId,children:l.targetAlias}),e.jsx(V,{text:o("connection.targets.copyTargetAlias","Copy Studio ID"),children:e.jsx("button",{type:"button",className:t.copyIconButton,"aria-label":o("connection.targets.copyTargetAlias","Copy Studio ID"),onClick:()=>H(l.targetAlias,"target_alias"),children:e.jsx(K,{size:13,"aria-hidden":"true"})})})]}),e.jsx("td",{children:e.jsx("span",{className:t.targetPrimary,children:l.placeName??"-"})}),e.jsxs("td",{children:[l.placeId??"-",l.placeId!==void 0?e.jsx(V,{text:o("connection.targets.copyPlaceId","Copy Place ID"),children:e.jsx("button",{type:"button",className:t.copyIconButton,"aria-label":o("connection.targets.copyPlaceId","Copy Place ID"),onClick:()=>H(String(l.placeId),"place_id"),children:e.jsx(K,{size:13,"aria-hidden":"true"})})}):null]}),e.jsxs("td",{children:[e.jsx("span",{className:t.monoMuted,title:l.clientId,children:k}),e.jsx(V,{text:o("connection.targets.copyClientId","Copy Connection ID"),children:e.jsx("button",{type:"button",className:t.copyIconButton,"aria-label":o("connection.targets.copyClientId","Copy Connection ID"),onClick:()=>H(l.clientId,"client_id"),children:e.jsx(K,{size:13,"aria-hidden":"true"})})})]}),e.jsx("td",{children:l.connectionState}),e.jsx("td",{children:l.lastRoutedAt?F(l.lastRoutedAt,o):"-"}),e.jsx("td",{children:F(l.lastSeen,o)}),e.jsx("td",{children:l.pluginVersion??"-"}),e.jsx("td",{children:C==="pinned"&&T===l.clientId?e.jsx("span",{className:t.routingBadge,children:o("connection.routing.pinnedBadge","Pinned")}):C==="recentPriority"&&($==null?void 0:$.clientId)===l.clientId?e.jsx("span",{className:t.routingBadge,children:o("connection.routing.priorityBadge","Priority")}):e.jsx("span",{className:t.monoMuted,children:"-"})}),e.jsx("td",{children:l.inFlightRequestId?l.inFlightRequestId.slice(0,8):"-"})]},l.clientId)}):e.jsx("tr",{children:e.jsx("td",{colSpan:9,className:t.emptyRow,children:o("connection.targets.none","No Studio targets connected. Open Roblox Studio and connect WEPPY Plugin.")})})})]})})]}),e.jsxs("div",{className:`${t.card} ${u?t.disabled:""}`,children:[e.jsxs("div",{className:t.cardHeader,children:[e.jsx("span",{children:o("connection.log.title","Connection Log")}),e.jsx("button",{className:t.clearButton,onClick:()=>{s("dashboard_click_event",{click_target:"connection_clear_log",page:"connection"}),I(!0)},children:o("common.clear","Clear")})]}),e.jsx(Ne,{entries:f})]}),e.jsx(X,{open:M,title:o("connection.clear.title","Clear connection log?"),message:o("connection.clear.message","This permanently removes the stored connection log for the current project."),cancelLabel:o("common.cancel","Cancel"),confirmLabel:o("common.clear","Clear"),loading:B,onCancel:()=>!B&&I(!1),onConfirm:R}),e.jsx(X,{open:!!N,title:o("connection.agents.kill.title","Kill agent?"),message:`"${N==null?void 0:N.name}" 프로세스를 강제 종료합니다. 해당 에이전트의 진행 중인 작업이 중단됩니다.`,cancelLabel:o("common.cancel","Cancel"),confirmLabel:o("connection.agents.kill","Kill"),loading:j,onCancel:()=>!j&&p(null),onConfirm:Y})]})}export{Jo as Component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as T,j as e,f as W,l as q,d as _,r,v as z,w as Q,x as X,a as H,s as K,y as Z,k as A,N as J}from"./index-B9LVK3-K.js";import{P as ee}from"./PageHeader-Cqg4GMtU.js";import{I as N}from"./InfoLabel-ZfsTcz5c.js";import{s as g}from"./ConfirmModal.module-NrFlfTWy.js";import{T as B}from"./TooltipText-ZamrETeK.js";import{s as o,u as te}from"./useSettings-mbARvRgI.js";import{C as M}from"./copy-Cey6jv67.js";function k(n,a){return e.jsxs("div",{className:g.pathBlock,children:[e.jsx("span",{className:g.pathLabel,children:n}),e.jsx("code",{className:g.pathCode,children:a})]})}function oe(n){const t=/^[A-Z]:\\/i.test(n)||n.includes("\\")?"\\":"/";return`${n.replace(/[\\/]+$/,"")}${t}weppy-project-sync`}function ne({open:n,step:a,selectedProjectRoot:t,studioConnected:c,loading:d=!1,errorMessage:p=null,onClose:s,onPick:h,onApply:j}){const{t:l}=T();if(!n)return null;const S=t?oe(t):"";return e.jsx("div",{className:g.backdrop,onClick:d?void 0:s,role:"presentation",children:e.jsxs("div",{className:g.modal,onClick:y=>y.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"project-root-change-modal-title",children:[e.jsx("h2",{id:"project-root-change-modal-title",className:g.title,children:a==="initial"?l("header.projectRootModal.initial.title","Change project root"):l("header.projectRootModal.confirm.title","Confirm new project root")}),e.jsx("p",{className:g.message,children:a==="initial"?c?l("header.projectRootModal.initial.body.connected","MCP will switch to the new project root and resync current Studio contents into the new target."):l("header.projectRootModal.initial.body.disconnected","MCP will switch to the new project root and use the new folder as the next sync target."):l("header.projectRootModal.confirm.body","Review the selected project folder before applying.")}),e.jsxs("div",{className:g.bodyGrid,children:[a==="initial"?e.jsxs(e.Fragment,{children:[k(l("header.projectRootModal.initial.nextSyncRoot","New sync target after selection"),l("header.projectRootModal.initial.nextSyncRoot.placeholder","<selected project folder>/weppy-project-sync")),e.jsxs("ul",{className:g.warningList,children:[c?e.jsxs(e.Fragment,{children:[e.jsx("li",{children:l("header.projectRootModal.initial.warningStop","Current sync stops immediately.")}),e.jsx("li",{children:l("header.projectRootModal.initial.warningFreshSync","The current Studio contents will be used to build a fresh full sync in the new target.")})]}):e.jsx("li",{children:l("header.projectRootModal.initial.warningDeferredSync","If Studio is not connected, full resync starts the next time the plugin connects.")}),e.jsx("li",{children:l("header.projectRootModal.initial.warningNoMove","Old sync folders are not moved automatically.")})]})]}):e.jsxs(e.Fragment,{children:[k(l("header.projectRootModal.confirm.projectRoot","Selected project folder"),t??""),k(l("header.projectRootModal.confirm.syncRoot","New sync target"),S),e.jsx("p",{className:g.message,children:l("header.projectRootModal.confirm.warningNoMove","Existing sync folders are not moved automatically.")})]}),p?e.jsx("p",{className:`${g.message} ${g.errorMessage}`,children:p}):null]}),e.jsxs("div",{className:g.actions,children:[e.jsx("button",{className:g.cancelButton,onClick:s,disabled:d,children:l("header.projectRootModal.cancel","Cancel")}),a==="initial"?e.jsx("button",{className:g.confirmButton,onClick:h,disabled:d,children:d?"...":l("header.projectRootModal.pick","Choose folder")}):e.jsx("button",{className:g.confirmButton,onClick:j,disabled:d||!t,children:d?"...":l("header.projectRootModal.apply","Apply change")})]})]})})}function F(n,a){if(n&&typeof n=="object"&&"message"in n&&typeof n.message=="string"){const t=n.message.trim();if(t.length>0)return t}return a}function se(){const{level:n,status:a}=W(),{t}=T(),{show:c}=q(),{search:d}=_(),p=r.useRef(null),[s,h]=r.useState(null),[j,l]=r.useState(!1),[S,y]=r.useState(null),[m,R]=r.useState(null),[f,v]=r.useState(!1),[w,L]=r.useState(!1),[I,x]=r.useState(null),i=r.useMemo(()=>new URLSearchParams(d).get("section")==="project-root",[d]),C=r.useCallback(async()=>{if(n==="disconnected"){h(null),l(!1);return}l(!1);try{const u=await z();h(u)}catch{h(null),l(!0)}},[n]);r.useEffect(()=>{C()},[C,a==null?void 0:a.connectedClients,a==null?void 0:a.sessionId]),r.useEffect(()=>{var u,P,O;i&&((P=(u=p.current)==null?void 0:u.scrollIntoView)==null||P.call(u,{block:"start",behavior:"smooth"}),(O=p.current)==null||O.focus())},[i]);const b=(u=!1)=>{!u&&(f||w)||(y(null),R(null),x(null))},E=()=>{n==="disconnected"||!s||(x(null),R(null),y("initial"))},Y=async()=>{v(!0),x(null);try{const u=await X();if(u.cancelled||!u.projectRoot){b(!0);return}R(u.projectRoot),y("confirm")}catch(u){x(F(u,t("header.projectRootModal.error","Failed to change project root")))}finally{v(!1)}},G=async()=>{if(m){L(!0),x(null);try{const u=await Q(m);h(u),l(!1),b(!0)}catch(u){const P=F(u,t("header.projectRootModal.error","Failed to change project root"));x(P),c(P,"error")}finally{L(!1)}}},$=j?t("controls.projectRoot.unavailable","Project root unavailable"):t("common.loading","Loading..."),V=n==="disconnected"||!s;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{id:"controls-project-root",ref:p,tabIndex:-1,className:o.card,children:[e.jsxs("div",{className:o.cardHeader,children:[e.jsx(N,{label:t("controls.projectRoot.title","Project Root"),tooltip:t("controls.projectRoot.title.tooltip","Authoritative project root and sync target used by MCP.")}),e.jsx(B,{text:t("controls.projectRoot.live.tooltip","Changing this updates MCP runtime state immediately after confirmation."),children:e.jsx("span",{className:`${o.headerBadge} ${o.headerBadgeLive}`,children:t("settings.general.liveApply","Live Apply")})})]}),e.jsxs("dl",{className:o.controlGrid,children:[e.jsx("dt",{children:t("controls.projectRoot.projectRoot","Project Root")}),e.jsx("dd",{children:(s==null?void 0:s.projectRoot)??$}),e.jsx("dt",{children:t("controls.projectRoot.syncRoot","Sync Root")}),e.jsx("dd",{children:(s==null?void 0:s.projectSyncRoot)??$})]}),e.jsx("p",{className:o.controlHint,children:t("controls.projectRoot.hint","Use this only when MCP should write sync data under a different project folder. Existing sync folders are not moved automatically.")}),e.jsx("button",{type:"button",className:o.actionBtn,disabled:V,onClick:E,children:t("header.changeProjectRoot","Change Project Root")})]}),e.jsx(ne,{open:S!==null,step:S??"initial",selectedProjectRoot:m,studioConnected:n==="studioConnected",loading:f||w,errorMessage:I,onClose:b,onPick:Y,onApply:G})]})}function ie(n){if(!n)return null;const a=n.placeName?n.placeId!==void 0?`${n.placeName} · ${n.placeId}`:n.placeName:n.placeId!==void 0?String(n.placeId):null;return a?`${n.targetAlias} · ${a}`:n.targetAlias}function U(n,a){const t=Math.max(0,Math.floor((Date.now()-n)/1e3));return t<60?`${t}${a("connection.time.secondsAgo","s ago")}`:t<3600?`${Math.floor(t/60)}${a("connection.time.minutesAgo","m ago")}`:`${Math.floor(t/3600)}${a("connection.time.hoursAgo","h ago")}`}function ae(){const{status:n,level:a}=W(),{t}=T(),{show:c}=q(),{search:d}=_(),p=r.useRef(null),[s,h]=r.useState(null),[j,l]=r.useState(null),S=r.useMemo(()=>new URLSearchParams(d).get("section")==="studio-routing",[d]),y=r.useCallback(async()=>{if(a==="disconnected"){h(null);return}try{const i=await H.get("/api/dashboard/studio-routing");h(i)}catch{h(null)}},[a]);r.useEffect(()=>{y()},[y,n==null?void 0:n.connectedClients,n==null?void 0:n.sessionId]),r.useEffect(()=>{var i,C,b;S&&((C=(i=p.current)==null?void 0:i.scrollIntoView)==null||C.call(i,{block:"start",behavior:"smooth"}),(b=p.current)==null||b.focus())},[S]);const m=(s==null?void 0:s.studioRoutingMode)??(n==null?void 0:n.studioRoutingMode)??"recentPriority",R=(s==null?void 0:s.pinnedTargetClientId)??(n==null?void 0:n.pinnedTargetClientId)??null,f=K((s==null?void 0:s.targets)??(n==null?void 0:n.pluginClients)??[],m,R),v=(s==null?void 0:s.priorityTarget)??Z(f,m,R),w=ie(v),L=new Set(f.filter(i=>i.placeId!==void 0).map(i=>i.placeId).filter((i,C,b)=>b.filter(E=>E===i).length>1)),I=async i=>{l(i.studioRoutingMode==="pinned"?i.pinnedTargetClientId??"pinned":"recentPriority");try{const C=await H.patch("/api/dashboard/studio-routing",i);h(C)}catch{c(t("connection.routing.updateFailed","Failed to update routing target"),"error")}finally{l(null)}},x=async i=>{try{await navigator.clipboard.writeText(i),c(t("connection.targets.copied","Copied value"),"success")}catch{c(t("connection.targets.copyFailed","Failed to copy value"),"error")}};return e.jsxs("div",{id:"controls-studio-routing",ref:p,tabIndex:-1,className:o.card,children:[e.jsx("div",{className:o.cardHeader,children:e.jsx(N,{label:t("controls.studioRouting.title","Studio Routing"),tooltip:t("controls.studioRouting.title.tooltip","Routing priority for MCP requests that do not name a Studio target.")})}),e.jsxs("div",{className:o.routingOverview,children:[e.jsxs("div",{className:o.routingOverviewCopy,children:[e.jsx("span",{className:o.routingEyebrow,children:t("controls.studioRouting.priorityTitle","Priority for requests without a named Studio target")}),e.jsx("strong",{children:m==="pinned"?t("connection.routing.pinned","Manual: Pinned Studio"):t("connection.routing.recentPriority","Automatic: Recent priority")}),e.jsx("p",{children:t("controls.studioRouting.priorityDescription","Explicit Studio ID, Connection ID, or Place ID requests bypass this priority setting and route to the named Studio.")})]}),e.jsxs("div",{className:o.priorityTargetSummary,children:[e.jsx("span",{children:t("controls.studioRouting.currentPriorityTarget","Current priority target")}),e.jsx("strong",{children:w??t("controls.studioRouting.noPriorityTarget","No connected Studio target")})]})]}),e.jsxs("div",{className:o.studioRoutingChoiceControl,role:"group","aria-label":t("connection.routing.priorityControl","Priority mode for requests without a named Studio target"),children:[e.jsxs("button",{type:"button",className:m==="recentPriority"?o.segmentActive:o.segment,disabled:j!==null,"aria-pressed":m==="recentPriority",onClick:()=>I({studioRoutingMode:"recentPriority"}),children:[e.jsx("span",{children:t("connection.routing.recentPriority","Automatic: Recent priority")}),e.jsx("small",{children:t("controls.studioRouting.recentPriorityHelp","Requests the highest-priority active Studio, based on recent routed commands and connection order.")})]}),e.jsxs("button",{type:"button",className:m==="pinned"?o.segmentActive:o.segment,disabled:!f.length||j!==null,"aria-pressed":m==="pinned",onClick:()=>I({studioRoutingMode:"pinned"}),children:[e.jsx("span",{children:t("connection.routing.pinned","Manual: Pinned Studio")}),e.jsx("small",{children:t("controls.studioRouting.pinnedHelp","Requests the pinned Studio unless the agent names a Studio ID, Connection ID, or Place ID.")})]})]}),L.size>0?e.jsx("p",{className:o.routingWarning,children:t("controls.studioRouting.duplicatePlaceWarning","More than one connected Studio window has the same Place ID. Ask the AI agent to use Studio ID for that place.")}):null,e.jsx("div",{className:o.tableWrap,children:e.jsxs("table",{className:o.table,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:t("connection.targets.routing","Routing")}),e.jsx("th",{children:t("connection.targets.target","Studio ID")}),e.jsx("th",{children:t("connection.targets.place","Place")}),e.jsx("th",{children:t("connection.targets.placeId","Place ID")}),e.jsx("th",{children:t("connection.targets.lastUsed","Last Used")}),e.jsx("th",{children:t("connection.targets.lastSeen","Last Seen")}),e.jsx("th",{children:t("connection.targets.clientId","Connection ID")})]})}),e.jsx("tbody",{children:f.length>0?f.map(i=>e.jsxs("tr",{children:[e.jsx("td",{children:m==="pinned"&&R===i.clientId?e.jsx("span",{className:o.routingBadge,children:t("connection.routing.pinnedBadge","Pinned")}):m==="recentPriority"&&(v==null?void 0:v.clientId)===i.clientId?e.jsx("span",{className:o.routingBadge,children:t("connection.routing.priorityBadge","Priority")}):m==="pinned"?e.jsx("button",{type:"button",className:o.setPriorityTargetButton,disabled:j!==null,onClick:()=>I({studioRoutingMode:"pinned",pinnedTargetClientId:i.clientId}),children:t("connection.routing.setPriorityTarget","Set as priority target")}):null}),e.jsxs("td",{children:[e.jsx("span",{className:o.monoMuted,title:i.clientId,children:i.targetAlias}),e.jsx(A,{text:t("connection.targets.copyTargetAlias","Copy Studio ID"),children:e.jsx("button",{type:"button",className:o.copyIconButton,"aria-label":t("connection.targets.copyTargetAlias","Copy Studio ID"),onClick:()=>x(i.targetAlias),children:e.jsx(M,{size:13,"aria-hidden":"true"})})})]}),e.jsx("td",{children:i.placeName??"-"}),e.jsxs("td",{children:[i.placeId??"-",i.placeId!==void 0?e.jsx(A,{text:t("connection.targets.copyPlaceId","Copy Place ID"),children:e.jsx("button",{type:"button",className:o.copyIconButton,"aria-label":t("connection.targets.copyPlaceId","Copy Place ID"),onClick:()=>x(String(i.placeId)),children:e.jsx(M,{size:13,"aria-hidden":"true"})})}):null]}),e.jsx("td",{children:i.lastRoutedAt?U(i.lastRoutedAt,t):"-"}),e.jsx("td",{children:U(i.lastSeen,t)}),e.jsxs("td",{children:[e.jsx("span",{className:o.monoMuted,title:i.clientId,children:i.clientId.slice(0,10)}),e.jsx(A,{text:t("connection.targets.copyClientId","Copy Connection ID"),children:e.jsx("button",{type:"button",className:o.copyIconButton,"aria-label":t("connection.targets.copyClientId","Copy Connection ID"),onClick:()=>x(i.clientId),children:e.jsx(M,{size:13,"aria-hidden":"true"})})})]})]},i.clientId)):e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:o.emptyRow,children:t("connection.targets.none","No Studio targets connected. Open Roblox Studio and connect WEPPY Plugin.")})})})]})})]})}const le=["debug","info","warn","error"];function D({checked:n,onChange:a,testId:t,ariaLabel:c}){return e.jsxs("label",{className:o.toggleSwitch,"data-testid":t,children:[e.jsx("input",{type:"checkbox",className:o.toggleInput,checked:n,"aria-label":c,onChange:d=>a(d.target.checked)}),e.jsx("span",{className:o.toggleTrack,"aria-hidden":"true",children:e.jsx("span",{className:o.toggleThumb})})]})}function re({settings:n,updateHotSetting:a}){const{t}=T(),[c,d]=r.useState(null),p=r.useCallback(async(s,h)=>{await a(s,h),d(s),setTimeout(()=>d(j=>j===s?null:j),2e3)},[a]);return e.jsxs("div",{className:o.card,children:[e.jsxs("div",{className:o.cardHeader,children:[e.jsx(N,{label:t("settings.general.title","General Settings"),tooltip:t("settings.general.title.tooltip","Hot settings that apply immediately when changed.")}),e.jsx(B,{text:t("settings.general.liveApply.tooltip","Changes in this section are applied immediately without a separate save button."),children:e.jsx("span",{className:`${o.headerBadge} ${o.headerBadgeLive}`,children:t("settings.general.liveApply","Live Apply")})})]}),n?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:o.settingRow,children:[e.jsx("span",{className:o.settingLabel,children:e.jsx(N,{label:t("settings.general.logLevel","Log Level"),tooltip:t("settings.general.logLevel.tooltip","Sets how much detail WEPPY Dashboard writes to its logs.")})}),e.jsxs("div",{className:o.settingControl,children:[e.jsx("select",{className:o.select,value:n.hot.LOG_LEVEL,onChange:s=>p("LOG_LEVEL",s.target.value),children:le.map(s=>e.jsx("option",{value:s,children:s},s))}),c==="LOG_LEVEL"&&e.jsx("span",{className:o.savedIndicator,children:t("settings.general.applied")})]})]}),e.jsxs("div",{className:o.settingRow,children:[e.jsx("span",{className:o.settingLabel,children:e.jsx(N,{label:t("settings.general.localHistory","Tool History Recording"),tooltip:t("settings.general.localHistory.tooltip","Stores local tool execution history for the WEPPY Dashboard history views.")})}),e.jsxs("div",{className:o.settingControl,children:[e.jsx("span",{className:`${o.savedIndicator} ${c==="ENABLE_LOCAL_HISTORY"?"":o.savedIndicatorHidden}`,children:t("settings.general.applied","Applied")}),e.jsx(D,{checked:n.hot.ENABLE_LOCAL_HISTORY,ariaLabel:t("settings.general.localHistory","Tool History Recording"),testId:"settings-toggle-enable-local-history",onChange:s=>p("ENABLE_LOCAL_HISTORY",s)})]})]}),e.jsxs("div",{className:o.settingRow,children:[e.jsx("span",{className:o.settingLabel,children:e.jsx(N,{label:t("settings.general.localStatistics","Tool Statistics Collection"),tooltip:t("settings.general.localStatistics.tooltip","Aggregates local usage statistics for WEPPY Dashboard reporting.")})}),e.jsxs("div",{className:o.settingControl,children:[e.jsx("span",{className:`${o.savedIndicator} ${c==="ENABLE_LOCAL_STATISTICS"?"":o.savedIndicatorHidden}`,children:t("settings.general.applied","Applied")}),e.jsx(D,{checked:n.hot.ENABLE_LOCAL_STATISTICS,ariaLabel:t("settings.general.localStatistics","Tool Statistics Collection"),testId:"settings-toggle-enable-local-statistics",onChange:s=>p("ENABLE_LOCAL_STATISTICS",s)})]})]}),e.jsxs("div",{className:o.settingRow,children:[e.jsx("span",{className:o.settingLabel,children:e.jsx(N,{label:t("settings.general.contextCapture","Context Capture"),tooltip:t("settings.general.contextCapture.tooltip","When enabled, WEPPY Dashboard records structured execution context for changelog and playtest views.")})}),e.jsxs("div",{className:o.settingControl,children:[e.jsx("span",{className:`${o.savedIndicator} ${c==="ENABLE_CONTEXT_CAPTURE"?"":o.savedIndicatorHidden}`,children:t("settings.general.applied","Applied")}),e.jsx(D,{checked:n.hot.ENABLE_CONTEXT_CAPTURE,ariaLabel:t("settings.general.contextCapture","Context Capture"),testId:"settings-toggle-enable-context-capture",onChange:s=>p("ENABLE_CONTEXT_CAPTURE",s)})]})]}),e.jsxs("div",{className:o.settingRow,children:[e.jsx("span",{className:o.settingLabel,children:e.jsx(N,{label:t("settings.general.requestTimeout","Action Timeout"),tooltip:t("settings.general.requestTimeout.tooltip","Maximum time WEPPY Dashboard waits for an action before it fails.")})}),e.jsxs("div",{className:o.settingControl,children:[e.jsx("input",{type:"number",className:o.numberInput,value:n.hot.REQUEST_TIMEOUT,min:1e3,max:12e4,step:1e3,onChange:s=>{const h=parseInt(s.target.value,10);isNaN(h)||p("REQUEST_TIMEOUT",h)}}),e.jsx(B,{text:t("settings.general.requestTimeout.unit.tooltip","Action timeout is measured in milliseconds."),children:e.jsx("span",{className:o.unit,children:t("settings.general.requestTimeout.unit","ms")})}),c==="REQUEST_TIMEOUT"&&e.jsx("span",{className:o.savedIndicator,children:t("settings.general.applied","Applied")})]})]})]}):e.jsx("div",{className:o.loading,children:t("settings.unavailable")})]})}function je(){const{t:n}=T(),{search:a}=_(),{settings:t,updateHotSetting:c,loading:d}=te();return r.useMemo(()=>new URLSearchParams(a).get("section"),[a])==="license"?e.jsx(J,{to:"/settings?section=license",replace:!0}):d?e.jsx("div",{className:o.page,children:e.jsx("div",{className:o.loading,children:n("common.loading")})}):e.jsxs("div",{className:o.page,children:[e.jsx(ee,{title:n("page.controls.title","Controls"),description:n("page.controls.description","Manage project root, Studio routing, and MCP live settings."),helpTopicId:"controls"}),e.jsx(se,{}),e.jsx(ae,{}),e.jsx(re,{settings:t,updateHotSetting:c})]})}export{je as Component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as _,r as b,j as a,g as h}from"./index-B9LVK3-K.js";const m="_scope_120mz_1",x="_main_120mz_13",j="_label_120mz_20",I="_selectorLabel_120mz_28",L="_placeSelect_120mz_35",z="_name_120mz_48",A="_id_120mz_59",w="_badgeLive_120mz_66",k="_badgeMuted_120mz_67",y="_copy_120mz_86",E="_note_120mz_98",n={scope:m,main:x,label:j,selectorLabel:I,placeSelect:L,name:z,id:A,badgeLive:w,badgeMuted:k,copy:y,note:E};function d(e,l){return l===null?null:e.places.find(c=>c.placeId===l)??null}function S(e){var l;return e.lastActivePlaceId!==null?e.lastActivePlaceId:((l=e.places[0])==null?void 0:l.placeId)??null}function M(e){return e.pluginConnected&&e.activePlaceId!==null?e.activePlaceId:S(e)}function U(e,l){if(e.pluginConnected&&e.activePlaceId!==null){const t=d(e,e.activePlaceId);return{label:l("placeScope.current.label","Current Place"),placeId:e.activePlaceId,placeName:e.activePlaceName??(t==null?void 0:t.placeName)??l("placeScope.unknownPlace","Unknown place"),badge:l("placeScope.live","Live"),live:!0,note:null}}const c=S(e),s=d(e,c);if(c!==null){const t=c===e.lastActivePlaceId?e.lastActivePlaceName:null;return{label:l("placeScope.lastActive.label","Last Active Place"),placeId:c,placeName:t??(s==null?void 0:s.placeName)??l("placeScope.unknownPlace","Unknown place"),badge:l("placeScope.pluginRequired","Plugin required"),live:!1,note:l("placeScope.pluginRequired.note","Connect WEPPY Plugin to confirm the live active place.")}}return{label:l("placeScope.noPlace.label","Place scope"),placeId:null,placeName:l("placeScope.noPlace.value","No place data available yet"),badge:l("placeScope.noPlace.badge","No place"),live:!1,note:l("placeScope.noPlace.note","Connect WEPPY Plugin and sync a place to create place-scoped data.")}}function q(e,l,c){const s=typeof l=="number"?d(e,l):null,t=M(e),o=(s==null?void 0:s.placeId)??t,r=d(e,o);if(o===null)return{label:c("placeScope.noPlace.label","Place scope"),placeId:null,placeName:c("placeScope.noPlace.value","No place data available yet"),badge:c("placeScope.noPlace.badge","No place"),live:!1,note:c("placeScope.noPlace.note","Connect WEPPY Plugin and sync a place to create place-scoped data.")};const u=e.pluginConnected&&e.activePlaceId===o,f=o===e.lastActivePlaceId?e.lastActivePlaceName:null;return{label:u?c("placeScope.current.label","Current Place"):c("placeScope.selected.label","Selected Place"),placeId:o,placeName:(r==null?void 0:r.placeName)??f??c("placeScope.unknownPlace","Unknown place"),badge:u?c("placeScope.live","Live"):c("placeScope.stored","Stored"),live:u,note:u?null:c("placeScope.selected.note","Showing stored data only. Studio routing is unchanged.")}}function F(e,l){switch(e){case"sync":return l("placeScope.surface.sync","Sync status and logs use this place.");case"changelog":return l("placeScope.surface.changelog","Changelog sessions use this place.");case"playtest":return l("placeScope.surface.playtest","Playtest reports use this place.");case"uiStudio":return l("placeScope.surface.uiStudio","UI captures and change history use this place.");case"tools":return l("placeScope.surface.tools","Tool history and statistics use this place.")}}function T({surface:e,selectable:l=!1,selectedPlaceId:c=null,onSelectedPlaceIdChange:s}){const{t}=_(),[o,r]=b.useState(null),[u,f]=b.useState(!0);if(b.useEffect(()=>{let i=!1;async function v(){try{const P=await h();i||r(P)}catch{i||r(null)}finally{i||f(!1)}}return v(),()=>{i=!0}},[]),b.useEffect(()=>{!l||!o||typeof c!="number"||d(o,c)||s==null||s(null)},[s,l,c,o]),u)return a.jsx("div",{className:n.scope,"aria-live":"polite",children:a.jsx("span",{className:n.label,children:t("placeScope.loading","Loading place scope...")})});if(!o)return a.jsx("div",{className:n.scope,"aria-live":"polite",children:a.jsx("span",{className:n.label,children:t("placeScope.unavailable","Place scope unavailable")})});const p=l?q(o,c,t):U(o,t),g=typeof p.placeId=="number"?String(p.placeId):"",N=l&&o.places.length>0;return a.jsxs("div",{className:n.scope,"aria-live":"polite",children:[a.jsxs("div",{className:n.main,children:[N?a.jsxs(a.Fragment,{children:[a.jsxs("label",{className:n.selectorLabel,children:[a.jsx("span",{className:n.label,children:t("placeScope.selector.label","Place data")}),a.jsx("select",{className:n.placeSelect,value:g,onChange:i=>{const v=Number.parseInt(i.currentTarget.value,10);s==null||s(Number.isInteger(v)?v:null)},children:o.places.map(i=>a.jsxs("option",{value:i.placeId,children:[i.placeName," (",i.placeId,")"]},i.placeId))})]}),a.jsx("span",{className:n.label,children:p.label}),a.jsx("span",{className:n.name,children:p.placeName})]}):a.jsxs(a.Fragment,{children:[a.jsx("span",{className:n.label,children:p.label}),a.jsx("span",{className:n.name,children:p.placeName})]}),p.placeId!==null?a.jsx("span",{className:n.id,children:p.placeId}):null,a.jsx("span",{className:p.live?n.badgeLive:n.badgeMuted,children:p.badge})]}),a.jsxs("div",{className:n.copy,children:[a.jsx("span",{children:F(e,t)}),p.note?a.jsx("span",{className:n.note,children:p.note}):null]})]})}export{T as C};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._scope_120mz_1{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0;padding:9px 12px;border:1px solid var(--border);border-radius:8px;background:var(--bg-secondary)}._main_120mz_13{display:flex;align-items:center;gap:8px;min-width:0}._label_120mz_20{flex:0 0 auto;color:var(--text-secondary);font-family:var(--font-label);font-size:11px;font-weight:600}._selectorLabel_120mz_28{display:flex;align-items:center;gap:8px;min-width:0}._placeSelect_120mz_35{min-width:180px;max-width:280px;height:30px;padding:0 28px 0 10px;border:1px solid var(--border);border-radius:6px;background:var(--bg-primary);color:var(--text-primary);font:inherit;font-size:12px}._name_120mz_48{min-width:0;color:var(--text-primary);font-family:var(--font-label);font-size:12px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._id_120mz_59{flex:0 0 auto;color:var(--text-muted);font-family:var(--font-code);font-size:11px}._badgeLive_120mz_66,._badgeMuted_120mz_67{flex:0 0 auto;padding:2px 7px;border-radius:999px;font-family:var(--font-label);font-size:10px;font-weight:600}._badgeLive_120mz_66{background:var(--success-bg);color:var(--success)}._badgeMuted_120mz_67{background:var(--warning-bg);color:var(--warning)}._copy_120mz_86{display:flex;align-items:center;justify-content:flex-end;gap:8px;min-width:0;color:var(--text-secondary);font-size:12px;line-height:1.4;text-align:right}._note_120mz_98{color:var(--text-muted)}@media(max-width:720px){._scope_120mz_1{align-items:flex-start;flex-direction:column}._copy_120mz_86{align-items:flex-start;flex-direction:column;text-align:left}._selectorLabel_120mz_28{width:100%}._placeSelect_120mz_35{flex:1 1 auto;min-width:0;max-width:none}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{u as _,r as x,j as e}from"./index-
|
|
1
|
+
import{u as _,r as x,j as e}from"./index-B9LVK3-K.js";const N="_container_uv8oc_2",j="_header_uv8oc_10",v="_modeBtn_uv8oc_18",g="_modeBtnActive_uv8oc_33",w="_unifiedView_uv8oc_40",L="_diffLine_uv8oc_46",b="_lineNum_uv8oc_55",C="_lineContent_uv8oc_64",S="_lineAdded_uv8oc_68",V="_lineRemoved_uv8oc_73",B="_lineContext_uv8oc_78",$="_sideBySide_uv8oc_83",A="_sidePane_uv8oc_90",P="_sideLabel_uv8oc_100",R="_sideContent_uv8oc_112",D="_empty_uv8oc_117",s={container:N,header:j,modeBtn:v,modeBtnActive:g,unifiedView:w,diffLine:L,lineNum:b,lineContent:C,lineAdded:S,lineRemoved:V,lineContext:B,sideBySide:$,sidePane:A,sideLabel:P,sideContent:R,empty:D};function k(n,i){const l=n.split(`
|
|
2
2
|
`),d=i.split(`
|
|
3
3
|
`),a=[],f=Math.max(l.length,d.length);let t=0,r=0;for(;(t<l.length||r<d.length)&&(t<l.length&&r<d.length?l[t]===d[r]?(a.push({type:"context",content:l[t],lineNum:r+1}),t++,r++):(a.push({type:"removed",content:l[t],lineNum:t+1}),t++,t<l.length&&l[t]===d[r]?(a.push({type:"added",content:d[r],lineNum:r+1}),r++):r<d.length&&(a.push({type:"added",content:d[r],lineNum:r+1}),r++)):t<l.length?(a.push({type:"removed",content:l[t],lineNum:t+1}),t++):r<d.length&&(a.push({type:"added",content:d[r],lineNum:r+1}),r++),!(a.length>f*3)););return a}function O({before:n,after:i}){const{t:l}=_(),[d,a]=x.useState("unified"),f=typeof n=="string"?n:n!=null?JSON.stringify(n,null,2):"",t=typeof i=="string"?i:i!=null?JSON.stringify(i,null,2):"",r=x.useMemo(()=>k(f,t),[f,t]);if(!f&&!t)return e.jsx("div",{className:s.container,children:e.jsx("div",{className:s.empty,children:l("changelog.diff.empty","No diff available")})});if(!f&&t){const c=t.split(`
|
|
4
4
|
`);return e.jsx("div",{className:s.container,children:e.jsx("div",{className:s.unifiedView,children:c.map((u,m)=>e.jsxs("div",{className:`${s.diffLine} ${s.lineAdded}`,children:[e.jsx("span",{className:s.lineNum,children:m+1}),e.jsxs("span",{className:s.lineContent,children:["+ ",u]})]},m))})})}return e.jsxs("div",{className:s.container,children:[e.jsxs("div",{className:s.header,children:[e.jsx("button",{className:`${s.modeBtn} ${d==="unified"?s.modeBtnActive:""}`,onClick:()=>a("unified"),children:l("changelog.diff.unified","Unified")}),e.jsx("button",{className:`${s.modeBtn} ${d==="side-by-side"?s.modeBtnActive:""}`,onClick:()=>a("side-by-side"),children:l("changelog.diff.sideBySide","Side by Side")})]}),d==="unified"?e.jsx("div",{className:s.unifiedView,children:r.map((c,u)=>e.jsxs("div",{className:`${s.diffLine} ${c.type==="added"?s.lineAdded:c.type==="removed"?s.lineRemoved:s.lineContext}`,children:[e.jsx("span",{className:s.lineNum,children:c.lineNum??""}),e.jsxs("span",{className:s.lineContent,children:[c.type==="added"?"+ ":c.type==="removed"?"- ":" ",c.content]})]},u))}):e.jsxs("div",{className:s.sideBySide,children:[e.jsxs("div",{className:s.sidePane,children:[e.jsx("div",{className:s.sideLabel,children:l("changelog.diff.before","Before")}),e.jsx("div",{className:s.sideContent,children:f.split(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as r,
|
|
1
|
+
import{j as r,k as e}from"./index-B9LVK3-K.js";function s({label:t,tooltip:o}){return r.jsx(e,{text:o,children:t})}export{s as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,u as R,r as v,d as L,m as F,a as M,D as V}from"./index-DG2RrKOl.js";import{I as A}from"./InfoLabel-Cyz7d4Kc.js";import{P as U}from"./PageHeader-CThGgsAt.js";import{S as z}from"./StatusBadge-CkLieULy.js";import{T as O}from"./TooltipText-H3YSCbob.js";import{G as X}from"./GameChangeDetail-CghOvUm8.js";import{u as q,f as J}from"./useLiveUptime-BHqJirBV.js";const K="_page_1xgxh_2",Q="_card_1xgxh_10",W="_cardHeader_1xgxh_17",Y="_disconnectCard_1xgxh_28",Z="_disconnectIcon_1xgxh_36",ee="_disconnectTitle_1xgxh_41",te="_disconnectMessage_1xgxh_48",se="_reconnectGuide_1xgxh_55",ne="_guideStep_1xgxh_64",ie="_stepNumber_1xgxh_72",ce="_reconnectIndicator_1xgxh_88",re="_reconnectDot_1xgxh_98",ae="_pulse_1xgxh_1",oe="_disconnectActions_1xgxh_112",le="_btn_1xgxh_118",de="_btnSecondary_1xgxh_134",me="_metricRow_1xgxh_152",ge="_metricGrid_1xgxh_158",he="_metricCard_1xgxh_164",xe="_metric_ok_1xgxh_174",ue="_metric_warn_1xgxh_179",ve="_metric_error_1xgxh_184",_e="_metricHeader_1xgxh_189",pe="_metricIcon_1xgxh_200",fe="_metricTitle_1xgxh_204",Ce="_metricValue_1xgxh_208",je="_metricSubtitle_1xgxh_215",we="_guideCard_1xgxh_225",Ne="_guideTitle_1xgxh_232",ye="_checklist_1xgxh_239",Te="_feedEmpty_1xgxh_263",Se="_feedList_1xgxh_270",Ie="_feedItem_1xgxh_278",be="_feedTime_1xgxh_291",ke="_feedIcon_1xgxh_298",Me="_feedSummary_1xgxh_304",De="_feedText_1xgxh_313",Be="_feedContext_1xgxh_321",He="_feedItemClickable_1xgxh_330",Ee="_feedChevron_1xgxh_338",Pe="_feedDetail_1xgxh_347",$e="_feedDetailPre_1xgxh_356",Re="_feedDetailText_1xgxh_365",Ge="_changelogSummary_1xgxh_372",Le="_changeTag_1xgxh_381",Fe="_tierBar_1xgxh_393",Ve="_tierBarTrack_1xgxh_399",Ae="_tierBarFillBasic_1xgxh_407",Ue="_tierBarFillPro_1xgxh_412",ze="_tierLabels_1xgxh_417",s={page:K,card:Q,cardHeader:W,disconnectCard:Y,disconnectIcon:Z,disconnectTitle:ee,disconnectMessage:te,reconnectGuide:se,guideStep:ne,stepNumber:ie,reconnectIndicator:ce,reconnectDot:re,pulse:ae,disconnectActions:oe,btn:le,btnSecondary:de,metricRow:me,metricGrid:ge,metricCard:he,metric_ok:xe,metric_warn:ue,metric_error:ve,metricHeader:_e,metricIcon:pe,metricTitle:fe,metricValue:Ce,metricSubtitle:je,guideCard:we,guideTitle:Ne,checklist:ye,feedEmpty:Te,feedList:Se,feedItem:Ie,feedTime:be,feedIcon:ke,feedSummary:Me,feedText:De,feedContext:Be,feedItemClickable:He,feedChevron:Ee,feedDetail:Pe,feedDetailPre:$e,feedDetailText:Re,changelogSummary:Ge,changeTag:Le,tierBar:Fe,tierBarTrack:Ve,tierBarFillBasic:Ae,tierBarFillPro:Ue,tierLabels:ze};function N({title:e,value:i,icon:c,subtitle:r,status:a,children:n}){const l=a?s[`metric_${a}`]:"";return t.jsxs("div",{className:`${s.metricCard} ${l}`,children:[t.jsxs("div",{className:s.metricHeader,children:[c&&t.jsx("span",{className:s.metricIcon,children:c}),t.jsx("span",{className:s.metricTitle,children:e})]}),t.jsx("div",{className:s.metricValue,children:i}),r&&t.jsx("div",{className:s.metricSubtitle,children:r}),n]})}function Oe(e){var c,r;const i=e==null?void 0:e.contextSummary;return(i==null?void 0:i.intent)??((r=(c=i==null?void 0:i.affectedAreas)==null?void 0:c[0])==null?void 0:r.label)??(i==null?void 0:i.testScenario)??null}function H({changes:e}){const{t:i}=R(),[c,r]=v.useState(null);return e.length===0?t.jsx("div",{className:s.feedEmpty,children:i("overview.feed.empty")}):t.jsx("div",{className:s.feedList,children:e.map((a,n)=>{const l=c===n,g=a.raw,h=g&&(g.before!=null||g.after!=null||g.details!=null),_=Oe(g);return t.jsxs("div",{children:[t.jsxs("div",{className:`${s.feedItem} ${h?s.feedItemClickable:""}`,onClick:()=>h&&r(l?null:n),children:[t.jsx("span",{className:s.feedTime,children:a.timestamp}),t.jsx("span",{className:s.feedIcon,children:a.icon}),t.jsxs("span",{className:s.feedText,children:[t.jsx("span",{className:s.feedSummary,children:a.summary}),_&&t.jsx("span",{className:s.feedContext,children:_})]}),h&&t.jsx("span",{className:s.feedChevron,children:l?"▴":"▾"})]}),l&&g&&t.jsx("div",{className:s.feedDetail,children:t.jsx(X,{change:g})})]},n)})})}const E=20;function G(e){return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`}function P(){return G(new Date)}function $(e){switch(e){case"script":return"📝";case"instance":return"🧱";case"property":return"🎨";case"lighting":return"💡";case"terrain":return"⛰️";case"asset":return"📦";default:return"🔧"}}function Xe(){const{level:e,status:i}=L(),c=F(),[r,a]=v.useState(null),[n,l]=v.useState(null),[g,h]=v.useState(null),[_,x]=v.useState([]),y=v.useRef(null),T=v.useCallback(async()=>{try{const o=await M.get("/connection-info");a(o)}catch{a(null)}},[]),S=v.useCallback(async()=>{try{const o=await M.get("/api/dashboard/changelog/active");if(h(o),o.recentChanges&&o.recentChanges.length>0){const p=o.recentChanges.map(u=>({timestamp:u.timestamp?G(new Date(u.timestamp)):P(),icon:$(u.category),summary:u.summary,category:u.category,raw:u}));x(p)}}catch{h(null)}},[]),f=v.useCallback(async()=>{try{const o=await M.get("/sync/status");l(o)}catch{l(null)}},[]);return v.useEffect(()=>{e!=="disconnected"?(T(),S(),f()):(a(null),l(null),h(null));const o=new V;y.current=o,o.connect();const p=o.on("game_change",C=>{const d=C,j={timestamp:P(),icon:$(d.category),summary:d.summary,category:d.category};x(k=>{const w=[j,...k];return w.length>E?w.slice(0,E):w}),S()}),u=o.on("sync",C=>{const d=C;l(j=>({...j,state:d.status,...d.placeId?{placeId:d.placeId}:{}}))});return()=>{p(),u(),o.disconnect(),y.current=null}},[e,T,S,f]),{level:e,status:i,connectionInfo:r,syncStatus:n,changeSummary:g,recentChanges:_,tier:c}}function D(e){return e.scriptsModified+e.scriptsCreated+e.instancesCreated+e.instancesDeleted+e.instancesMoved+e.propertiesChanged+e.assetsInserted+(e.lightingChanged?1:0)+(e.terrainChanged?1:0)}function qe(e,i){switch(e){case"syncing":return i("status.syncing","Syncing");case"initializing":return i("status.initializing","Initializing");case"error":return i("status.error","Error");default:return i("status.idle","Idle")}}function Je(e){switch(e){case"syncing":return"ok";case"initializing":return"warn";case"error":return"error";default:return"ok"}}function b(e,i,c,r){return t.jsxs("div",{className:e.metricSubtitle,children:[t.jsx(A,{label:i,tooltip:c}),": ",r]},i)}function m(e,i){return t.jsx(O,{text:i,children:e})}function st(){var w,B;const{t:e}=R(),{level:i,status:c,connectionInfo:r,syncStatus:a,changeSummary:n,recentChanges:l}=Xe(),g=q(c==null?void 0:c.uptime),h=t.jsx(U,{title:e("page.overview.title","Overview"),description:e("page.overview.description","Check server, plugin, agent, sync, and recent game-change status in one place."),helpTopicId:"overview",helpState:{connectionLevel:i}});if(i==="disconnected")return t.jsxs("div",{className:s.page,children:[h,t.jsxs("div",{className:s.disconnectCard,children:[t.jsx("div",{className:s.disconnectIcon,children:"⚠️"}),t.jsx("h2",{className:s.disconnectTitle,children:e("overview.l0.title")}),t.jsx("p",{className:s.disconnectMessage,children:e("overview.l0.message")}),t.jsxs("div",{className:s.reconnectGuide,children:[t.jsxs("div",{className:s.guideStep,children:[t.jsx("span",{className:s.stepNumber,children:"1"}),t.jsx("span",{children:e("overview.l0.step1")})]}),t.jsxs("div",{className:s.guideStep,children:[t.jsx("span",{className:s.stepNumber,children:"2"}),t.jsx("span",{children:e("overview.l0.step2")})]})]}),t.jsxs("div",{className:s.reconnectIndicator,children:[t.jsx("span",{className:s.reconnectDot}),e("overview.l0.reconnecting")]}),t.jsxs("div",{className:s.disconnectActions,children:[t.jsx("button",{className:s.btn,onClick:()=>window.location.reload(),children:e("overview.l0.reconnectBtn")}),t.jsx("button",{className:s.btnSecondary,onClick:()=>{window.location.hash="#/settings"},children:e("overview.l0.settingsBtn")})]})]})]});const _=(r==null?void 0:r.mcpInstanceCount)??0,x=((w=r==null?void 0:r.mcpInstances)==null?void 0:w.find(I=>!I.isServer&&I.aiClientName))??((B=r==null?void 0:r.mcpInstances)==null?void 0:B.find(I=>!!I.aiClientName))??null,y=(c==null?void 0:c.pluginClients)??[],T=y.length>0,S=(c==null?void 0:c.sessionId)??(r==null?void 0:r.sessionId)??"-",f=e("overview.metric.server.tooltip","MCP server runtime and process status"),o=e("overview.metric.plugin.tooltip","Roblox Studio plugin connection and version status"),p=e("overview.metric.agent.tooltip","Connected AI coding agents and their runtime state"),u=e("overview.metric.sync.tooltip","Current Studio to local sync activity"),C=c?[b(s,e("overview.meta.version","Version"),e("overview.meta.version.tooltip","Installed MCP server version"),`v${c.version}`),b(s,e("overview.meta.session","Session"),e("overview.meta.session.tooltip","Current MCP session identifier"),S),b(s,e("overview.meta.pid","PID"),e("overview.meta.pid.tooltip","Operating system process identifier"),String(c.pid??"-")),b(s,e("overview.meta.uptime","Uptime"),e("overview.meta.uptime.tooltip","Time elapsed since the MCP server started"),J(g??c.uptime))]:[];if(i==="serverOnly")return t.jsxs("div",{className:s.page,children:[h,t.jsxs("div",{className:s.metricRow,children:[t.jsx(N,{title:m(e("overview.metric.server"),f),value:m(e("status.online"),f),icon:"🖥️",status:"ok",children:t.jsxs(t.Fragment,{children:[C,t.jsx(z,{status:"online"})]})}),t.jsx(N,{title:m(e("overview.metric.agent"),p),value:m((x==null?void 0:x.aiClientName)??e("overview.metric.noAgent"),p),icon:"🤖",subtitle:_>1?`${_} ${e("overview.metric.agent.instancesUnit","instances")}`:void 0,status:x?"ok":"warn"})]}),t.jsxs("div",{className:s.guideCard,children:[t.jsx("h3",{className:s.guideTitle,children:e("overview.l1.pluginGuide")}),t.jsxs("ul",{className:s.checklist,children:[t.jsx("li",{children:e("overview.l1.check1")}),t.jsx("li",{children:e("overview.l1.check2")})]})]}),t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:e("overview.feed.title")}),l.length>0?t.jsx(H,{changes:l}):t.jsx("div",{className:s.feedEmpty,children:e("overview.l1.feedHint")})]}),n&&D(n)>0&&t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:e("overview.changelog.title")}),t.jsxs("div",{className:s.changelogSummary,children:[t.jsxs("span",{children:[e("overview.changelog.entries","Entries"),": ",D(n)]}),n.scriptsModified>0&&t.jsxs("span",{className:s.changeTag,children:["📝"," ",n.scriptsModified," ",e("overview.changelog.scripts")]}),n.instancesCreated>0&&t.jsxs("span",{className:s.changeTag,children:["🧱"," ",n.instancesCreated," ",e("overview.changelog.instances")]}),n.propertiesChanged>0&&t.jsxs("span",{className:s.changeTag,children:["🎨"," ",n.propertiesChanged," ",e("overview.changelog.properties")]}),n.assetsInserted>0&&t.jsxs("span",{className:s.changeTag,children:["📦"," ",n.assetsInserted," ",e("overview.changelog.assets")]})]})]})]});const d=y[0],j=n?D(n):0,k=!!n&&j>0;return t.jsxs("div",{className:s.page,children:[h,t.jsxs("div",{className:s.metricGrid,children:[t.jsx(N,{title:m(e("overview.metric.server"),f),value:m(e("status.online"),f),icon:"🖥️",status:"ok",children:t.jsx(t.Fragment,{children:C})}),t.jsx(N,{title:m(e("overview.metric.plugin"),o),value:m(e(T?"status.online":"status.offline"),o),icon:"🔌",subtitle:d?`${d.placeName??d.projectName??"-"} / v${d.pluginVersion??"-"}`:void 0,status:T?"ok":"error"}),t.jsx(N,{title:m(e("overview.metric.agent"),p),value:m((x==null?void 0:x.aiClientName)??e("overview.metric.noAgent"),p),icon:"🤖",subtitle:_>1?`${_} ${e("overview.metric.agent.instancesUnit","instances")}`:void 0,status:x?"ok":"warn"}),t.jsx(N,{title:m(e("overview.metric.sync"),u),value:m(qe(a==null?void 0:a.state,e),u),icon:"🔄",status:Je(a==null?void 0:a.state)})]}),t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:e("overview.feed.title")}),t.jsx(H,{changes:l})]}),k&&t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:e("overview.changelog.title")}),t.jsxs("div",{className:s.changelogSummary,children:[t.jsxs("span",{children:[e("overview.changelog.entries","Entries"),": ",j]}),n.scriptsModified>0&&t.jsxs("span",{className:s.changeTag,children:["📝"," ",n.scriptsModified," ",e("overview.changelog.scripts")]}),n.instancesCreated>0&&t.jsxs("span",{className:s.changeTag,children:["🧱"," ",n.instancesCreated," ",e("overview.changelog.instances")]}),n.propertiesChanged>0&&t.jsxs("span",{className:s.changeTag,children:["🎨"," ",n.propertiesChanged," ",e("overview.changelog.properties")]}),n.assetsInserted>0&&t.jsxs("span",{className:s.changeTag,children:["📦"," ",n.assetsInserted," ",e("overview.changelog.assets")]})]})]})]})}export{st as Component};
|
|
1
|
+
import{j as t,u as R,r as v,f as L,h as F,a as M,D as V}from"./index-B9LVK3-K.js";import{I as A}from"./InfoLabel-ZfsTcz5c.js";import{P as U}from"./PageHeader-Cqg4GMtU.js";import{S as z}from"./StatusBadge-BSFzbkXM.js";import{T as O}from"./TooltipText-ZamrETeK.js";import{G as X}from"./GameChangeDetail-DKAKmyGF.js";import{u as q,f as J}from"./useLiveUptime-BGlwL1Q-.js";const K="_page_1xgxh_2",Q="_card_1xgxh_10",W="_cardHeader_1xgxh_17",Y="_disconnectCard_1xgxh_28",Z="_disconnectIcon_1xgxh_36",ee="_disconnectTitle_1xgxh_41",te="_disconnectMessage_1xgxh_48",se="_reconnectGuide_1xgxh_55",ne="_guideStep_1xgxh_64",ie="_stepNumber_1xgxh_72",ce="_reconnectIndicator_1xgxh_88",re="_reconnectDot_1xgxh_98",ae="_pulse_1xgxh_1",oe="_disconnectActions_1xgxh_112",le="_btn_1xgxh_118",de="_btnSecondary_1xgxh_134",me="_metricRow_1xgxh_152",ge="_metricGrid_1xgxh_158",he="_metricCard_1xgxh_164",xe="_metric_ok_1xgxh_174",ue="_metric_warn_1xgxh_179",ve="_metric_error_1xgxh_184",_e="_metricHeader_1xgxh_189",pe="_metricIcon_1xgxh_200",fe="_metricTitle_1xgxh_204",Ce="_metricValue_1xgxh_208",je="_metricSubtitle_1xgxh_215",we="_guideCard_1xgxh_225",Ne="_guideTitle_1xgxh_232",ye="_checklist_1xgxh_239",Te="_feedEmpty_1xgxh_263",Se="_feedList_1xgxh_270",Ie="_feedItem_1xgxh_278",be="_feedTime_1xgxh_291",ke="_feedIcon_1xgxh_298",Me="_feedSummary_1xgxh_304",De="_feedText_1xgxh_313",Be="_feedContext_1xgxh_321",He="_feedItemClickable_1xgxh_330",Ee="_feedChevron_1xgxh_338",Pe="_feedDetail_1xgxh_347",$e="_feedDetailPre_1xgxh_356",Re="_feedDetailText_1xgxh_365",Ge="_changelogSummary_1xgxh_372",Le="_changeTag_1xgxh_381",Fe="_tierBar_1xgxh_393",Ve="_tierBarTrack_1xgxh_399",Ae="_tierBarFillBasic_1xgxh_407",Ue="_tierBarFillPro_1xgxh_412",ze="_tierLabels_1xgxh_417",s={page:K,card:Q,cardHeader:W,disconnectCard:Y,disconnectIcon:Z,disconnectTitle:ee,disconnectMessage:te,reconnectGuide:se,guideStep:ne,stepNumber:ie,reconnectIndicator:ce,reconnectDot:re,pulse:ae,disconnectActions:oe,btn:le,btnSecondary:de,metricRow:me,metricGrid:ge,metricCard:he,metric_ok:xe,metric_warn:ue,metric_error:ve,metricHeader:_e,metricIcon:pe,metricTitle:fe,metricValue:Ce,metricSubtitle:je,guideCard:we,guideTitle:Ne,checklist:ye,feedEmpty:Te,feedList:Se,feedItem:Ie,feedTime:be,feedIcon:ke,feedSummary:Me,feedText:De,feedContext:Be,feedItemClickable:He,feedChevron:Ee,feedDetail:Pe,feedDetailPre:$e,feedDetailText:Re,changelogSummary:Ge,changeTag:Le,tierBar:Fe,tierBarTrack:Ve,tierBarFillBasic:Ae,tierBarFillPro:Ue,tierLabels:ze};function N({title:e,value:i,icon:c,subtitle:r,status:a,children:n}){const l=a?s[`metric_${a}`]:"";return t.jsxs("div",{className:`${s.metricCard} ${l}`,children:[t.jsxs("div",{className:s.metricHeader,children:[c&&t.jsx("span",{className:s.metricIcon,children:c}),t.jsx("span",{className:s.metricTitle,children:e})]}),t.jsx("div",{className:s.metricValue,children:i}),r&&t.jsx("div",{className:s.metricSubtitle,children:r}),n]})}function Oe(e){var c,r;const i=e==null?void 0:e.contextSummary;return(i==null?void 0:i.intent)??((r=(c=i==null?void 0:i.affectedAreas)==null?void 0:c[0])==null?void 0:r.label)??(i==null?void 0:i.testScenario)??null}function H({changes:e}){const{t:i}=R(),[c,r]=v.useState(null);return e.length===0?t.jsx("div",{className:s.feedEmpty,children:i("overview.feed.empty")}):t.jsx("div",{className:s.feedList,children:e.map((a,n)=>{const l=c===n,m=a.raw,g=m&&(m.before!=null||m.after!=null||m.details!=null),_=Oe(m);return t.jsxs("div",{children:[t.jsxs("div",{className:`${s.feedItem} ${g?s.feedItemClickable:""}`,onClick:()=>g&&r(l?null:n),children:[t.jsx("span",{className:s.feedTime,children:a.timestamp}),t.jsx("span",{className:s.feedIcon,children:a.icon}),t.jsxs("span",{className:s.feedText,children:[t.jsx("span",{className:s.feedSummary,children:a.summary}),_&&t.jsx("span",{className:s.feedContext,children:_})]}),g&&t.jsx("span",{className:s.feedChevron,children:l?"▴":"▾"})]}),l&&m&&t.jsx("div",{className:s.feedDetail,children:t.jsx(X,{change:m})})]},n)})})}const E=20;function G(e){return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`}function P(){return G(new Date)}function $(e){switch(e){case"script":return"📝";case"instance":return"🧱";case"property":return"🎨";case"lighting":return"💡";case"terrain":return"⛰️";case"asset":return"📦";default:return"🔧"}}function Xe(){const{level:e,status:i}=L(),c=F(),[r,a]=v.useState(null),[n,l]=v.useState(null),[m,g]=v.useState(null),[_,h]=v.useState([]),y=v.useRef(null),T=v.useCallback(async()=>{try{const o=await M.get("/connection-info");a(o)}catch{a(null)}},[]),S=v.useCallback(async()=>{try{const o=await M.get("/api/dashboard/changelog/active");if(g(o),o.recentChanges&&o.recentChanges.length>0){const p=o.recentChanges.map(x=>({timestamp:x.timestamp?G(new Date(x.timestamp)):P(),icon:$(x.category),summary:x.summary,category:x.category,raw:x}));h(p)}}catch{g(null)}},[]),f=v.useCallback(async()=>{try{const o=await M.get("/sync/status");l(o)}catch{l(null)}},[]);return v.useEffect(()=>{e!=="disconnected"?(T(),S(),f()):(a(null),l(null),g(null));const o=new V;y.current=o,o.connect();const p=o.on("game_change",C=>{const u=C,j={timestamp:P(),icon:$(u.category),summary:u.summary,category:u.category};h(k=>{const w=[j,...k];return w.length>E?w.slice(0,E):w}),S()}),x=o.on("sync",C=>{const u=C;l(j=>({...j,state:u.status,...u.placeId?{placeId:u.placeId}:{}}))});return()=>{p(),x(),o.disconnect(),y.current=null}},[e,T,S,f]),{level:e,status:i,connectionInfo:r,syncStatus:n,changeSummary:m,recentChanges:_,tier:c}}function D(e){return e.scriptsModified+e.scriptsCreated+e.instancesCreated+e.instancesDeleted+e.instancesMoved+e.propertiesChanged+e.assetsInserted+(e.lightingChanged?1:0)+(e.terrainChanged?1:0)}function qe(e,i){switch(e){case"syncing":return i("status.syncing","Syncing");case"initializing":return i("status.initializing","Initializing");case"error":return i("status.error","Error");default:return i("status.idle","Idle")}}function Je(e){switch(e){case"syncing":return"ok";case"initializing":return"warn";case"error":return"error";default:return"ok"}}function b(e,i,c,r){return t.jsxs("div",{className:e.metricSubtitle,children:[t.jsx(A,{label:i,tooltip:c}),": ",r]},i)}function d(e,i){return t.jsx(O,{text:i,children:e})}function st(){var w,B;const{t:e}=R(),{level:i,status:c,connectionInfo:r,syncStatus:a,changeSummary:n,recentChanges:l}=Xe(),m=q(c==null?void 0:c.uptime),g=t.jsx(U,{title:e("page.overview.title","Overview"),description:e("page.overview.description","Check server, plugin, agent, sync, and recent game-change status in one place."),helpTopicId:"overview",helpState:{connectionLevel:i}});if(i==="disconnected")return t.jsxs("div",{className:s.page,children:[g,t.jsxs("div",{className:s.disconnectCard,children:[t.jsx("div",{className:s.disconnectIcon,children:"⚠️"}),t.jsx("h2",{className:s.disconnectTitle,children:e("overview.l0.title")}),t.jsx("p",{className:s.disconnectMessage,children:e("overview.l0.message")}),t.jsxs("div",{className:s.reconnectGuide,children:[t.jsxs("div",{className:s.guideStep,children:[t.jsx("span",{className:s.stepNumber,children:"1"}),t.jsx("span",{children:e("overview.l0.step1")})]}),t.jsxs("div",{className:s.guideStep,children:[t.jsx("span",{className:s.stepNumber,children:"2"}),t.jsx("span",{children:e("overview.l0.step2")})]})]}),t.jsxs("div",{className:s.reconnectIndicator,children:[t.jsx("span",{className:s.reconnectDot}),e("overview.l0.reconnecting")]}),t.jsxs("div",{className:s.disconnectActions,children:[t.jsx("button",{className:s.btn,onClick:()=>window.location.reload(),children:e("overview.l0.reconnectBtn")}),t.jsx("button",{className:s.btnSecondary,onClick:()=>{window.location.hash="#/settings"},children:e("overview.l0.settingsBtn")})]})]})]});const _=(r==null?void 0:r.mcpInstanceCount)??0,h=((w=r==null?void 0:r.mcpInstances)==null?void 0:w.find(I=>!I.isServer&&I.aiClientName))??((B=r==null?void 0:r.mcpInstances)==null?void 0:B.find(I=>!!I.aiClientName))??null,y=(c==null?void 0:c.pluginClients)??[],T=y.length>0,S=(c==null?void 0:c.sessionId)??(r==null?void 0:r.sessionId)??"-",f=e("overview.metric.server.tooltip","MCP server runtime and process status"),o=e("overview.metric.plugin.tooltip","Roblox Studio plugin connection and version status"),p=e("overview.metric.agent.tooltip","Connected AI coding agents and their runtime state"),x=e("overview.metric.sync.tooltip","Current Studio to local sync activity"),C=c?[b(s,e("overview.meta.version","Version"),e("overview.meta.version.tooltip","Installed MCP server version"),`v${c.version}`),b(s,e("overview.meta.session","Session"),e("overview.meta.session.tooltip","Current MCP session identifier"),S),b(s,e("overview.meta.pid","PID"),e("overview.meta.pid.tooltip","Operating system process identifier"),String(c.pid??"-")),b(s,e("overview.meta.uptime","Uptime"),e("overview.meta.uptime.tooltip","Time elapsed since the MCP server started"),J(m??c.uptime))]:[];if(i==="serverOnly")return t.jsxs("div",{className:s.page,children:[g,t.jsxs("div",{className:s.metricRow,children:[t.jsx(N,{title:d(e("overview.metric.server"),f),value:d(e("status.online"),f),icon:"🖥️",status:"ok",children:t.jsxs(t.Fragment,{children:[C,t.jsx(z,{status:"online"})]})}),t.jsx(N,{title:d(e("overview.metric.agent"),p),value:d((h==null?void 0:h.aiClientName)??e("overview.metric.noAgent"),p),icon:"🤖",subtitle:_>1?`${_} ${e("overview.metric.agent.instancesUnit","instances")}`:void 0,status:h?"ok":"warn"})]}),t.jsxs("div",{className:s.guideCard,children:[t.jsx("h3",{className:s.guideTitle,children:e("overview.l1.pluginGuide")}),t.jsxs("ul",{className:s.checklist,children:[t.jsx("li",{children:e("overview.l1.check1")}),t.jsx("li",{children:e("overview.l1.check2")})]})]}),t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:e("overview.feed.title")}),l.length>0?t.jsx(H,{changes:l}):t.jsx("div",{className:s.feedEmpty,children:e("overview.l1.feedHint")})]}),n&&D(n)>0&&t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:e("overview.changelog.title")}),t.jsxs("div",{className:s.changelogSummary,children:[t.jsxs("span",{children:[e("overview.changelog.entries","Entries"),": ",D(n)]}),n.scriptsModified>0&&t.jsxs("span",{className:s.changeTag,children:["📝"," ",n.scriptsModified," ",e("overview.changelog.scripts")]}),n.instancesCreated>0&&t.jsxs("span",{className:s.changeTag,children:["🧱"," ",n.instancesCreated," ",e("overview.changelog.instances")]}),n.propertiesChanged>0&&t.jsxs("span",{className:s.changeTag,children:["🎨"," ",n.propertiesChanged," ",e("overview.changelog.properties")]}),n.assetsInserted>0&&t.jsxs("span",{className:s.changeTag,children:["📦"," ",n.assetsInserted," ",e("overview.changelog.assets")]})]})]})]});const u=y[0],j=n?D(n):0,k=!!n&&j>0;return t.jsxs("div",{className:s.page,children:[g,t.jsxs("div",{className:s.metricGrid,children:[t.jsx(N,{title:d(e("overview.metric.server"),f),value:d(e("status.online"),f),icon:"🖥️",status:"ok",children:t.jsx(t.Fragment,{children:C})}),t.jsx(N,{title:d(e("overview.metric.plugin"),o),value:d(e(T?"status.online":"status.offline"),o),icon:"🔌",subtitle:u?`${u.placeName??"-"} / v${u.pluginVersion??"-"}`:void 0,status:T?"ok":"error"}),t.jsx(N,{title:d(e("overview.metric.agent"),p),value:d((h==null?void 0:h.aiClientName)??e("overview.metric.noAgent"),p),icon:"🤖",subtitle:_>1?`${_} ${e("overview.metric.agent.instancesUnit","instances")}`:void 0,status:h?"ok":"warn"}),t.jsx(N,{title:d(e("overview.metric.sync"),x),value:d(qe(a==null?void 0:a.state,e),x),icon:"🔄",status:Je(a==null?void 0:a.state)})]}),t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:e("overview.feed.title")}),t.jsx(H,{changes:l})]}),k&&t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:e("overview.changelog.title")}),t.jsxs("div",{className:s.changelogSummary,children:[t.jsxs("span",{children:[e("overview.changelog.entries","Entries"),": ",j]}),n.scriptsModified>0&&t.jsxs("span",{className:s.changeTag,children:["📝"," ",n.scriptsModified," ",e("overview.changelog.scripts")]}),n.instancesCreated>0&&t.jsxs("span",{className:s.changeTag,children:["🧱"," ",n.instancesCreated," ",e("overview.changelog.instances")]}),n.propertiesChanged>0&&t.jsxs("span",{className:s.changeTag,children:["🎨"," ",n.propertiesChanged," ",e("overview.changelog.properties")]}),n.assetsInserted>0&&t.jsxs("span",{className:s.changeTag,children:["📦"," ",n.assetsInserted," ",e("overview.changelog.assets")]})]})]})]})}export{st as Component};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{i as z,u as J,e as Q,r as p,j as t,X as V,E as Z,J as ee}from"./index-B9LVK3-K.js";/**
|
|
2
|
+
* @license lucide-react v1.8.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const te=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],oe=z("circle-question-mark",te),a={canDo:{key:"dashboardHelp.section.canDo",fallback:"What you can do here"},needs:{key:"dashboardHelp.section.needs",fallback:"What you need to use it"},currentState:{key:"dashboardHelp.section.currentState",fallback:"Check based on current status"}},ne="https://create.roblox.com/docs/cloud/auth/api-keys",se="https://create.roblox.com/docs/cloud/guides/usage-assets",ae="https://create.roblox.com/docs/cloud/reference/features/assets",re="https://create.roblox.com/docs/reference/engine/classes/DataModel#CreatorId",le="https://create.roblox.com/docs/reference/engine/classes/Player#UserId",ie="https://create.roblox.com/docs/projects/groups",ce="https://create.roblox.com/docs/cloud/reference/features/groups";function g(e,s,n,h){return{id:e,title:{key:`dashboardHelp.${e}.title`,fallback:s},sections:n,links:h}}function l(e,s,n,h){return{heading:e,items:h.map((i,P)=>({key:`dashboardHelp.${s}.${n}.${P+1}`,fallback:i}))}}function r(e,s,n){return{heading:a.currentState,items:[{key:`dashboardHelp.${e}.currentState.${s}`,fallback:n}]}}function m(e,s,n,h,i,P){return g(e,s,[l(a.canDo,e,"canDo",n),l(a.needs,e,"needs",h),l(a.currentState,e,"currentState",i)],P)}function de(e){return e.tier==="basic"?r("assets","basic","Activate Pro before uploading to Roblox."):e.uploadEnabled===!1?r("assets","uploadDisabled","Turn on API Key local upload in Assets settings."):e.hasOpenCloudCredential===!1?r("assets","noCredential","Save and test an Open Cloud API Key."):e.hasDefaultCreator===!1?r("assets","noCreator","Save a default Creator ID or enter Creator details during upload."):r("assets","default","Open an asset detail dialog to start upload or usage scan.")}function ue(e){return e.connectionLevel!==void 0&&e.connectionLevel!=="studioConnected"?r("sync","pluginMissing","Connect WEPPY Plugin in Studio before using live sync details."):e.tier==="basic"?r("sync","basic","Activate Pro to use bidirectional or reverse sync."):r("sync","default","Use the sync log to diagnose stuck or failed sync activity.")}function pe(e,s={}){return e==="openCloudApiKey"?g(e,"Open Cloud API Key help",[l(a.canDo,e,"canDo",["WEPPY uses this key only for Roblox Open Cloud requests."]),l(a.needs,e,"needs",["Create a Roblox API key in Creator Hub. Add Assets under Access Permissions, then enable both Read and Write operations.","Set the key target to the same User or Group that you use as the upload Creator.","The raw key is encrypted on this device. It is not sent to WEPPY servers, and it is not stored in any other external storage, browser storage, telemetry, logs, tool history, or Asset Library metadata."]),s.hasOpenCloudCredential?r(e,"saved","Use Test Connection to confirm the saved key still works."):r(e,"empty","Create an API key in Roblox Creator Hub, paste it here, then save and test it.")],[{label:{key:"dashboardHelp.openCloudApiKey.link.apiKeys",fallback:"Roblox API keys"},href:ne},{label:{key:"dashboardHelp.openCloudApiKey.link.assetsGuide",fallback:"Assets API usage guide"},href:se},{label:{key:"dashboardHelp.openCloudApiKey.link.assetsReference",fallback:"Assets API reference"},href:ae}]):e==="openCloudCreatorId"?g(e,"Creator ID help",[l(a.canDo,e,"canDo",["The default Creator decides which User or Group owns newly uploaded Roblox assets."]),l(a.needs,e,"needs",["For User, sign in to roblox.com, open your profile from your avatar or username, then copy only the number between /users/ and /profile in the browser URL.","For Group, open the Roblox group or community page, then copy only the number after /groups/ or /communities/ in the browser URL.","Paste only the numeric ID in Creator ID. Do not paste the full URL, rbxassetid://, User, or Group text."]),s.hasDefaultCreator?r(e,"saved","Keep this value if new assets should continue using the same owner."):r(e,"empty","Choose User or Group, paste the numeric ID, then save the default Creator.")],[{label:{key:"dashboardHelp.openCloudCreatorId.link.creatorId",fallback:"Creator ID reference"},href:re},{label:{key:"dashboardHelp.openCloudCreatorId.link.userId",fallback:"User ID reference"},href:le},{label:{key:"dashboardHelp.openCloudCreatorId.link.groups",fallback:"Roblox groups"},href:ie},{label:{key:"dashboardHelp.openCloudCreatorId.link.groupsApi",fallback:"Groups Cloud API"},href:ce}]):{overview:g("overview","Overview help",[l(a.canDo,"overview","canDo",["Check MCP server, WEPPY Plugin, AI Agent, Sync, and recent game changes in one place."]),l(a.needs,"overview","needs",["Useful status requires the MCP server. Live Studio status also needs WEPPY Plugin connected to the active place."]),s.connectionLevel==="serverOnly"?r("overview","serverOnly","Open Roblox Studio and start WEPPY Plugin so live place data can appear."):r("overview","default","If the server disconnects, restart MCP or wait for the automatic reconnect.")]),connection:m("connection","Connection help",["Inspect server process details, connected AI agents, Studio plugin clients, and connection log events."],["The MCP server must be reachable. Plugin rows appear after Studio sends heartbeats."],["If Plugin is missing, open Roblox Studio and run WEPPY Plugin. If AI Agent is missing, reconnect the MCP server from your AI tool."]),sync:g("sync","Sync help",[l(a.canDo,"sync","canDo",["Review Studio to local sync status, direction, apply mode, and sync logs."]),l(a.needs,"sync","needs",["Sync needs an active place and connected WEPPY Plugin. Two-way and reverse workflows depend on Pro."]),ue(s)]),assets:g("assets","Assets help",[l(a.canDo,"assets","canDo",["Browse local Asset Library files, switch place/shared scope, filter categories, scan usage, insert RBXM into Studio, and upload local assets to Roblox."]),l(a.needs,"assets","needs",["Upload needs Pro, the Open Cloud upload toggle, a valid API Key, and a Creator. Browse and preview work on Basic."]),de(s)]),changelog:m("changelog","Changelog help",["Review real game-change sessions extracted from AI actions and sync events."],["Entries are scoped to the active place. Basic shows only the latest preview entries."],["If the list is empty, ask the AI Agent to make a game change. Clear only deletes saved history records, not Studio objects."]),playtest:g("playtest","Playtest help",[l(a.canDo,"playtest","canDo",["Review Playtest results and reports saved by the AI Agent."]),l(a.needs,"playtest","needs",["Pro shows real stored reports. Basic shows sample preview data. Live active-place confidence needs WEPPY Plugin connected."]),s.tier==="basic"?r("playtest","basic","Activate Pro to use real Playtest history."):r("playtest","default","Ask the AI Agent to run a Playtest when no report is available.")]),uiStudio:g("uiStudio","UI Studio help",[l(a.canDo,"uiStudio","canDo",["Review AI-created UI analysis, improvement suggestions, captures, and before/after history."]),l(a.needs,"uiStudio","needs",["Pro shows real UI Studio data. Basic shows a bundled sample. New capture/check actions need WEPPY Plugin connected."]),s.tier==="basic"?r("uiStudio","basic","Activate Pro to use live UI Studio previews."):r("uiStudio","default","Ask the AI Agent to capture the UI or recheck improvement suggestions, then copy follow-up requests back to the AI chat.")]),tools:m("tools","Tools help",["Inspect tool history, status classification, fallback/unsupported/warn/error details, and usage statistics."],["History and statistics depend on local recording settings and the active place bucket."],["If no records appear, check Controls > General Settings and confirm history/statistics are enabled. Expand failed rows to inspect input, permission, or connection causes."]),controls:m("controls","Controls help",["Manage Project Root, Studio routing, and MCP hot settings."],["Project Root and Studio Routing need MCP server connection. Hot settings need a server response. Asset upload controls live in Assets settings."],["Use Project Root only when MCP should write sync data under a different project folder. Use Studio Routing only for requests where the agent does not name Studio ID, Connection ID, or Place ID."]),settings:m("settings","Settings help",["Manage License, saved data cleanup, server environment display, and language."],["License actions need MCP server connection. Server environment values are read-only here. Asset upload controls live in Assets settings."],["Activate a license for Pro features. Change environment values outside WEPPY Dashboard, then restart MCP. Review delete confirmations before clearing saved data."]),whatsNew:m("whatsNew","What's New help",["Review WEPPY Dashboard, MCP, and Plugin announcements, releases, and change notes."],["Announcements are bundled locally. Unread state is stored in this browser."],["After you visit this page, unread announcements from this visit are marked read when you leave. The top header does not show a duplicate What's New button on this page."])}[e]}const he="_root_rxppj_1",fe="_rootPage_rxppj_7",ge="_rootField_rxppj_11",ye="_button_rxppj_15",be="_panel_rxppj_50",ve="_panelField_rxppj_65",me="_panelPage_rxppj_69",Pe="_panelHeader_rxppj_73",ke="_closeButton_rxppj_91",_e="_sectionStack_rxppj_112",we="_helpSection_rxppj_117",Ce="_linkList_rxppj_118",c={root:he,rootPage:fe,rootField:ge,button:ye,panel:be,panelField:ve,panelPage:me,panelHeader:Pe,closeButton:ke,sectionStack:_e,helpSection:we,linkList:Ce},y=12,A=8,xe=120,Ae=360,Ee=340,Y=560;function Re({topicId:e,state:s,variant:n="page",className:h}){const{t:i}=J(),{trackEvent:P}=Q(),[f,w]=p.useState(!1),[C,D]=p.useState(null),j=p.useId(),M=p.useRef(null),U=p.useRef(null),R=p.useRef(null),b=pe(e,s),I=i(b.title.key,b.title.fallback),x=p.useCallback(()=>{const o=U.current,d=R.current;if(!o||!d||typeof window>"u")return;const u=o.getBoundingClientRect(),v=d.getBoundingClientRect(),k=window.innerWidth,_=window.innerHeight,q=n==="field"?Ee:Ae,N=v.width||Math.min(q,k-y*2),B=v.height||Y;let S=n==="field"?u.left:u.right-N;S=Math.max(y,Math.min(S,k-N-y));const L=_-u.bottom-A-y,W=u.top-A-y,T=L<Math.min(B,220)&&W>L,$=Math.max(xe,T?W:L),G=Math.min(Y,$),F=Math.min(B,G);let H=T?u.top-A-F:u.bottom+A;H=Math.max(y,Math.min(H,_-F-y)),D({top:Math.round(H),left:Math.round(S),maxHeight:Math.round(G)})},[n]);p.useLayoutEffect(()=>{f?x():D(null)},[f,x]),p.useEffect(()=>{if(!f)return;const o=u=>{var k,_;const v=u.target;v&&!((k=M.current)!=null&&k.contains(v))&&!((_=R.current)!=null&&_.contains(v))&&w(!1)},d=u=>{u.key==="Escape"&&w(!1)};return document.addEventListener("mousedown",o),document.addEventListener("keydown",d),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("keydown",d)}},[f]),p.useEffect(()=>{if(!f)return;const o=()=>x();return window.addEventListener("scroll",o,!0),window.addEventListener("resize",o),()=>{window.removeEventListener("scroll",o,!0),window.removeEventListener("resize",o)}},[f,x]);const K=n==="field"?i("dashboardHelp.fieldButton.ariaLabel","Open field help"):i("dashboardHelp.pageButton.ariaLabel","Open page help"),X=C?{top:C.top,left:C.left,maxHeight:C.maxHeight}:{top:-9999,left:-9999,visibility:"hidden"},O=f?t.jsxs("section",{ref:R,id:j,className:[c.panel,n==="field"?c.panelField:c.panelPage].filter(Boolean).join(" "),style:X,role:"dialog","aria-label":I,"data-panel-placement":"help-portal",children:[t.jsxs("div",{className:c.panelHeader,children:[t.jsx("h2",{children:I}),t.jsx("button",{type:"button",className:c.closeButton,"aria-label":i("common.close","Close"),onClick:()=>w(!1),children:t.jsx(V,{size:15,"aria-hidden":"true"})})]}),t.jsx("div",{className:c.sectionStack,children:b.sections.map(o=>t.jsxs("section",{className:c.helpSection,children:[t.jsx("h3",{children:i(o.heading.key,o.heading.fallback)}),t.jsx("ul",{children:o.items.map(d=>t.jsx("li",{children:i(d.key,d.fallback)},d.key))})]},o.heading.key))}),b.links&&b.links.length>0&&t.jsxs("div",{className:c.linkList,children:[t.jsx("h3",{children:i("dashboardHelp.section.links","Related links")}),b.links.map(o=>t.jsxs("a",{href:o.href,target:"_blank",rel:"noreferrer",children:[i(o.label.key,o.label.fallback),t.jsx(Z,{size:12,"aria-hidden":"true"})]},o.href))]})]}):null;return t.jsxs(t.Fragment,{children:[t.jsx("div",{ref:M,className:[c.root,n==="field"?c.rootField:c.rootPage,h??""].filter(Boolean).join(" "),children:t.jsxs("button",{ref:U,type:"button",className:c.button,"aria-label":`${K}: ${I}`,"aria-expanded":f,"aria-controls":j,onClick:()=>{w(o=>{const d=!o;return o||P("dashboard_click_event",{click_target:"dashboard_help_open",help_topic:e,placement:n}),d})},children:[t.jsx(oe,{size:n==="field"?14:16,"aria-hidden":"true"}),n==="page"&&t.jsx("span",{children:i("dashboardHelp.button","Help")})]})}),O&&typeof document<"u"?ee.createPortal(O,document.body):null]})}const Ie="_pageHeader_qym7v_1",Se="_copy_qym7v_9",Le="_titleLine_qym7v_16",He="_actions_qym7v_39",E={pageHeader:Ie,copy:Se,titleLine:Le,actions:He};function je({title:e,description:s,badge:n,helpTopicId:h,helpState:i}){return t.jsxs("div",{className:E.pageHeader,children:[t.jsxs("div",{className:E.copy,children:[t.jsxs("div",{className:E.titleLine,children:[t.jsx("h1",{children:e}),n]}),t.jsx("p",{children:s})]}),t.jsx("div",{className:E.actions,children:t.jsx(Re,{topicId:h,state:i})})]})}export{Re as D,je as P};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{r as o,a as v,u as N,j as t,e as H,h as D,l as E,T as $}from"./index-B9LVK3-K.js";import{P as U}from"./PageHeader-Cqg4GMtU.js";import{I as R}from"./InfoLabel-ZfsTcz5c.js";import{C as O}from"./CurrentPlaceScope-BMyP2w7Z.js";import{T as S}from"./TooltipText-ZamrETeK.js";import{C as F}from"./ConfirmModal-C9EhZCHZ.js";import"./ConfirmModal.module-NrFlfTWy.js";const V=5e3;function B(e){if(typeof e=="number")return{placeId:String(e)}}function W(e,r){return typeof r!="number"?e:`${e}?placeId=${encodeURIComponent(String(r))}`}function z(e){const r=(e==null?void 0:e.enabled)??!0,n=(e==null?void 0:e.placeId)??null,[l,a]=o.useState([]),[p,i]=o.useState(null),[d,c]=o.useState(r),m=o.useRef(null),u=o.useCallback(async()=>{try{const y=B(n),x=y?await v.get("/api/dashboard/playtest/history",y):await v.get("/api/dashboard/playtest/history");a(x.entries??[])}catch{}},[n]),h=o.useCallback(async()=>{if(!r){c(!1);return}await u(),c(!1)},[r,u]),g=o.useCallback(async()=>{r&&(await v.post(W("/api/dashboard/playtest/history/clear",n)),a([]),i(null))},[r,n]);o.useEffect(()=>{i(null)},[n]);const f=o.useCallback(async y=>{if(r)try{const x=B(n),w=x?await v.get(`/api/dashboard/playtest/report/${y}`,x):await v.get(`/api/dashboard/playtest/report/${y}`);i(w)}catch{i(null)}},[r,n]);return o.useEffect(()=>{if(!r){c(!1);return}return h(),m.current=setInterval(h,V),()=>{m.current&&clearInterval(m.current)}},[r,h]),{history:l,selectedReport:p,loading:d,loadReport:f,clearHistory:g}}function G(e){const r="2026-03-27T15:26:00.000Z",n={testScenario:e("playtest.sample.context.why","Spawn into the arena, survive the opener, and verify the HUD responds immediately."),expectedBehavior:e("playtest.sample.context.expected","The player spawns safely, the countdown UI appears within one second, and the first wave starts without errors."),observedBehavior:e("playtest.sample.context.observed","Spawn protection held, the HUD updated on time, and wave one completed with no gameplay regressions.")};return{history:[{timestamp:r,testName:e("playtest.sample.history.name","Sample Arena Smoke Test"),mode:"play",status:"passed",durationMs:4820,contextId:"sample_playtest_preview",contextSummary:n}],report:{markdown:e("playtest.sample.report.markdown",`# Sample Arena Smoke Test
|
|
2
|
+
|
|
3
|
+
- Spawn flow: PASS
|
|
4
|
+
- HUD countdown: PASS
|
|
5
|
+
- Wave bootstrap: PASS
|
|
6
|
+
|
|
7
|
+
This is a sample preview. Live playtests and real reports are available with Pro.`),logs:e("playtest.sample.report.logs",`[sample] boot playtest preview
|
|
8
|
+
[sample] spawn protection active
|
|
9
|
+
[sample] hud countdown rendered
|
|
10
|
+
[sample] wave one completed
|
|
11
|
+
[sample] preview report finished`),contextId:"sample_playtest_preview",contextSummary:n}}}const Q="_page_3lq3l_2",Y="_sampleBanner_3lq3l_9",Z="_sampleBannerRow_3lq3l_21",J="_sampleBannerMain_3lq3l_28",K="_sampleBadge_3lq3l_35",X="_sampleTitle_3lq3l_50",ee="_sampleMessage_3lq3l_57",te="_sampleActions_3lq3l_64",se="_primaryAction_3lq3l_72",ae="_secondaryAction_3lq3l_73",re="_card_3lq3l_109",ne="_cardHeader_3lq3l_116",le="_clearButton_3lq3l_128",oe="_statusRow_3lq3l_143",ie="_statusIndicator_3lq3l_150",ce="_statusRunning_3lq3l_158",de="_statusPaused_3lq3l_163",pe="_statusNotRunning_3lq3l_167",me="_statusLabel_3lq3l_171",ue="_statusMeta_3lq3l_178",he="_controlButtons_3lq3l_184",ye="_btn_3lq3l_191",_e="_btnPrimary_3lq3l_213",xe="_btnDanger_3lq3l_223",ge="_historyList_3lq3l_233",ve="_historyItem_3lq3l_241",Se="_historyItemSelected_3lq3l_260",fe="_historyItemHeader_3lq3l_265",be="_historyIcon_3lq3l_271",je="_historyTimestamp_3lq3l_276",we="_historyName_3lq3l_283",Ne="_historyItemMeta_3lq3l_293",Ce="_historyMode_3lq3l_302",qe="_historyDuration_3lq3l_306",Ie="_historyStatus_3lq3l_310",Le="_status_passed_3lq3l_317",Pe="_status_failed_3lq3l_321",Re="_status_running_3lq3l_325",Be="_historyError_3lq3l_329",Te="_historyContext_3lq3l_339",Me="_historyContextLine_3lq3l_348",ke="_historyContextLabel_3lq3l_354",Ae="_reportContainer_3lq3l_363",He="_reportContextPanel_3lq3l_369",De="_reportContextRow_3lq3l_379",Ee="_reportContextLabel_3lq3l_387",$e="_reportSection_3lq3l_395",Ue="_reportSectionHeader_3lq3l_401",Oe="_reportMarkdown_3lq3l_413",Fe="_reportLogs_3lq3l_426",Ve="_emptyState_3lq3l_441",We="_emptyStateTitle_3lq3l_448",ze="_emptyStateMessage_3lq3l_456",Ge="_upgradePanel_3lq3l_465",Qe="_upgradePanelIcon_3lq3l_473",Ye="_upgradePanelTitle_3lq3l_478",Ze="_upgradePanelDesc_3lq3l_486",Je="_benefitList_3lq3l_496",Ke="_benefitItem_3lq3l_507",Xe="_upgradeActions_3lq3l_522",s={page:Q,sampleBanner:Y,sampleBannerRow:Z,sampleBannerMain:J,sampleBadge:K,sampleTitle:X,sampleMessage:ee,sampleActions:te,primaryAction:se,secondaryAction:ae,card:re,cardHeader:ne,clearButton:le,statusRow:oe,statusIndicator:ie,statusRunning:ce,statusPaused:de,statusNotRunning:pe,statusLabel:me,statusMeta:ue,controlButtons:he,btn:ye,btnPrimary:_e,btnDanger:xe,historyList:ge,historyItem:ve,historyItemSelected:Se,historyItemHeader:fe,historyIcon:be,historyTimestamp:je,historyName:we,historyItemMeta:Ne,historyMode:Ce,historyDuration:qe,historyStatus:Ie,status_passed:Le,status_failed:Pe,status_running:Re,historyError:Be,historyContext:Te,historyContextLine:Me,historyContextLabel:ke,reportContainer:Ae,reportContextPanel:He,reportContextRow:De,reportContextLabel:Ee,reportSection:$e,reportSectionHeader:Ue,reportMarkdown:Oe,reportLogs:Fe,emptyState:Ve,emptyStateTitle:We,emptyStateMessage:ze,upgradePanel:Ge,upgradePanelIcon:Qe,upgradePanelTitle:Ye,upgradePanelDesc:Ze,benefitList:Je,benefitItem:Ke,upgradeActions:Xe};function j(e){return e.trim().toLowerCase()}function et(e){switch(j(e)){case"passed":return"✅";case"failed":return"❌";case"running":return"⏱";default:return"❓"}}function tt(e,r){switch(j(r)){case"run":return e("playtest.status.mode.run","Run");case"server":return e("playtest.status.mode.server","Server");case"edit":return e("playtest.status.mode.edit","Edit");case"play":return e("playtest.status.mode.play","Play");default:return r}}function st(e,r){switch(j(r)){case"passed":return e("playtest.history.status.passed","Passed");case"failed":return e("playtest.history.status.failed","Failed");case"running":return e("playtest.history.status.running","Running");default:return e("playtest.history.status.unknown","Unknown")}}function at(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function rt({entries:e,onSelect:r,selectedTimestamp:n}){const{t:l}=N();return e.length===0?t.jsx("div",{className:s.emptyState,children:l("playtest.history.empty","No test results yet")}):t.jsx("div",{className:s.historyList,children:e.map(a=>{var i,d,c,m,u,h;const p=a.timestamp===n;return t.jsxs("button",{className:`${s.historyItem} ${p?s.historyItemSelected:""}`,onClick:()=>r(a.timestamp),children:[t.jsxs("div",{className:s.historyItemHeader,children:[t.jsx("span",{className:s.historyIcon,children:et(a.status)}),t.jsx("span",{className:s.historyTimestamp,children:a.timestamp}),t.jsx("span",{className:s.historyName,children:a.testName})]}),t.jsxs("div",{className:s.historyItemMeta,children:[t.jsx(S,{text:l("playtest.history.mode.tooltip","Playtest mode used for this recorded test run."),children:t.jsxs("span",{className:s.historyMode,children:[l("playtest.history.mode","Mode"),": ",tt(l,a.mode)]})}),t.jsx("span",{className:s.historyDuration,children:at(a.durationMs)}),t.jsx(S,{text:l("playtest.history.status.tooltip","Recorded result state for this automated playtest run."),children:t.jsx("span",{className:`${s.historyStatus} ${s[`status_${j(a.status)}`]??""}`,children:st(l,a.status)})})]}),a.errorMessage&&t.jsx("div",{className:s.historyError,children:a.errorMessage}),(a.contextId||((i=a.contextSummary)==null?void 0:i.testScenario)||((d=a.contextSummary)==null?void 0:d.expectedBehavior)||((c=a.contextSummary)==null?void 0:c.observedBehavior))&&t.jsxs("div",{className:s.historyContext,children:[a.contextId&&t.jsxs("div",{className:s.historyContextLine,children:[t.jsx("span",{className:s.historyContextLabel,children:l("playtest.context.contextId","Context ID")}),t.jsx("span",{children:a.contextId})]}),((m=a.contextSummary)==null?void 0:m.testScenario)&&t.jsxs("div",{className:s.historyContextLine,children:[t.jsx("span",{className:s.historyContextLabel,children:l("playtest.context.why","Why this test ran")}),t.jsx("span",{children:a.contextSummary.testScenario})]}),((u=a.contextSummary)==null?void 0:u.expectedBehavior)&&t.jsxs("div",{className:s.historyContextLine,children:[t.jsx("span",{className:s.historyContextLabel,children:l("playtest.context.expected","Expected")}),t.jsx("span",{children:a.contextSummary.expectedBehavior})]}),((h=a.contextSummary)==null?void 0:h.observedBehavior)&&t.jsxs("div",{className:s.historyContextLine,children:[t.jsx("span",{className:s.historyContextLabel,children:l("playtest.context.observed","Observed")}),t.jsx("span",{children:a.contextSummary.observedBehavior})]})]})]},a.timestamp)})})}function nt({report:e}){var l,a,p,i,d,c;const{t:r}=N(),n=!!((l=e.contextSummary)!=null&&l.testScenario||(a=e.contextSummary)!=null&&a.expectedBehavior||(p=e.contextSummary)!=null&&p.observedBehavior);return t.jsxs("div",{className:s.reportContainer,children:[n&&t.jsxs("div",{className:s.reportContextPanel,children:[((i=e.contextSummary)==null?void 0:i.testScenario)&&t.jsxs("div",{className:s.reportContextRow,children:[t.jsx("span",{className:s.reportContextLabel,children:r("playtest.context.why","Why this test ran")}),t.jsx("span",{children:e.contextSummary.testScenario})]}),((d=e.contextSummary)==null?void 0:d.expectedBehavior)&&t.jsxs("div",{className:s.reportContextRow,children:[t.jsx("span",{className:s.reportContextLabel,children:r("playtest.context.expected","Expected")}),t.jsx("span",{children:e.contextSummary.expectedBehavior})]}),((c=e.contextSummary)==null?void 0:c.observedBehavior)&&t.jsxs("div",{className:s.reportContextRow,children:[t.jsx("span",{className:s.reportContextLabel,children:r("playtest.context.observed","Observed")}),t.jsx("span",{children:e.contextSummary.observedBehavior})]})]}),e.markdown&&t.jsxs("div",{className:s.reportSection,children:[t.jsx("div",{className:s.reportSectionHeader,children:t.jsx(S,{text:r("playtest.report.content.tooltip","Markdown summary for the selected automated playtest run."),children:t.jsx("span",{children:r("playtest.report.content","Report")})})}),t.jsx("pre",{className:s.reportMarkdown,children:e.markdown})]}),e.logs&&t.jsxs("div",{className:s.reportSection,children:[t.jsx("div",{className:s.reportSectionHeader,children:t.jsx(S,{text:r("playtest.report.logs.tooltip","Execution logs captured for the selected automated playtest run."),children:t.jsx("span",{children:r("playtest.report.logs","Logs")})})}),t.jsx("pre",{className:s.reportLogs,children:e.logs})]}),!e.markdown&&!e.logs&&t.jsx("div",{className:s.emptyState,children:r("playtest.report.empty","No report content available")})]})}function ut(){var P;const{t:e}=N(),{trackEvent:r}=H(),{tier:n,loading:l}=D(),a=!l&&n==="basic",[p,i]=o.useState(null),d=z({enabled:!a,placeId:p}),{show:c}=E(),[m,u]=o.useState(null),[h,g]=o.useState(!1),[f,y]=o.useState(!1),{history:x,selectedReport:w,loading:T}=d,_=a?G(e):null,C=((P=_==null?void 0:_.history[0])==null?void 0:P.timestamp)??null,q=a?m??C:m,I=(_==null?void 0:_.history)??x,L=_&&q===C?_.report:w,M=a?!1:T,k=b=>{u(b),!a&&d.loadReport(b)},A=async()=>{y(!0);try{await d.clearHistory(),c(e("toast.clearSuccess","Cleared successfully"),"success"),g(!1),u(null)}catch{c(e("toast.clearFailed","Failed to clear data"),"error")}finally{y(!1)}};return t.jsxs("div",{className:s.page,children:[t.jsx(U,{title:e("page.playtest.title","Playtest"),description:e("page.playtest.description","Review automated playtest runs, saved reports, and result history."),helpTopicId:"playtest",helpState:{tier:n}}),!a&&t.jsx(O,{surface:"playtest",selectable:!0,selectedPlaceId:p,onSelectedPlaceIdChange:b=>{i(b),u(null)}}),a&&t.jsx("div",{className:s.sampleBanner,children:t.jsxs("div",{className:s.sampleBannerRow,children:[t.jsxs("div",{className:s.sampleBannerMain,children:[t.jsx("div",{className:s.sampleBadge,children:e("playtest.sample.badge","Preview of the Pro playtest view")}),t.jsx("div",{className:s.sampleTitle,children:e("playtest.sample.title","You are previewing the report viewer that becomes available after upgrading to Pro.")}),t.jsx("div",{className:s.sampleMessage,children:e("playtest.sample.message","This preview uses sample data. Real playtest history management and stored reports unlock with Pro.")})]}),t.jsx("div",{className:s.sampleActions,children:t.jsx("a",{className:s.primaryAction,href:$.playtest,target:"_blank",rel:"noreferrer",onClick:()=>r("dashboard_click_event",{click_target:"upgrade_cta",placement:"playtest_sample_banner",page:"playtest"}),children:e("tier.upgrade","View Pro")})})]})}),t.jsxs("div",{className:s.card,children:[t.jsxs("div",{className:s.cardHeader,children:[t.jsx(R,{label:e("playtest.history.title","Test History"),tooltip:e("playtest.history.title.tooltip","Recorded automated playtest runs for this project.")}),a?t.jsx(S,{text:e("playtest.sample.clearDisabled","Available with Pro for live playtest history."),children:t.jsx("span",{children:t.jsx("button",{className:s.clearButton,disabled:!0,children:e("common.clear","Clear")})})}):t.jsx("button",{className:s.clearButton,onClick:()=>{r("dashboard_click_event",{click_target:"playtest_clear_history",page:"playtest"}),g(!0)},children:e("common.clear","Clear")})]}),M?t.jsx("div",{className:s.emptyState,children:e("common.loading","Loading...")}):I.length===0?t.jsxs("div",{className:s.emptyState,children:[t.jsx("div",{className:s.emptyStateTitle,children:e("playtest.empty.title","No playtest results yet")}),t.jsx("div",{className:s.emptyStateMessage,children:e("playtest.empty.message","Test results for this place will appear here after the AI Agent runs a Playtest.")})]}):t.jsx(rt,{entries:I,onSelect:k,selectedTimestamp:q??void 0})]}),L&&t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:t.jsx(R,{label:e("playtest.report.title","Selected Report"),tooltip:e("playtest.report.title.tooltip","Detailed output for the currently selected automated playtest run.")})}),t.jsx(nt,{report:L})]}),!a&&t.jsx(F,{open:h,title:e("playtest.clear.title","Clear test history?"),message:e("playtest.clear.message","This permanently removes the stored playtest reports for the current place."),cancelLabel:e("common.cancel","Cancel"),confirmLabel:e("common.clear","Clear"),loading:f,onCancel:()=>!f&&g(!1),onConfirm:A})]})}export{ut as Component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as V,e as ae,r as u,j as e,g as le,a as I,d as re,T as ce,A as de,S as ue}from"./index-B9LVK3-K.js";import{P as pe}from"./PageHeader-Cqg4GMtU.js";import{I as v}from"./InfoLabel-ZfsTcz5c.js";import{T as d}from"./TooltipText-ZamrETeK.js";import{s as i,u as ge}from"./useSettings-mbARvRgI.js";import{C as he}from"./ConfirmModal-C9EhZCHZ.js";import{D as ie,f as ne,r as me,s as ye,a as oe,d as K,S as te,b as ve}from"./sample-requests-CS0o0F7H.js";import"./ConfirmModal.module-NrFlfTWy.js";const xe="_card_1jlvt_4",je="_cardEmbedded_1jlvt_14",fe="_cardTitle_1jlvt_21",Se="_usageRow_1jlvt_30",be="_usageTotal_1jlvt_36",_e="_usageBreakdown_1jlvt_42",Ne="_usageCounts_1jlvt_47",Ce="_divider_1jlvt_53",ke="_lastRunRow_1jlvt_60",Re="_lastRunLabel_1jlvt_69",Le="_errorIcon_1jlvt_75",we="_tooltip_1jlvt_83",He="_cleanupRow_1jlvt_106",Pe="_cleanupLabel_1jlvt_113",Be="_cleanupBtn_1jlvt_120",De="_cleanupBtnDanger_1jlvt_143",Ae="_retentionSection_1jlvt_155",Te="_retentionTitle_1jlvt_161",Me="_retentionFieldset_1jlvt_170",Ee="_proOverlay_1jlvt_185",$e="_radioRow_1jlvt_197",Ie="_radioLabel_1jlvt_204",Ue="_presetGroup_1jlvt_224",ze="_presetBtn_1jlvt_232",Oe="_presetBtnActive_1jlvt_249",Fe="_freeInput_1jlvt_256",qe="_inputError_1jlvt_272",Ge="_inputUnit_1jlvt_276",We="_cascadeRow_1jlvt_283",Ye="_retentionActions_1jlvt_302",Ke="_saveBtn_1jlvt_308",Ve="_runNowBtn_1jlvt_330",Je="_errorMsg_1jlvt_353",n={card:xe,cardEmbedded:je,cardTitle:fe,usageRow:Se,usageTotal:be,usageBreakdown:_e,usageCounts:Ne,divider:Ce,lastRunRow:ke,lastRunLabel:Re,errorIcon:Le,tooltip:we,cleanupRow:He,cleanupLabel:Pe,cleanupBtn:Be,cleanupBtnDanger:De,retentionSection:Ae,retentionTitle:Te,retentionFieldset:Me,proOverlay:Ee,radioRow:$e,radioLabel:Ie,presetGroup:Ue,presetBtn:ze,presetBtnActive:Oe,freeInput:Fe,inputError:qe,inputUnit:Ge,cascadeRow:We,retentionActions:Ye,saveBtn:Ke,runNowBtn:Ve,errorMsg:Je};function Qe(t,s){return!!(t.mode==="off"&&s.mode!=="off"||t.mode==="age"&&s.mode==="age"&&(s.ageDays??0)<(t.ageDays??0)||t.mode==="size"&&s.mode==="size"&&(s.sizeMb??0)<(t.sizeMb??0)||!t.cascadeSnapshots&&s.cascadeSnapshots)}function se(t){return t.mode==="age"?Number.isInteger(t.ageDays)&&t.ageDays>=1&&t.ageDays<=365:t.mode==="size"?Number.isInteger(t.sizeMb)&&t.sizeMb>=50&&t.sizeMb<=1e4:!0}function Xe(t,s){return t.mode===s.mode&&t.ageDays===s.ageDays&&t.sizeMb===s.sizeMb&&t.cascadeSnapshots===s.cascadeSnapshots}function z(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:t<1024*1024*1024?`${(t/(1024*1024)).toFixed(1)} MB`:`${(t/(1024*1024*1024)).toFixed(2)} GB`}function Ze({placeId:t,tier:s,currentPolicy:l,onSaved:x}){const{t:o}=V(),{trackEvent:N}=ae(),[a,g]=u.useState(l),[p,P]=u.useState(()=>[7,14,30,90].includes(l.ageDays??-1)?"":String(l.ageDays??30)),[k,B]=u.useState(()=>[100,500,1e3].includes(l.sizeMb??-1)?"":String(l.sizeMb??500)),[S,D]=u.useState(null),[h,y]=u.useState(!1),[A,R]=u.useState(!1),[_,L]=u.useState(!1),[w,H]=u.useState(null);u.useEffect(()=>{g(l);const c=[7,14,30,90],b=[100,500,1e3];P(c.includes(l.ageDays??-1)?"":String(l.ageDays??30)),B(b.includes(l.sizeMb??-1)?"":String(l.sizeMb??500))},[l]);const C=s==="basic",j=se(a),r=Xe(l,a),T=j&&!r&&!A,f=c=>{g(b=>{const U={...b,mode:c};return c==="age"&&(U.ageDays=parseInt(p,10)||30),c==="size"&&(U.sizeMb=parseInt(k,10)||500),U})},m=c=>{P(""),g(b=>({...b,ageDays:c}))},O=c=>{B(""),g(b=>({...b,sizeMb:c}))},J=c=>{P(c);const b=parseInt(c,10);Number.isNaN(b)||g(U=>({...U,ageDays:b}))},E=c=>{B(c);const b=parseInt(c,10);Number.isNaN(b)||g(U=>({...U,sizeMb:b}))},Q=async()=>{if(H(null),N("dashboard_click_event",{click_target:"ui_studio_cleanup_save",page:"settings"}),Qe(l,a)){try{const c=await ne(t,{mode:a.mode,ageDays:a.ageDays,sizeMb:a.sizeMb,cascadeSnapshots:a.cascadeSnapshots});D(c.dryRun),y(!0)}catch(c){H(c.message)}return}await Y()},Y=async()=>{R(!0);try{await ye(t,a),y(!1),x()}catch(c){throw H(c.message),c}finally{R(!1)}},X=async()=>{H(null),N("dashboard_click_event",{click_target:"ui_studio_cleanup_run_now",page:"settings"}),L(!0);try{await me(t),x()}catch(c){H(c.message)}finally{L(!1)}},Z=S?`${o("uiStudio.cleanup.policy.confirm.messageStrict","이 정책으로 즉시")} ${S.wouldRemoveRequests}${o("uiStudio.cleanup.policy.confirm.requests","건")} / ${S.wouldRemoveSnapshots}${o("uiStudio.cleanup.policy.confirm.snapshots","개 화면 캡처")} / ${z(S.wouldFreeBytes)} ${o("uiStudio.cleanup.policy.confirm.freed","가 삭제됩니다 — 적용?")}`:"",$=a.mode==="age"&&!se(a),ee=a.mode==="size"&&!se(a);return e.jsxs("div",{className:n.retentionSection,children:[e.jsx("h3",{className:n.retentionTitle,children:e.jsx(v,{label:o("uiStudio.cleanup.policy.title","자동 삭제 정책"),tooltip:o("uiStudio.cleanup.policy.title.tooltip","Rules that automatically remove old or large captures.")})}),e.jsxs("div",{style:{position:"relative"},children:[C&&e.jsx("div",{className:n.proOverlay,title:o("uiStudio.cleanup.policy.proRequired","Pro에서 사용 가능"),children:e.jsx("div",{className:n.tooltip,children:o("uiStudio.cleanup.policy.proRequired","Pro에서 사용 가능")})}),e.jsxs("fieldset",{className:n.retentionFieldset,disabled:C,style:C?{opacity:.45,pointerEvents:"none"}:void 0,children:[e.jsx("div",{className:n.radioRow,children:e.jsx(d,{text:o("uiStudio.cleanup.policy.modeOff.tooltip","Turn off auto-cleanup. Data stays until you remove it manually."),children:e.jsxs("label",{className:n.radioLabel,children:[e.jsx("input",{type:"radio",name:"cleanupMode",value:"off",checked:a.mode==="off",onChange:()=>f("off")}),o("uiStudio.cleanup.policy.modeOff","사용 안 함 (off)")]})})}),e.jsxs("div",{children:[e.jsx("div",{className:n.radioRow,children:e.jsx(d,{text:o("uiStudio.cleanup.policy.modeAge.tooltip","Automatically delete data older than the configured number of days."),children:e.jsxs("label",{className:n.radioLabel,children:[e.jsx("input",{type:"radio",name:"cleanupMode",value:"age",checked:a.mode==="age",onChange:()=>f("age")}),o("uiStudio.cleanup.policy.modeAge","기간 기반 (age)")]})})}),a.mode==="age"&&e.jsxs("div",{className:n.presetGroup,children:[[7,14,30,90].map(c=>e.jsx(d,{text:o("uiStudio.cleanup.policy.agePreset.tooltip","Delete data older than this many days."),children:e.jsxs("button",{type:"button",className:`${n.presetBtn} ${a.ageDays===c&&p===""?n.presetBtnActive:""}`,onClick:()=>m(c),children:[c,o("uiStudio.cleanup.policy.daysUnit","일")]})},c)),e.jsx(d,{text:o("uiStudio.cleanup.policy.ageInput.tooltip","Enter any value between 1 and 365 days."),children:e.jsx("input",{type:"number",className:`${n.freeInput} ${$?n.inputError:""}`,value:p,min:1,max:365,onChange:c=>J(c.target.value)})}),e.jsxs("span",{className:n.inputUnit,children:["1–365",o("uiStudio.cleanup.policy.daysUnit","일")]})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:n.radioRow,children:e.jsx(d,{text:o("uiStudio.cleanup.policy.modeSize.tooltip","When total usage exceeds the limit, the oldest data is removed first."),children:e.jsxs("label",{className:n.radioLabel,children:[e.jsx("input",{type:"radio",name:"cleanupMode",value:"size",checked:a.mode==="size",onChange:()=>f("size")}),o("uiStudio.cleanup.policy.modeSize","용량 기반 (size)")]})})}),a.mode==="size"&&e.jsxs("div",{className:n.presetGroup,children:[[100,500,1e3].map(c=>e.jsx(d,{text:o("uiStudio.cleanup.policy.sizePreset.tooltip","Keep total usage under this size."),children:e.jsxs("button",{type:"button",className:`${n.presetBtn} ${a.sizeMb===c&&k===""?n.presetBtnActive:""}`,onClick:()=>O(c),children:[c,o("uiStudio.cleanup.policy.mbUnit","MB")]})},c)),e.jsx(d,{text:o("uiStudio.cleanup.policy.sizeInput.tooltip","Enter any value between 50 MB and 10000 MB (10 GB)."),children:e.jsx("input",{type:"number",className:`${n.freeInput} ${ee?n.inputError:""}`,value:k,min:50,max:1e4,onChange:c=>E(c.target.value)})}),e.jsxs("span",{className:n.inputUnit,children:["50–10000",o("uiStudio.cleanup.policy.mbUnit","MB")]})]})]}),e.jsx(d,{text:o("uiStudio.cleanup.policy.cascade.tooltip","Also delete the capture images linked to those records. If off, the images stay."),children:e.jsxs("label",{className:n.cascadeRow,children:[e.jsx("input",{type:"checkbox",checked:a.cascadeSnapshots,onChange:c=>g(b=>({...b,cascadeSnapshots:c.target.checked}))}),o("uiStudio.cleanup.policy.cascade","연결된 화면 캡처도 함께 삭제")]})}),e.jsxs("div",{className:n.retentionActions,children:[e.jsx(d,{text:o("uiStudio.cleanup.policy.save.tooltip","Save the current cleanup rule. It runs in the background from then on."),children:e.jsx("button",{type:"button",className:n.saveBtn,onClick:()=>void Q(),disabled:!T,children:o("uiStudio.cleanup.policy.save","정책 저장")})}),e.jsx(d,{text:o("uiStudio.cleanup.policy.runNow.tooltip","Run the current rule once now, without waiting for the next scheduled run."),children:e.jsx("button",{type:"button",className:n.runNowBtn,onClick:()=>void X(),disabled:_,children:o("uiStudio.cleanup.policy.runNow","지금 정리")})})]}),w&&e.jsx("div",{className:n.errorMsg,children:w})]})]}),h&&S&&e.jsx(ie,{title:o("uiStudio.cleanup.policy.confirm.title","정책 적용 확인"),message:Z,danger:!0,confirmLabel:o("uiStudio.cleanup.policy.save","정책 저장"),busy:A,onConfirm:Y,onClose:()=>y(!1)})]})}function et({placeId:t,tier:s,onChanged:l,sampleUsage:x,sampleRetention:o,embedded:N=!1}){const{t:a}=V(),g=s==="basic"&&x!=null&&o!=null,[p,P]=u.useState(g?x:null),[k,B]=u.useState(g?o:null),[S,D]=u.useState(null),[h,y]=u.useState(null),[A,R]=u.useState(null),_=u.useCallback(async()=>{if(!g&&t!=null){D(null);try{const[f,m]=await Promise.all([oe(t),ne(t)]);P(f),B(m.policy)}catch(f){D(f.message)}}},[t,g]);u.useEffect(()=>{_()},[_]);const L=u.useCallback(()=>{_(),l==null||l()},[_,l]),w=u.useCallback(async()=>{if(h&&t!=null){R(null);try{h.kind==="keep7"?await K(t,{olderThanDays:7,alsoSnapshots:!0}):h.kind==="keep30"?await K(t,{olderThanDays:30,alsoSnapshots:!0}):await K(t,{all:!0,alsoSnapshots:!0}),y(null),_(),l==null||l()}catch(f){throw R(f.message),f}}},[h,t,_,l]);function H(f){const m=a("uiStudio.cleanup.studioPreservedNote","This deletes saved change records and screenshots on disk only; Roblox Studio instances are not affected.");return f.kind==="keep7"?`${a("uiStudio.cleanup.cleanupConfirmMessage.keep7","7일 이전 변경 기록과 화면 캡처가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.")} ${m}`:f.kind==="keep30"?`${a("uiStudio.cleanup.cleanupConfirmMessage.keep30","30일 이전 변경 기록과 화면 캡처가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.")} ${m}`:`${((p==null?void 0:p.requestCount)??0)+((p==null?void 0:p.snapshotCount)??0)}${a("uiStudio.cleanup.cleanupConfirmMessage.all","개의 저장된 변경 기록과 화면 캡처가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.")} ${m}`}if(t==null&&!g)return null;if(S)return e.jsx("div",{className:`${n.card} ${N?n.cardEmbedded:""}`,children:e.jsx("p",{className:n.errorMsg,children:S})});if(!p||!k)return e.jsx("div",{className:`${n.card} ${N?n.cardEmbedded:""}`,children:e.jsx("p",{style:{fontSize:12,color:"var(--text-muted)",margin:0},children:a("uiStudio.storage.loading","로딩 중...")})});const C=k.lastRunAt,j=k.lastRunStats,r=C?new Date(C).toLocaleString():null,T=t??0;return e.jsxs("div",{className:`${n.card} ${N?n.cardEmbedded:""}`,children:[e.jsx("h3",{className:n.cardTitle,children:e.jsx(v,{label:a("uiStudio.storage.title","UI Studio 저장 데이터"),tooltip:a("uiStudio.storage.title.tooltip","Disk usage of UI Studio change records and screenshots.")})}),e.jsxs("div",{className:n.usageRow,children:[e.jsx(d,{text:a("uiStudio.storage.usageLabel.tooltip","Disk space currently used by UI Studio for this project."),children:e.jsxs("div",{className:n.usageTotal,children:[a("uiStudio.storage.usageLabel","사용 중")," ",z(p.totalBytes)]})}),e.jsxs("div",{className:n.usageBreakdown,children:[e.jsx(d,{text:a("uiStudio.storage.historyBytes.tooltip","Space taken by change record data (JSON)."),children:e.jsxs("span",{children:[a("uiStudio.storage.historyBytes","변경 이력")," ",z(p.historyBytes)]})})," · ",e.jsx(d,{text:a("uiStudio.storage.snapshotBytes.tooltip","Space taken by captured PNG image files."),children:e.jsxs("span",{children:[a("uiStudio.storage.snapshotBytes","화면 캡처")," ",z(p.snapshotBytes)]})})]}),e.jsxs("div",{className:n.usageCounts,children:[e.jsx(d,{text:a("uiStudio.storage.requestCount.tooltip","Number of actions where AI changed the UI."),children:e.jsxs("span",{children:[a("uiStudio.storage.requestCount","변경 기록")," ",p.requestCount.toLocaleString(),a("uiStudio.storage.countSuffix","개")]})})," · ",e.jsx(d,{text:a("uiStudio.storage.mutationCount.tooltip","Number of detail changes inside actions (one property edit = 1)."),children:e.jsxs("span",{children:[a("uiStudio.storage.mutationCount","변경 상세")," ",p.mutationCount.toLocaleString(),a("uiStudio.storage.countSuffix","개")]})})," · ",e.jsx(d,{text:a("uiStudio.storage.snapshotCount.tooltip","Number of saved capture image files."),children:e.jsxs("span",{children:[a("uiStudio.storage.snapshotCount","화면 캡처")," ",p.snapshotCount.toLocaleString(),a("uiStudio.storage.countSuffix","개")]})})]})]}),e.jsx("hr",{className:n.divider}),e.jsx(Ze,{placeId:T,tier:s,currentPolicy:k,onSaved:L}),e.jsx("hr",{className:n.divider}),e.jsxs("div",{className:n.lastRunRow,children:[e.jsx("span",{className:n.lastRunLabel,children:e.jsx(v,{label:a("uiStudio.storage.lastRun","마지막 자동 정리"),tooltip:a("uiStudio.storage.lastRun.tooltip","When the auto-cleanup policy last ran, and what it removed.")})}),r?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:r}),j&&e.jsxs("span",{children:["· ",a("uiStudio.storage.requestCount","변경 기록")," ",j.removedRequests,a("uiStudio.storage.countSuffix","개")," / ",a("uiStudio.storage.snapshotCount","화면 캡처")," ",j.removedSnapshots,a("uiStudio.storage.countSuffix","개")," / ",z(j.freedBytes)," ",a("uiStudio.storage.lastRunFreed","회수")]}),j&&j.errors>0&&e.jsxs("span",{className:n.errorIcon,title:`${a("uiStudio.storage.lastRunErrors","오류")} ${j.errors}건`,children:["⚠",e.jsxs("span",{className:n.tooltip,children:[a("uiStudio.storage.lastRunErrors","오류")," ",j.errors,a("uiStudio.storage.countSuffix","건")]})]})]}):e.jsx("span",{children:a("uiStudio.storage.lastRunNever","—")})]}),e.jsx("hr",{className:n.divider}),e.jsxs("div",{className:n.cleanupRow,children:[e.jsx("span",{className:n.cleanupLabel,children:e.jsx(v,{label:a("uiStudio.cleanup.label","수동 정리"),tooltip:a("uiStudio.cleanup.label.tooltip","Manually clean up change records and captures whenever you want.")})}),e.jsx(d,{text:a("uiStudio.cleanup.keep7.tooltip","Delete change records and captures older than 7 days."),children:e.jsx("button",{type:"button",className:n.cleanupBtn,onClick:()=>y({kind:"keep7"}),disabled:s==="basic",children:a("uiStudio.cleanup.keepLastNDays","최근 7일만 남기기").replace("{n}","7")})}),e.jsx(d,{text:a("uiStudio.cleanup.keep30.tooltip","Delete change records and captures older than 30 days."),children:e.jsx("button",{type:"button",className:n.cleanupBtn,onClick:()=>y({kind:"keep30"}),disabled:s==="basic",children:a("uiStudio.cleanup.keepLastNDays","최근 30일만 남기기").replace("{n}","30")})}),e.jsx(d,{text:a("uiStudio.cleanup.deleteAll.tooltip","Delete every change record and capture for this project. The actual UI in Roblox Studio is not affected."),children:e.jsx("button",{type:"button",className:`${n.cleanupBtn} ${n.cleanupBtnDanger}`,onClick:()=>y({kind:"all"}),disabled:s==="basic",children:a("uiStudio.cleanup.deleteAll","전체 삭제…")})})]}),A&&e.jsx("div",{className:n.errorMsg,children:A}),h&&e.jsx(ie,{title:a("uiStudio.cleanup.cleanupConfirmTitle","정리 확인"),message:H(h),danger:!0,confirmLabel:a("common.delete","삭제"),onConfirm:w,onClose:()=>{y(null),R(null)}})]})}const tt={toolsActivity:null,toolStats:null,toolSessions:null,syncLog:null,playtestReports:null,projectChanges:null,connectionLog:null},st={toolsActivity:null,toolStats:null,syncLog:null,playtestReports:null,projectChanges:null,connectionLog:null};function at(t){var s;return t?t.pluginConnected?t.activePlaceId:t.lastActivePlaceId??((s=t.places[0])==null?void 0:s.placeId)??null:null}async function M(t){try{return await t}catch{return null}}function G(t){return t?typeof t.total=="number"?t.total:Array.isArray(t.entries)?t.entries.length:null:null}function W(t,s,l,x){return s===null?t("settings.dataHistory.metric.unavailable","Unavailable"):`${s.toLocaleString()} ${t(l,x)}`}function F(t,s,l){const x=l===null?t("settings.dataHistory.metric.sizeUnavailable","size unavailable"):z(l);return`${s} · ${x}`}function q(t,s){var x;const l=(x=t==null?void 0:t[s])==null?void 0:x.bytes;return typeof l=="number"&&Number.isFinite(l)?l:null}function it(t,s){return s?[`${s.requestCount.toLocaleString()} ${t("uiStudio.storage.requestCount","change records")}`,`${s.snapshotCount.toLocaleString()} ${t("uiStudio.storage.snapshotCount","screenshots")}`,z(s.totalBytes)].join(" · "):t("settings.dataHistory.metric.unavailable","Unavailable")}function nt({tier:t}){const{t:s}=V(),[l,x]=u.useState(tt),[o,N]=u.useState(st),[a,g]=u.useState(t==="basic"?te:null),[p,P]=u.useState(null),[k,B]=u.useState(!0),[S,D]=u.useState(!0),[h,y]=u.useState(null),[A,R]=u.useState(!1),[_,L]=u.useState(null),w=u.useCallback(async()=>{B(!0);const m=await M(le()),O=at(m);P(O);const[J,E,Q,Y,X,Z,$]=await Promise.all([M(I.get("/api/dashboard/history",{limit:"1",offset:"0"})),M(I.get("/api/dashboard/tool-stats")),M(I.get("/sync/history",{limit:"1",offset:"0"})),M(I.get("/api/dashboard/playtest/history")),M(I.get("/api/dashboard/changelog",{limit:"1",offset:"0"})),M(I.get("/api/dashboard/connection-log")),M(I.get("/api/dashboard/storage-summary"))]),ee=t==="basic"?te:O===null?null:await M(oe(O));x({toolsActivity:G(J),toolStats:(E==null?void 0:E.totalCalls)??null,toolSessions:(E==null?void 0:E.totalSessions)??null,syncLog:G(Q),playtestReports:G(Y),projectChanges:G(X),connectionLog:G(Z)}),N({toolsActivity:q($,"toolsActivity"),toolStats:q($,"toolStats"),syncLog:q($,"syncLog"),playtestReports:q($,"playtestReports"),projectChanges:q($,"projectChanges"),connectionLog:q($,"connectionLog")}),g(ee),B(!1)},[t]);u.useEffect(()=>{w()},[w]);const H=u.useMemo(()=>[{key:"toolsActivity",title:s("settings.dataHistory.toolsActivity.title","Tool activity"),description:s("settings.dataHistory.toolsActivity.description","Saved tool runs shown on the Tools page."),metric:F(s,W(s,l.toolsActivity,"settings.dataHistory.metric.records","records"),o.toolsActivity),metricTooltip:s("settings.dataHistory.toolsActivity.metric.tooltip","Number of saved tool runs and the disk space they use."),route:"/tools",clearEndpoint:"/api/dashboard/tools/history/clear"},{key:"toolStats",title:s("settings.dataHistory.toolStats.title","Tool usage statistics"),description:s("settings.dataHistory.toolStats.description","Aggregated tool counts and status totals."),metric:F(s,l.toolStats===null?s("settings.dataHistory.metric.unavailable","Unavailable"):`${l.toolStats.toLocaleString()} ${s("settings.dataHistory.metric.runs","runs")} · ${(l.toolSessions??0).toLocaleString()} ${s("settings.dataHistory.metric.sessions","sessions")}`,o.toolStats),metricTooltip:s("settings.dataHistory.toolStats.metric.tooltip","Aggregated total runs and session counts."),route:"/tools",clearEndpoint:"/api/dashboard/tools/statistics/clear"},{key:"syncLog",title:s("settings.dataHistory.syncLog.title","Sync log"),description:s("settings.dataHistory.syncLog.description","Saved file sync events for the active place."),metric:F(s,W(s,l.syncLog,"settings.dataHistory.metric.records","records"),o.syncLog),metricTooltip:s("settings.dataHistory.syncLog.metric.tooltip","Number of saved sync events and the disk space they use."),route:"/sync",clearEndpoint:"/api/dashboard/sync/history/clear"},{key:"playtestReports",title:s("settings.dataHistory.playtest.title","Playtest reports"),description:s("settings.dataHistory.playtest.description","Saved automated playtest reports and logs."),metric:F(s,W(s,l.playtestReports,"settings.dataHistory.metric.reports","reports"),o.playtestReports),metricTooltip:s("settings.dataHistory.playtestReports.metric.tooltip","Number of saved playtest reports and the disk space they use."),route:"/playtest",clearEndpoint:"/api/dashboard/playtest/history/clear"},{key:"projectChanges",title:s("settings.dataHistory.projectChanges.title","Project change summary"),description:s("settings.dataHistory.projectChanges.description","Saved summaries of project changes."),metric:F(s,W(s,l.projectChanges,"settings.dataHistory.metric.records","records"),o.projectChanges),metricTooltip:s("settings.dataHistory.projectChanges.metric.tooltip","Number of saved project change summaries and the disk space they use."),route:"/changelog",clearEndpoint:"/api/dashboard/changelog/clear"},{key:"connectionLog",title:s("settings.dataHistory.connectionLog.title","Connection log"),description:s("settings.dataHistory.connectionLog.description","Saved MCP and Studio connection events."),metric:F(s,W(s,l.connectionLog,"settings.dataHistory.metric.records","records"),o.connectionLog),metricTooltip:s("settings.dataHistory.connectionLog.metric.tooltip","Number of saved connection events and the disk space they use."),route:"/connection",clearEndpoint:"/api/dashboard/connection-log/clear"}],[l,o,s]),C=async()=>{if(h){R(!0),L(null);try{if(h.kind==="uiStudio"){if(t!=="pro"||p===null)throw new Error("UI Studio place is unavailable");await K(p,{all:!0,alsoSnapshots:!0}),L(s("settings.dataHistory.uiStudio.clear.success","UI Studio saved data cleared."))}else await I.post(h.row.clearEndpoint),L(s("settings.dataHistory.clear.success","Saved data cleared."));y(null),await w()}catch{L(h.kind==="uiStudio"?s("settings.dataHistory.uiStudio.clear.failed","Failed to clear UI Studio saved data."):s("settings.dataHistory.clear.failed","Failed to clear saved data."))}finally{R(!1)}}},j=t==="pro"?p:0,r=t==="pro"&&p!==null,T=(h==null?void 0:h.kind)==="uiStudio",f=s("settings.dataHistory.title","Data & History");return e.jsxs(e.Fragment,{children:[e.jsxs("section",{id:"data-history",className:i.card,children:[e.jsxs("div",{className:i.cardHeader,children:[e.jsx(v,{label:s("settings.dataHistory.title","Data & History"),tooltip:s("settings.dataHistory.title.tooltip","Manage saved dashboard data in one place.")}),e.jsxs("div",{className:i.cardHeaderActions,children:[e.jsx(d,{text:s("settings.dataHistory.scope.tooltip","Clear actions apply to the current project and active place where applicable."),children:e.jsx("span",{className:i.headerBadge,children:k?s("common.loading","Loading"):s("settings.dataHistory.scope","Current project")})}),e.jsx(d,{text:s("settings.dataHistory.toggle.tooltip","Collapse or expand this section."),children:e.jsx("button",{className:i.collapseButton,type:"button","aria-expanded":S,"aria-controls":"settings-data-history-body","aria-label":S?s("settings.dataHistory.collapse","Collapse {title}").replace("{title}",f):s("settings.dataHistory.expand","Expand {title}").replace("{title}",f),onClick:()=>D(m=>!m),children:S?"▾":"▸"})})]})]}),S&&e.jsxs("div",{id:"settings-data-history-body",children:[e.jsx("p",{className:i.dataHistoryIntro,children:s("settings.dataHistory.intro","Review saved dashboard data, open the related page, or clear stored records from one place.")}),e.jsxs("div",{className:i.dataHistoryList,children:[H.map(m=>e.jsxs("div",{className:i.dataHistoryRow,children:[e.jsxs("div",{className:i.dataHistoryMain,children:[e.jsx("div",{className:i.dataHistoryTitle,children:m.title}),e.jsx("div",{className:i.dataHistoryDescription,children:m.description})]}),e.jsx(d,{text:m.metricTooltip,children:e.jsx("div",{className:i.dataHistoryMetric,children:m.metric})}),e.jsxs("div",{className:i.dataHistoryActions,children:[e.jsx(d,{text:s("settings.dataHistory.open.tooltip","Open the page that shows this item in detail."),children:e.jsx("a",{className:i.linkButton,href:`#${m.route}`,children:s("settings.dataHistory.open","Open")})}),e.jsx(d,{text:s("settings.dataHistory.clear.tooltip","Delete only the records saved for this item. Roblox Studio data is not changed."),children:e.jsx("button",{className:i.dangerButton,type:"button",onClick:()=>y({kind:"row",row:m}),children:s("common.clear","Clear")})})]})]},m.key)),e.jsxs("div",{className:`${i.dataHistoryRow} ${i.uiStudioDataHistoryRow}`,children:[e.jsxs("div",{className:i.dataHistoryMain,children:[e.jsx("div",{className:i.dataHistoryTitle,children:s("settings.dataHistory.uiStudio.title","UI Studio history and screenshots")}),e.jsx("div",{className:i.dataHistoryDescription,children:s("settings.dataHistory.uiStudio.description","Saved UI Studio change records, screenshots, and cleanup policy.")})]}),e.jsx(d,{text:s("settings.dataHistory.uiStudio.metric.tooltip","UI Studio change record and capture counts, plus total disk usage."),children:e.jsx("div",{className:i.dataHistoryMetric,children:it(s,a)})}),e.jsxs("div",{className:i.dataHistoryActions,children:[e.jsx(d,{text:s("settings.dataHistory.open.tooltip","Open the page that shows this item in detail."),children:e.jsx("a",{className:i.linkButton,href:"#/ui-studio?tab=history",children:s("settings.dataHistory.open","Open")})}),e.jsx(d,{text:s("settings.dataHistory.clear.tooltip","Delete only the records saved for this item. Roblox Studio data is not changed."),children:e.jsx("button",{className:i.dangerButton,type:"button",disabled:!r,onClick:()=>y({kind:"uiStudio"}),children:s("common.clear","Clear")})})]})]}),e.jsx("div",{className:`${i.dataHistoryDetail} ${i.uiStudioDataHistoryDetail}`,children:e.jsx(et,{placeId:j,tier:t,onChanged:w,embedded:!0,...t==="basic"?{sampleUsage:te,sampleRetention:ve}:{}})})]}),_&&e.jsx("p",{className:i.inlineStatus,children:_})]})]}),e.jsx(he,{open:h!==null,title:T?s("settings.dataHistory.uiStudio.clear.title","Clear UI Studio saved data?"):s("settings.dataHistory.clear.title","Clear saved data?"),message:T?s("settings.dataHistory.uiStudio.clear.message","This deletes saved UI Studio change records and screenshots only. Roblox Studio instances and project objects are not changed."):s("settings.dataHistory.clear.message","This deletes saved dashboard records only. Roblox Studio instances and project objects are not changed."),cancelLabel:s("common.cancel","Cancel"),confirmLabel:s("common.clear","Clear"),loading:A,onCancel:()=>!A&&y(null),onConfirm:()=>void C()})]})}const ot={en:"English",ko:"한국어",es:"Español","pt-br":"Português (BR)",ja:"日本語",id:"Bahasa Indonesia",de:"Deutsch","fr-fr":"Français"};function lt(t){return t==="active"?i.statusActive:t==="grace"?i.statusGrace:t==="invalid"||t==="revoked"?i.statusError:i.statusInactive}function rt(t,s){return t.refreshBlockedReason==="missing_session_token"?{label:s("settings.license.status.activationRequired","Activation Required"),tooltip:s("settings.license.status.activationRequired.tooltip","Manual license activation is required before WEPPY Dashboard can refresh this status."),detail:s("settings.license.detail.missingSessionToken","Refresh is blocked because the current session token is missing."),detailTone:i.licenseNoticeWarning}:t.statusDetail==="active_cancel_pending"?{label:s("settings.license.active","Active"),tooltip:s("settings.license.status.activeCancelPending.tooltip","Cancellation is pending, but Pro access remains active until the current billing period ends."),detail:s("settings.license.detail.cancelPending","Cancellation is scheduled. Pro access remains active until the current billing period ends."),detailTone:i.licenseNoticeInfo}:t.statusDetail==="grace_provider_unavailable"?{label:s("settings.license.status.grace","Grace"),tooltip:s("settings.license.status.grace.tooltip","Provider verification is temporarily unavailable, but Pro access remains active during the grace period."),detail:s("settings.license.detail.graceProviderUnavailable","Provider unavailable. Pro access remains active during grace mode."),detailTone:i.licenseNoticeInfo}:t.statusDetail==="grace_expired"||t.statusDetail==="grace_payment_failed"?{label:s("settings.license.status.grace","Grace"),tooltip:s("settings.license.status.graceBilling.tooltip","Pro access is still available during a billing-related grace period."),detail:s("settings.license.detail.graceBilling","Pro access remains available during a billing grace period."),detailTone:i.licenseNoticeInfo}:{label:s(`settings.license.${t.status}`,t.status),tooltip:s(`settings.license.${t.status}.tooltip`,"Current license activation state."),detail:t.refreshRequired?s("settings.license.detail.refreshRecommended","License verification should be refreshed soon."):null,detailTone:i.licenseNoticeMuted}}function vt(){const{t,selectedLocale:s,setLocale:l}=V(),{trackEvent:x}=ae(),{search:o}=re(),{settings:N,license:a,licenseControlsDisabled:g,licenseSubmitting:p,licenseMessage:P,activateLicense:k,refreshLicense:B,resetLicense:S,loading:D}=ge(),[h,y]=u.useState(""),A=a?rt(a,t):null,R=(a==null?void 0:a.tier)==="pro",_=(a==null?void 0:a.tier)==="pro"?a.maskedKey:void 0,L=a!=null&&a.provider&&a.provider!=="auto"?a.provider:void 0,w=(a==null?void 0:a.tier)==="pro"?"pro":"basic",H=u.useRef(null),C=u.useRef(null),j=u.useMemo(()=>new URLSearchParams(o).get("section")==="license",[o]);return u.useEffect(()=>{var T;if(!j||D)return;const r=H.current;if((T=r==null?void 0:r.scrollIntoView)==null||T.call(r,{block:"start",behavior:"smooth"}),C.current&&!C.current.disabled){C.current.focus();return}r==null||r.focus()},[D,g,p,j]),D?e.jsx("div",{className:i.page,children:e.jsx("div",{className:i.loading,children:t("common.loading")})}):e.jsxs("div",{className:i.page,children:[e.jsx(pe,{title:t("page.settings.title","Settings"),description:t("page.settings.description","Manage license, saved data, server environment, and language."),helpTopicId:"settings",helpState:{tier:w}}),e.jsxs("div",{id:"settings-license",ref:H,tabIndex:-1,"data-testid":"settings-license-card",className:[i.card,j?i.licenseCardTarget:"",(a==null?void 0:a.tier)==="pro"?i.licenseCardPro:""].filter(Boolean).join(" "),children:[e.jsxs("div",{className:i.cardHeader,children:[e.jsx(v,{label:t("settings.license.title","License"),tooltip:t("settings.license.title.tooltip","Current license status and subscription tier.")}),e.jsx(d,{text:g?t("settings.license.disconnected.tooltip","Reconnect to the MCP server to manage license actions from WEPPY Dashboard."):t("settings.license.live.tooltip","License actions are sent to the MCP server immediately."),children:e.jsx("span",{className:`${i.headerBadge} ${g?"":i.headerBadgeLive}`,children:g?t("settings.license.disconnected","Disconnected"):t("settings.general.liveApply","Live Apply")})})]}),e.jsxs(e.Fragment,{children:[a?e.jsxs(e.Fragment,{children:[(()=>{const r=A;return e.jsxs(e.Fragment,{children:[e.jsxs("dl",{className:i.licenseGrid,children:[e.jsx("dt",{children:e.jsx(v,{label:t("settings.license.status","Status"),tooltip:t("settings.license.status.tooltip","Current license activation state.")})}),e.jsxs("dd",{children:[e.jsx("span",{className:`${i.statusDot} ${lt(a.status)}`}),e.jsx(d,{text:(r==null?void 0:r.tooltip)??t(`settings.license.${a.status}.tooltip`,"Current license activation state."),children:(r==null?void 0:r.label)??t(`settings.license.${a.status}`,a.status)})]}),e.jsx("dt",{children:e.jsx(v,{label:t("settings.license.tier","Tier"),tooltip:t("settings.license.tier.tooltip","Current subscription tier for available WEPPY Dashboard features.")})}),e.jsx("dd",{className:a.tier==="pro"?i.proBadge:"",children:e.jsx(d,{text:t(`tier.${a.tier}.tooltip`,"Available feature set for the connected license."),children:a.tier==="pro"?t("tier.pro","Pro"):t("tier.basic","Basic")})}),_&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(v,{label:t("settings.license.key","Key"),tooltip:t("settings.license.key.tooltip","Masked license key currently loaded by the server.")})}),e.jsx("dd",{children:e.jsx(d,{text:t("settings.license.keyValue.tooltip","Masked license key currently loaded by the server."),children:_})})]}),L&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(v,{label:t("settings.license.provider","Provider"),tooltip:t("settings.license.provider.tooltip","License provider used to validate this key.")})}),e.jsx("dd",{children:e.jsx(d,{text:t("settings.license.providerValue.tooltip","License provider used to validate this key."),children:L})})]})]}),(r==null?void 0:r.detail)&&e.jsx("p",{className:`${i.licenseNotice} ${r.detailTone}`,children:a.refreshBlockedReason==="missing_session_token"?t("settings.license.detail.manualActivation","Manual activation required to restore Pro access."):r.detail}),a.refreshBlockedReason==="missing_session_token"&&e.jsx("p",{className:`${i.licenseNotice} ${i.licenseNoticeMuted}`,children:r==null?void 0:r.detail})]})})(),a.tier==="basic"&&e.jsx(d,{text:t("tier.upgrade.tooltip","View Pro features and purchase options."),children:e.jsx("a",{className:i.upgradeLink,href:ce.settingsLicense,target:"_blank",rel:"noopener noreferrer",onClick:()=>x("dashboard_click_event",{click_target:"upgrade_cta",placement:"settings_license",page:"settings"}),children:t("tier.upgrade","View Pro")})})]}):e.jsx("div",{className:i.loading,children:t("settings.license.unavailable")}),e.jsxs("div",{className:i.licenseControls,children:[e.jsxs("div",{className:i.licenseControlRow,children:[e.jsx(d,{text:t("settings.license.refresh.tooltip","Re-fetch the current state from the license server. Useful when a billing change hasn't appeared yet."),children:e.jsx("button",{type:"button",className:i.actionBtn,disabled:g||p||!R,onClick:()=>{B()},children:p?t("common.loading"):t("settings.license.refresh","Refresh License")})}),e.jsx(d,{text:t("settings.license.reset.tooltip","Remove the currently registered license key. Use this before activating with a different key."),children:e.jsx("button",{type:"button",className:i.actionBtn,disabled:g||p||!R,onClick:()=>{S()},children:p?t("common.loading"):t("settings.license.reset","Reset License")})})]}),e.jsxs("div",{className:i.licenseControlRow,children:[e.jsxs("label",{className:`${i.licenseField} ${i.licenseFieldGrow}`,children:[e.jsx("span",{className:i.controlLabel,children:e.jsx(v,{label:t("settings.license.keyInput","License Key"),tooltip:t("settings.license.key.tooltip","Masked license key currently loaded by the server.")})}),e.jsx("input",{ref:C,"aria-label":t("settings.license.keyInput","License Key"),className:i.textInput,type:"text",value:h,disabled:g||p,onChange:r=>y(r.target.value)})]}),e.jsx(d,{text:t("settings.license.activate.tooltip","Activate Pro features with the entered license key."),children:e.jsx("button",{type:"button",className:i.actionBtn,disabled:g||p,onClick:()=>{(async()=>await k(h)&&y(""))()},children:p?t("common.loading"):t("settings.license.activate","Activate License")})})]}),P&&e.jsx("p",{className:i.licenseMessage,children:P})]})]})]}),e.jsx(nt,{tier:w}),e.jsxs("div",{className:i.card,children:[e.jsxs("div",{className:i.cardHeader,children:[e.jsx(v,{label:t("settings.cold.title","Server Environment"),tooltip:t("settings.cold.title.tooltip","Read-only server environment values loaded at startup.")}),e.jsx(d,{text:t("settings.readOnly.tooltip","This section shows values that cannot be edited from WEPPY Dashboard."),children:e.jsx("span",{className:i.headerBadge,children:t("settings.readOnly","Read-only")})})]}),N?e.jsxs(e.Fragment,{children:[e.jsxs("dl",{className:i.coldGrid,children:[e.jsx("dt",{children:e.jsx(v,{label:"HTTP_PORT",tooltip:t("settings.cold.httpPort.tooltip","Port number used by the MCP WEPPY Dashboard HTTP server.")})}),e.jsx("dd",{children:N.cold.HTTP_PORT}),e.jsx("dt",{children:e.jsx(v,{label:"HTTP_HOST",tooltip:t("settings.cold.httpHost.tooltip","Host interface that the MCP WEPPY Dashboard HTTP server binds to.")})}),e.jsx("dd",{children:N.cold.HTTP_HOST}),e.jsx("dt",{children:e.jsx(v,{label:"DASHBOARD_AUTO_OPEN",tooltip:t("settings.cold.dashboardAutoOpen.tooltip","Controls whether WEPPY Dashboard opens automatically in the browser when the server starts.")})}),e.jsx("dd",{children:e.jsx(d,{text:t("settings.cold.dashboardAutoOpen.value.tooltip","Current startup behavior for opening WEPPY Dashboard in a browser."),children:String(N.cold.DASHBOARD_AUTO_OPEN)})})]}),e.jsx("p",{className:i.coldHint,children:t("settings.cold.hint","Set via environment variables to change these values.")})]}):e.jsx("div",{className:i.loading,children:t("settings.unavailable")})]}),e.jsxs("div",{className:i.card,children:[e.jsx("div",{className:i.cardHeader,children:e.jsx(v,{label:t("settings.language.title","Language"),tooltip:t("settings.language.title.tooltip","Choose how the WEPPY Dashboard interface text is localized.")})}),e.jsxs("div",{className:i.langRow,children:[e.jsx("label",{children:e.jsx(v,{label:t("settings.language.dashboard","WEPPY Dashboard Language"),tooltip:t("settings.language.dashboard.tooltip","Overrides the WEPPY Dashboard language or follows the system language when set to Auto.")})}),e.jsx(d,{text:t("settings.language.auto.tooltip","Follow the operating system's language. Falls back to English when not supported."),children:e.jsxs("select",{className:i.select,value:s,onChange:r=>l(r.target.value),children:[e.jsx("option",{value:de,children:t("settings.language.auto","Auto")}),ue.map(r=>e.jsx("option",{value:r,children:ot[r]??r},r))]})})]})]})]})}export{vt as Component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._card_1jlvt_4{border:1px solid var(--border);border-radius:var(--radius);background:var(--bg-card);padding:16px 20px;display:flex;flex-direction:column;gap:14px}._cardEmbedded_1jlvt_14{border:none;border-radius:0;background:transparent;padding:14px 0 0}._cardTitle_1jlvt_21{margin:0;font-size:13px;font-weight:600;color:var(--text-primary);letter-spacing:.02em}._usageRow_1jlvt_30{display:flex;flex-direction:column;gap:4px}._usageTotal_1jlvt_36{font-size:13px;font-weight:600;color:var(--text-primary)}._usageBreakdown_1jlvt_42{font-size:12px;color:var(--text-muted)}._usageCounts_1jlvt_47{font-size:12px;color:var(--text-secondary)}._divider_1jlvt_53{border:none;border-top:1px solid var(--border);margin:0}._lastRunRow_1jlvt_60{font-size:12px;color:var(--text-secondary);display:flex;align-items:center;gap:6px;flex-wrap:wrap}._lastRunLabel_1jlvt_69{color:var(--text-muted);font-weight:500;white-space:nowrap}._errorIcon_1jlvt_75{color:var(--error-text);cursor:help;font-size:13px;line-height:1;position:relative}._errorIcon_1jlvt_75:hover ._tooltip_1jlvt_83{display:block}._tooltip_1jlvt_83{display:none;position:absolute;bottom:calc(100% + 6px);left:50%;transform:translate(-50%);background:var(--bg-secondary);border:1px solid var(--border);border-radius:4px;padding:4px 8px;font-size:11px;color:var(--error-text);white-space:nowrap;z-index:10;pointer-events:none;box-shadow:0 2px 8px #0003}._cleanupRow_1jlvt_106{display:flex;flex-wrap:wrap;gap:8px;align-items:center}._cleanupLabel_1jlvt_113{font-size:12px;color:var(--text-muted);font-weight:500;white-space:nowrap}._cleanupBtn_1jlvt_120{padding:5px 10px;border-radius:5px;border:1px solid var(--border);background:var(--bg-secondary);color:var(--text-secondary);font-family:var(--font-label);font-size:11px;cursor:pointer;white-space:nowrap;transition:border-color var(--transition),color var(--transition)}._cleanupBtn_1jlvt_120:hover:not(:disabled){border-color:var(--accent);color:var(--text-primary)}._cleanupBtn_1jlvt_120:disabled{opacity:.45;cursor:not-allowed}._cleanupBtnDanger_1jlvt_143{border-color:var(--error-border, rgba(224, 85, 85, .4));color:var(--error-text)}._cleanupBtnDanger_1jlvt_143:hover:not(:disabled){border-color:var(--error-text);background:var(--error-bg, rgba(224, 85, 85, .08));color:var(--error-text)}._retentionSection_1jlvt_155{display:flex;flex-direction:column;gap:10px}._retentionTitle_1jlvt_161{margin:0;font-size:12px;font-weight:600;color:var(--text-muted);letter-spacing:.04em;text-transform:uppercase}._retentionFieldset_1jlvt_170{display:flex;flex-direction:column;gap:10px;border:none;margin:0;padding:0;position:relative}._retentionFieldset_1jlvt_170[disabled]{opacity:.5;pointer-events:none}._proOverlay_1jlvt_185{position:absolute;top:0;right:0;bottom:0;left:0;cursor:not-allowed;z-index:1}._proOverlay_1jlvt_185:hover ._tooltip_1jlvt_83{display:block}._radioRow_1jlvt_197{display:flex;align-items:center;gap:8px;flex-wrap:wrap}._radioLabel_1jlvt_204{display:flex;align-items:center;gap:5px;font-size:13px;color:var(--text-secondary);cursor:pointer;-webkit-user-select:none;user-select:none;white-space:nowrap}._radioLabel_1jlvt_204 input[type=radio]{width:14px;height:14px;cursor:pointer;accent-color:var(--accent);flex-shrink:0}._presetGroup_1jlvt_224{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-left:20px}._presetBtn_1jlvt_232{padding:3px 8px;border-radius:4px;border:1px solid var(--border);background:var(--bg-secondary);color:var(--text-secondary);font-family:var(--font-label);font-size:11px;cursor:pointer;transition:border-color var(--transition),background var(--transition)}._presetBtn_1jlvt_232:hover{border-color:var(--accent);color:var(--text-primary)}._presetBtnActive_1jlvt_249{border-color:var(--accent);background:var(--accent-dim);color:var(--accent);font-weight:600}._freeInput_1jlvt_256{width:72px;font-size:12px;padding:3px 7px;border:1px solid var(--border);border-radius:4px;background:var(--bg-secondary);color:var(--text-primary);font-family:inherit}._freeInput_1jlvt_256:focus{outline:none;border-color:var(--accent)}._freeInput_1jlvt_256._inputError_1jlvt_272{border-color:var(--error-text)}._inputUnit_1jlvt_276{font-size:11px;color:var(--text-muted);white-space:nowrap}._cascadeRow_1jlvt_283{display:flex;align-items:center;gap:7px;font-size:13px;color:var(--text-secondary);cursor:pointer;-webkit-user-select:none;user-select:none}._cascadeRow_1jlvt_283 input[type=checkbox]{width:14px;height:14px;cursor:pointer;accent-color:var(--accent);flex-shrink:0}._retentionActions_1jlvt_302{display:flex;gap:8px;flex-wrap:wrap}._saveBtn_1jlvt_308{padding:6px 14px;border-radius:5px;border:1px solid transparent;background:var(--accent);color:var(--bg-card);font-family:var(--font-label);font-size:12px;font-weight:600;cursor:pointer;transition:opacity var(--transition)}._saveBtn_1jlvt_308:hover:not(:disabled){opacity:.88}._saveBtn_1jlvt_308:disabled{opacity:.45;cursor:not-allowed}._runNowBtn_1jlvt_330{padding:6px 14px;border-radius:5px;border:1px solid var(--border);background:var(--bg-secondary);color:var(--text-secondary);font-family:var(--font-label);font-size:12px;cursor:pointer;transition:border-color var(--transition),color var(--transition)}._runNowBtn_1jlvt_330:hover:not(:disabled){border-color:var(--accent);color:var(--text-primary)}._runNowBtn_1jlvt_330:disabled{opacity:.45;cursor:not-allowed}._errorMsg_1jlvt_353{font-size:12px;color:var(--error-text);padding:4px 0}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as o,j as s}from"./index-
|
|
1
|
+
import{u as o,j as s}from"./index-B9LVK3-K.js";const e="_badge_1ucqq_2",c="_dot_1ucqq_12",a="_online_1ucqq_20",l="_offline_1ucqq_25",_="_idle_1ucqq_30",u="_syncing_1ucqq_34",d="_initializing_1ucqq_35",n={badge:e,dot:c,online:a,offline:l,idle:_,syncing:u,initializing:d},g={online:"status.online",offline:"status.offline",idle:"status.idle",syncing:"status.syncing",initializing:"status.initializing"};function f({status:i}){const{t}=o();return s.jsxs("span",{className:n.badge,children:[s.jsx("span",{className:`${n.dot} ${n[i]}`}),t(g[i])]})}export{f as S};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{r as l,a as P,D as E,e as R,d as $,m as A,j as t,u as D,f as O,h as B,l as H,k as M,T as F}from"./index-B9LVK3-K.js";import{P as U}from"./PageHeader-Cqg4GMtU.js";import{I as _}from"./InfoLabel-ZfsTcz5c.js";import{T as b}from"./TooltipText-ZamrETeK.js";import{C as W}from"./ConfirmModal-C9EhZCHZ.js";import{C as S}from"./CurrentPlaceScope-BMyP2w7Z.js";import{S as q}from"./StatusBadge-BSFzbkXM.js";import"./ConfirmModal.module-NrFlfTWy.js";const G=5e3;function z(){const[e,i]=l.useState(null),[c,o]=l.useState([]),[d,r]=l.useState(!0),[y,w]=l.useState(null),m=l.useRef(null),g=l.useRef(null),p=l.useCallback(async()=>{var u;try{const[T,I]=await Promise.all([P.get("/sync/status"),P.get("/api/dashboard/place-summary")]);i(T);const a=(u=I.places)==null?void 0:u.find(j=>j.isActive);w((a==null?void 0:a.placeDirName)??null)}catch{}},[]),f=l.useCallback(async()=>{try{const u=await P.get("/sync/history",{limit:"30"});o(u.entries??[])}catch{o([])}},[]),x=l.useCallback(async()=>{await Promise.all([p(),f()]),r(!1)},[p,f]),N=l.useCallback(()=>{x()},[x]),n=l.useCallback(async()=>{await P.post("/api/dashboard/sync/history/clear"),o([]),p()},[p]);return l.useEffect(()=>(x(),g.current=setInterval(x,G),()=>{g.current&&clearInterval(g.current)}),[x]),l.useEffect(()=>{const u=new E;m.current=u,u.connect();const T=u.on("sync",()=>{p(),f()});return()=>{T(),u.disconnect(),m.current=null}},[p,f]),{status:e,history:c,loading:d,activePlaceDirName:y,refresh:N,clearHistory:n}}const V="_actions_1j3p3_60",Y="_btn_1j3p3_68",J="_btnPrimary_1j3p3_99",Q="_panel_1j3p3_109",X="_panelIcon_1j3p3_116",Z="_panelTitle_1j3p3_122",K="_panelDesc_1j3p3_131",ee="_benefitList_1j3p3_139",te="_benefitItem_1j3p3_148",h={actions:V,btn:Y,btnPrimary:J,panel:Q,panelIcon:X,panelTitle:Z,panelDesc:K,benefitList:ee,benefitItem:te};function se({icon:e,title:i,description:c,benefits:o,upgradeLabel:d,upgradeHref:r}){const{trackEvent:y}=R(),{pathname:w,search:m}=$(),g=A(w,m);return t.jsxs("div",{className:h.panel,children:[e&&t.jsx("div",{className:h.panelIcon,children:e}),t.jsx("div",{className:h.panelTitle,children:i}),t.jsx("div",{className:h.panelDesc,children:c}),t.jsx("ul",{className:h.benefitList,children:o.map(p=>t.jsx("li",{className:h.benefitItem,children:p},p))}),t.jsx("div",{className:h.actions,children:t.jsx("a",{className:`${h.btn} ${h.btnPrimary}`,href:r,target:"_blank",rel:"noreferrer",onClick:()=>y("dashboard_click_event",{click_target:"upgrade_cta",placement:"tier_panel",...g}),children:d})})]})}const ne="_page_siyu4_2",ie="_card_siyu4_10",ae="_cardHeader_siyu4_17",ce="_clearButton_siyu4_29",oe="_statusRow_siyu4_39",le="_metaItem_siyu4_46",re="_statusGrid_siyu4_52",de="_table_siyu4_71",pe="_directionRail_siyu4_99",ue="_endpointLabel_siyu4_105",ye="_optionRail_siyu4_109",_e="_directionOption_siyu4_115",he="_directionOptionActive_siyu4_129",me="_directionOptionInactive_siyu4_133",ge="_direction_forward_siyu4_139",fe="_direction_bidirectional_siyu4_143",xe="_direction_reverse_siyu4_147",be="_lockBadge_siyu4_152",je="_proBadge_siyu4_160",ve="_forwardBadge_siyu4_174",we="_logContainer_siyu4_187",Te="_logEntry_siyu4_194",Ne="_logTime_siyu4_206",Pe="_logType_siyu4_212",Ie="_logTypeWrite_siyu4_221",Ce="_logTypeUpdate_siyu4_225",Le="_logTypeDelete_siyu4_229",Se="_logTypeIdle_siyu4_233",ke="_logPath_siyu4_237",Re="_logEmpty_siyu4_244",Ee="_overlay_siyu4_251",$e="_overlayTitle_siyu4_261",Ae="_overlayMessage_siyu4_268",De="_checklist_siyu4_274",Oe="_checkItem_siyu4_284",Be="_upgradePanel_siyu4_300",He="_upgradePanelHeader_siyu4_307",Me="_benefitList_siyu4_315",Fe="_benefitItem_siyu4_324",Ue="_upgradeActions_siyu4_339",We="_btn_siyu4_344",qe="_btnPrimary_siyu4_361",Ge="_disabled_siyu4_372",s={page:ne,card:ie,cardHeader:ae,clearButton:ce,statusRow:oe,metaItem:le,statusGrid:re,table:de,directionRail:pe,endpointLabel:ue,optionRail:ye,directionOption:_e,directionOptionActive:he,directionOptionInactive:me,direction_forward:ge,direction_bidirectional:fe,direction_reverse:xe,lockBadge:be,proBadge:je,forwardBadge:ve,logContainer:we,logEntry:Te,logTime:Ne,logType:Pe,logTypeWrite:Ie,logTypeUpdate:Ce,logTypeDelete:Le,logTypeIdle:Se,logPath:ke,logEmpty:Re,overlay:Ee,overlayTitle:$e,overlayMessage:Ae,checklist:De,checkItem:Oe,upgradePanel:Be,upgradePanelHeader:He,benefitList:Me,benefitItem:Fe,upgradeActions:Ue,btn:We,btnPrimary:qe,disabled:Ge},ze=[{key:"forward",symbol:"←"},{key:"bidirectional",symbol:"↔"},{key:"reverse",symbol:"→"}];function Ve(e){const i=new Date(e);return`${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}`}function Ye(e){switch(e){case"write":return s.logTypeWrite;case"update":return s.logTypeUpdate;case"delete":return s.logTypeDelete;default:return s.logTypeIdle}}function Je(e){switch(e){case"syncing":return"syncing";case"initializing":return"initializing";case"idle":return"idle";default:return"offline"}}function Qe(e,i,c,o){const d=e(`sync.directions.cat.${i}`,i.charAt(0).toUpperCase()+i.slice(1)),r=e("sync.directions.endpoint.local","Local"),y=e("sync.directions.endpoint.studio","Studio");switch(c){case"forward":return[`${d}: ${r} <- ${y}`,e("sync.directions.tooltip.forward.body","Studio changes sync to local files only")].join(`
|
|
2
|
+
`);case"bidirectional":return[`${d}: ${r} <-> ${y}`,e("sync.directions.tooltip.bidirectional.body","Two-way sync between Local and Studio"),o?e("sync.directions.tooltip.proRequired","Pro required in Basic tier"):""].filter(Boolean).join(`
|
|
3
|
+
`);case"reverse":return[`${d}: ${r} -> ${y}`,e("sync.directions.tooltip.reverse.body","Push local file changes to Studio"),o?e("sync.directions.tooltip.proRequired","Pro required in Basic tier"):""].filter(Boolean).join(`
|
|
4
|
+
`);default:return d}}const Xe=["scripts","values","containers","data","services"];function Ze(e,i){return i==="manual"?e("sync.directions.mode.manual","Manual"):i==="auto"?e("sync.directions.mode.auto","Auto"):"-"}function k(...e){const i=e[0]??"",c=i.includes("\\")&&!i.includes("/")?"\\":"/";return e.filter(o=>o.length>0).map((o,d)=>d===0?o.replace(/[\\/]+$/g,""):o.replace(/^[\\/]+|[\\/]+$/g,"")).join(c)}function Ke(e){const i=e.replace(/[\\/]+$/g,""),c=i.split(/[\\/]+/);return c[c.length-1]??i}function et(e,i){const c=Ke(e);return c==="explorer"?e:c===i?k(e,"explorer"):k(e,i,"explorer")}function tt(e,i){return i==="manual"?e("sync.directions.mode.manual.tooltip","Applies sync changes only when you trigger them manually."):i==="auto"?e("sync.directions.mode.auto.tooltip","Applies sync changes automatically when updates arrive."):""}function st(e,i){switch(i){case"write":return e("sync.log.type.write","WRITE");case"update":return e("sync.log.type.update","UPDATE");case"delete":return e("sync.log.type.delete","DELETE");default:return e("sync.log.type.idle","IDLE")}}function nt(e,i){switch(i){case"write":return e("sync.log.type.write.tooltip","A new sync output was written to disk.");case"update":return e("sync.log.type.update.tooltip","An existing synced file or instance was updated.");case"delete":return e("sync.log.type.delete.tooltip","A synced file or instance was removed.");default:return e("sync.log.type.idle.tooltip","A sync event was recorded without a file mutation.")}}function ut(){const{t:e}=D(),{trackEvent:i}=R(),{level:c}=O(),{tier:o,loading:d}=B(),r=z(),{show:y}=H(),[w,m]=l.useState(!1),[g,p]=l.useState(!1),f=!d&&o==="basic",x=c==="disconnected"||c==="serverOnly",N=t.jsx(U,{title:e("page.sync.title","Sync"),description:e("page.sync.description","Monitor Studio to local sync status, direction, apply mode, and recent sync logs."),helpTopicId:"sync",helpState:{connectionLevel:c,tier:o}});if(x)return t.jsxs("div",{className:s.page,children:[N,t.jsx(S,{surface:"sync"}),t.jsx("div",{className:s.card,children:t.jsxs("div",{className:s.overlay,children:[t.jsx("div",{className:s.overlayTitle,children:e("sync.overlay.title","Roblox Studio plugin required")}),t.jsx("div",{className:s.overlayMessage,children:e("sync.overlay.message","Sync status will be available once the Roblox Studio plugin connects.")}),t.jsxs("ul",{className:s.checklist,children:[t.jsx("li",{className:s.checkItem,children:e("sync.overlay.check1","Is Roblox Studio running?")}),t.jsx("li",{className:s.checkItem,children:e("sync.overlay.check2","Is the WEPPY Plugin installed?")})]})]})})]});const n=r.status,u=r.history,T=Je(n==null?void 0:n.state),I=async()=>{p(!0);try{await r.clearHistory(),y(e("toast.clearSuccess","Cleared successfully"),"success"),m(!1)}catch{y(e("toast.clearFailed","Failed to clear data"),"error")}finally{p(!1)}};return t.jsxs("div",{className:s.page,children:[N,t.jsx(S,{surface:"sync"}),t.jsxs("div",{className:s.card,children:[t.jsxs("div",{className:s.cardHeader,children:[t.jsx(b,{text:e("sync.status.title.tooltip","Current Studio and local file sync status for this place."),children:e("sync.status.title","Sync Status")}),f&&t.jsx(b,{text:e("sync.status.forwardOnly.tooltip","Basic tier allows Studio to local forward sync only."),children:t.jsx("span",{className:s.forwardBadge,children:e("sync.status.forwardOnly","Forward Only")})})]}),t.jsxs("div",{className:s.statusRow,children:[t.jsx(q,{status:T}),(n==null?void 0:n.placeName)&&t.jsxs("span",{className:s.metaItem,children:[t.jsx(_,{label:e("sync.status.place","Place"),tooltip:e("sync.status.place.tooltip","Connected Roblox place name and place ID.")}),": ",n.placeName,n.placeId?` (${n.placeId})`:""]})]}),t.jsxs("dl",{className:s.statusGrid,children:[(n==null?void 0:n.syncRoot)&&t.jsxs(t.Fragment,{children:[t.jsx("dt",{children:t.jsx(_,{label:e("sync.status.path","Place Root"),tooltip:e("sync.status.path.tooltip","Local filesystem root currently used for this place sync output.")})}),t.jsx("dd",{children:n.syncRoot})]}),r.activePlaceDirName&&(n==null?void 0:n.syncRoot)&&t.jsxs(t.Fragment,{children:[t.jsx("dt",{children:t.jsx(_,{label:e("sync.status.placePath","Explorer Path"),tooltip:e("sync.status.placePath.tooltip","Explorer files path for the active place.")})}),t.jsx("dd",{children:et(n.syncRoot,r.activePlaceDirName)})]}),(n==null?void 0:n.instanceCount)!=null&&t.jsxs(t.Fragment,{children:[t.jsx("dt",{children:t.jsx(_,{label:e("sync.status.instances","Instances"),tooltip:e("sync.status.instances.tooltip","Total synced Roblox instances tracked in the local mirror.")})}),t.jsx("dd",{children:n.instanceCount})]}),(n==null?void 0:n.scriptCount)!=null&&t.jsxs(t.Fragment,{children:[t.jsx("dt",{children:t.jsx(_,{label:e("sync.status.scripts","Scripts"),tooltip:e("sync.status.scripts.tooltip","Total synced script files currently indexed for this place.")})}),t.jsx("dd",{children:n.scriptCount})]}),(n==null?void 0:n.state)==="syncing"&&t.jsxs(t.Fragment,{children:[t.jsx("dt",{children:t.jsx(_,{label:e("sync.status.state","State"),tooltip:e("sync.status.state.tooltip","Current runtime sync state reported by the server.")})}),t.jsx("dd",{children:e("status.syncing","Syncing")})]})]})]}),(n==null?void 0:n.directions)&&t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:t.jsx(b,{text:e("sync.directions.title.tooltip","Per-category sync direction and apply behavior between Local and Studio."),children:e("sync.directions.title","Sync Directions")})}),t.jsxs("table",{className:s.table,children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{children:t.jsx(_,{label:e("sync.directions.type","Type"),tooltip:e("sync.directions.type.tooltip","Sync category affected by this rule.")})}),t.jsx("th",{children:t.jsx(_,{label:e("sync.directions.direction","Direction"),tooltip:e("sync.directions.direction.tooltip","Whether each category syncs from Studio, to Studio, or both ways.")})}),t.jsx("th",{children:t.jsx(_,{label:e("sync.directions.applyMode","Apply Mode"),tooltip:e("sync.directions.applyMode.tooltip","How incoming sync changes are applied for this category.")})})]})}),t.jsx("tbody",{children:Xe.map(a=>{var L;const j=n.directions[a],C=(L=n.applyModes)==null?void 0:L[a];return t.jsxs("tr",{children:[t.jsx("td",{children:e(`sync.directions.cat.${a}`,a.charAt(0).toUpperCase()+a.slice(1))}),t.jsx("td",{children:t.jsxs("div",{className:s.directionRail,"aria-label":`${a}-direction-rail`,children:[t.jsx(b,{text:e("sync.directions.endpoint.local.tooltip","Local files on disk are always shown on the left side of the direction rail."),children:t.jsx("span",{className:s.endpointLabel,children:e("sync.directions.endpoint.local","Local")})}),t.jsx("span",{className:s.optionRail,children:ze.map(v=>t.jsx(M,{text:Qe(e,a,v.key,f),children:t.jsx("span",{className:`${s.directionOption} ${j===v.key?s.directionOptionActive:s.directionOptionInactive} ${s[`direction_${v.key}`]??""}`,"data-active":j===v.key?"true":"false",children:v.symbol})},v.key))}),t.jsx(b,{text:e("sync.directions.endpoint.studio.tooltip","Roblox Studio is always shown on the right side of the direction rail."),children:t.jsx("span",{className:s.endpointLabel,children:e("sync.directions.endpoint.studio","Studio")})})]})}),t.jsx("td",{children:t.jsx(b,{text:tt(e,C),children:Ze(e,C)})})]},a)})})]})]}),t.jsxs("div",{className:s.card,children:[t.jsxs("div",{className:s.cardHeader,children:[t.jsx("span",{children:e("sync.log.title","Sync Log")}),t.jsx("button",{className:s.clearButton,onClick:()=>{i("dashboard_click_event",{click_target:"sync_clear_log",page:"sync"}),m(!0)},children:e("common.clear","Clear")})]}),t.jsx("div",{className:s.logContainer,children:u.length===0?t.jsx("div",{className:s.logEmpty,children:e("sync.log.empty","No sync events yet")}):u.map((a,j)=>t.jsxs("div",{className:s.logEntry,children:[t.jsx("span",{className:s.logTime,children:Ve(a.timestamp)}),t.jsx(b,{text:nt(e,a.type),children:t.jsx("span",{className:`${s.logType} ${Ye(a.type)}`,children:st(e,a.type)})}),t.jsxs("span",{className:s.logPath,children:[a.path,a.details?` — ${a.details}`:""]})]},j))})]}),f&&t.jsx(se,{title:e("sync.upgrade.title","Explore Full Sync with Pro"),description:e("tier.banner.save","Save AI tokens with Pro!"),benefits:[e("sync.upgrade.benefit1","Bidirectional sync — edit files, auto-apply to Studio"),e("sync.upgrade.benefit2","Reverse sync — push file changes back to Studio"),e("sync.upgrade.benefit3","Full sync history and detailed change log")],upgradeLabel:e("sync.upgrade.buy","View Pro"),upgradeHref:F.sync}),t.jsx(W,{open:w,title:e("sync.clear.title","Clear sync log?"),message:e("sync.clear.message","This permanently removes the stored sync log for the current place."),cancelLabel:e("common.cancel","Cancel"),confirmLabel:e("common.clear","Clear"),loading:g,onCancel:()=>!g&&m(!1),onConfirm:I})]})}export{ut as Component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./index-
|
|
1
|
+
import{j as s}from"./index-B9LVK3-K.js";const r="_tabBar_1o4kh_2",_="_tabs_1o4kh_9",d="_actions_1o4kh_14",k="_tab_1o4kh_2",h="_tabActive_1o4kh_39",a={tabBar:r,tabs:_,actions:d,tab:k,tabActive:h};function v({items:n,value:c,onChange:l,ariaLabel:b,className:i,rightActions:e}){return s.jsxs("div",{className:[a.tabBar,i].filter(Boolean).join(" "),role:"tablist","aria-label":b,children:[s.jsx("div",{className:a.tabs,children:n.map(t=>{const o=t.key===c;return s.jsx("button",{type:"button",role:"tab","aria-selected":o,"data-testid":t.testId,className:[a.tab,o?a.tabActive:""].filter(Boolean).join(" "),onClick:()=>l(t.key),children:t.label},t.key)})}),e?s.jsx("div",{className:a.actions,children:e}):null]})}export{v as T};
|