@weppy/roblox-mcp 2.10.3 → 2.11.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 +34 -6
- package/dashboard/dist/assets/{AssetsPage-DFC---br.js → AssetsPage-kz1FKCck.js} +10 -10
- package/dashboard/dist/assets/ChangelogDetailPage-DtMfQXpn.js +1 -0
- package/dashboard/dist/assets/ChangelogDetailPage-vGgnpq1q.css +1 -0
- package/dashboard/dist/assets/ChangelogPage-DBeldxYm.js +1 -0
- package/dashboard/dist/assets/{ConfirmModal-BqCEvp7Y.js → ConfirmModal-Cxha5h-n.js} +1 -1
- package/dashboard/dist/assets/{ConnectionPage-DAz-lhiE.js → ConnectionPage-8_vdhL7O.js} +2 -2
- package/dashboard/dist/assets/ControlsPage-CZBhWyyn.js +1 -0
- package/dashboard/dist/assets/CurrentPlaceScope-BKwvaN7Z.js +1 -0
- package/dashboard/dist/assets/{GameChangeDetail-CMSmIwO-.js → GameChangeDetail-raYOxmZc.js} +1 -1
- package/dashboard/dist/assets/{InfoLabel-BAhsgLcj.js → InfoLabel-dwgFWAxs.js} +1 -1
- package/dashboard/dist/assets/OverviewPage-DI5xU7tr.js +1 -0
- package/dashboard/dist/assets/PageHeader-BfTFbEOK.js +6 -0
- package/dashboard/dist/assets/PageHeader-CV_rjuG8.css +1 -0
- package/dashboard/dist/assets/{PlaytestPage-BIkP1kCO.js → PlaytestPage-BXzNfelw.js} +2 -2
- package/dashboard/dist/assets/SettingsPage-BzmeWDML.js +1 -0
- package/dashboard/dist/assets/{StatusBadge-Df9BQsJU.js → StatusBadge-Cbf0AbKE.js} +1 -1
- package/dashboard/dist/assets/SyncPage-BnVXEQel.css +1 -0
- package/dashboard/dist/assets/SyncPage-ChaWvprV.js +4 -0
- package/dashboard/dist/assets/{Tabs-Ccrw7Hjb.js → Tabs-9EkdOGoe.js} +1 -1
- package/dashboard/dist/assets/ToolsPage-AYrVzepe.js +1 -0
- package/dashboard/dist/assets/{TooltipText-CGH7dKN6.js → TooltipText-DLPk69aK.js} +1 -1
- package/dashboard/dist/assets/{PageHeader-CrhjZjgp.css → UiPrimitive-BMSNRGwI.css} +1 -1
- package/dashboard/dist/assets/UiPrimitive-jQZP77uI.js +1 -0
- package/dashboard/dist/assets/{UiStudioPage-io4UBG0Y.js → UiStudioPage-De2Q3D5I.js} +2 -2
- package/dashboard/dist/assets/WhatsNewPage-CK-MRVXv.js +1 -0
- package/dashboard/dist/assets/WhatsNewPage-wF04BABp.css +1 -0
- package/dashboard/dist/assets/{copy-D-nSZB9j.js → copy-mg-q_vEk.js} +1 -1
- package/dashboard/dist/assets/index-C8kXDvHv.js +750 -0
- package/dashboard/dist/assets/sample-requests-7VK_Hj8C.js +1 -0
- package/dashboard/dist/assets/{useLiveUptime-1Et9Q6mq.js → useLiveUptime-BzjLApne.js} +1 -1
- package/dashboard/dist/assets/{useSettings-DKMlodE_.js → useSettings-C1r4pJQ4.js} +1 -1
- package/dashboard/dist/index.html +1 -1
- package/dist/index.js +92 -79
- package/package.json +1 -1
- package/roblox-plugin/WeppyRobloxMCP.rbxm +0 -0
- package/dashboard/dist/assets/ChangelogDetailPage-D6Tqz7ut.css +0 -1
- package/dashboard/dist/assets/ChangelogDetailPage-gvZDaLft.js +0 -1
- package/dashboard/dist/assets/ChangelogPage-eOFIHxbD.js +0 -1
- package/dashboard/dist/assets/ControlsPage-CKEswTa6.js +0 -1
- package/dashboard/dist/assets/CurrentPlaceScope-C8U9I15o.js +0 -1
- package/dashboard/dist/assets/OverviewPage-COMQ7wYS.js +0 -1
- package/dashboard/dist/assets/PageHeader-Bfy2f-GH.js +0 -6
- package/dashboard/dist/assets/SettingsPage-ClSPo4J8.js +0 -1
- package/dashboard/dist/assets/SyncPage-CIZWp8Ul.css +0 -1
- package/dashboard/dist/assets/SyncPage-O1vlpViJ.js +0 -4
- package/dashboard/dist/assets/ToolsPage-CdPa3eYv.js +0 -1
- package/dashboard/dist/assets/WhatsNewPage-BIYOEZg3.css +0 -1
- package/dashboard/dist/assets/WhatsNewPage-CGKwvik4.js +0 -1
- package/dashboard/dist/assets/index-CnXGGM07.js +0 -686
- package/dashboard/dist/assets/sample-requests-ythz0BoY.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weppy/roblox-mcp",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.11.0",
|
|
4
4
|
"description": "MCP (Model Context Protocol) server for Roblox Studio integration - enables AI coding agents to interact with Roblox Studio in real-time",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._page_q2jbi_2{display:flex;flex-direction:column;gap:20px;max-width:900px}._header_q2jbi_10{display:flex;align-items:center;gap:12px}._backLink_q2jbi_16{font-family:var(--font-label);font-size:12px;color:var(--accent);cursor:pointer;text-decoration:none;transition:opacity var(--transition)}._backLink_q2jbi_16:hover{opacity:.8}._headerTitle_q2jbi_29{font-family:var(--font-label);font-size:14px;font-weight:600;color:var(--text-primary);letter-spacing:.03em}._headerTime_q2jbi_37{font-family:var(--font-code);font-size:12px;color:var(--text-secondary);margin-left:auto}._statusActive_q2jbi_44{color:var(--success);font-weight:600}._statusCompleted_q2jbi_49{color:var(--text-muted)}._section_q2jbi_54{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:16px 20px}._sectionTitle_q2jbi_61{font-family:var(--font-label);font-size:12px;font-weight:600;color:var(--text-primary);text-transform:uppercase;letter-spacing:.05em;margin-bottom:12px;padding-bottom:8px;border-bottom:1px solid var(--border)}._summaryGrid_q2jbi_74{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:10px}._summaryCard_q2jbi_80{background:var(--bg-secondary);border:1px solid var(--border);border-radius:6px;padding:10px 12px;text-align:center;cursor:pointer;transition:border-color var(--transition)}._summaryCard_q2jbi_80:hover{border-color:var(--accent)}._summaryCardActive_q2jbi_94{border-color:var(--accent);background:var(--accent-dim)}._summaryIcon_q2jbi_99{font-size:20px;display:block;margin-bottom:4px}._summaryCount_q2jbi_105{font-family:var(--font-code);font-size:18px;font-weight:700;color:var(--text-primary)}._summaryLabel_q2jbi_112{font-family:var(--font-label);font-size:10px;color:var(--text-secondary);text-transform:uppercase;letter-spacing:.04em;margin-top:2px}._contextGrid_q2jbi_121{display:flex;flex-direction:column;gap:10px}._contextRow_q2jbi_127{display:flex;flex-direction:column;gap:4px}._contextKey_q2jbi_133{font-family:var(--font-label);font-size:10px;color:var(--text-muted);text-transform:uppercase;letter-spacing:.05em}._contextValue_q2jbi_141{font-family:var(--font-label);font-size:13px;color:var(--text-primary);line-height:1.5}._timelineFilter_q2jbi_149{display:flex;align-items:center;gap:8px;margin-bottom:12px}._filterLabel_q2jbi_156{font-family:var(--font-label);font-size:11px;color:var(--text-secondary)}._filterSelect_q2jbi_162{font-family:var(--font-code);font-size:11px;padding:3px 8px;border:1px solid var(--border);border-radius:4px;background:var(--bg-secondary);color:var(--text-primary)}._timeline_q2jbi_149{display:flex;flex-direction:column;gap:0;position:relative;max-height:480px;overflow-y:auto}._timelineEntry_q2jbi_182{display:flex;gap:12px;padding:8px 0;border-bottom:1px solid var(--border);transition:background var(--transition);cursor:pointer}._timelineEntry_q2jbi_182:last-child{border-bottom:none}._timelineEntry_q2jbi_182:hover{background:var(--bg-secondary)}._timelineTime_q2jbi_199{font-family:var(--font-code);font-size:11px;color:var(--text-muted);min-width:50px;flex-shrink:0}._timelineIcon_q2jbi_207{font-size:14px;flex-shrink:0}._timelineBody_q2jbi_212{flex:1;min-width:0}._timelineSummary_q2jbi_217{font-family:var(--font-code);font-size:12px;color:var(--text-primary);word-break:break-all}._timelineTarget_q2jbi_224{font-family:var(--font-code);font-size:11px;color:var(--text-secondary);margin-top:2px}._timelineConfidence_q2jbi_231{font-family:var(--font-label);font-size:9px;padding:1px 5px;border-radius:3px;margin-left:8px;vertical-align:middle}._confidenceExact_q2jbi_240{background:#22c55e26;color:var(--success)}._confidencePartial_q2jbi_245{background:#f59e0b26;color:var(--warning)}._confidenceAfterOnly_q2jbi_250{background:#22c55e14;color:var(--text-secondary)}._confidenceIntentOnly_q2jbi_255{background:#ef444426;color:var(--error)}._confidenceUnknown_q2jbi_260{background:var(--bg-secondary);color:var(--text-muted)}._timelineExpanded_q2jbi_266{margin-top:8px;padding:8px;background:var(--bg-card);border:1px solid var(--border);border-radius:6px}._beforeAfterList_q2jbi_275{display:flex;flex-direction:column;gap:12px}._beforeAfterItem_q2jbi_281{background:var(--bg-secondary);border:1px solid var(--border);border-radius:6px;overflow:hidden}._beforeAfterHeader_q2jbi_288{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;background:var(--bg-card);border-bottom:1px solid var(--border);cursor:pointer}._beforeAfterPath_q2jbi_298{font-family:var(--font-code);font-size:11px;color:var(--text-primary)}._beforeAfterBadge_q2jbi_304{font-family:var(--font-label);font-size:9px;padding:1px 6px;border-radius:3px;text-transform:uppercase;letter-spacing:.04em}._badgeCreate_q2jbi_313{background:#22c55e26;color:var(--success)}._badgeModify_q2jbi_318{background:#f59e0b26;color:var(--warning)}._badgeDelete_q2jbi_323{background:#ef444426;color:var(--error)}._badgeMove_q2jbi_328{background:#3b82f626;color:var(--accent)}._beforeAfterBody_q2jbi_333{padding:8px}._empty_q2jbi_338{text-align:center;padding:20px;color:var(--text-muted);font-family:var(--font-label);font-size:12px}._loading_q2jbi_347{text-align:center;padding:40px 20px;color:var(--text-secondary);font-family:var(--font-label);font-size:12px}._error_q2jbi_356{text-align:center;padding:40px 20px;color:var(--error);font-family:var(--font-label);font-size:13px}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r,a as w,u as V,b as G,c as D,d as F,j as e}from"./index-CnXGGM07.js";import{I as P}from"./InfoLabel-BAhsgLcj.js";import{G as U}from"./GameChangeDetail-CMSmIwO-.js";import{T as g}from"./TooltipText-CGH7dKN6.js";function H(t){const i={scriptsModified:0,scriptsCreated:0,instancesCreated:0,instancesDeleted:0,instancesMoved:0,propertiesChanged:0,lightingChanged:!1,terrainChanged:!1,assetsInserted:0};for(const o of t)switch(o.category){case"script":o.changeType==="create"?i.scriptsCreated++:i.scriptsModified++;break;case"instance":o.changeType==="create"?i.instancesCreated++:o.changeType==="delete"?i.instancesDeleted++:o.changeType==="move"&&i.instancesMoved++;break;case"property":i.propertiesChanged++;break;case"lighting":i.lightingChanged=!0;break;case"terrain":i.terrainChanged=!0;break;case"asset":i.assetsInserted++;break}return i}function W(t){if(typeof t=="number")return{placeId:String(t)}}function Y(t,i){const[o,h]=r.useState(""),[I,a]=r.useState(""),[d,x]=r.useState(),[E,L]=r.useState("completed"),[f,$]=r.useState([]),[O,R]=r.useState([]),[A,p]=r.useState([]),[_,j]=r.useState(),[b,v]=r.useState(),[S,C]=r.useState(),[N,T]=r.useState({scriptsModified:0,scriptsCreated:0,instancesCreated:0,instancesDeleted:0,instancesMoved:0,propertiesChanged:0,lightingChanged:!1,terrainChanged:!1,assetsInserted:0}),[k,u]=r.useState(!0),[q,y]=r.useState(null),m=r.useCallback(async()=>{if(t){u(!0),y(null);try{const s=W(i),[c,l]=await Promise.all([s?w.get(`/api/dashboard/changelog/${t}`,s):w.get(`/api/dashboard/changelog/${t}`),s?w.get(`/api/dashboard/changelog/${t}/changes`,s):w.get(`/api/dashboard/changelog/${t}/changes`)]);h(c.entryId),a(c.startTime),x(c.endTime),L(c.status),$(c.entries),R(c.failures),j(c.contextSummary),v(c.replayMetadata),C(c.verificationSummary),p(l.changes),T(H(l.changes))}catch(s){y(s instanceof Error?s.message:"Failed to load changelog detail")}finally{u(!1)}}},[t,i]);return r.useEffect(()=>{m()},[m]),{entryId:o,startTime:I,endTime:d,status:E,entries:f,failures:O,changes:A,changeSummary:N,contextSummary:_,replayMetadata:b,verificationSummary:S,loading:k,error:q,refresh:m}}const z={script:"📝",instance:"🧱",property:"🎨",lighting:"🌅",terrain:"⛰️",asset:"📦"};function J(t){return z[t]??"❓"}const Q="_page_q2jbi_2",X="_header_q2jbi_10",Z="_backLink_q2jbi_16",ee="_headerTitle_q2jbi_29",te="_headerTime_q2jbi_37",ne="_statusActive_q2jbi_44",ae="_statusCompleted_q2jbi_49",se="_section_q2jbi_54",ie="_sectionTitle_q2jbi_61",ce="_summaryGrid_q2jbi_74",re="_summaryCard_q2jbi_80",oe="_summaryCardActive_q2jbi_94",le="_summaryIcon_q2jbi_99",de="_summaryCount_q2jbi_105",me="_summaryLabel_q2jbi_112",ge="_contextGrid_q2jbi_121",he="_contextRow_q2jbi_127",ue="_contextKey_q2jbi_133",ye="_contextValue_q2jbi_141",xe="_timelineFilter_q2jbi_149",fe="_filterLabel_q2jbi_156",pe="_filterSelect_q2jbi_162",_e="_timeline_q2jbi_149",je="_timelineEntry_q2jbi_182",be="_timelineTime_q2jbi_199",ve="_timelineIcon_q2jbi_207",Se="_timelineBody_q2jbi_212",Ce="_timelineSummary_q2jbi_217",Ne="_timelineTarget_q2jbi_224",Te="_timelineConfidence_q2jbi_231",ke="_confidenceExact_q2jbi_240",qe="_confidencePartial_q2jbi_245",we="_confidenceAfterOnly_q2jbi_250",Ie="_confidenceIntentOnly_q2jbi_255",Ee="_confidenceUnknown_q2jbi_260",Le="_timelineExpanded_q2jbi_266",$e="_empty_q2jbi_338",Oe="_loading_q2jbi_347",Re="_error_q2jbi_356",n={page:Q,header:X,backLink:Z,headerTitle:ee,headerTime:te,statusActive:ne,statusCompleted:ae,section:se,sectionTitle:ie,summaryGrid:ce,summaryCard:re,summaryCardActive:oe,summaryIcon:le,summaryCount:de,summaryLabel:me,contextGrid:ge,contextRow:he,contextKey:ue,contextValue:ye,timelineFilter:xe,filterLabel:fe,filterSelect:pe,timeline:_e,timelineEntry:je,timelineTime:be,timelineIcon:ve,timelineBody:Se,timelineSummary:Ce,timelineTarget:Ne,timelineConfidence:Te,confidenceExact:ke,confidencePartial:qe,confidenceAfterOnly:we,confidenceIntentOnly:Ie,confidenceUnknown:Ee,timelineExpanded:Le,empty:$e,loading:Oe,error:Re},B=[{key:"script",icon:"📝",labelKey:"changelog.category.script"},{key:"instance",icon:"🧱",labelKey:"changelog.category.instance"},{key:"property",icon:"🎨",labelKey:"changelog.category.property"},{key:"lighting",icon:"🌅",labelKey:"changelog.category.lighting"},{key:"terrain",icon:"⛰️",labelKey:"changelog.category.terrain"},{key:"asset",icon:"📦",labelKey:"changelog.category.asset"}];function K(t){if(!t)return"--:--";const i=new Date(t);return`${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}`}function Ae(t){if(!t)return"--:--:--";const i=new Date(t);return`${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}:${String(i.getSeconds()).padStart(2,"0")}`}function Ke(t,i){if(!t||!i)return"";const o=new Date(i).getTime()-new Date(t).getTime();return o<0?"":`${Math.round(o/6e4)}min`}function Me(t){switch(t){case"exact":return n.confidenceExact;case"partial":return n.confidencePartial;case"after-only":return n.confidenceAfterOnly;case"intent-only":return n.confidenceIntentOnly;default:return n.confidenceUnknown}}function Be(t,i){switch(i){case"exact":return t("changelog.detail.confidence.exact","Exact");case"partial":return t("changelog.detail.confidence.partial","Partial");case"after-only":return t("changelog.detail.confidence.afterOnly","After only");case"intent-only":return t("changelog.detail.confidence.intentOnly","Intent only");default:return t("changelog.detail.confidence.unknown","Unknown")}}function Ve(t,i){switch(i){case"exact":return t("changelog.detail.confidence.exact.tooltip","Both the before and after state were confirmed for this change.");case"partial":return t("changelog.detail.confidence.partial.tooltip","Only part of the before and after state could be confirmed for this change.");case"after-only":return t("changelog.detail.confidence.afterOnly.tooltip","Only the resulting state after the change could be confirmed.");case"intent-only":return t("changelog.detail.confidence.intentOnly.tooltip","Only the requested action was recorded, not the resulting state.");default:return t("changelog.detail.confidence.unknown.tooltip","This change could not be confidently classified from the available data.")}}function Ge(t){const i=new URLSearchParams(t).get("placeId");if(!i)return null;const o=Number.parseInt(i,10);return Number.isInteger(o)&&o>=0?o:null}function He(){var p,_,j,b,v,S,C,N,T,k,u,q,y,m;const{t}=V(),{id:i}=G(),o=D(),h=F(),I=r.useMemo(()=>Ge(h.search),[h.search]),a=Y(i,I),[d,x]=r.useState("all"),[E,L]=r.useState(null),f=r.useMemo(()=>[...d==="all"?a.changes:a.changes.filter(c=>c.category===d)].reverse(),[a.changes,d]);if(a.loading)return e.jsx("div",{className:n.loading,children:t("common.loading","Loading...")});if(a.error)return e.jsxs("div",{className:n.error,children:[a.error,e.jsx("br",{}),e.jsxs("span",{className:n.backLink,onClick:()=>o("/changelog"),children:["←"," ",t("changelog.detail.backToList","Back to list")]})]});const $=Ke(a.startTime,a.endTime),O=a.endTime?`${K(a.startTime)} → ${K(a.endTime)} (${$})`:`${K(a.startTime)} → ${t("changelog.card.inProgress","in progress")}`,R=!!((p=a.contextSummary)!=null&&p.intent||(_=a.contextSummary)!=null&&_.testScenario||(j=a.contextSummary)!=null&&j.expectedBehavior||(b=a.contextSummary)!=null&&b.observedBehavior),A=!!((v=a.verificationSummary)!=null&&v.label||(S=a.verificationSummary)!=null&&S.status||(C=a.verificationSummary)!=null&&C.testTimestamp);return e.jsxs("div",{className:n.page,children:[e.jsxs("div",{className:n.header,children:[e.jsxs("span",{className:n.backLink,onClick:()=>o("/changelog"),children:["←"," ",t("sidebar.changelog","Changelog")]}),e.jsx("span",{className:n.headerTitle,children:"|"}),e.jsx("span",{className:n.headerTime,children:O}),e.jsx(g,{text:a.status==="active"?t("changelog.card.active.tooltip","This session is still receiving new game changes."):t("changelog.card.completed.tooltip","This session has ended and no more changes are expected."),children:e.jsx("span",{className:a.status==="active"?n.statusActive:n.statusCompleted,children:a.status==="active"?t("changelog.card.active","Active"):t("changelog.card.completed","Completed")})})]}),e.jsxs("div",{className:n.section,children:[e.jsx("div",{className:n.sectionTitle,children:e.jsx(g,{text:t("changelog.detail.changeSummary.tooltip","Counts of extracted game changes grouped by category for this session."),children:e.jsx("span",{children:t("changelog.detail.changeSummary","Change Summary")})})}),e.jsx("div",{className:n.summaryGrid,children:B.map(s=>{const c=a.changeSummary;let l;switch(s.key){case"script":l=c.scriptsModified+c.scriptsCreated;break;case"instance":l=c.instancesCreated+c.instancesDeleted+c.instancesMoved;break;case"property":l=c.propertiesChanged;break;case"lighting":l=c.lightingChanged?1:0;break;case"terrain":l=c.terrainChanged?1:0;break;case"asset":l=c.assetsInserted;break;default:l=0}const M=d===s.key;return e.jsxs("div",{className:`${n.summaryCard} ${M?n.summaryCardActive:""}`,onClick:()=>x(M?"all":s.key),children:[e.jsx("span",{className:n.summaryIcon,children:s.icon}),e.jsx("div",{className:n.summaryCount,children:l}),e.jsx("div",{className:n.summaryLabel,children:t(s.labelKey,s.key)})]},s.key)})})]}),R&&e.jsxs("div",{className:n.section,children:[e.jsx("div",{className:n.sectionTitle,children:e.jsx(g,{text:t("changelog.detail.context.tooltip","Structured execution context captured for this changelog session."),children:e.jsx("span",{children:t("changelog.detail.context.title","Context Summary")})})}),e.jsxs("div",{className:n.contextGrid,children:[((N=a.contextSummary)==null?void 0:N.intent)&&e.jsxs("div",{className:n.contextRow,children:[e.jsx("span",{className:n.contextKey,children:t("changelog.card.sessionIntent","Session intent")}),e.jsx("span",{className:n.contextValue,children:a.contextSummary.intent})]}),((T=a.contextSummary)==null?void 0:T.testScenario)&&e.jsxs("div",{className:n.contextRow,children:[e.jsx("span",{className:n.contextKey,children:t("playtest.context.why","Why this test ran")}),e.jsx("span",{className:n.contextValue,children:a.contextSummary.testScenario})]}),((k=a.contextSummary)==null?void 0:k.expectedBehavior)&&e.jsxs("div",{className:n.contextRow,children:[e.jsx("span",{className:n.contextKey,children:t("playtest.context.expected","Expected")}),e.jsx("span",{className:n.contextValue,children:a.contextSummary.expectedBehavior})]}),((u=a.contextSummary)==null?void 0:u.observedBehavior)&&e.jsxs("div",{className:n.contextRow,children:[e.jsx("span",{className:n.contextKey,children:t("playtest.context.observed","Observed")}),e.jsx("span",{className:n.contextValue,children:a.contextSummary.observedBehavior})]})]})]}),A&&e.jsxs("div",{className:n.section,children:[e.jsx("div",{className:n.sectionTitle,children:e.jsx(g,{text:t("changelog.detail.verification.tooltip","Verification signals linked to this changelog session."),children:e.jsx("span",{children:t("changelog.detail.verification.title","Verification")})})}),e.jsxs("div",{className:n.contextGrid,children:[((q=a.verificationSummary)==null?void 0:q.label)&&e.jsxs("div",{className:n.contextRow,children:[e.jsx("span",{className:n.contextKey,children:t("changelog.detail.verification.label","Result")}),e.jsx("span",{className:n.contextValue,children:a.verificationSummary.label})]}),((y=a.verificationSummary)==null?void 0:y.status)&&e.jsxs("div",{className:n.contextRow,children:[e.jsx("span",{className:n.contextKey,children:t("changelog.detail.verification.status","Status")}),e.jsx("span",{className:n.contextValue,children:a.verificationSummary.status})]}),((m=a.verificationSummary)==null?void 0:m.testTimestamp)&&e.jsxs("div",{className:n.contextRow,children:[e.jsx("span",{className:n.contextKey,children:t("changelog.detail.verification.timestamp","Recorded at")}),e.jsx("span",{className:n.contextValue,children:a.verificationSummary.testTimestamp})]})]})]}),e.jsxs("div",{className:n.section,children:[e.jsx("div",{className:n.sectionTitle,children:e.jsx(g,{text:t("changelog.detail.changeTimeline.tooltip","Chronological list of extracted game changes for this session."),children:e.jsx("span",{children:t("changelog.detail.changeTimeline","Change Timeline")})})}),e.jsxs("div",{className:n.timelineFilter,children:[e.jsx("span",{className:n.filterLabel,children:e.jsx(P,{label:`${t("changelog.detail.filterCategory","Category")}:`,tooltip:t("changelog.detail.filterCategory.tooltip","Filter the timeline to a single change category.")})}),e.jsxs("select",{className:n.filterSelect,value:d,onChange:s=>x(s.target.value),children:[e.jsx("option",{value:"all",children:t("tools.filter.all","All")}),B.map(s=>e.jsxs("option",{value:s.key,children:[s.icon," ",t(s.labelKey,s.key)]},s.key))]})]}),f.length===0?e.jsx("div",{className:n.empty,children:t("changelog.detail.noChanges","No changes in this category")}):e.jsx("div",{className:n.timeline,children:f.map((s,c)=>{const l=E===c;return e.jsxs("div",{children:[e.jsxs("div",{className:n.timelineEntry,onClick:()=>L(l?null:c),children:[e.jsx("span",{className:n.timelineTime,children:Ae(s.timestamp)}),e.jsx("span",{className:n.timelineIcon,children:J(s.category)}),e.jsxs("div",{className:n.timelineBody,children:[e.jsxs("div",{className:n.timelineSummary,children:[s.summary,e.jsx(g,{text:Ve(t,s.confidence),children:e.jsx("span",{className:`${n.timelineConfidence} ${Me(s.confidence)}`,children:Be(t,s.confidence)})})]}),e.jsx("div",{className:n.timelineTarget,children:s.target})]})]}),l&&e.jsx("div",{className:n.timelineExpanded,children:e.jsx(U,{change:s})})]},c)})})]})]})}export{He as Component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as l,a as F,D,u as M,j as e,e as O,c as V,h as U,l as K,T as G}from"./index-CnXGGM07.js";import{P as H}from"./PageHeader-Bfy2f-GH.js";import{C as Z}from"./ConfirmModal-BqCEvp7Y.js";import{C as Q}from"./CurrentPlaceScope-C8U9I15o.js";import{T as k}from"./TooltipText-CGH7dKN6.js";import{T as q}from"./Tabs-Ccrw7Hjb.js";import"./ConfirmModal.module-D1aZY2bQ.js";const z=10;function J(t,o){return typeof o!="number"?t:`${t}?placeId=${encodeURIComponent(String(o))}`}function W(t){const o=(t==null?void 0:t.placeId)??null,[s,n]=l.useState([]),[u,_]=l.useState(0),[a,f]=l.useState(!1),[x,v]=l.useState(!0),[g,C]=l.useState(0),[d,y]=l.useState("all"),N=l.useRef(null),m=l.useCallback(async(h,b)=>{v(!0);try{const j={limit:String(z),offset:String(h)};b!=="all"&&(j.status=b),typeof o=="number"&&(j.placeId=String(o));const I=await F.get("/api/dashboard/changelog",j);n(I.entries),_(I.total),f(I.hasMore)}catch{n([]),_(0),f(!1)}finally{v(!1)}},[o]),S=l.useCallback(()=>{m(g,d)},[m,g,d]),i=l.useCallback(async()=>{await F.post(J("/api/dashboard/changelog/clear",o)),n([]),_(0),f(!1)},[o]);return l.useEffect(()=>{m(g,d)},[m,g,d]),l.useEffect(()=>{const h=new D;N.current=h,h.connect();const b=h.on("command",()=>{m(g,d)});return()=>{b(),h.disconnect(),N.current=null}},[m,g,d]),{entries:s,total:u,hasMore:a,loading:x,offset:g,statusFilter:d,setOffset:C,setStatusFilter:y,refresh:S,clear:i}}const X="_card_1n89u_2",Y="_header_1n89u_17",ee="_statusBadge_1n89u_24",te="_statusDot_1n89u_35",se="_active_1n89u_41",ae="_completed_1n89u_50",ne="_timeRange_1n89u_58",ce="_summaryList_1n89u_65",oe="_summaryItem_1n89u_71",ie="_summaryIcon_1n89u_80",le="_summaryText_1n89u_86",re="_progressBar_1n89u_91",ge="_progressFill_1n89u_99",de="_emptySummary_1n89u_112",me="_contextBlock_1n89u_120",he="_contextLabel_1n89u_129",pe="_contextValue_1n89u_137",c={card:X,header:Y,statusBadge:ee,statusDot:te,active:se,completed:ae,timeRange:ne,summaryList:ce,summaryItem:oe,summaryIcon:ie,summaryText:le,progressBar:re,progressFill:ge,emptySummary:de,contextBlock:me,contextLabel:he,contextValue:pe};function R(t){if(!t)return"--:--";const o=new Date(t);return`${String(o.getHours()).padStart(2,"0")}:${String(o.getMinutes()).padStart(2,"0")}`}function ue({entry:t,onClick:o}){var h,b,j,I,B,L,A,P,w,E;const{t:s}=M(),n=t.changeSummary,u=t.status==="active",_=t.isBootstrapOnly===!0,a=[],f=n.scriptsModified+n.scriptsCreated;if(f>0){const p=[];n.scriptsModified>0&&p.push(`${n.scriptsModified} ${s("changelog.card.modified","modified")}`),n.scriptsCreated>0&&p.push(`${n.scriptsCreated} ${s("changelog.card.created","created")}`);const T=`${f} ${s("changelog.card.scripts","scripts")} ${p.join(", ")}`;a.push({icon:"📝",text:T,tooltip:s("changelog.card.scripts.tooltip","Script changes made in this session.")})}const x=n.instancesCreated+n.instancesDeleted+n.instancesMoved;if(x>0){const p=[];n.instancesCreated>0&&p.push(`${n.instancesCreated} ${s("changelog.card.created","created")}`),n.instancesDeleted>0&&p.push(`${n.instancesDeleted} ${s("changelog.card.deleted","deleted")}`),n.instancesMoved>0&&p.push(`${n.instancesMoved} ${s("changelog.card.moved","moved")}`);const T=`${x} ${s("changelog.card.instances","instances")} ${p.join(", ")}`;a.push({icon:"🧱",text:T,tooltip:s("changelog.card.instances.tooltip","Instance create, delete, move, or clone changes in this session.")})}n.propertiesChanged>0&&a.push({icon:"🎨",text:`${n.propertiesChanged} ${s("changelog.card.propertiesChanged","properties changed")}`,tooltip:s("changelog.card.propertiesChanged.tooltip","Property value changes recorded for this session.")}),n.lightingChanged&&a.push({icon:"🌅",text:s("changelog.card.lightingConfigured","Lighting configured"),tooltip:s("changelog.card.lightingConfigured.tooltip","Lighting or atmosphere settings changed in this session.")}),n.terrainChanged&&a.push({icon:"⛰️",text:s("changelog.card.terrainConfigured","Terrain configured"),tooltip:s("changelog.card.terrainConfigured.tooltip","Terrain data or terrain settings changed in this session.")}),n.assetsInserted>0&&a.push({icon:"📦",text:`${n.assetsInserted} ${s("changelog.card.assetsInserted","assets inserted")}`,tooltip:s("changelog.card.assetsInserted.tooltip","Assets inserted into the place during this session.")});const v=R(t.startTime),g=u?s("changelog.card.inProgress","in progress"):t.endTime?R(t.endTime):"--:--",C=_?s("changelog.card.bootstrapStatus","Bootstrap"):u?s("changelog.card.active","Active"):s("changelog.card.completed","Completed"),d=_?s("changelog.card.bootstrapStatus.tooltip","This session only contains the initial sync bootstrap snapshot."):u?s("changelog.card.active.tooltip","This session is still receiving new game changes."):s("changelog.card.completed.tooltip","This session has ended and no more changes are expected."),y=_?s("changelog.card.bootstrapSummary","Initial sync snapshot"):s("changelog.card.noChanges","No changes yet"),N=_?s("changelog.card.bootstrapSummary.tooltip","Initial file sync writes are collapsed into a single bootstrap snapshot row."):s("changelog.card.noChanges.tooltip","No game changes have been extracted for this session yet."),m=(b=(h=t.contextSummary)==null?void 0:h.intent)==null?void 0:b.trim(),S=((L=(B=(I=(j=t.contextSummary)==null?void 0:j.affectedAreas)==null?void 0:I[0])==null?void 0:B.label)==null?void 0:L.trim())||((P=(A=t.contextSummary)==null?void 0:A.testScenario)==null?void 0:P.trim()),i=(E=(w=t.verificationSummary)==null?void 0:w.label)==null?void 0:E.trim();return e.jsxs("div",{className:c.card,onClick:o,children:[e.jsxs("div",{className:c.header,children:[e.jsx(k,{text:d,children:e.jsxs("span",{className:`${c.statusBadge} ${u?c.active:c.completed}`,children:[e.jsx("span",{className:c.statusDot}),C]})}),e.jsxs("span",{className:c.timeRange,children:[v,"~",g]})]}),e.jsx("div",{className:c.summaryList,children:a.length>0?a.map((p,T)=>e.jsxs("div",{className:c.summaryItem,children:[e.jsx("span",{className:c.summaryIcon,children:p.icon}),e.jsx(k,{text:p.tooltip,children:e.jsx("span",{className:c.summaryText,children:p.text})})]},T)):e.jsx(k,{text:N,children:e.jsx("span",{className:c.emptySummary,style:{display:"block"},children:y})})}),m&&e.jsxs("div",{className:c.contextBlock,children:[e.jsx("span",{className:c.contextLabel,children:s("changelog.card.sessionIntent","Session intent")}),e.jsx("span",{className:c.contextValue,children:m})]}),!m&&S&&e.jsxs("div",{className:c.contextBlock,children:[e.jsx("span",{className:c.contextLabel,children:s("changelog.card.representativeArea","Representative area")}),e.jsx("span",{className:c.contextValue,children:S})]}),i&&e.jsxs("div",{className:c.contextBlock,children:[e.jsx("span",{className:c.contextLabel,children:s("changelog.card.verification","Verification")}),e.jsx("span",{className:c.contextValue,children:i})]}),u&&e.jsx("div",{className:c.progressBar,children:e.jsx("div",{className:c.progressFill})})]})}const _e="_page_1tggr_2",fe="_limitNotice_1tggr_9",xe="_limitNoticeContent_1tggr_23",ye="_limitNoticeTitle_1tggr_28",be="_limitNoticeText_1tggr_35",ve="_primaryAction_1tggr_41",Ce="_clearButton_1tggr_67",Ne="_list_1tggr_88",Se="_empty_1tggr_95",je="_loading_1tggr_104",Ie="_pagination_1tggr_113",Te="_pageInfo_1tggr_121",$e="_btn_1tggr_127",r={page:_e,limitNotice:fe,limitNoticeContent:xe,limitNoticeTitle:ye,limitNoticeText:be,primaryAction:ve,clearButton:Ce,list:Ne,empty:Se,loading:je,pagination:Ie,pageInfo:Te,btn:$e},$=10;function ke(t,o){return typeof o!="number"?`/changelog/${t}`:`/changelog/${t}?placeId=${encodeURIComponent(String(o))}`}const Be=[{key:"all",labelKey:"changelog.filter.all"},{key:"active",labelKey:"changelog.filter.active"},{key:"completed",labelKey:"changelog.filter.completed"}];function Me(){const{t}=M(),{trackEvent:o,trackPageView:s}=O(),n=V(),[u,_]=l.useState(null),a=W({placeId:u}),f=U(),{show:x}=K(),[v,g]=l.useState(!1),[C,d]=l.useState(!1),y=!f.loading&&f.tier==="basic",N=y?a.entries.slice(0,3):a.entries,m=!y&&a.total>$,S=async()=>{d(!0);try{await a.clear(),x(t("toast.clearSuccess","Cleared successfully"),"success"),g(!1)}catch{x(t("toast.clearFailed","Failed to clear data"),"error")}finally{d(!1)}};return e.jsxs("div",{className:r.page,children:[e.jsx(H,{title:t("page.changelog.title","Changelog"),description:t("page.changelog.description","Review game-change sessions captured from AI actions and sync events."),helpTopicId:"changelog",helpState:{tier:f.tier}}),e.jsx(Q,{surface:"changelog",selectable:!0,selectedPlaceId:u,onSelectedPlaceIdChange:i=>{_(i),a.setOffset(0)}}),e.jsx(q,{items:Be.map(i=>({key:i.key,label:t(i.labelKey,i.key.charAt(0).toUpperCase()+i.key.slice(1))})),value:a.statusFilter,onChange:i=>{const h=`changelog_${i}`;o("dashboard_click_event",{click_target:`changelog_tab_${i}`,page:"changelog",tab:h}),s({page:"changelog",tab:h}),a.setStatusFilter(i),a.setOffset(0)},rightActions:e.jsx("button",{className:r.clearButton,onClick:()=>{o("dashboard_click_event",{click_target:"changelog_clear",page:"changelog",tab:`changelog_${a.statusFilter}`}),g(!0)},children:t("common.clear","Clear")})}),a.loading&&a.entries.length===0&&e.jsx("div",{className:r.loading,children:t("common.loading","Loading...")}),!a.loading&&a.entries.length===0?e.jsx("div",{className:r.empty,children:t("changelog.empty","No changelog entries for the current place yet")}):e.jsx("div",{className:r.list,children:N.map(i=>e.jsx(ue,{entry:i,onClick:()=>n(ke(i.entryId,u))},i.entryId))}),m&&e.jsxs("div",{className:r.pagination,children:[e.jsx("button",{className:r.btn,disabled:a.offset===0,onClick:()=>a.setOffset(Math.max(0,a.offset-$)),children:t("tools.page.prev","Prev")}),e.jsxs("span",{className:r.pageInfo,children:[a.offset+1,"–",Math.min(a.offset+$,a.total)," / ",a.total]}),e.jsx("button",{className:r.btn,disabled:!a.hasMore,onClick:()=>a.setOffset(a.offset+$),children:t("tools.page.next","Next")})]}),y&&e.jsx(e.Fragment,{children:e.jsxs("div",{className:r.limitNotice,children:[e.jsxs("div",{className:r.limitNoticeContent,children:[e.jsx("div",{className:r.limitNoticeTitle,children:t("changelog.basic.limit.title","Basic preview shows the latest 3 sessions")}),e.jsx("div",{className:r.limitNoticeText,children:t("changelog.basic.limit.body","Full changelog timeline browsing is available with Pro.")})]}),e.jsx("a",{className:r.primaryAction,href:G.changelog,target:"_blank",rel:"noreferrer",onClick:()=>o("dashboard_click_event",{click_target:"upgrade_cta",placement:"changelog_limit_notice",page:"changelog",tab:`changelog_${a.statusFilter}`}),children:t("tier.upgrade","View Pro")})]})}),e.jsx(Z,{open:v,title:t("changelog.clear.title","Clear changelog?"),message:t("changelog.clear.message","This permanently removes the stored changelog for the current place."),cancelLabel:t("common.cancel","Cancel"),confirmLabel:t("common.clear","Clear"),loading:C,onCancel:()=>!C&&g(!1),onConfirm:S})]})}export{Me as Component};
|
|
@@ -1 +0,0 @@
|
|
|
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-CnXGGM07.js";import{P as ee}from"./PageHeader-Bfy2f-GH.js";import{I as N}from"./InfoLabel-BAhsgLcj.js";import{s as g}from"./ConfirmModal.module-D1aZY2bQ.js";import{T as B}from"./TooltipText-CGH7dKN6.js";import{s as o,u as te}from"./useSettings-DKMlodE_.js";import{C as M}from"./copy-D-nSZB9j.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};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as h,r as f,j as a,g as _}from"./index-CnXGGM07.js";import{B as x}from"./PageHeader-Bfy2f-GH.js";const j="_scope_1kz7c_1",m="_main_1kz7c_13",k="_label_1kz7c_20",I="_selectorLabel_1kz7c_28",w="_placeSelect_1kz7c_35",z="_name_1kz7c_48",A="_id_1kz7c_59",L="_scopeBadge_1kz7c_66",y="_copy_1kz7c_70",E="_note_1kz7c_82",n={scope:j,main:m,label:k,selectorLabel:I,placeSelect:w,name:z,id:A,scopeBadge:L,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 B(e){return e.pluginConnected&&e.activePlaceId!==null?e.activePlaceId:S(e)}function U(e,l){if(e.pluginConnected&&e.activePlaceId!==null){const o=d(e,e.activePlaceId);return{label:l("placeScope.current.label","Current Place"),placeId:e.activePlaceId,placeName:e.activePlaceName??(o==null?void 0:o.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 o=c===e.lastActivePlaceId?e.lastActivePlaceName:null;return{label:l("placeScope.lastActive.label","Last Active Place"),placeId:c,placeName:o??(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,o=B(e),t=(s==null?void 0:s.placeId)??o,r=d(e,t);if(t===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===t,b=t===e.lastActivePlaceId?e.lastActivePlaceName:null;return{label:u?c("placeScope.current.label","Current Place"):c("placeScope.selected.label","Selected Place"),placeId:t,placeName:(r==null?void 0:r.placeName)??b??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 W({surface:e,selectable:l=!1,selectedPlaceId:c=null,onSelectedPlaceIdChange:s}){const{t:o}=h(),[t,r]=f.useState(null),[u,b]=f.useState(!0);if(f.useEffect(()=>{let i=!1;async function v(){try{const g=await _();i||r(g)}catch{i||r(null)}finally{i||b(!1)}}return v(),()=>{i=!0}},[]),f.useEffect(()=>{!l||!t||typeof c!="number"||d(t,c)||s==null||s(null)},[s,l,c,t]),u)return a.jsx("div",{className:n.scope,"aria-live":"polite",children:a.jsx("span",{className:n.label,children:o("placeScope.loading","Loading place scope...")})});if(!t)return a.jsx("div",{className:n.scope,"aria-live":"polite",children:a.jsx("span",{className:n.label,children:o("placeScope.unavailable","Place scope unavailable")})});const p=l?q(t,c,o):U(t,o),N=typeof p.placeId=="number"?String(p.placeId):"",P=l&&t.places.length>0;return a.jsxs("div",{className:n.scope,"aria-live":"polite",children:[a.jsxs("div",{className:n.main,children:[P?a.jsxs(a.Fragment,{children:[a.jsxs("label",{className:n.selectorLabel,children:[a.jsx("span",{className:n.label,children:o("placeScope.selector.label","Place data")}),a.jsx("select",{className:n.placeSelect,value:N,onChange:i=>{const v=Number.parseInt(i.currentTarget.value,10);s==null||s(Number.isInteger(v)?v:null)},children:t.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(x,{variant:p.live?"success":"warning",shape:"pill",className:n.scopeBadge,children:p.badge})]}),a.jsxs("div",{className:n.copy,children:[a.jsx("span",{children:F(e,o)}),p.note?a.jsx("span",{className:n.note,children:p.note}):null]})]})}export{W as C};
|
|
@@ -1 +0,0 @@
|
|
|
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-CnXGGM07.js";import{I as A}from"./InfoLabel-BAhsgLcj.js";import{P as U}from"./PageHeader-Bfy2f-GH.js";import{S as z}from"./StatusBadge-Df9BQsJU.js";import{T as O}from"./TooltipText-CGH7dKN6.js";import{G as X}from"./GameChangeDetail-CMSmIwO-.js";import{u as q,f as J}from"./useLiveUptime-1Et9Q6mq.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};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{i as Z,r as d,j as t,u as ee,e as te,X as ne,E as oe,J as se}from"./index-CnXGGM07.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 ae=[["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"}]],q=Z("circle-question-mark",ae),re="_button_vab4n_1",ce="_iconButton_vab4n_2",ie="_checkboxInput_vab4n_26",le="_button_sm_vab4n_37",de="_button_md_vab4n_42",ue="_primary_vab4n_47",pe="_secondary_vab4n_58",he="_ghost_vab4n_69",be="_danger_vab4n_81",fe="_iconButton_sm_vab4n_104",_e="_iconButton_md_vab4n_109",ge="_badge_vab4n_114",ye="_pill_vab4n_133",ve="_interactive_vab4n_137",me="_neutral_vab4n_151",Pe="_accent_vab4n_157",ke="_success_vab4n_163",we="_warning_vab4n_169",Ce="_info_vab4n_175",xe="_error_vab4n_181",Ie="_pro_vab4n_193",_={button:re,iconButton:ce,checkboxInput:ie,button_sm:le,button_md:de,primary:ue,secondary:pe,ghost:he,danger:be,iconButton_sm:fe,iconButton_md:_e,badge:ge,pill:ye,interactive:ve,neutral:me,accent:Pe,success:ke,warning:we,info:Ce,error:xe,pro:Ie};function S(...e){return e.filter(Boolean).join(" ")}const Re=d.forwardRef(function({variant:n="secondary",size:o="md",className:i,type:a="button",...b},u){return t.jsx("button",{ref:u,type:a,className:S(_.button,_[n],_[`button_${o}`],i),...b})}),X=d.forwardRef(function({size:n="md",className:o,type:i="button",...a},b){return t.jsx("button",{ref:b,type:i,className:S(_.iconButton,_[`iconButton_${n}`],o),...a})}),at=d.forwardRef(function({variant:n="neutral",shape:o="square",interactive:i=!1,className:a,...b},u){return t.jsx("span",{ref:u,className:S(_.badge,_[n],o==="pill"&&_.pill,i&&_.interactive,a),...b})}),rt=d.forwardRef(function({className:n,type:o,...i},a){return t.jsx("input",{ref:a,type:"checkbox",className:S(_.checkboxInput,n),...i})}),r={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"}},Ae="https://create.roblox.com/docs/cloud/auth/api-keys",Ee="https://create.roblox.com/docs/cloud/guides/usage-assets",Se="https://create.roblox.com/docs/cloud/reference/features/assets",Le="https://create.roblox.com/docs/reference/engine/classes/DataModel#CreatorId",Be="https://create.roblox.com/docs/reference/engine/classes/Player#UserId",He="https://create.roblox.com/docs/projects/groups",De="https://create.roblox.com/docs/cloud/reference/features/groups";function g(e,n,o,i){return{id:e,title:{key:`dashboardHelp.${e}.title`,fallback:n},sections:o,links:i}}function l(e,n,o,i){return{heading:e,items:i.map((a,b)=>({key:`dashboardHelp.${n}.${o}.${b+1}`,fallback:a}))}}function c(e,n,o){return{heading:r.currentState,items:[{key:`dashboardHelp.${e}.currentState.${n}`,fallback:o}]}}function P(e,n,o,i,a,b){return g(e,n,[l(r.canDo,e,"canDo",o),l(r.needs,e,"needs",i),l(r.currentState,e,"currentState",a)],b)}function je(e){return e.tier==="basic"?c("assets","basic","Activate Pro before uploading to Roblox."):e.uploadEnabled===!1?c("assets","uploadDisabled","Turn on API Key local upload in Assets settings."):e.hasOpenCloudCredential===!1?c("assets","noCredential","Save and test an Open Cloud API Key."):e.hasDefaultCreator===!1?c("assets","noCreator","Save a default Creator ID or enter Creator details during upload."):c("assets","default","Open an asset detail dialog to start upload or usage scan.")}function Ne(e){return e.connectionLevel!==void 0&&e.connectionLevel!=="studioConnected"?c("sync","pluginMissing","Connect WEPPY Plugin in Studio before using live sync details."):e.tier==="basic"?c("sync","basic","Activate Pro to use bidirectional or reverse sync."):c("sync","default","Use the sync log to diagnose stuck or failed sync activity.")}function Me(e,n={}){return e==="openCloudApiKey"?g(e,"Open Cloud API Key help",[l(r.canDo,e,"canDo",["WEPPY uses this key only for Roblox Open Cloud requests."]),l(r.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."]),n.hasOpenCloudCredential?c(e,"saved","Use Test Connection to confirm the saved key still works."):c(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:Ae},{label:{key:"dashboardHelp.openCloudApiKey.link.assetsGuide",fallback:"Assets API usage guide"},href:Ee},{label:{key:"dashboardHelp.openCloudApiKey.link.assetsReference",fallback:"Assets API reference"},href:Se}]):e==="openCloudCreatorId"?g(e,"Creator ID help",[l(r.canDo,e,"canDo",["The default Creator decides which User or Group owns newly uploaded Roblox assets."]),l(r.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."]),n.hasDefaultCreator?c(e,"saved","Keep this value if new assets should continue using the same owner."):c(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:Le},{label:{key:"dashboardHelp.openCloudCreatorId.link.userId",fallback:"User ID reference"},href:Be},{label:{key:"dashboardHelp.openCloudCreatorId.link.groups",fallback:"Roblox groups"},href:He},{label:{key:"dashboardHelp.openCloudCreatorId.link.groupsApi",fallback:"Groups Cloud API"},href:De}]):{overview:g("overview","Overview help",[l(r.canDo,"overview","canDo",["Check MCP server, WEPPY Plugin, AI Agent, Sync, and recent game changes in one place."]),l(r.needs,"overview","needs",["Useful status requires the MCP server. Live Studio status also needs WEPPY Plugin connected to the active place."]),n.connectionLevel==="serverOnly"?c("overview","serverOnly","Open Roblox Studio and start WEPPY Plugin so live place data can appear."):c("overview","default","If the server disconnects, restart MCP or wait for the automatic reconnect.")]),connection:P("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(r.canDo,"sync","canDo",["Review Studio to local sync status, direction, apply mode, and sync logs."]),l(r.needs,"sync","needs",["Sync needs an active place and connected WEPPY Plugin. Two-way and reverse workflows depend on Pro."]),Ne(n)]),assets:g("assets","Assets help",[l(r.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(r.needs,"assets","needs",["Upload needs Pro, the Open Cloud upload toggle, a valid API Key, and a Creator. Browse and preview work on Basic."]),je(n)]),changelog:P("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(r.canDo,"playtest","canDo",["Review Playtest results and reports saved by the AI Agent."]),l(r.needs,"playtest","needs",["Pro shows real stored reports. Basic shows sample preview data. Live active-place confidence needs WEPPY Plugin connected."]),n.tier==="basic"?c("playtest","basic","Activate Pro to use real Playtest history."):c("playtest","default","Ask the AI Agent to run a Playtest when no report is available.")]),uiStudio:g("uiStudio","UI Studio help",[l(r.canDo,"uiStudio","canDo",["Review AI-created UI analysis, improvement suggestions, captures, and before/after history."]),l(r.needs,"uiStudio","needs",["Pro shows real UI Studio data. Basic shows a bundled sample. New capture/check actions need WEPPY Plugin connected."]),n.tier==="basic"?c("uiStudio","basic","Activate Pro to use live UI Studio previews."):c("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:P("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:P("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:P("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:P("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 Ue="_root_15e9p_1",Oe="_rootPage_15e9p_7",We="_rootField_15e9p_11",Te="_helpButton_15e9p_15",Ge="_panel_15e9p_19",Fe="_panelField_15e9p_34",$e="_panelPage_15e9p_38",Ye="_panelHeader_15e9p_42",Ke="_closeButton_15e9p_60",qe="_sectionStack_15e9p_64",Xe="_helpSection_15e9p_69",ze="_linkList_15e9p_70",h={root:Ue,rootPage:Oe,rootField:We,helpButton:Te,panel:Ge,panelField:Fe,panelPage:$e,panelHeader:Ye,closeButton:Ke,sectionStack:qe,helpSection:Xe,linkList:ze},y=12,A=8,Je=120,Qe=360,Ve=340,z=560;function Ze({topicId:e,state:n,variant:o="page",className:i}){const{t:a}=ee(),{trackEvent:b}=te(),[u,k]=d.useState(!1),[x,M]=d.useState(null),L=d.useId(),U=d.useRef(null),B=d.useRef(null),H=d.useRef(null),v=Me(e,n),I=a(v.title.key,v.title.fallback),R=d.useCallback(()=>{const s=B.current,p=H.current;if(!s||!p||typeof window>"u")return;const f=s.getBoundingClientRect(),m=p.getBoundingClientRect(),w=window.innerWidth,C=window.innerHeight,Q=o==="field"?Ve:Qe,T=m.width||Math.min(Q,w-y*2),G=m.height||z;let D=o==="field"?f.left:f.right-T;D=Math.max(y,Math.min(D,w-T-y));const j=C-f.bottom-A-y,F=f.top-A-y,$=j<Math.min(G,220)&&F>j,V=Math.max(Je,$?F:j),Y=Math.min(z,V),K=Math.min(G,Y);let N=$?f.top-A-K:f.bottom+A;N=Math.max(y,Math.min(N,C-K-y)),M({top:Math.round(N),left:Math.round(D),maxHeight:Math.round(Y)})},[o]);d.useLayoutEffect(()=>{u?R():M(null)},[u,R]),d.useEffect(()=>{if(!u)return;const s=f=>{var w,C;const m=f.target;m&&!((w=U.current)!=null&&w.contains(m))&&!((C=H.current)!=null&&C.contains(m))&&k(!1)},p=f=>{f.key==="Escape"&&k(!1)};return document.addEventListener("mousedown",s),document.addEventListener("keydown",p),()=>{document.removeEventListener("mousedown",s),document.removeEventListener("keydown",p)}},[u]),d.useEffect(()=>{if(!u)return;const s=()=>R();return window.addEventListener("scroll",s,!0),window.addEventListener("resize",s),()=>{window.removeEventListener("scroll",s,!0),window.removeEventListener("resize",s)}},[u,R]);const O=o==="field"?a("dashboardHelp.fieldButton.ariaLabel","Open field help"):a("dashboardHelp.pageButton.ariaLabel","Open page help"),J=x?{top:x.top,left:x.left,maxHeight:x.maxHeight}:{top:-9999,left:-9999,visibility:"hidden"},W=u?t.jsxs("section",{ref:H,id:L,className:[h.panel,o==="field"?h.panelField:h.panelPage].filter(Boolean).join(" "),style:J,role:"dialog","aria-label":I,"data-panel-placement":"help-portal",children:[t.jsxs("div",{className:h.panelHeader,children:[t.jsx("h2",{children:I}),t.jsx(X,{type:"button",size:"sm",className:h.closeButton,"aria-label":a("common.close","Close"),onClick:()=>k(!1),children:t.jsx(ne,{size:15,"aria-hidden":"true"})})]}),t.jsx("div",{className:h.sectionStack,children:v.sections.map(s=>t.jsxs("section",{className:h.helpSection,children:[t.jsx("h3",{children:a(s.heading.key,s.heading.fallback)}),t.jsx("ul",{children:s.items.map(p=>t.jsx("li",{children:a(p.key,p.fallback)},p.key))})]},s.heading.key))}),v.links&&v.links.length>0&&t.jsxs("div",{className:h.linkList,children:[t.jsx("h3",{children:a("dashboardHelp.section.links","Related links")}),v.links.map(s=>t.jsxs("a",{href:s.href,target:"_blank",rel:"noreferrer",children:[a(s.label.key,s.label.fallback),t.jsx(oe,{size:12,"aria-hidden":"true"})]},s.href))]})]}):null;return t.jsxs(t.Fragment,{children:[t.jsx("div",{ref:U,className:[h.root,o==="field"?h.rootField:h.rootPage,i??""].filter(Boolean).join(" "),children:o==="field"?t.jsx(X,{ref:B,type:"button",size:"sm",className:h.helpButton,"aria-label":`${O}: ${I}`,"aria-expanded":u,"aria-controls":L,onClick:()=>{k(s=>{const p=!s;return s||b("dashboard_click_event",{click_target:"dashboard_help_open",help_topic:e,placement:o}),p})},children:t.jsx(q,{size:14,"aria-hidden":"true"})}):t.jsxs(Re,{ref:B,type:"button",variant:"secondary",size:"sm",className:h.helpButton,"aria-label":`${O}: ${I}`,"aria-expanded":u,"aria-controls":L,onClick:()=>{k(s=>{const p=!s;return s||b("dashboard_click_event",{click_target:"dashboard_help_open",help_topic:e,placement:o}),p})},children:[t.jsx(q,{size:16,"aria-hidden":"true"}),t.jsx("span",{children:a("dashboardHelp.button","Help")})]})}),W&&typeof document<"u"?se.createPortal(W,document.body):null]})}const et="_pageHeader_qym7v_1",tt="_copy_qym7v_9",nt="_titleLine_qym7v_16",ot="_actions_qym7v_39",E={pageHeader:et,copy:tt,titleLine:nt,actions:ot};function ct({title:e,description:n,badge:o,helpTopicId:i,helpState:a}){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}),o]}),t.jsx("p",{children:n})]}),t.jsx("div",{className:E.actions,children:t.jsx(Ze,{topicId:i,state:a})})]})}export{at as B,rt as C,Ze as D,ct as P};
|
|
@@ -1 +0,0 @@
|
|
|
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-CnXGGM07.js";import{C as pe,P as ge}from"./PageHeader-Bfy2f-GH.js";import{I as x}from"./InfoLabel-BAhsgLcj.js";import{T as d}from"./TooltipText-CGH7dKN6.js";import{s as i,u as he}from"./useSettings-DKMlodE_.js";import{C as me}from"./ConfirmModal-BqCEvp7Y.js";import{D as ie,f as ne,r as ye,s as xe,a as oe,d as K,S as te,b as ve}from"./sample-requests-ythz0BoY.js";import"./ConfirmModal.module-D1aZY2bQ.js";const fe="_card_g3as3_4",Se="_cardEmbedded_g3as3_14",be="_cardTitle_g3as3_21",je="_usageRow_g3as3_30",_e="_usageTotal_g3as3_36",Ne="_usageBreakdown_g3as3_42",ke="_usageCounts_g3as3_47",Ce="_divider_g3as3_53",Re="_lastRunRow_g3as3_60",Le="_lastRunLabel_g3as3_69",we="_errorIcon_g3as3_75",He="_tooltip_g3as3_83",Be="_cleanupRow_g3as3_106",Pe="_cleanupLabel_g3as3_113",De="_cleanupBtn_g3as3_120",Ae="_cleanupBtnDanger_g3as3_143",Te="_retentionSection_g3as3_156",Ee="_retentionTitle_g3as3_162",Me="_retentionFieldset_g3as3_171",$e="_proOverlay_g3as3_186",Ie="_radioRow_g3as3_198",Ue="_radioLabel_g3as3_205",ze="_presetGroup_g3as3_225",Oe="_presetBtn_g3as3_233",Fe="_presetBtnActive_g3as3_250",qe="_freeInput_g3as3_257",Ge="_inputError_g3as3_273",We="_inputUnit_g3as3_277",Ye="_cascadeRow_g3as3_284",Ke="_retentionActions_g3as3_299",Ve="_saveBtn_g3as3_305",Je="_runNowBtn_g3as3_327",Qe="_errorMsg_g3as3_350",n={card:fe,cardEmbedded:Se,cardTitle:be,usageRow:je,usageTotal:_e,usageBreakdown:Ne,usageCounts:ke,divider:Ce,lastRunRow:Re,lastRunLabel:Le,errorIcon:we,tooltip:He,cleanupRow:Be,cleanupLabel:Pe,cleanupBtn:De,cleanupBtnDanger:Ae,retentionSection:Te,retentionTitle:Ee,retentionFieldset:Me,proOverlay:$e,radioRow:Ie,radioLabel:Ue,presetGroup:ze,presetBtn:Oe,presetBtnActive:Fe,freeInput:qe,inputError:Ge,inputUnit:We,cascadeRow:Ye,retentionActions:Ke,saveBtn:Ve,runNowBtn:Je,errorMsg:Qe};function Xe(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 Ze(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 et({placeId:t,tier:s,currentPolicy:r,onSaved:v}){const{t:l}=V(),{trackEvent:j}=ae(),[a,g]=u.useState(r),[p,B]=u.useState(()=>[7,14,30,90].includes(r.ageDays??-1)?"":String(r.ageDays??30)),[k,P]=u.useState(()=>[100,500,1e3].includes(r.sizeMb??-1)?"":String(r.sizeMb??500)),[f,D]=u.useState(null),[m,y]=u.useState(!1),[A,_]=u.useState(!1),[N,L]=u.useState(!1),[C,R]=u.useState(null);u.useEffect(()=>{g(r);const c=[7,14,30,90],b=[100,500,1e3];B(c.includes(r.ageDays??-1)?"":String(r.ageDays??30)),P(b.includes(r.sizeMb??-1)?"":String(r.sizeMb??500))},[r]);const w=s==="basic",S=se(a),H=Ze(r,a),T=S&&!H&&!A,o=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})},h=c=>{B(""),g(b=>({...b,ageDays:c}))},O=c=>{P(""),g(b=>({...b,sizeMb:c}))},J=c=>{B(c);const b=parseInt(c,10);Number.isNaN(b)||g(U=>({...U,ageDays:b}))},M=c=>{P(c);const b=parseInt(c,10);Number.isNaN(b)||g(U=>({...U,sizeMb:b}))},Q=async()=>{if(R(null),j("dashboard_click_event",{click_target:"ui_studio_cleanup_save",page:"settings"}),Xe(r,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){R(c.message)}return}await Y()},Y=async()=>{_(!0);try{await xe(t,a),y(!1),v()}catch(c){throw R(c.message),c}finally{_(!1)}},X=async()=>{R(null),j("dashboard_click_event",{click_target:"ui_studio_cleanup_run_now",page:"settings"}),L(!0);try{await ye(t),v()}catch(c){R(c.message)}finally{L(!1)}},Z=f?`${l("uiStudio.cleanup.policy.confirm.messageStrict","이 정책으로 즉시")} ${f.wouldRemoveRequests}${l("uiStudio.cleanup.policy.confirm.requests","건")} / ${f.wouldRemoveSnapshots}${l("uiStudio.cleanup.policy.confirm.snapshots","개 화면 캡처")} / ${z(f.wouldFreeBytes)} ${l("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(x,{label:l("uiStudio.cleanup.policy.title","자동 삭제 정책"),tooltip:l("uiStudio.cleanup.policy.title.tooltip","Rules that automatically remove old or large captures.")})}),e.jsxs("div",{style:{position:"relative"},children:[w&&e.jsx("div",{className:n.proOverlay,title:l("uiStudio.cleanup.policy.proRequired","Pro에서 사용 가능"),children:e.jsx("div",{className:n.tooltip,children:l("uiStudio.cleanup.policy.proRequired","Pro에서 사용 가능")})}),e.jsxs("fieldset",{className:n.retentionFieldset,disabled:w,style:w?{opacity:.45,pointerEvents:"none"}:void 0,children:[e.jsx("div",{className:n.radioRow,children:e.jsx(d,{text:l("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:()=>o("off")}),l("uiStudio.cleanup.policy.modeOff","사용 안 함 (off)")]})})}),e.jsxs("div",{children:[e.jsx("div",{className:n.radioRow,children:e.jsx(d,{text:l("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:()=>o("age")}),l("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:l("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:()=>h(c),children:[c,l("uiStudio.cleanup.policy.daysUnit","일")]})},c)),e.jsx(d,{text:l("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",l("uiStudio.cleanup.policy.daysUnit","일")]})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:n.radioRow,children:e.jsx(d,{text:l("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:()=>o("size")}),l("uiStudio.cleanup.policy.modeSize","용량 기반 (size)")]})})}),a.mode==="size"&&e.jsxs("div",{className:n.presetGroup,children:[[100,500,1e3].map(c=>e.jsx(d,{text:l("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,l("uiStudio.cleanup.policy.mbUnit","MB")]})},c)),e.jsx(d,{text:l("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=>M(c.target.value)})}),e.jsxs("span",{className:n.inputUnit,children:["50–10000",l("uiStudio.cleanup.policy.mbUnit","MB")]})]})]}),e.jsx(d,{text:l("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(pe,{checked:a.cascadeSnapshots,onChange:c=>g(b=>({...b,cascadeSnapshots:c.target.checked}))}),l("uiStudio.cleanup.policy.cascade","연결된 화면 캡처도 함께 삭제")]})}),e.jsxs("div",{className:n.retentionActions,children:[e.jsx(d,{text:l("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:l("uiStudio.cleanup.policy.save","정책 저장")})}),e.jsx(d,{text:l("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:N,children:l("uiStudio.cleanup.policy.runNow","지금 정리")})})]}),C&&e.jsx("div",{className:n.errorMsg,children:C})]})]}),m&&f&&e.jsx(ie,{title:l("uiStudio.cleanup.policy.confirm.title","정책 적용 확인"),message:Z,danger:!0,confirmLabel:l("uiStudio.cleanup.policy.save","정책 저장"),busy:A,onConfirm:Y,onClose:()=>y(!1)})]})}function tt({placeId:t,tier:s,onChanged:r,sampleUsage:v,sampleRetention:l,embedded:j=!1}){const{t:a}=V(),g=s==="basic"&&v!=null&&l!=null,[p,B]=u.useState(g?v:null),[k,P]=u.useState(g?l:null),[f,D]=u.useState(null),[m,y]=u.useState(null),[A,_]=u.useState(null),N=u.useCallback(async()=>{if(!g&&t!=null){D(null);try{const[o,h]=await Promise.all([oe(t),ne(t)]);B(o),P(h.policy)}catch(o){D(o.message)}}},[t,g]);u.useEffect(()=>{N()},[N]);const L=u.useCallback(()=>{N(),r==null||r()},[N,r]),C=u.useCallback(async()=>{if(m&&t!=null){_(null);try{m.kind==="keep7"?await K(t,{olderThanDays:7,alsoSnapshots:!0}):m.kind==="keep30"?await K(t,{olderThanDays:30,alsoSnapshots:!0}):await K(t,{all:!0,alsoSnapshots:!0}),y(null),N(),r==null||r()}catch(o){throw _(o.message),o}}},[m,t,N,r]);function R(o){const h=a("uiStudio.cleanup.studioPreservedNote","This deletes saved change records and screenshots on disk only; Roblox Studio instances are not affected.");return o.kind==="keep7"?`${a("uiStudio.cleanup.cleanupConfirmMessage.keep7","7일 이전 변경 기록과 화면 캡처가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.")} ${h}`:o.kind==="keep30"?`${a("uiStudio.cleanup.cleanupConfirmMessage.keep30","30일 이전 변경 기록과 화면 캡처가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.")} ${h}`:`${((p==null?void 0:p.requestCount)??0)+((p==null?void 0:p.snapshotCount)??0)}${a("uiStudio.cleanup.cleanupConfirmMessage.all","개의 저장된 변경 기록과 화면 캡처가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.")} ${h}`}if(t==null&&!g)return null;if(f)return e.jsx("div",{className:`${n.card} ${j?n.cardEmbedded:""}`,children:e.jsx("p",{className:n.errorMsg,children:f})});if(!p||!k)return e.jsx("div",{className:`${n.card} ${j?n.cardEmbedded:""}`,children:e.jsx("p",{style:{fontSize:12,color:"var(--text-muted)",margin:0},children:a("uiStudio.storage.loading","로딩 중...")})});const w=k.lastRunAt,S=k.lastRunStats,H=w?new Date(w).toLocaleString():null,T=t??0;return e.jsxs("div",{className:`${n.card} ${j?n.cardEmbedded:""}`,children:[e.jsx("h3",{className:n.cardTitle,children:e.jsx(x,{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(et,{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(x,{label:a("uiStudio.storage.lastRun","마지막 자동 정리"),tooltip:a("uiStudio.storage.lastRun.tooltip","When the auto-cleanup policy last ran, and what it removed.")})}),H?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:H}),S&&e.jsxs("span",{children:["· ",a("uiStudio.storage.requestCount","변경 기록")," ",S.removedRequests,a("uiStudio.storage.countSuffix","개")," / ",a("uiStudio.storage.snapshotCount","화면 캡처")," ",S.removedSnapshots,a("uiStudio.storage.countSuffix","개")," / ",z(S.freedBytes)," ",a("uiStudio.storage.lastRunFreed","회수")]}),S&&S.errors>0&&e.jsxs("span",{className:n.errorIcon,title:`${a("uiStudio.storage.lastRunErrors","오류")} ${S.errors}건`,children:["⚠",e.jsxs("span",{className:n.tooltip,children:[a("uiStudio.storage.lastRunErrors","오류")," ",S.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(x,{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}),m&&e.jsx(ie,{title:a("uiStudio.cleanup.cleanupConfirmTitle","정리 확인"),message:R(m),danger:!0,confirmLabel:a("common.delete","삭제"),onConfirm:C,onClose:()=>{y(null),_(null)}})]})}const st={toolsActivity:null,toolStats:null,toolSessions:null,syncLog:null,playtestReports:null,projectChanges:null,connectionLog:null},at={toolsActivity:null,toolStats:null,syncLog:null,playtestReports:null,projectChanges:null,connectionLog:null};function it(t){var s;return t?t.pluginConnected?t.activePlaceId:t.lastActivePlaceId??((s=t.places[0])==null?void 0:s.placeId)??null:null}async function E(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,r,v){return s===null?t("settings.dataHistory.metric.unavailable","Unavailable"):`${s.toLocaleString()} ${t(r,v)}`}function F(t,s,r){const v=r===null?t("settings.dataHistory.metric.sizeUnavailable","size unavailable"):z(r);return`${s} · ${v}`}function q(t,s){var v;const r=(v=t==null?void 0:t[s])==null?void 0:v.bytes;return typeof r=="number"&&Number.isFinite(r)?r:null}function nt(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 ot({tier:t}){const{t:s}=V(),[r,v]=u.useState(st),[l,j]=u.useState(at),[a,g]=u.useState(t==="basic"?te:null),[p,B]=u.useState(null),[k,P]=u.useState(!0),[f,D]=u.useState(!0),[m,y]=u.useState(null),[A,_]=u.useState(!1),[N,L]=u.useState(null),C=u.useCallback(async()=>{P(!0);const h=await E(le()),O=it(h);B(O);const[J,M,Q,Y,X,Z,$]=await Promise.all([E(I.get("/api/dashboard/history",{limit:"1",offset:"0"})),E(I.get("/api/dashboard/tool-stats")),E(I.get("/sync/history",{limit:"1",offset:"0"})),E(I.get("/api/dashboard/playtest/history")),E(I.get("/api/dashboard/changelog",{limit:"1",offset:"0"})),E(I.get("/api/dashboard/connection-log")),E(I.get("/api/dashboard/storage-summary"))]),ee=t==="basic"?te:O===null?null:await E(oe(O));v({toolsActivity:G(J),toolStats:(M==null?void 0:M.totalCalls)??null,toolSessions:(M==null?void 0:M.totalSessions)??null,syncLog:G(Q),playtestReports:G(Y),projectChanges:G(X),connectionLog:G(Z)}),j({toolsActivity:q($,"toolsActivity"),toolStats:q($,"toolStats"),syncLog:q($,"syncLog"),playtestReports:q($,"playtestReports"),projectChanges:q($,"projectChanges"),connectionLog:q($,"connectionLog")}),g(ee),P(!1)},[t]);u.useEffect(()=>{C()},[C]);const R=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,r.toolsActivity,"settings.dataHistory.metric.records","records"),l.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,r.toolStats===null?s("settings.dataHistory.metric.unavailable","Unavailable"):`${r.toolStats.toLocaleString()} ${s("settings.dataHistory.metric.runs","runs")} · ${(r.toolSessions??0).toLocaleString()} ${s("settings.dataHistory.metric.sessions","sessions")}`,l.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,r.syncLog,"settings.dataHistory.metric.records","records"),l.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,r.playtestReports,"settings.dataHistory.metric.reports","reports"),l.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,r.projectChanges,"settings.dataHistory.metric.records","records"),l.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,r.connectionLog,"settings.dataHistory.metric.records","records"),l.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"}],[r,l,s]),w=async()=>{if(m){_(!0),L(null);try{if(m.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(m.row.clearEndpoint),L(s("settings.dataHistory.clear.success","Saved data cleared."));y(null),await C()}catch{L(m.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{_(!1)}}},S=t==="pro"?p:0,H=t==="pro"&&p!==null,T=(m==null?void 0:m.kind)==="uiStudio",o=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(x,{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":f,"aria-controls":"settings-data-history-body","aria-label":f?s("settings.dataHistory.collapse","Collapse {title}").replace("{title}",o):s("settings.dataHistory.expand","Expand {title}").replace("{title}",o),onClick:()=>D(h=>!h),children:f?"▾":"▸"})})]})]}),f&&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:[R.map(h=>e.jsxs("div",{className:i.dataHistoryRow,children:[e.jsxs("div",{className:i.dataHistoryMain,children:[e.jsx("div",{className:i.dataHistoryTitle,children:h.title}),e.jsx("div",{className:i.dataHistoryDescription,children:h.description})]}),e.jsx(d,{text:h.metricTooltip,children:e.jsx("div",{className:i.dataHistoryMetric,children:h.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:`#${h.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:h}),children:s("common.clear","Clear")})})]})]},h.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:nt(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:!H,onClick:()=>y({kind:"uiStudio"}),children:s("common.clear","Clear")})})]})]}),e.jsx("div",{className:`${i.dataHistoryDetail} ${i.uiStudioDataHistoryDetail}`,children:e.jsx(tt,{placeId:S,tier:t,onChanged:C,embedded:!0,...t==="basic"?{sampleUsage:te,sampleRetention:ve}:{}})})]}),N&&e.jsx("p",{className:i.inlineStatus,children:N})]})]}),e.jsx(me,{open:m!==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 w()})]})}const lt={en:"English",ko:"한국어",es:"Español","pt-br":"Português (BR)",ja:"日本語",id:"Bahasa Indonesia",de:"Deutsch","fr-fr":"Français"};function rt(t){return t==="active"?i.statusActive:t==="grace"?i.statusGrace:t==="invalid"||t==="revoked"?i.statusError:i.statusInactive}function ct(t){return t?t.refreshBlockedReason==="missing_session_token"?!0:t.status==="active"||t.status==="grace"||t.status==="invalid"||t.status==="revoked"||t.status==="unknown":!1}function dt(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 ft(){const{t,selectedLocale:s,setLocale:r}=V(),{trackEvent:v}=ae(),{search:l}=re(),{settings:j,license:a,licenseControlsDisabled:g,licenseSubmitting:p,licenseMessage:B,activateLicense:k,refreshLicense:P,resetLicense:f,loading:D}=he(),[m,y]=u.useState(""),A=a?dt(a,t):null,_=ct(a),N=_&&(a==null?void 0:a.refreshBlockedReason)!=="missing_session_token",L=_,C=_?a==null?void 0:a.maskedKey:void 0,R=a!=null&&a.provider&&a.provider!=="auto"?a.provider:void 0,w=(a==null?void 0:a.tier)==="pro"?"pro":"basic",S=u.useRef(null),H=u.useRef(null),T=u.useMemo(()=>new URLSearchParams(l).get("section")==="license",[l]);return u.useEffect(()=>{var h;if(!T||D)return;const o=S.current;if((h=o==null?void 0:o.scrollIntoView)==null||h.call(o,{block:"start",behavior:"smooth"}),H.current&&!H.current.disabled){H.current.focus();return}o==null||o.focus()},[D,g,p,T]),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(ge,{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:S,tabIndex:-1,"data-testid":"settings-license-card",className:[i.card,T?i.licenseCardTarget:"",(a==null?void 0:a.tier)==="pro"?i.licenseCardPro:""].filter(Boolean).join(" "),children:[e.jsxs("div",{className:i.cardHeader,children:[e.jsx(x,{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 o=A;return e.jsxs(e.Fragment,{children:[e.jsxs("dl",{className:i.licenseGrid,children:[e.jsx("dt",{children:e.jsx(x,{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} ${rt(a.status)}`}),e.jsx(d,{text:(o==null?void 0:o.tooltip)??t(`settings.license.${a.status}.tooltip`,"Current license activation state."),children:(o==null?void 0:o.label)??t(`settings.license.${a.status}`,a.status)})]}),e.jsx("dt",{children:e.jsx(x,{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")})}),C&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(x,{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:C})})]}),R&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(x,{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:R})})]})]}),(o==null?void 0:o.detail)&&e.jsx("p",{className:`${i.licenseNotice} ${o.detailTone}`,children:a.refreshBlockedReason==="missing_session_token"?t("settings.license.detail.manualActivation","Manual activation required to restore Pro access."):o.detail}),a.refreshBlockedReason==="missing_session_token"&&e.jsx("p",{className:`${i.licenseNotice} ${i.licenseNoticeMuted}`,children:o==null?void 0:o.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:()=>v("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||!N,onClick:()=>{P()},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||!L,onClick:()=>{f()},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(x,{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:H,"aria-label":t("settings.license.keyInput","License Key"),className:i.textInput,type:"text",value:m,disabled:g||p,onChange:o=>y(o.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(m)&&y(""))()},children:p?t("common.loading"):t("settings.license.activate","Activate License")})})]}),B&&e.jsx("p",{className:i.licenseMessage,children:B})]})]})]}),e.jsx(ot,{tier:w}),e.jsxs("div",{className:i.card,children:[e.jsxs("div",{className:i.cardHeader,children:[e.jsx(x,{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")})})]}),j?e.jsxs(e.Fragment,{children:[e.jsxs("dl",{className:i.coldGrid,children:[e.jsx("dt",{children:e.jsx(x,{label:"HTTP_PORT",tooltip:t("settings.cold.httpPort.tooltip","Port number used by the MCP WEPPY Dashboard HTTP server.")})}),e.jsx("dd",{children:j.cold.HTTP_PORT}),e.jsx("dt",{children:e.jsx(x,{label:"HTTP_HOST",tooltip:t("settings.cold.httpHost.tooltip","Host interface that the MCP WEPPY Dashboard HTTP server binds to.")})}),e.jsx("dd",{children:j.cold.HTTP_HOST}),e.jsx("dt",{children:e.jsx(x,{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(j.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(x,{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(x,{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:o=>r(o.target.value),children:[e.jsx("option",{value:de,children:t("settings.language.auto","Auto")}),ue.map(o=>e.jsx("option",{value:o,children:lt[o]??o},o))]})})]})]})]})}export{ft as Component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._progressPromoWrap_1j3p3_1{display:flex;flex-direction:column;gap:8px}._progressPromo_1j3p3_1{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:14px 20px;display:flex;align-items:center;gap:16px}._progressMain_1j3p3_17{flex:1;min-width:0}._progressLabel_1j3p3_22{font-family:var(--font-label);font-size:11px;color:var(--text-secondary);margin-bottom:6px;display:flex;justify-content:space-between;gap:12px}._progressBar_1j3p3_32{height:6px;background:var(--bg-secondary);border-radius:3px;overflow:hidden}._progressFill_1j3p3_39{height:100%;background:var(--pro-badge);border-radius:3px;transition:width var(--transition)}._progressTextGroup_1j3p3_46{display:flex;flex-direction:column;gap:3px}._progressText_1j3p3_46{font-family:var(--font-label);font-size:13px;color:var(--pro-badge);white-space:nowrap;font-weight:500}._actions_1j3p3_60{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}._btn_1j3p3_68{display:inline-flex;align-items:center;justify-content:center;font-family:var(--font-label);font-size:12px;padding:6px 14px;border-radius:4px;border:1px solid var(--border);background:var(--bg-secondary);color:var(--text-primary);cursor:pointer;text-decoration:none;transition:background var(--transition),border-color var(--transition),opacity var(--transition)}._btn_1j3p3_68:hover{border-color:var(--accent);background:var(--accent-dim)}._btnOutline_1j3p3_89{border-color:var(--pro-badge);color:var(--pro-badge)}._btnOutline_1j3p3_89:hover{background:var(--pro-bg-soft);border-color:var(--pro-badge)}._btnPrimary_1j3p3_99{background:var(--pro-badge);color:var(--pro-text-on-badge);border-color:var(--pro-badge)}._btnPrimary_1j3p3_99:hover{opacity:.9}._panel_1j3p3_109{background:linear-gradient(180deg,var(--pro-bg-soft),transparent 60%),var(--bg-secondary);border:1px solid var(--pro-border);border-radius:var(--radius);padding:24px 20px}._panelIcon_1j3p3_116{font-size:32px;margin-bottom:12px;text-align:center}._panelTitle_1j3p3_122{font-family:var(--font-label);font-size:15px;font-weight:600;color:var(--pro-text);margin-bottom:8px;text-align:center}._panelDesc_1j3p3_131{font-size:13px;color:var(--text-secondary);margin-bottom:16px;line-height:1.5;text-align:center}._benefitList_1j3p3_139{list-style:none;padding:0;margin:0 0 16px;display:flex;flex-direction:column;gap:4px}._benefitItem_1j3p3_148{font-size:12px;color:var(--text-secondary);padding-left:16px;position:relative}._benefitItem_1j3p3_148:before{content:"+";position:absolute;left:0;color:var(--pro-badge);font-weight:600}@media(max-width:720px){._progressPromo_1j3p3_1{flex-direction:column;align-items:stretch}._progressText_1j3p3_46{white-space:normal}._actions_1j3p3_60{justify-content:stretch}._btn_1j3p3_68{width:100%}}._page_3a7tv_2{display:flex;flex-direction:column;gap:16px;max-width:900px}._card_3a7tv_10{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:16px 20px}._cardHeader_3a7tv_17{font-family:var(--font-label);font-size:13px;font-weight:600;color:var(--text-primary);margin-bottom:12px;display:flex;align-items:center;justify-content:space-between;gap:8px}._clearButton_3a7tv_29{border:1px solid var(--danger-border);background:var(--danger-bg);color:var(--danger-text);border-radius:var(--radius-control);padding:6px 12px;font-family:var(--font-label);font-size:12px;font-weight:600;cursor:pointer;transition:background var(--transition),border-color var(--transition),color var(--transition)}._clearButton_3a7tv_29:hover{background:var(--danger-hover-bg);border-color:var(--danger)}._clearButton_3a7tv_29:focus-visible{outline:none;box-shadow:var(--focus-ring)}._statusRow_3a7tv_53{display:flex;align-items:center;gap:12px;margin-bottom:8px}._metaItem_3a7tv_60{font-family:var(--font-code);font-size:12px;color:var(--text-secondary)}._statusGrid_3a7tv_66{display:grid;grid-template-columns:auto 1fr;gap:4px 16px;font-size:12px}._statusGrid_3a7tv_66 dt{color:var(--text-secondary);font-family:var(--font-label)}._statusGrid_3a7tv_66 dd{margin:0;font-family:var(--font-code);color:var(--text-primary)}._table_3a7tv_85{width:100%;border-collapse:collapse;font-family:var(--font-code);font-size:12px}._table_3a7tv_85 th{text-align:left;padding:6px 12px;border-bottom:1px solid var(--border);color:var(--text-secondary);font-family:var(--font-label);font-weight:500;font-size:11px}._table_3a7tv_85 td{padding:6px 12px;border-bottom:1px solid var(--border);color:var(--text-primary)}._table_3a7tv_85 tr:last-child td{border-bottom:none}._deletePolicyRow_3a7tv_112{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:12px;margin-bottom:10px;font-size:12px}._deletePolicyRow_3a7tv_112>[data-tooltip-text]{justify-self:end}._deletePolicyBadge_3a7tv_125{min-height:20px}._directionRail_3a7tv_130{display:inline-flex;align-items:center;gap:10px}._endpointLabel_3a7tv_136{color:var(--text-secondary)}._optionRail_3a7tv_140{display:inline-flex;align-items:center;gap:6px}._directionOption_3a7tv_146{display:inline-flex;align-items:center;justify-content:center;width:28px;height:24px;border-radius:var(--radius-control);border:1px solid var(--border);font-family:var(--font-code);font-size:13px;cursor:help;-webkit-user-select:none;user-select:none}._directionOptionActive_3a7tv_160{background:var(--bg-secondary)}._directionOptionInactive_3a7tv_164{background:transparent;opacity:.45;color:var(--text-muted)}._directionOptionActive_3a7tv_160._direction_forward_3a7tv_170{color:var(--success)}._directionOptionActive_3a7tv_160._direction_bidirectional_3a7tv_174{color:var(--accent)}._directionOptionActive_3a7tv_160._direction_reverse_3a7tv_178{color:var(--warning)}._lockBadge_3a7tv_183{display:inline-block;margin-left:6px;font-size:11px;color:var(--text-muted)}._proBadge_3a7tv_191{display:inline-block;margin-left:6px;padding:1px 5px;font-size:9px;font-weight:600;letter-spacing:.05em;color:var(--pro-text-on-badge);background:var(--pro-badge);border-radius:var(--radius-control);vertical-align:middle}._forwardBadge_3a7tv_205{display:inline-flex;align-items:center;min-height:20px;padding:2px 8px;font-size:10px;font-weight:600;letter-spacing:.04em;color:var(--text-secondary);background:var(--bg-secondary);border:1px solid var(--border);border-radius:var(--radius-control)}._logContainer_3a7tv_220{max-height:240px;overflow-y:auto;font-family:var(--font-code);font-size:11px}._logEntry_3a7tv_227{display:flex;gap:10px;padding:3px 0;border-bottom:1px solid var(--border);color:var(--text-primary)}._logEntry_3a7tv_227:last-child{border-bottom:none}._logTime_3a7tv_239{color:var(--text-muted);flex-shrink:0;width:44px}._logType_3a7tv_245{font-weight:500;flex-shrink:0;width:90px;text-transform:uppercase;font-size:10px;letter-spacing:.04em}._logTypeWrite_3a7tv_254{color:var(--success)}._logTypeUpdate_3a7tv_258{color:var(--accent)}._logTypeDelete_3a7tv_262{color:var(--error)}._logTypeIdle_3a7tv_266{color:var(--text-muted)}._logPath_3a7tv_270{color:var(--text-secondary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._logEmpty_3a7tv_277{color:var(--text-muted);font-style:italic;padding:8px 0}._overlay_3a7tv_284{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:48px 24px;gap:16px}._overlayTitle_3a7tv_294{font-family:var(--font-label);font-size:15px;font-weight:600;color:var(--text-primary)}._overlayMessage_3a7tv_301{font-size:13px;color:var(--text-secondary);max-width:400px}._checklist_3a7tv_307{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:8px;text-align:left}._checkItem_3a7tv_317{font-family:var(--font-code);font-size:12px;color:var(--text-secondary);padding-left:20px;position:relative}._checkItem_3a7tv_317:before{content:"○";position:absolute;left:0;color:var(--text-muted)}._upgradePanel_3a7tv_333{background:var(--bg-secondary);border:1px solid var(--border);border-radius:var(--radius);padding:16px 20px}._upgradePanelHeader_3a7tv_340{font-family:var(--font-label);font-size:13px;font-weight:600;color:var(--accent);margin-bottom:8px}._benefitList_3a7tv_348{list-style:none;padding:0;margin:0 0 12px;display:flex;flex-direction:column;gap:4px}._benefitItem_3a7tv_357{font-size:12px;color:var(--text-secondary);padding-left:16px;position:relative}._benefitItem_3a7tv_357:before{content:"+";position:absolute;left:0;color:var(--accent);font-weight:600}._upgradeActions_3a7tv_372{display:flex;gap:8px}._btn_3a7tv_377{font-family:var(--font-label);font-size:12px;padding:6px 14px;border-radius:var(--radius-control);border:1px solid var(--border);background:var(--bg-secondary);color:var(--text-primary);cursor:pointer;transition:background var(--transition),border-color var(--transition)}._btn_3a7tv_377:hover{border-color:var(--accent);background:var(--accent-dim)}._btnPrimary_3a7tv_394{background:var(--accent);color:var(--bg-card);border-color:var(--accent)}._btnPrimary_3a7tv_394:hover{opacity:.9}._disabled_3a7tv_405{opacity:.4;pointer-events:none}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{r as l,a as N,D,e as k,d as A,m as E,j as t,u as $,f as B,h as O,l as H,k as M,T as F}from"./index-CnXGGM07.js";import{P as U,B as W}from"./PageHeader-Bfy2f-GH.js";import{I as _}from"./InfoLabel-BAhsgLcj.js";import{T as v}from"./TooltipText-CGH7dKN6.js";import{C as q}from"./ConfirmModal-BqCEvp7Y.js";import{C as L}from"./CurrentPlaceScope-C8U9I15o.js";import{S as G}from"./StatusBadge-Df9BQsJU.js";import"./ConfirmModal.module-D1aZY2bQ.js";const z=5e3;function V(){const[e,a]=l.useState(null),[o,c]=l.useState([]),[d,r]=l.useState(!0),[u,w]=l.useState(null),m=l.useRef(null),g=l.useRef(null),p=l.useCallback(async()=>{var y;try{const[P,I]=await Promise.all([N.get("/sync/status"),N.get("/api/dashboard/place-summary")]);a(P);const i=(y=I.places)==null?void 0:y.find(b=>b.isActive);w((i==null?void 0:i.placeDirName)??null)}catch{}},[]),f=l.useCallback(async()=>{try{const y=await N.get("/sync/history",{limit:"30"});c(y.entries??[])}catch{c([])}},[]),x=l.useCallback(async()=>{await Promise.all([p(),f()]),r(!1)},[p,f]),T=l.useCallback(()=>{x()},[x]),n=l.useCallback(async()=>{await N.post("/api/dashboard/sync/history/clear"),c([]),p()},[p]);return l.useEffect(()=>(x(),g.current=setInterval(x,z),()=>{g.current&&clearInterval(g.current)}),[x]),l.useEffect(()=>{const y=new D;m.current=y,y.connect();const P=y.on("sync",()=>{p(),f()});return()=>{P(),y.disconnect(),m.current=null}},[p,f]),{status:e,history:o,loading:d,activePlaceDirName:u,refresh:T,clearHistory:n}}const Y="_actions_1j3p3_60",J="_btn_1j3p3_68",Q="_btnPrimary_1j3p3_99",X="_panel_1j3p3_109",Z="_panelIcon_1j3p3_116",K="_panelTitle_1j3p3_122",ee="_panelDesc_1j3p3_131",te="_benefitList_1j3p3_139",se="_benefitItem_1j3p3_148",h={actions:Y,btn:J,btnPrimary:Q,panel:X,panelIcon:Z,panelTitle:K,panelDesc:ee,benefitList:te,benefitItem:se};function ne({icon:e,title:a,description:o,benefits:c,upgradeLabel:d,upgradeHref:r}){const{trackEvent:u}=k(),{pathname:w,search:m}=A(),g=E(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:a}),t.jsx("div",{className:h.panelDesc,children:o}),t.jsx("ul",{className:h.benefitList,children:c.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:()=>u("dashboard_click_event",{click_target:"upgrade_cta",placement:"tier_panel",...g}),children:d})})]})}const ae="_page_3a7tv_2",ie="_card_3a7tv_10",oe="_cardHeader_3a7tv_17",ce="_clearButton_3a7tv_29",le="_statusRow_3a7tv_53",re="_metaItem_3a7tv_60",de="_statusGrid_3a7tv_66",pe="_table_3a7tv_85",ye="_deletePolicyRow_3a7tv_112",ue="_deletePolicyBadge_3a7tv_125",_e="_directionRail_3a7tv_130",he="_endpointLabel_3a7tv_136",me="_optionRail_3a7tv_140",ge="_directionOption_3a7tv_146",fe="_directionOptionActive_3a7tv_160",ve="_directionOptionInactive_3a7tv_164",xe="_direction_forward_3a7tv_170",be="_direction_bidirectional_3a7tv_174",je="_direction_reverse_3a7tv_178",we="_lockBadge_3a7tv_183",Pe="_proBadge_3a7tv_191",Te="_forwardBadge_3a7tv_205",Ne="_logContainer_3a7tv_220",Ie="_logEntry_3a7tv_227",Se="_logTime_3a7tv_239",Ce="_logType_3a7tv_245",Le="_logTypeWrite_3a7tv_254",Re="_logTypeUpdate_3a7tv_258",ke="_logTypeDelete_3a7tv_262",De="_logTypeIdle_3a7tv_266",Ae="_logPath_3a7tv_270",Ee="_logEmpty_3a7tv_277",$e="_overlay_3a7tv_284",Be="_overlayTitle_3a7tv_294",Oe="_overlayMessage_3a7tv_301",He="_checklist_3a7tv_307",Me="_checkItem_3a7tv_317",Fe="_upgradePanel_3a7tv_333",Ue="_upgradePanelHeader_3a7tv_340",We="_benefitList_3a7tv_348",qe="_benefitItem_3a7tv_357",Ge="_upgradeActions_3a7tv_372",ze="_btn_3a7tv_377",Ve="_btnPrimary_3a7tv_394",Ye="_disabled_3a7tv_405",s={page:ae,card:ie,cardHeader:oe,clearButton:ce,statusRow:le,metaItem:re,statusGrid:de,table:pe,deletePolicyRow:ye,deletePolicyBadge:ue,directionRail:_e,endpointLabel:he,optionRail:me,directionOption:ge,directionOptionActive:fe,directionOptionInactive:ve,direction_forward:xe,direction_bidirectional:be,direction_reverse:je,lockBadge:we,proBadge:Pe,forwardBadge:Te,logContainer:Ne,logEntry:Ie,logTime:Se,logType:Ce,logTypeWrite:Le,logTypeUpdate:Re,logTypeDelete:ke,logTypeIdle:De,logPath:Ae,logEmpty:Ee,overlay:$e,overlayTitle:Be,overlayMessage:Oe,checklist:He,checkItem:Me,upgradePanel:Fe,upgradePanelHeader:Ue,benefitList:We,benefitItem:qe,upgradeActions:Ge,btn:ze,btnPrimary:Ve,disabled:Ye},Je=[{key:"forward",symbol:"←"},{key:"bidirectional",symbol:"↔"},{key:"reverse",symbol:"→"}];function Qe(e){const a=new Date(e);return`${String(a.getHours()).padStart(2,"0")}:${String(a.getMinutes()).padStart(2,"0")}`}function Xe(e){switch(e){case"write":return s.logTypeWrite;case"update":return s.logTypeUpdate;case"delete":return s.logTypeDelete;default:return s.logTypeIdle}}function Ze(e){switch(e){case"syncing":return"syncing";case"initializing":return"initializing";case"idle":return"idle";default:return"offline"}}function Ke(e,a,o,c){const d=e(`sync.directions.cat.${a}`,a.charAt(0).toUpperCase()+a.slice(1)),r=e("sync.directions.endpoint.local","Local"),u=e("sync.directions.endpoint.studio","Studio");switch(o){case"forward":return[`${d}: ${r} <- ${u}`,e("sync.directions.tooltip.forward.body","Studio changes sync to local files only")].join(`
|
|
2
|
-
`);case"bidirectional":return[`${d}: ${r} <-> ${u}`,e("sync.directions.tooltip.bidirectional.body","Two-way sync between Local and Studio"),c?e("sync.directions.tooltip.proRequired","Pro required in Basic tier"):""].filter(Boolean).join(`
|
|
3
|
-
`);case"reverse":return[`${d}: ${r} -> ${u}`,e("sync.directions.tooltip.reverse.body","Push local file changes to Studio"),c?e("sync.directions.tooltip.proRequired","Pro required in Basic tier"):""].filter(Boolean).join(`
|
|
4
|
-
`);default:return d}}const et=["scripts","values","containers","data","services"];function tt(e,a){return a==="manual"?e("sync.directions.mode.manual","Manual"):a==="auto"?e("sync.directions.mode.auto","Auto"):"-"}function R(...e){const a=e[0]??"",o=a.includes("\\")&&!a.includes("/")?"\\":"/";return e.filter(c=>c.length>0).map((c,d)=>d===0?c.replace(/[\\/]+$/g,""):c.replace(/^[\\/]+|[\\/]+$/g,"")).join(o)}function st(e){const a=e.replace(/[\\/]+$/g,""),o=a.split(/[\\/]+/);return o[o.length-1]??a}function nt(e,a){const o=st(e);return o==="explorer"?e:o===a?R(e,"explorer"):R(e,a,"explorer")}function at(e,a){return a==="manual"?e("sync.directions.mode.manual.tooltip","Applies sync changes only when you trigger them manually."):a==="auto"?e("sync.directions.mode.auto.tooltip","Applies sync changes automatically when updates arrive."):""}function it(e,a){return a===!0?e("sync.directions.deletePolicy.auto","Auto Delete"):e("sync.directions.deletePolicy.ask","Ask Before Delete")}function ot(e,a){return a===!0?e("sync.directions.deletePolicy.auto.tooltip","Deleted local files can remove matching Studio instances automatically."):e("sync.directions.deletePolicy.ask.tooltip","Deleted local files are reviewed before Studio instances are removed.")}function ct(e,a){switch(a){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 lt(e,a){switch(a){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 gt(){const{t:e}=$(),{trackEvent:a}=k(),{level:o}=B(),{tier:c,loading:d}=O(),r=V(),{show:u}=H(),[w,m]=l.useState(!1),[g,p]=l.useState(!1),f=!d&&c==="basic",x=o==="disconnected"||o==="serverOnly",T=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:o,tier:c}});if(x)return t.jsxs("div",{className:s.page,children:[T,t.jsx(L,{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,y=r.history,P=Ze(n==null?void 0:n.state),I=async()=>{p(!0);try{await r.clearHistory(),u(e("toast.clearSuccess","Cleared successfully"),"success"),m(!1)}catch{u(e("toast.clearFailed","Failed to clear data"),"error")}finally{p(!1)}};return t.jsxs("div",{className:s.page,children:[T,t.jsx(L,{surface:"sync"}),t.jsxs("div",{className:s.card,children:[t.jsxs("div",{className:s.cardHeader,children:[t.jsx(v,{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(v,{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(G,{status:P}),(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:nt(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(v,{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("div",{className:s.deletePolicyRow,children:[t.jsx(_,{label:e("sync.directions.deletePolicy","Delete Policy"),tooltip:e("sync.directions.deletePolicy.tooltip","Controls whether local file deletes can remove matching Studio instances automatically.")}),t.jsx(v,{text:ot(e,n.autoApplyDeletes),children:t.jsx(W,{variant:n.autoApplyDeletes===!0?"warning":"neutral",className:s.deletePolicyBadge,children:it(e,n.autoApplyDeletes)})})]}),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:et.map(i=>{var C;const b=n.directions[i],S=(C=n.applyModes)==null?void 0:C[i];return t.jsxs("tr",{children:[t.jsx("td",{children:e(`sync.directions.cat.${i}`,i.charAt(0).toUpperCase()+i.slice(1))}),t.jsx("td",{children:t.jsxs("div",{className:s.directionRail,"aria-label":`${i}-direction-rail`,children:[t.jsx(v,{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:Je.map(j=>t.jsx(M,{text:Ke(e,i,j.key,f),children:t.jsx("span",{className:`${s.directionOption} ${b===j.key?s.directionOptionActive:s.directionOptionInactive} ${s[`direction_${j.key}`]??""}`,"data-active":b===j.key?"true":"false",children:j.symbol})},j.key))}),t.jsx(v,{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(v,{text:at(e,S),children:tt(e,S)})})]},i)})})]})]}),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:()=>{a("dashboard_click_event",{click_target:"sync_clear_log",page:"sync"}),m(!0)},children:e("common.clear","Clear")})]}),t.jsx("div",{className:s.logContainer,children:y.length===0?t.jsx("div",{className:s.logEmpty,children:e("sync.log.empty","No sync events yet")}):y.map((i,b)=>t.jsxs("div",{className:s.logEntry,children:[t.jsx("span",{className:s.logTime,children:Qe(i.timestamp)}),t.jsx(v,{text:lt(e,i.type),children:t.jsx("span",{className:`${s.logType} ${Xe(i.type)}`,children:ct(e,i.type)})}),t.jsxs("span",{className:s.logPath,children:[i.path,i.details?` — ${i.details}`:""]})]},b))})]}),f&&t.jsx(ne,{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(q,{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{gt as Component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as s,r as n,a as O,D as nt,u as ct,e as dt,l as ut}from"./index-CnXGGM07.js";import{P as pt}from"./PageHeader-Bfy2f-GH.js";import{T as M}from"./TooltipText-CGH7dKN6.js";import{C as ht}from"./ConfirmModal-BqCEvp7Y.js";import{C as mt}from"./CurrentPlaceScope-C8U9I15o.js";import{T as bt}from"./Tabs-Ccrw7Hjb.js";import"./ConfirmModal.module-D1aZY2bQ.js";const xt="_wrapper_hzgda_2",ft="_table_hzgda_7",gt="_sortable_hzgda_32",_t="_sortArrow_hzgda_41",wt="_clickable_hzgda_52",yt="_empty_hzgda_57",Ct="_expandedRow_hzgda_65",jt="_expandedCell_hzgda_74",T={wrapper:xt,table:ft,sortable:gt,sortArrow:_t,clickable:wt,empty:yt,expandedRow:Ct,expandedCell:jt};function kt({columns:t,data:a,sortBy:x,sortDir:z="asc",onSort:P,onRowClick:i,rowKey:j,emptyMessage:k,expandedKey:B,renderExpandedRow:N}){return s.jsx("div",{className:T.wrapper,children:s.jsxs("table",{className:T.table,children:[s.jsx("thead",{children:s.jsx("tr",{children:t.map(u=>s.jsxs("th",{style:u.width?{width:u.width}:void 0,className:u.sortable?T.sortable:void 0,onClick:u.sortable&&P?()=>P(u.key):void 0,children:[s.jsx("span",{children:u.label}),u.sortable&&x===u.key&&s.jsx("span",{className:T.sortArrow,children:z==="asc"?"▴":"▾"})]},u.key))})}),s.jsx("tbody",{children:a.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:t.length,className:T.empty,children:k||"No data"})}):a.map((u,E)=>{const R=j?j(u):String(E),h=B!=null&&R===B&&N?N(u):null;return s.jsxs(n.Fragment,{children:[s.jsx("tr",{className:i?T.clickable:void 0,onClick:i?()=>i(u):void 0,children:t.map(y=>s.jsx("td",{children:y.render?y.render(u):String(u[y.key]??"")},y.key))}),h&&s.jsx("tr",{className:T.expandedRow,children:s.jsx("td",{colSpan:t.length,className:T.expandedCell,children:h})})]},R)})})]})})}function St(t){return{...t,sequenceNumber:typeof t.sequenceNumber=="number"?t.sequenceNumber:void 0,executionTimeMs:typeof t.executionTimeMs=="number"?t.executionTimeMs:void 0}}const Tt=50;function Nt(t){if(typeof t=="number")return{placeId:String(t)}}function Z(t,a){return typeof a!="number"?t:`${t}?placeId=${encodeURIComponent(String(a))}`}function vt(t){const a=(t==null?void 0:t.placeId)??null,[x,z]=n.useState(null),[P,i]=n.useState(!0),[j,k]=n.useState([]),[B,N]=n.useState(0),[u,E]=n.useState(!1),[R,w]=n.useState(!0),[h,y]=n.useState(0),[f,L]=n.useState(""),F=n.useRef(null),m=n.useCallback(async()=>{i(!0);try{const c=Nt(a),C=c?await O.get("/api/dashboard/tool-stats",c):await O.get("/api/dashboard/tool-stats");z(C)}catch{}finally{i(!1)}},[a]),_=n.useCallback(async(c,C)=>{w(!0);try{const H={limit:String(Tt),offset:String(c)};C&&(H.tool=C),typeof a=="number"&&(H.placeId=String(a));const I=await O.get("/api/dashboard/history",H);k(I.entries.map(St)),N(I.total),E(I.hasMore)}catch{k([]),N(0),E(!1)}finally{w(!1)}},[a]),U=n.useCallback(()=>{m(),_(h,f)},[_,m,h,f]),V=n.useCallback(async()=>{await O.post(Z("/api/dashboard/tools/history/clear",a)),_(h,f)},[_,h,f,a]),$=n.useCallback(async()=>{await O.post(Z("/api/dashboard/tools/statistics/clear",a)),m()},[m,a]);return n.useEffect(()=>{m()},[m]),n.useEffect(()=>{_(h,f)},[_,h,f]),n.useEffect(()=>{const c=new nt;F.current=c,c.connect();const C=c.on("command",()=>{m(),_(h,f)});return()=>{C(),c.disconnect(),F.current=null}},[_,m,h,f]),{statistics:x,statsLoading:P,history:j,historyTotal:B,historyHasMore:u,historyLoading:R,historyOffset:h,historyToolFilter:f,setHistoryOffset:y,setHistoryToolFilter:L,refresh:U,clearHistory:V,clearStatistics:$}}const Mt="_page_1wi3z_2",zt="_card_1wi3z_12",Pt="_cardToolbar_1wi3z_19",Bt="_sectionTitle_1wi3z_27",Et="_dangerButton_1wi3z_33",Rt="_proBadge_1wi3z_52",Lt="_statusOk_1wi3z_67",It="_statusFallback_1wi3z_80",At="_statusUnsupported_1wi3z_93",Ht="_statusWarning_1wi3z_106",Ot="_statusError_1wi3z_119",Ft="_tierBasic_1wi3z_133",$t="_tierPro_1wi3z_137",qt="_tierMixed_1wi3z_142",Dt="_filterRow_1wi3z_153",Wt="_filterLabel_1wi3z_160",Ut="_filterSelect_1wi3z_169",Vt="_expandedRow_1wi3z_185",Kt="_expandedSection_1wi3z_190",Gt="_detailList_1wi3z_200",Jt="_detailItem_1wi3z_206",Qt="_detailLabel_1wi3z_212",Zt="_detailValue_1wi3z_217",Xt="_pre_1wi3z_222",Yt="_pagination_1wi3z_239",te="_pageInfo_1wi3z_247",ee="_btn_1wi3z_253",se="_tierDistribution_1wi3z_281",oe="_tierBarWrap_1wi3z_285",ae="_tierBarBasic_1wi3z_293",re="_tierBarPro_1wi3z_298",le="_tierLabels_1wi3z_303",ie="_statsTableWrap_1wi3z_312",ne="_statsTable_1wi3z_312",ce="_sortableHeader_1wi3z_343",de="_sortArrow_1wi3z_348",ue="_statsToolRow_1wi3z_352",pe="_statsActionRow_1wi3z_360",he="_expandButton_1wi3z_364",me="_expandIcon_1wi3z_376",be="_actionLabel_1wi3z_381",xe="_emptyStats_1wi3z_388",fe="_summaryLine_1wi3z_394",o={page:Mt,card:zt,cardToolbar:Pt,sectionTitle:Bt,dangerButton:Et,proBadge:Rt,statusOk:Lt,statusFallback:It,statusUnsupported:At,statusWarning:Ht,statusError:Ot,tierBasic:Ft,tierPro:$t,tierMixed:qt,filterRow:Dt,filterLabel:Wt,filterSelect:Ut,expandedRow:Vt,expandedSection:Kt,detailList:Gt,detailItem:Jt,detailLabel:Qt,detailValue:Zt,pre:Xt,pagination:Yt,pageInfo:te,btn:ee,tierDistribution:se,tierBarWrap:oe,tierBarBasic:ae,tierBarPro:re,tierLabels:le,statsTableWrap:ie,statsTable:ne,sortableHeader:ce,sortArrow:de,statsToolRow:ue,statsActionRow:pe,expandButton:he,expandIcon:me,actionLabel:be,emptyStats:xe,summaryLine:fe},K=50,ge=new Set(["clientId","placeId","pinnedTarget","recentPriority","globalQueue"]);function _e(t){const a=new Date(t);return`${String(a.getHours()).padStart(2,"0")}:${String(a.getMinutes()).padStart(2,"0")}:${String(a.getSeconds()).padStart(2,"0")}`}function W(t){return typeof t!="number"||!Number.isFinite(t)?"-":t<1e3?`${t}ms`:`${(t/1e3).toFixed(1)}s`}function A(t,a){return a==="pro"?t("tier.pro","Pro"):a==="mixed"?t("tier.mixed","Mixed"):t("tier.basic","Basic")}function tt(t,a){return a!==t&&a.startsWith(`${t}_`)?a.slice(t.length+1):""}function we(t,a){const x=tt(t,a);return x?`${t}.${x}`:t}function X(t){return typeof t=="string"&&t.length>0?t:void 0}function ye(t){if(!Array.isArray(t))return;const a=t.filter(x=>typeof x=="string"&&x.length>0);return a.length>0?a:void 0}function Ce(t){const a=t.result??{};return{requestedCommand:t.requestedCommand??X(a.requestedCommand),executedCommand:t.executedCommand??X(a.executedCommand),alternatives:t.alternatives??ye(a.alternatives)}}function je(t,a){switch(t.status){case"fallback":return{label:a("tools.badge.fallback","FALLBACK"),tooltip:a("tools.badge.fallback.tooltip","The requested Pro action succeeded via a Basic fallback."),className:o.statusFallback};case"unsupported":return{label:a("tools.badge.unsupported","UNSUPPORTED"),tooltip:a("tools.badge.unsupported.tooltip","The requested Pro action was blocked and no fallback ran."),className:o.statusUnsupported};case"warning":return{label:a("tools.badge.warn","WARN"),tooltip:a("tools.badge.warn.tooltip","The tool call failed as an expected caller, project, policy, or user-code issue."),className:o.statusWarning};case"error":return{label:a("tools.badge.err","FAILED"),tooltip:a("tools.badge.err.tooltip","The tool run failed."),className:o.statusError};default:return{label:a("tools.status.ok","OK"),tooltip:a("tools.status.ok.tooltip","The tool run completed successfully."),className:o.statusOk}}}function g(t,a){return s.jsxs("div",{className:o.detailItem,children:[s.jsx("span",{className:o.detailLabel,children:t}),s.jsx("span",{className:o.detailValue,children:a})]})}function ke(t){if(!t||typeof t!="object")return;const a=t;if(typeof a.selectionMode=="string"&&ge.has(a.selectionMode))return a}function Y(t){if(!(!t||typeof t!="object"||!("routing"in t)))return ke(t.routing)}function Se(t){return t.routing??Y(t.result)??Y(t.data)}function Te(t,a){return t.requestedClientId?t.requestedClientId:t.requestedPlaceId!==void 0?t.requestedPlaceId:a("tools.history.routing.none","No Studio target named")}function Ne(t){return t.actualPlaceName?`${t.actualPlaceName} · ${t.actualPlaceId??"-"}`:t.actualClientId??"-"}function Ie(){const{t}=ct(),{trackEvent:a,trackPageView:x}=dt(),[z,P]=n.useState(null),i=vt({placeId:z}),{show:j}=ut(),[k,B]=n.useState("history"),[N,u]=n.useState(null),[E,R]=n.useState(null),[w,h]=n.useState(null),[y,f]=n.useState(!1),[L,F]=n.useState("totalCalls"),[m,_]=n.useState("desc"),U=n.useCallback(e=>{F(r=>r===e?(_(l=>l==="asc"?"desc":"asc"),e):(_("desc"),e))},[]),V=n.useMemo(()=>{var r;const e=new Set;return Object.keys(((r=i.statistics)==null?void 0:r.tools)??{}).forEach(l=>e.add(l)),i.history.forEach(l=>{l.tool&&e.add(l.tool)}),i.historyToolFilter&&e.add(i.historyToolFilter),Array.from(e).sort()},[i.history,i.historyToolFilter,i.statistics]),$=n.useMemo(()=>{var e;return(e=i.statistics)!=null&&e.tools?Object.values(i.statistics.tools).map(r=>{var Q;const l=Object.entries(r.commands??{}).map(([p,d])=>({toolName:r.tool,commandName:d.command??p,label:tt(r.tool,d.command??p)||(d.command??p),tier:d.tier,totalCalls:d.totalCalls,successCount:d.successCount,fallbackCount:d.fallbackCount,unsupportedCount:d.unsupportedCount,warningCount:d.warningCount??0,failureCount:d.failureCount,totalExecutionTimeMs:d.totalExecutionTimeMs,avgExecutionTimeMs:d.avgExecutionTimeMs})),b=l.reduce((p,d)=>p+d.totalCalls,0),S=l.reduce((p,d)=>p+d.successCount,0),q=l.reduce((p,d)=>p+d.fallbackCount,0),D=l.reduce((p,d)=>p+d.unsupportedCount,0),rt=l.reduce((p,d)=>p+d.warningCount,0),lt=l.reduce((p,d)=>p+d.failureCount,0),J=l.reduce((p,d)=>p+d.totalExecutionTimeMs,0),it=new Set(l.map(p=>p.tier)).size>1?"mixed":((Q=l[0])==null?void 0:Q.tier)??r.tier;return{toolName:r.tool,tier:it,commands:l,totalCalls:b,successCount:S,fallbackCount:q,unsupportedCount:D,warningCount:rt,failureCount:lt,totalExecutionTimeMs:J,avgExecutionTimeMs:b>0?Math.round(J/b):0}}):[]},[i.statistics]),c=n.useCallback((e,r,l,b)=>s.jsx(M,{text:t(l,b),children:t(e,r)}),[t]),C=n.useMemo(()=>[...$].sort((r,l)=>{const b=r[L],S=l[L];if(typeof b=="number"&&typeof S=="number")return m==="asc"?b-S:S-b;const q=String(b??""),D=String(S??"");return m==="asc"?q.localeCompare(D):D.localeCompare(q)}),[$,L,m]),H=n.useMemo(()=>[{key:"timestamp",label:c("tools.col.time","Time","tools.col.time.tooltip","When the tool run was recorded."),width:"80px",render:e=>_e(e.timestamp)},{key:"toolName",label:c("tools.col.toolAction","Tool.Action","tools.col.toolAction.tooltip","Tool name and action that were executed."),render:e=>s.jsxs("span",{children:[we(e.tool,e.command),e.tier==="pro"&&s.jsx(M,{text:t("tools.badge.pro.tooltip","This entry used a Pro-only tool or action."),children:s.jsx("span",{className:o.proBadge,children:t("tools.badge.pro","PRO")})})]})},{key:"executionTimeMs",label:c("tools.col.duration","Duration","tools.col.duration.tooltip","How long the tool took to finish."),width:"80px",render:e=>W(e.executionTimeMs)},{key:"status",label:c("tools.col.status","Status","tools.col.status.tooltip","Outcome of the recorded tool run."),width:"120px",render:e=>{const r=je(e,t);return s.jsx(M,{text:r.tooltip,children:s.jsx("span",{className:r.className,children:r.label})})}},{key:"tier",label:c("tools.col.tier","Tier","tools.col.tier.tooltip","License tier required for the tool or action."),width:"60px",render:e=>s.jsx("span",{className:e.tier==="pro"?o.tierPro:o.tierBasic,children:A(t,e.tier)})}],[t,c]),I=n.useMemo(()=>[{key:"toolName",label:c("tools.col.tool","Tool","tools.col.tool.tooltip","Consolidated tool name in the statistics table."),sortable:!0},{key:"totalCalls",label:c("tools.col.calls","Calls","tools.col.calls.tooltip","Total number of recorded calls for this tool."),sortable:!0,width:"70px"},{key:"successCount",label:c("tools.col.ok","OK","tools.col.ok.tooltip","Number of direct successful runs."),sortable:!0,width:"70px"},{key:"fallbackCount",label:c("tools.col.fallback","FALLBACK","tools.col.fallback.tooltip","Number of runs that succeeded through fallback execution."),sortable:!0,width:"110px"},{key:"unsupportedCount",label:c("tools.col.unsupported","UNSUPPORTED","tools.col.unsupported.tooltip","Number of blocked runs without fallback execution."),sortable:!0,width:"130px"},{key:"warningCount",label:c("tools.col.warn","WARN","tools.col.warn.tooltip","Number of expected failures caused by caller input, project state, Roblox policy, or user code."),sortable:!0,width:"80px"},{key:"failureCount",label:c("tools.col.err","FAILED","tools.col.err.tooltip","Number of runs that failed."),sortable:!0,width:"70px"},{key:"avgExecutionTimeMs",label:c("tools.col.avgTime","Avg Time","tools.col.avgTime.tooltip","Average execution time across recorded calls."),sortable:!0,width:"90px",render:e=>W(e.avgExecutionTimeMs)},{key:"tier",label:c("tools.col.tier","Tier","tools.col.tierStats.tooltip","Basic, Pro, or Mixed summary for the tool statistics row."),sortable:!0,width:"70px",render:e=>s.jsx(M,{text:e.tier==="mixed"?t("tools.tier.mixed.tooltip","This tool includes both Basic and Pro actions."):"",children:s.jsx("span",{className:e.tier==="pro"?o.tierPro:e.tier==="mixed"?o.tierMixed:o.tierBasic,children:A(t,e.tier)})})}],[t,c]),v=n.useMemo(()=>{if(!i.statistics)return null;const e=i.statistics.tierSummary.basic.totalCalls,r=i.statistics.tierSummary.pro.totalCalls,l=e+r;if(l===0)return null;const b=Math.round(e/l*100),S=100-b;return{basic:e,pro:r,basicPct:b,proPct:S}},[i.statistics]),G=n.useCallback(e=>{R(r=>r===e?null:e)},[]),et=n.useCallback(async()=>{if(w){f(!0);try{w==="history"?await i.clearHistory():await i.clearStatistics(),j(t("toast.clearSuccess","Cleared successfully"),"success"),h(null)}catch{j(t("toast.clearFailed","Failed to clear data"),"error")}finally{f(!1)}}},[w,j,t,i]),st=n.useCallback(e=>{const r=e==="history"?"tools_history":"tools_statistics";a("dashboard_click_event",{click_target:e==="history"?"tools_tab_history":"tools_tab_statistics",page:"tools",tab:r}),x({page:"tools",tab:r}),B(e)},[a,x]),ot=n.useCallback(e=>{const r=Ce(e),l=Se(e);return s.jsxs("div",{className:o.expandedRow,children:[s.jsxs("div",{className:o.expandedSection,children:[s.jsxs("strong",{children:[s.jsx(M,{text:t("tools.detail.params.tooltip","Input parameters passed to this tool run."),children:t("tools.detail.params","Parameters")}),":"]}),s.jsx("pre",{className:o.pre,children:JSON.stringify(e.parameters,null,2)})]}),e.result&&s.jsxs("div",{className:o.expandedSection,children:[s.jsxs("strong",{children:[s.jsx(M,{text:t("tools.detail.result.tooltip","Returned result payload for this tool run."),children:t("tools.detail.result","Result")}),":"]}),s.jsx("pre",{className:o.pre,children:JSON.stringify(e.result,null,2)})]}),l?s.jsxs("div",{className:o.expandedSection,children:[s.jsx("strong",{children:t("tools.history.routing","Routing")}),s.jsxs("div",{className:o.detailList,children:[g(t("tools.history.routing.mode","Mode"),l.selectionMode),g(t("tools.history.routing.requested","Requested"),Te(l,t)),g(t("tools.history.routing.actual","Actual"),Ne(l))]})]}):null,(e.status==="fallback"||e.status==="unsupported"||e.status==="warning"||e.status==="error")&&s.jsx("div",{className:o.expandedSection,children:s.jsxs("div",{className:o.detailList,children:[e.status==="fallback"&&(r==null?void 0:r.requestedCommand)&&g(t("tools.detail.requestedCommand","Requested Command"),r.requestedCommand),e.status==="fallback"&&(r==null?void 0:r.executedCommand)&&g(t("tools.detail.executedCommand","Executed Command"),r.executedCommand),e.status==="fallback"&&(r==null?void 0:r.alternatives)&&g(t("tools.detail.alternatives","Alternatives"),r.alternatives.join(", ")),e.status==="unsupported"&&e.blockedMessage&&g(t("tools.detail.blockedMessage","Blocked Reason"),e.blockedMessage),e.status==="unsupported"&&g(t("tools.detail.noFallback","No Fallback"),t("tools.detail.noFallback.value","No fallback ran.")),e.status==="warning"&&e.warningMessage&&g(t("tools.detail.warningMessage","Warning Message"),e.warningMessage),e.status==="error"&&e.errorMessage&&g(t("tools.detail.errorMessage","Error Message"),e.errorMessage),e.status==="error"&&e.blockedMessage&&g(t("tools.detail.blockedMessage","Blocked Reason"),e.blockedMessage),e.status==="error"&&e.fallbackCommand&&g(t("tools.detail.executedCommand","Executed Command"),e.fallbackCommand)]})})]})},[t]),at=["history","statistics"].map(e=>({key:e,label:t(`tools.tab.${e}`,e.charAt(0).toUpperCase()+e.slice(1))}));return s.jsxs("div",{className:o.page,children:[s.jsx(pt,{title:t("page.tools.title","Tools"),description:t("page.tools.description","Inspect tool history, outcomes, fallback details, and usage statistics."),helpTopicId:"tools"}),s.jsx(mt,{surface:"tools",selectable:!0,selectedPlaceId:z,onSelectedPlaceIdChange:e=>{P(e),i.setHistoryOffset(0)}}),s.jsx(bt,{items:at,value:k,onChange:st}),k==="history"&&s.jsxs("div",{className:o.card,children:[s.jsxs("div",{className:o.cardToolbar,children:[s.jsx("div",{className:o.sectionTitle,children:t("tools.tab.history","History")}),s.jsx("button",{className:o.dangerButton,onClick:()=>{a("dashboard_click_event",{click_target:"tools_clear_history",page:"tools",tab:"tools_history"}),h("history")},children:t("common.clear","Clear")})]}),s.jsx("div",{className:o.filterRow,children:s.jsxs("label",{className:o.filterLabel,children:[t("tools.filter.tool","Tool"),":",s.jsxs("select",{className:o.filterSelect,value:i.historyToolFilter,onChange:e=>{i.setHistoryToolFilter(e.target.value),i.setHistoryOffset(0)},children:[s.jsx("option",{value:"",children:t("tools.filter.all","All")}),V.map(e=>s.jsx("option",{value:e,children:e},e))]})]})}),s.jsx(kt,{columns:H,data:i.history,rowKey:e=>e.id,onRowClick:e=>u(r=>r===e.id?null:e.id),emptyMessage:t("tools.empty.history","No tool history entries for this place"),expandedKey:N,renderExpandedRow:ot}),s.jsxs("div",{className:o.pagination,children:[s.jsx("button",{className:o.btn,disabled:i.historyOffset===0,title:t("tools.page.prev.tooltip","Go to the previous page of tool history results."),onClick:()=>i.setHistoryOffset(Math.max(0,i.historyOffset-K)),children:t("tools.page.prev","Prev")}),s.jsxs("span",{className:o.pageInfo,children:[i.historyOffset+1,"–",Math.min(i.historyOffset+K,i.historyTotal)," / ",i.historyTotal]}),s.jsx("button",{className:o.btn,disabled:!i.historyHasMore,title:t("tools.page.next.tooltip","Go to the next page of tool history results."),onClick:()=>i.setHistoryOffset(i.historyOffset+K),children:t("tools.page.next","Next")})]})]}),k==="statistics"&&s.jsxs("div",{className:o.card,children:[s.jsxs("div",{className:o.cardToolbar,children:[s.jsx("div",{className:o.sectionTitle,children:t("tools.tab.statistics","Statistics")}),s.jsx("button",{className:o.dangerButton,onClick:()=>{a("dashboard_click_event",{click_target:"tools_clear_statistics",page:"tools",tab:"tools_statistics"}),h("statistics")},children:t("common.clear","Clear")})]}),v&&s.jsxs("div",{className:o.tierDistribution,children:[s.jsxs("div",{className:o.tierBarWrap,children:[s.jsx("div",{className:o.tierBarBasic,style:{width:`${v.basicPct}%`}}),s.jsx("div",{className:o.tierBarPro,style:{width:`${v.proPct}%`}})]}),s.jsxs("div",{className:o.tierLabels,children:[s.jsxs("span",{children:[A(t,"basic")," ",v.basicPct,"% (",v.basic,")"]}),s.jsxs("span",{children:[A(t,"pro")," ",v.proPct,"% (",v.pro,")"]})]})]}),s.jsx("div",{className:o.statsTableWrap,children:s.jsxs("table",{className:o.statsTable,children:[s.jsx("thead",{children:s.jsx("tr",{children:I.map(e=>s.jsxs("th",{style:e.width?{width:e.width}:void 0,className:e.sortable?o.sortableHeader:void 0,onClick:e.sortable?()=>U(e.key):void 0,children:[s.jsx("span",{children:e.label}),e.sortable&&L===e.key&&s.jsx("span",{className:o.sortArrow,children:m==="asc"?"▴":"▾"})]},e.key))})}),s.jsx("tbody",{children:C.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:I.length,className:o.emptyStats,children:t("tools.empty.stats","No tool statistics for this place")})}):C.map(e=>{const r=E===e.toolName;return s.jsxs(n.Fragment,{children:[s.jsxs("tr",{className:o.statsToolRow,onClick:()=>G(e.toolName),children:[s.jsx("td",{children:s.jsxs("button",{type:"button",className:o.expandButton,"aria-expanded":r,"aria-label":`${e.toolName} ${r?t("common.collapse","Collapse"):t("common.expand","Expand")}`,onClick:l=>{l.stopPropagation(),G(e.toolName)},children:[s.jsx("span",{className:o.expandIcon,"aria-hidden":"true",children:r?"▾":"▸"}),s.jsx("span",{children:e.toolName})]})}),s.jsx("td",{children:e.totalCalls}),s.jsx("td",{children:e.successCount}),s.jsx("td",{children:e.fallbackCount}),s.jsx("td",{children:e.unsupportedCount}),s.jsx("td",{children:e.warningCount}),s.jsx("td",{children:e.failureCount}),s.jsx("td",{children:W(e.avgExecutionTimeMs)}),s.jsx("td",{children:s.jsx(M,{text:e.tier==="mixed"?t("tools.tier.mixed.tooltip","This tool includes both Basic and Pro actions."):"",children:s.jsx("span",{className:e.tier==="pro"?o.tierPro:e.tier==="mixed"?o.tierMixed:o.tierBasic,children:A(t,e.tier)})})})]}),r&&e.commands.map(l=>s.jsxs("tr",{className:o.statsActionRow,children:[s.jsx("td",{children:s.jsx("span",{className:o.actionLabel,children:l.label})}),s.jsx("td",{children:l.totalCalls}),s.jsx("td",{children:l.successCount}),s.jsx("td",{children:l.fallbackCount}),s.jsx("td",{children:l.unsupportedCount}),s.jsx("td",{children:l.warningCount}),s.jsx("td",{children:l.failureCount}),s.jsx("td",{children:W(l.avgExecutionTimeMs)}),s.jsx("td",{children:s.jsx("span",{className:l.tier==="pro"?o.tierPro:o.tierBasic,children:A(t,l.tier)})})]},`${e.toolName}:${l.commandName}`))]},e.toolName)})})]})}),i.statistics&&s.jsxs("div",{className:o.summaryLine,children:[t("tools.summary.total","Total"),": ",i.statistics.totalCalls," ",t("tools.summary.calls","calls")," | ",t("tools.summary.sessions","Sessions"),": ",i.statistics.totalSessions]})]}),s.jsx(ht,{open:w!==null,title:w==="history"?t("tools.clear.history.title","Clear history?"):t("tools.clear.statistics.title","Clear statistics?"),message:w==="history"?t("tools.clear.history.message","This permanently removes the current place tools history."):t("tools.clear.statistics.message","This permanently resets the current place tool statistics."),cancelLabel:t("common.cancel","Cancel"),confirmLabel:t("common.clear","Clear"),loading:y,onCancel:()=>!y&&h(null),onConfirm:et})]})}export{Ie as Component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._card_f20gt_2{position:relative;display:flex;flex-direction:column;gap:8px;padding:14px 16px;border:1px solid var(--border);border-radius:var(--radius);border-left-width:3px;background:var(--bg-card)}._cardUnread_f20gt_15{border-left-color:var(--accent)}._cardRead_f20gt_20{border-left-color:var(--text-muted)}._topRow_f20gt_25{display:flex;align-items:center;gap:8px;flex-wrap:wrap}._categoryChip_f20gt_32{display:inline-flex;align-items:center;padding:2px 8px;border-radius:999px;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;background:var(--accent-dim);color:var(--accent)}._versionChip_f20gt_45{display:inline-flex;align-items:center;padding:2px 8px;border-radius:999px;font-size:11px;font-weight:600;background:#7f8daa24;color:var(--text-secondary);font-family:var(--font-code)}._date_f20gt_57{margin-left:auto;font-size:12px;color:var(--text-muted);white-space:nowrap}._title_f20gt_65{margin:0;font-size:15px;font-weight:700;color:var(--text-primary);line-height:1.3}._body_f20gt_74{font-size:13px;color:var(--text-secondary);line-height:1.5;white-space:pre-wrap;word-break:break-word}._linkList_f20gt_82{display:flex;flex-wrap:wrap;gap:8px}._link_f20gt_82{display:inline-flex;align-items:center;gap:4px;font-size:13px;color:var(--accent);text-decoration:none;font-weight:600}._link_f20gt_82:hover{text-decoration:underline}._newBadge_f20gt_104{display:inline-flex;align-items:center;padding:1px 6px;border-radius:999px;font-size:10px;font-weight:800;letter-spacing:.06em;background:var(--error);color:#fff}._page_1talg_2{display:flex;flex-direction:column;gap:24px;max-width:720px}._section_1talg_10{display:flex;flex-direction:column;gap:12px}._sectionTitle_1talg_16{display:flex;align-items:center;gap:8px;margin:0;font-size:14px;font-weight:700;color:var(--text-primary);text-transform:uppercase;letter-spacing:.06em}._unreadCount_1talg_28{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 6px;border-radius:999px;font-size:11px;font-weight:700;background:var(--error);color:#fff}._empty_1talg_43{padding:32px 0;text-align:center;font-size:14px;color:var(--text-muted)}._divider_1talg_51{height:1px;background:var(--border);border:none;margin:0}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u,j as e,G as y,r as N,H as w}from"./index-CnXGGM07.js";import{P as x}from"./PageHeader-Bfy2f-GH.js";const j="_card_f20gt_2",C="_cardUnread_f20gt_15",R="_cardRead_f20gt_20",k="_topRow_f20gt_25",v="_categoryChip_f20gt_32",b="_versionChip_f20gt_45",S="_date_f20gt_57",T="_title_f20gt_65",E="_body_f20gt_74",A="_linkList_f20gt_82",U="_link_f20gt_82",B="_newBadge_f20gt_104",a={card:j,cardUnread:C,cardRead:R,topRow:k,categoryChip:v,versionChip:b,date:S,title:T,body:E,linkList:A,link:U,newBadge:B},L={release:"whatsNew.category.release",notice:"whatsNew.category.notice",deprecation:"whatsNew.category.deprecation",tip:"whatsNew.category.tip"};function f({announcement:s,isNew:p}){const{locale:r,t:o}=u(),i=p?a.cardUnread:a.cardRead,g=s.title[r]??s.title.en,l=s.body[r]??s.body.en,d=s.links??(s.link?[s.link]:[]),h=n=>typeof n=="string"?n:n[r]??n.en;return e.jsxs("div",{className:`${a.card} ${i}`,children:[e.jsxs("div",{className:a.topRow,children:[e.jsx("span",{className:a.categoryChip,children:o(L[s.category])}),s.version&&e.jsx("span",{className:a.versionChip,children:s.version}),p&&e.jsx("span",{className:a.newBadge,children:o("whatsNew.newBadge","NEW")}),e.jsx("span",{className:a.date,children:s.date})]}),e.jsx("h3",{className:a.title,children:g}),e.jsx("p",{className:a.body,children:l}),d.length>0&&e.jsx("div",{className:a.linkList,children:d.map(n=>{const _=h(n.url),t=h(n.label);return e.jsxs("a",{className:a.link,href:_,target:"_blank",rel:"noopener noreferrer",children:["↗"," ",t]},_)})})]})}const $="_page_1talg_2",M="_section_1talg_10",z="_sectionTitle_1talg_16",H="_unreadCount_1talg_28",P="_empty_1talg_43",W="_divider_1talg_51",c={page:$,section:M,sectionTitle:z,unreadCount:H,empty:P,divider:W};function O(){const{t:s}=u(),{readSet:p,markRead:r}=y(),o=N.useMemo(()=>{const t=[];for(const m of w)p.has(m.id)||t.push(m.id);return t},[]),i=N.useRef(o);i.current=o,N.useEffect(()=>()=>{i.current.length>0&&r(i.current)},[]);const g=N.useMemo(()=>new Set(o),[o]),l=w.filter(t=>g.has(t.id)),d=w.filter(t=>!g.has(t.id)),h=l.length>0,n=d.length>0,_=e.jsx(x,{title:s("whatsNew.pageTitle","What's New"),description:s("whatsNew.pageSubtitle","Stay up to date with MCP changes"),helpTopicId:"whatsNew"});return w.length===0?e.jsxs("div",{className:c.page,children:[_,e.jsx("p",{className:c.empty,children:s("whatsNew.empty","No announcements yet")})]}):e.jsxs("div",{className:c.page,children:[_,h&&e.jsxs("section",{className:c.section,children:[e.jsxs("h2",{className:c.sectionTitle,children:[s("whatsNew.unreadSection","Unread"),e.jsx("span",{className:c.unreadCount,children:l.length})]}),l.map(t=>e.jsx(f,{announcement:t,isNew:!0},`unread-${t.id}`))]}),h&&n&&e.jsx("hr",{className:c.divider}),n&&e.jsxs("section",{className:c.section,children:[e.jsx("h2",{className:c.sectionTitle,children:s("whatsNew.allSection","All Announcements")}),d.map(t=>e.jsx(f,{announcement:t,isNew:!1},`all-${t.id}`))]})]})}export{O as Component};
|