unleash-server 7.4.2 → 7.4.3
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/dist/lib/features/index.d.ts +1 -0
- package/dist/lib/features/index.d.ts.map +1 -1
- package/dist/lib/features/index.js +1 -0
- package/dist/lib/features/index.js.map +1 -1
- package/dist/lib/routes/admin-api/user/user.d.ts +1 -0
- package/dist/lib/routes/admin-api/user/user.d.ts.map +1 -1
- package/dist/lib/routes/admin-api/user/user.js +12 -1
- package/dist/lib/routes/admin-api/user/user.js.map +1 -1
- package/dist/lib/server-impl.d.ts +2 -2
- package/dist/lib/server-impl.d.ts.map +1 -1
- package/dist/lib/server-impl.js +2 -2
- package/dist/lib/server-impl.js.map +1 -1
- package/frontend/build/index.html +1 -1
- package/frontend/build/static/{AdvancedPlayground-DRpxJMnK.js → AdvancedPlayground-BVQjoHnr.js} +1 -1
- package/frontend/build/static/{BackendConnections-_n7OFNmD.js → BackendConnections-bRvUo06H.js} +1 -1
- package/frontend/build/static/{CreateProject-068uYB82.js → CreateProject-z7K5-k8g.js} +1 -1
- package/frontend/build/static/{EnterpriseEdge-D8BFcFOL.js → EnterpriseEdge-CAkbmuGs.js} +1 -1
- package/frontend/build/static/{FeatureMetricsChart-CmPDv0Qg.js → FeatureMetricsChart-TPw8l2qi.js} +1 -1
- package/frontend/build/static/{FeatureStaleDialog-p_WEko7Q.js → FeatureStaleDialog-DwV5Mzh6.js} +1 -1
- package/frontend/build/static/{FeatureViewLazyExport-CsvADBC_.js → FeatureViewLazyExport-CBpSqVMU.js} +2 -2
- package/frontend/build/static/{FlagMetricsChart-D0cnIXiN.js → FlagMetricsChart-DLcy8CzE.js} +1 -1
- package/frontend/build/static/{FrontendNetworkTrafficUsage-DF0QQUFI.js → FrontendNetworkTrafficUsage-CYJZFmkc.js} +1 -1
- package/frontend/build/static/{GridLayoutWrapper-CvaFKuMM.js → GridLayoutWrapper-CixVvIgD.js} +1 -1
- package/frontend/build/static/{ImpactMetricsPage-BQnbfPhs.js → ImpactMetricsPage-AS6DHn5C.js} +1 -1
- package/frontend/build/static/{LazyAdminExport-CaPIJWoT.js → LazyAdminExport-dyqU9IvB.js} +3 -3
- package/frontend/build/static/{LazyProjectExport-DxVvRHV2.js → LazyProjectExport-B1vRaljX.js} +2 -2
- package/frontend/build/static/{LifecycleChartComponent-7r5tp81g.js → LifecycleChartComponent-BGuUP9oF.js} +1 -1
- package/frontend/build/static/{LineChartComponent-p_JFdSdE.js → LineChartComponent-DA6kG8Ei.js} +1 -1
- package/frontend/build/static/{MarkCompletedDialogue-BHRKKIec.js → MarkCompletedDialogue-D2TM3HgS.js} +1 -1
- package/frontend/build/static/{NetworkOverview-Dr4-ROCD.js → NetworkOverview-aNdwr7xF.js} +1 -1
- package/frontend/build/static/{NetworkPrometheusAPIWarning-COfHXZmz.js → NetworkPrometheusAPIWarning-f1m-ZHgX.js} +1 -1
- package/frontend/build/static/{NetworkTraffic-Dm-2mi3M.js → NetworkTraffic-CzH9_YqS.js} +1 -1
- package/frontend/build/static/{NetworkTrafficUsage-fGr4QA8t.js → NetworkTrafficUsage-BqpcQ4JO.js} +1 -1
- package/frontend/build/static/{PercentageDonut-DystLTgb.js → PercentageDonut-cKg6eF-p.js} +1 -1
- package/frontend/build/static/{ReactJSONEditor-CdN66QkS.js → ReactJSONEditor-BH7GX57b.js} +1 -1
- package/frontend/build/static/{RoleCell-BjcvUPQZ.js → RoleCell-D01N1lHV.js} +1 -1
- package/frontend/build/static/{aggregateFeatureMetrics-60FrVlfS.js → aggregateFeatureMetrics-DJ_IwcyH.js} +1 -1
- package/frontend/build/static/{formatTickValue-CODpmZvr.js → formatTickValue-ClJtK_xN.js} +1 -1
- package/frontend/build/static/{index-B_EIW-7Y.js → index-Cz4lAJ3Y.js} +117 -117
- package/frontend/build/static/{networkTrafficUsageHighlightPlugin-COgb9_ZU.js → networkTrafficUsageHighlightPlugin-Ce-A3Xr6.js} +1 -1
- package/frontend/build/static/{useApiTokens-CdZATTgS.js → useApiTokens-Dx2wjhgw.js} +1 -1
- package/frontend/package.json +1 -1
- package/package.json +2 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{cm as D,b7 as U,r as o,b9 as W,F as _,H as z,j as t,s as a,c8 as x,M as E,bq as k,b6 as R,hg as f,y as A,cJ as B,cf as F,cK as $,bn as N,aJ as P,T as h,b as H,gc as j,jS as V,jT as O,jU as q,d as G,k as Z,L as J,aA as Y,cV as Q}from"./index-
|
|
1
|
+
import{cm as D,b7 as U,r as o,b9 as W,F as _,H as z,j as t,s as a,c8 as x,M as E,bq as k,b6 as R,hg as f,y as A,cJ as B,cf as F,cK as $,bn as N,aJ as P,T as h,b as H,gc as j,jS as V,jT as O,jU as q,d as G,k as Z,L as J,aA as Y,cV as Q}from"./index-Cz4lAJ3Y.js";import{u as X}from"./unknownify-B7hmSXnj.js";import{S as K}from"./LazyAdminExport-dyqU9IvB.js";import"./RoleCell-D01N1lHV.js";import"./useApiTokens-Dx2wjhgw.js";import"./PercentageDonut-cKg6eF-p.js";const ee={connectedEdges:[],revisionIds:[]},te=e=>{const{data:n,error:r,mutate:i}=D(U("api/admin/metrics/edges"),ne,e);return o.useMemo(()=>{const s=!r&&!n;return(n==null?void 0:n.connectedEdges)!==void 0?{edgeObservability:n,loading:s,refetch:()=>i(),error:r}:Array.isArray(n)?{edgeObservability:{connectedEdges:n,revisionIds:[]},loading:s,refetch:()=>i(),error:r}:{edgeObservability:ee,loading:s,refetch:()=>i(),error:r}},[n,r,i])},ne=e=>fetch(e).then(W("Connected Edges")).then(n=>n.json());var v={},re=z;Object.defineProperty(v,"__esModule",{value:!0});var w=v.default=void 0,se=re(_()),ie=t,oe=(0,se.default)((0,ie.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2z"}),"Circle");w=v.default=oe;const ae=a("table")(({theme:e})=>({width:"100%",borderCollapse:"collapse",fontSize:e.fontSizes.smallerBody,"& > thead":{borderBottom:`1px solid ${e.palette.text.primary}`},"& tr":{textAlign:"right","& > th:first-of-type, td:first-of-type":{textAlign:"left"}}})),S=a("tr")(({theme:e})=>({fontWeight:e.fontWeight.bold,"&&& > td":{paddingTop:e.spacing(1),"& > div":{display:"flex",alignItems:"center"}}})),de=({instance:e})=>t.jsxs(ae,{children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{children:"Latency (ms)"}),t.jsx("th",{children:"Avg"}),t.jsx("th",{children:"p99"})]})}),t.jsxs("tbody",{children:[t.jsx(S,{children:t.jsx("td",{colSpan:3,children:t.jsxs("div",{children:["Upstream"," ",t.jsx(x,{tooltip:"Latency measured for requests sent from this Edge instance to the configured upstream, i.e. Unleash or another Edge instance.",size:"16px"})]})})}),t.jsxs("tr",{children:[t.jsx("td",{children:"Client Features"}),t.jsx("td",{children:e.upstreamFeaturesAverageLatencyMs}),t.jsx("td",{children:e.upstreamFeaturesP99LatencyMs})]}),t.jsxs("tr",{children:[t.jsx("td",{children:"Metrics"}),t.jsx("td",{children:e.upstreamMetricsAverageLatencyMs}),t.jsx("td",{children:e.upstreamMetricsP99LatencyMs})]}),t.jsxs("tr",{children:[t.jsx("td",{children:"Edge"}),t.jsx("td",{children:e.upstreamEdgeAverageLatencyMs}),t.jsx("td",{children:e.upstreamEdgeP99LatencyMs})]}),t.jsx(S,{children:t.jsx("td",{colSpan:3,children:t.jsxs("div",{children:["Downstream"," ",t.jsx(x,{tooltip:"Latency measured when serving requests from clients, i.e. SDKs or other Edge instances.",size:"16px"})]})})}),t.jsxs("tr",{children:[t.jsx("td",{children:"Client Features"}),t.jsx("td",{children:e.clientFeaturesAverageLatencyMs}),t.jsx("td",{children:e.clientFeaturesP99LatencyMs})]}),t.jsxs("tr",{children:[t.jsx("td",{children:"Frontend"}),t.jsx("td",{children:e.frontendApiAverageLatencyMs}),t.jsx("td",{children:e.frontendApiP99LatencyMs})]})]})]}),le=a("table")(({theme:e})=>({width:"100%",borderCollapse:"collapse",fontSize:e.fontSizes.smallerBody,"& > thead":{borderBottom:`1px solid ${e.palette.text.primary}`},"& tr":{textAlign:"right","& > th:first-of-type, td:first-of-type":{textAlign:"left"},paddingTop:e.spacing(1)}})),C=a("td")(({theme:e})=>({paddingTop:e.spacing(1),maxWidth:"80px","& > div":{display:"flex",alignItems:"center",justifyContent:"end"}})),ce=a(E)(({theme:e})=>({padding:e.spacing(0,1)})),pe=e=>e.length===1?e[0]:"[]",he=e=>`${pe(e.projects)}:${e.environment}.***`,ge=e=>`[${e.projects.join(",")}]:${e.environment}`,xe=(e,n)=>{var r;return((r=e.find(i=>i.environment===n))==null?void 0:r.revisionId)||0},ue=e=>e<=0?"success":e<5?"warning":"error",me=({edgeRevisionId:e,upstreamRevisionId:n})=>{const r=n-e,s=r<=0?"Edge feature configuration is up to date":`Edge is ${r} revisions behind Unleash`;return t.jsx(A,{title:s,children:t.jsx(ce,{color:ue(r),children:e})})},ye=({apiKeys:e,revisionIds:n})=>{const{locationSettings:r}=k();return!e||e.length===0?null:t.jsxs(le,{children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{children:"Token"}),t.jsx("th",{children:"Revision"})]})}),t.jsx("tbody",{children:e==null?void 0:e.map(i=>{const s=he(i);return t.jsxs("tr",{children:[t.jsx(C,{children:t.jsx(R,{title:s,children:s})}),t.jsx(C,{children:t.jsxs("div",{children:[t.jsx(me,{edgeRevisionId:i.revisionId,upstreamRevisionId:xe(n,i.environment)}),t.jsx(x,{tooltip:`
|
|
2
2
|
Edge last updated this token: ${f(i.lastUpdated,r.locale)}
|
|
3
3
|
`,size:"14px"})]})})]},ge(i))})})]})},je=a("div")(({theme:e})=>({width:"100%",borderRadius:e.shape.borderRadiusMedium,border:"1px solid",borderColor:e.palette.secondary.border,backgroundColor:e.palette.secondary.light,display:"flex",flexDirection:"column",alignItems:"center",padding:0,zIndex:1,marginTop:e.spacing(1)})),fe=a(B)({width:"100%",background:"transparent",boxShadow:"none"}),Ee=a(F,{shouldForwardProp:e=>e!=="connectionStatus"})(({theme:e,connectionStatus:n})=>({fontSize:e.fontSizes.smallBody,padding:e.spacing(1),minHeight:e.spacing(3),"& .MuiAccordionSummary-content":{alignItems:"center",gap:e.spacing(1),margin:0,"&.Mui-expanded":{margin:0},"& svg":{fontSize:e.fontSizes.mainHeader,color:n==="Stale"?e.palette.warning.main:n==="Disconnected"?e.palette.error.main:e.palette.success.main}}})),ve=a($)(({theme:e})=>({display:"flex",flexDirection:"column",fontSize:e.fontSizes.smallerBody,gap:e.spacing(2)})),p=a("div")(({theme:e})=>({display:"flex",justifyContent:"space-between",gap:e.spacing(2),"& > span":{display:"flex",alignItems:"center"}})),Se=a(E)(({theme:e})=>({padding:e.spacing(0,1)})),Ce=({hosting:e})=>{switch(e){case"hosted":return"Cloud";case"enterprise-self-hosted":return"Self-hosted";default:return e?`Unknown: ${e}`:"Unknown"}},be=({reportedAt:e})=>{const n=new Date(e).getTime(),r=(Date.now()-n)/1e3;return r>360?"Disconnected":r>180?"Stale":"Connected"},Le=({started:e,reportedAt:n,cpuUsage:r})=>{const i=Number(r);if(!i)return"No usage";const s=new Date(e).getTime(),l=(new Date(n).getTime()-s)/1e3;return l===0?"No usage":`${(i/l*100).toFixed(2)} %`},ke=({memoryUsage:e})=>{if(!e)return"No usage";const n=["B","KB","MB","GB"];let r=e,i=0;for(;r>=1024&&i<n.length-1;)r/=1024,i++;return`${r.toFixed(2)} ${n[i]}`},Ae=({instance:e,revisionIds:n})=>{const{locationSettings:r}=k(),i=be(e),s=f(e.started,r==null?void 0:r.locale),d=f(e.reportedAt,r==null?void 0:r.locale),l=Le(e),c=ke(e),u=l==="No usage"&&c==="No usage"&&t.jsx("p",{children:"Resource metrics are only available when running on Linux."});return t.jsx(je,{children:t.jsxs(fe,{children:[t.jsxs(Ee,{expandIcon:t.jsx(N,{}),connectionStatus:i,children:[t.jsx(A,{arrow:!0,title:`${i}. Last reported: ${d}`,children:t.jsx(w,{})}),e.id||e.instanceId]}),t.jsxs(ve,{children:[t.jsxs(p,{children:[t.jsx("strong",{children:"ID"}),t.jsx("span",{children:e.instanceId})]}),t.jsxs(p,{children:[t.jsx("strong",{children:"Upstream server"}),t.jsx("span",{children:e.connectedVia||"Unleash"})]}),t.jsxs(p,{children:[t.jsx("strong",{children:"Region"}),t.jsx("span",{children:e.region||"Unknown"})]}),t.jsxs(p,{children:[t.jsx("strong",{children:"Hosting"}),t.jsx("span",{children:Ce(e)})]}),t.jsxs(p,{children:[t.jsx("strong",{children:"Version"}),t.jsx("span",{children:e.edgeVersion})]}),t.jsxs(p,{children:[t.jsx("strong",{children:"Status"}),t.jsx(Se,{color:i==="Disconnected"?"error":i==="Stale"?"warning":"success",children:i})]}),t.jsxs(p,{children:[t.jsx("strong",{children:"Start"}),t.jsx("span",{children:s})]}),t.jsxs(p,{children:[t.jsx("strong",{children:"Last report"}),t.jsx("span",{children:d})]}),t.jsxs(p,{children:[t.jsx("strong",{children:"CPU"}),t.jsxs("span",{children:[l," ",t.jsx(x,{tooltip:t.jsxs(t.Fragment,{children:[t.jsx("p",{children:"CPU average usage since instance started."}),u]}),size:"16px"})]})]}),t.jsxs(p,{children:[t.jsx("strong",{children:"Memory"}),t.jsxs("span",{children:[c," ",t.jsx(x,{tooltip:t.jsxs(t.Fragment,{children:[t.jsx("p",{children:"Current memory usage."}),u]}),size:"16px"})]})]}),t.jsxs(p,{children:[t.jsx("strong",{children:"Stream clients"}),t.jsx("span",{children:e.connectedStreamingClients})]}),t.jsx(p,{children:t.jsx(de,{instance:e})}),t.jsx(p,{children:t.jsx(ye,{apiKeys:e.apiKeyRevisionIds,revisionIds:n})})]})]})})},g="Unleash",we=a("div")(({theme:e})=>({marginBottom:e.spacing(18),display:"flex",justifyContent:"center"})),Me=a("div")(({theme:e})=>({display:"flex",justifyContent:"center",gap:e.spacing(4),flexWrap:"wrap",marginTop:e.spacing(2)})),M=a("div")(({theme:e})=>({borderRadius:e.shape.borderRadiusMedium,border:`1px solid ${e.palette.secondary.border}`,backgroundColor:e.palette.secondary.light,display:"flex",flexDirection:"column",alignItems:"center",padding:e.spacing(1.5),zIndex:1,marginTop:e.spacing(1),"& > svg":{width:e.spacing(9),height:e.spacing(9)}})),Ie=a(M)(({theme:e})=>({backgroundColor:P(e.palette.background.paper,.75),position:"relative"})),Te=a(E)({position:"absolute",top:-13}),De=a(h)(({theme:e})=>({marginTop:e.spacing(.5),fontWeight:e.fontWeight.bold})),Ue=a(h)(({theme:e})=>({fontSize:e.fontSizes.smallerBody,color:e.palette.text.secondary})),We=e=>e.reduce((n,r)=>(n.has(r.appName)||n.set(r.appName,{appName:r.appName,instances:[],groupTargets:new Set,level:0}),n.get(r.appName).instances.push(r),n),new Map),_e=e=>{const n=new Map,r=s=>{if(n.has(s.appName))return n.get(s.appName);let d=0;return s.groupTargets.forEach(l=>{if(l!==g){const c=e.get(l);c&&(d=Math.max(d,r(c)+1))}}),n.set(s.appName,d),d};e.forEach(s=>{s.level=r(s)});const i=new Map;return e.forEach(s=>{const d=i.get(s.level)||[];d.push(s),i.set(s.level,d)}),i},ze=e=>{const n=We(e),r=new Map,i=new Map;return n.forEach(s=>{s.instances=s.instances.sort((d,l)=>d.instanceId.localeCompare(l.instanceId)).map((d,l)=>{const c=`${s.appName}-${l+1}`;return r.set(d.instanceId,c),i.set(c,s.appName),{...d,id:c}})}),n.forEach(s=>{s.instances=s.instances.map(l=>({...l,connectedVia:l.connectedVia?r.get(l.connectedVia)||l.connectedVia:g}));const d=new Set;s.instances.forEach(l=>{if(!l.connectedVia||l.connectedVia===g)d.add(g);else{const c=i.get(l.connectedVia);c&&c!==s.appName&&d.add(c)}}),s.groupTargets=d}),_e(n)},Re=e=>e.every(n=>n.hosting==="hosted")?{hostingLabel:"Cloud",hostingColor:"secondary"}:e.every(n=>n.hosting==="enterprise-self-hosted")?{hostingLabel:"Self-hosted",hostingColor:"info"}:e.every(n=>n.hosting==="hosted"||n.hosting==="enterprise-self-hosted")?{hostingLabel:"Hybrid",hostingColor:"warning"}:{hostingLabel:"Unknown",hostingColor:"neutral"},Be=({connectedEdges:e,revisionIds:n})=>{const r=H(),i=o.useMemo(()=>ze(e),[e]),s=Array.from(i.keys()).sort((d,l)=>d-l);return t.jsxs(j.ArcherContainer,{strokeColor:r.palette.text.primary,endShape:{arrow:{arrowLength:4,arrowThickness:4}},children:[t.jsx(we,{children:t.jsx(j.ArcherElement,{id:g,children:t.jsxs(M,{children:[t.jsx(V,{darkmode:t.jsx(O,{}),lightmode:t.jsx(q,{})}),t.jsx(h,{sx:{mt:1},children:g})]})})}),s.map(d=>{var l;return t.jsx(Me,{children:(l=i.get(d))==null?void 0:l.map(({appName:c,groupTargets:u,instances:m})=>{const{hostingLabel:I,hostingColor:T}=Re(m);return t.jsx(j.ArcherElement,{id:c,relations:Array.from(u).map(y=>({targetId:y,targetAnchor:"bottom",sourceAnchor:"top",style:{strokeColor:r.palette.secondary.border}})),children:t.jsxs(Ie,{children:[t.jsx(Te,{color:T,children:I}),t.jsx(De,{children:X(c)}),t.jsxs(Ue,{children:[m.length," instance",m.length!==1&&"s"]}),m.map(y=>t.jsx(Ae,{instance:y,revisionIds:n},y.instanceId))]})},c)})},d)})]})},Fe=e=>o.createElement("svg",{width:312,height:144,viewBox:"0 0 312 144",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},o.createElement("rect",{width:312,height:144,rx:8,fill:"#F1F0FC"}),o.createElement("g",{opacity:.2},o.createElement("circle",{cx:155.933,cy:72.1494,r:59.9326,stroke:"#657A80",strokeWidth:1.35669,strokeLinecap:"square"}),o.createElement("ellipse",{cx:155.933,cy:72.2595,rx:43.5873,ry:60.2595,stroke:"#657A80",strokeWidth:1.35669,strokeLinecap:"square"}),o.createElement("ellipse",{cx:156.368,cy:72.1494,rx:27.2421,ry:59.9326,stroke:"#657A80",strokeWidth:1.35669,strokeLinecap:"square"}),o.createElement("ellipse",{cx:156.369,cy:72.1494,rx:10.8968,ry:59.9326,stroke:"#657A80",strokeWidth:1.35669,strokeLinecap:"square"})),o.createElement("g",{opacity:.2},o.createElement("mask",{id:"mask0_35832_1410",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:96,y:12,width:120,height:121},o.createElement("circle",{cx:155.933,cy:72.1494,r:59.2542,fill:"#92A1A5",stroke:"#657A80",strokeWidth:1.35669})),o.createElement("g",{mask:"url(#mask0_35832_1410)"},o.createElement("path",{d:"M96 48.1777C96 48.1777 109.076 59.2925 155.933 59.2925C202.789 59.2925 215.865 48.1777 215.865 48.1777",stroke:"#657A80",strokeWidth:1.35669}),o.createElement("path",{d:"M96 28.3438C96 28.3438 109.076 45.7787 155.933 45.7787C202.789 45.7787 215.865 28.3438 215.865 28.3438",stroke:"#657A80",strokeWidth:1.35669}),o.createElement("path",{d:"M96 2.19141C96 2.19141 109.076 33.1384 155.933 33.1384C202.789 33.1384 215.865 2.19141 215.865 2.19141",stroke:"#657A80",strokeWidth:1.35669}),o.createElement("path",{d:"M96 -39.4336C96 -39.4336 109.076 21.3707 155.933 21.3707C202.789 21.3707 215.865 -39.4336 215.865 -39.4336",stroke:"#657A80",strokeWidth:1.35669}),o.createElement("line",{x1:96,y1:71.472,x2:215.865,y2:71.472,stroke:"#657A80",strokeWidth:1.35669}),o.createElement("path",{d:"M215.867 95.6855C215.867 95.6855 202.79 84.5708 155.934 84.5708C109.078 84.5708 96.0016 95.6855 96.0016 95.6855",stroke:"#657A80",strokeWidth:1.35669}),o.createElement("path",{d:"M215.867 115.518C215.867 115.518 202.79 98.0826 155.934 98.0826C109.078 98.0826 96.0016 115.518 96.0016 115.518",stroke:"#657A80",strokeWidth:1.35669}),o.createElement("path",{d:"M215.867 141.672C215.867 141.672 202.79 110.725 155.934 110.725C109.078 110.725 96.0016 141.672 96.0016 141.672",stroke:"#657A80",strokeWidth:1.35669}),o.createElement("path",{d:"M215.866 183.297C215.866 183.297 202.79 122.493 155.934 122.493C109.078 122.493 96.0013 183.297 96.0013 183.297",stroke:"#657A80",strokeWidth:1.35669}))),o.createElement("rect",{x:116.749,y:86.5273,width:58.1081,height:29.0541,rx:14.527,transform:"rotate(-180 116.749 86.5273)",fill:"url(#paint0_linear_35832_1410)"}),o.createElement("ellipse",{cx:102.184,cy:71.9997,rx:14.565,ry:14.527,fill:"#817AFE"}),o.createElement("path",{d:"M106.258 67.9648H98.187V76.0354H106.258V67.9648Z",fill:"white"}),o.createElement("path",{d:"M140.556 78.3887L140.232 70.291L133.381 74.6202L140.556 78.3887ZM121.749 69.1189L129.108 72.5139L128.369 64.4436L121.749 69.1189ZM137.182 73.0493L137.645 72.5217C136.53 71.5447 135.079 70.5495 133.191 69.6186L132.88 70.2481L132.57 70.8776C134.358 71.7589 135.705 72.6876 136.719 73.577L137.182 73.0493ZM132.88 70.2481L133.191 69.6186C131.302 68.6877 129.629 68.143 128.176 67.8544L128.039 68.5428L127.902 69.2312C129.225 69.4939 130.782 69.9964 132.57 70.8776L132.88 70.2481Z",fill:"#6C65E5"}),o.createElement("rect",{x:147.284,y:55.7305,width:17.4324,height:32.5405,rx:3.48649,fill:"#1A4049"}),o.createElement("path",{d:"M171.444 78.3887L171.768 70.291L178.619 74.6202L171.444 78.3887ZM190.251 69.1189L182.892 72.5139L183.631 64.4436L190.251 69.1189ZM174.818 73.0493L174.355 72.5217C175.47 71.5447 176.921 70.5495 178.809 69.6186L179.12 70.2481L179.43 70.8776C177.642 71.7589 176.295 72.6876 175.281 73.577L174.818 73.0493ZM179.12 70.2481L178.809 69.6186C180.698 68.6877 182.371 68.143 183.824 67.8544L183.961 68.5428L184.098 69.2312C182.775 69.4939 181.218 69.9964 179.43 70.8776L179.12 70.2481Z",fill:"#6C65E5"}),o.createElement("rect",{x:253.359,y:86.5273,width:58.1081,height:29.0541,rx:14.527,transform:"rotate(-180 253.359 86.5273)",fill:"url(#paint1_linear_35832_1410)"}),o.createElement("ellipse",{cx:238.794,cy:71.9997,rx:14.565,ry:14.527,fill:"#1A4049"}),o.createElement("path",{d:"M242.867 67.9648H234.797V76.0354H242.867V67.9648Z",fill:"#EDF0F1"}),o.createElement("defs",null,o.createElement("linearGradient",{id:"paint0_linear_35832_1410",x1:116.737,y1:100.985,x2:174.889,y2:100.985,gradientUnits:"userSpaceOnUse"},o.createElement("stop",{stopColor:"#1A4049",stopOpacity:0}),o.createElement("stop",{offset:1,stopColor:"#0E1A1D"})),o.createElement("linearGradient",{id:"paint1_linear_35832_1410",x1:253.347,y1:100.985,x2:311.499,y2:100.985,gradientUnits:"userSpaceOnUse"},o.createElement("stop",{stopColor:"#657A80",stopOpacity:0}),o.createElement("stop",{offset:1,stopColor:"#1A4049",stopOpacity:.75})))),$e=a("div")(({theme:e})=>({display:"flex",flexDirection:"column",gap:e.spacing(1),maxWidth:e.spacing(80),margin:"auto"})),Ne=a("div")(({theme:e})=>({display:"flex",flexDirection:"row",gap:e.spacing(2.5),marginTop:e.spacing(2.5)})),Pe=a("div")(({theme:e})=>({border:`1px solid ${e.palette.divider}`,borderRadius:e.shape.borderRadiusLarge,padding:e.spacing(3),flex:1,display:"flex",flexDirection:"column",gap:e.spacing(1.5)})),He=a("div")({"& > svg":{width:"auto",maxWidth:"100%",height:"auto",display:"block"}}),Ve=a("ul")(({theme:e})=>({listStyle:"none",marginTop:e.spacing(1),marginBottom:e.spacing(1),paddingLeft:e.spacing(0),display:"flex",flexDirection:"column",gap:e.spacing(1)})),Oe=a("li")(({theme:e})=>({display:"flex",alignItems:"center",gap:e.spacing(1)})),qe=a(G)(({theme:e})=>({color:e.palette.primary.main,fontSize:"18px"})),Ge=a("div")(({theme:e})=>({display:"flex",justifyContent:"flex-start",margin:e.spacing(-.75)})),Ze=()=>t.jsxs($e,{children:[t.jsx(h,{variant:"h3",children:"Which version is right for you?"}),t.jsxs(h,{variant:"body2",color:"text.secondary",children:["Unleash Enterprise Edge is a high-performance proxy engineered for scalability, resilience, and privacy. It acts as a shield between your SDKs and the Unleash API, allowing you to handle thousands of concurrent connections with zero impact on your primary instance. Contact"," ",t.jsx("a",{href:"mailto:license@getunleash.io",children:"license@getunleash.io"})," ","today to provision your private Enterprise Edge environment."]}),t.jsxs(Ne,{children:[t.jsx(b,{image:t.jsx(K,{}),title:"Cloud hosted",description:"When you need to connect to Unleash from geographically distributed locations.",bullets:["Global infrastructure","No operational burden","Instant flag updates worldwide"],docsUrl:"https://docs.getunleash.io/deploy/hosting-options#cloud-hosted"}),t.jsx(b,{image:t.jsx(Fe,{}),title:"Self hosted",description:"Ensure low latency and data sovereignty by running Enterprise Edge inside your private network.",bullets:["Ideal for PII heavy data","Optimized for minimal latency","Improved security"],docsUrl:"https://docs.getunleash.io/deploy/hosting-options#self-hosted"})]})]}),b=({image:e,title:n,description:r,bullets:i,docsUrl:s})=>t.jsxs(Pe,{children:[t.jsx(He,{children:e}),t.jsx(h,{variant:"h3",children:n}),t.jsx(h,{variant:"body2",color:"text.secondary",children:r}),t.jsx(Ve,{children:i.map(d=>t.jsxs(Oe,{children:[t.jsx(qe,{})," ",t.jsx(h,{variant:"body2",color:"text.secondary",children:d})]},d))}),t.jsxs(h,{variant:"body2",color:"text.secondary",children:["Contact"," ",t.jsx("a",{href:"mailto:license@getunleash.io",children:"license@getunleash.io"})," to get started."]}),t.jsx(Ge,{children:t.jsx(Z,{component:J,to:s,size:"small",sx:{fontSize:"14px"},rel:"noopener noreferrer",target:"_blank",children:"Read docs"})})]}),Je=a(Y)(({theme:e})=>({".body":{padding:e.spacing(0)}})),L=a("div")(({theme:e})=>({padding:e.spacing(4)})),Ye=a("hr")(({theme:e})=>({border:"none",height:"1px",background:e.palette.divider,width:"100%",margin:e.spacing(2,0)})),rt=()=>{Q("Enterprise Edge");const{edgeObservability:e}=te({refreshInterval:3e4}),n=e.connectedEdges.length>0;return t.jsxs(Je,{header:"Enterprise Edge",children:[n&&t.jsxs(t.Fragment,{children:[t.jsx(L,{children:t.jsx(Be,{connectedEdges:e.connectedEdges,revisionIds:e.revisionIds})}),t.jsx(Ye,{})]}),t.jsx(L,{sx:{pb:n?6:4},children:t.jsx(Ze,{})})]})};export{rt as EnterpriseEdge,rt as default};
|
package/frontend/build/static/{FeatureMetricsChart-CmPDv0Qg.js → FeatureMetricsChart-TPw8l2qi.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jy as c,dt as m,jj as u,bt as x,b as g,bq as f,r as d,j as b,jM as C,jl as j,jm as v,jn as M,jE as q,jR as S,jH as E,jr as D,jq as T,jp as $}from"./index-
|
|
1
|
+
import{jy as c,dt as m,jj as u,bt as x,b as g,bq as f,r as d,j as b,jM as C,jl as j,jm as v,jn as M,jE as q,jR as S,jH as E,jr as D,jq as T,jp as $}from"./index-Cz4lAJ3Y.js";import{d as L}from"./FeatureViewLazyExport-CBpSqVMU.js";import"./MarkCompletedDialogue-D2TM3HgS.js";import"./aggregateFeatureMetrics-DJ_IwcyH.js";import"./FeatureStaleDialog-DwV5Mzh6.js";import"./PercentageDonut-cKg6eF-p.js";import"./GridLayoutWrapper-CixVvIgD.js";const R=(e,l,s)=>{const a={label:"Total requests",borderColor:e.palette.primary.main,backgroundColor:e.palette.primary.main,data:p(l,s,o=>o.yes+o.no),elements:{point:{radius:6,pointStyle:"circle"},line:{borderDash:[8,4]}}},t={label:"Exposed",borderColor:e.palette.success.main,backgroundColor:e.palette.success.main,data:p(l,s,o=>o.yes),elements:{point:{radius:6,pointStyle:"triangle"}}},r={label:"Not exposed",borderColor:e.palette.error.main,backgroundColor:e.palette.error.main,data:p(l,s,o=>o.no),elements:{point:{radius:6,pointStyle:"triangle",pointRotation:180}}};return{datasets:[t,r,a]}},p=(e,l,s)=>e.map(a=>({x:a.timestamp,y:s(a),variants:a.variants||{}})),_=(e,l)=>{if(l===0)return"";const[s,a]=e,t=Math.floor(Number(a)/l*100);return`${a} (${t}%) - ${s}`},h=(e,l,s,a)=>({locale:a.locale,responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},color:e.palette.text.secondary,plugins:{tooltip:{backgroundColor:e.palette.background.paper,bodyColor:e.palette.text.primary,titleColor:e.palette.text.secondary,borderColor:e.palette.primary.main,borderWidth:1,padding:10,boxPadding:5,usePointStyle:!0,itemSort:(t,r)=>{const o=["Total requests","Exposed","Not exposed"],n=o.indexOf(t.dataset.label),i=o.indexOf(r.dataset.label);return n-i},callbacks:{label:t=>`${t.formattedValue} - ${t.dataset.label}`,afterLabel:t=>{const r=t.dataset.data[t.dataIndex];if(t.dataset.label!=="Exposed"||r.variants===void 0)return"";const{disabled:o,...n}=r.variants;return Object.entries(n).map(i=>_(i,r.y)).join(`
|
|
2
2
|
`)},title:t=>`Time: ${s>48?m(t[0].parsed.x,a.locale,"UTC"):u(t[0].parsed.x,a.locale)}`}},legend:{position:"top",align:"end",labels:{boxWidth:10,boxHeight:10,usePointStyle:!0}},title:{text:k(s),position:"top",align:"start",display:!0,font:{size:16,weight:"400"},color:e.palette.text.primary}},scales:{y:{type:"linear",title:{display:!0,text:"Number of requests",color:e.palette.text.secondary},suggestedMin:0,ticks:{precision:0,color:e.palette.text.secondary},grid:{color:e.palette.divider,borderColor:e.palette.divider}},x:{type:"time",time:{unit:s>48?"day":"hour"},grid:{display:!1},ticks:{callback:(t,r,o)=>s>48?x(o[r].value,a.locale,"UTC"):u(o[r].value,a.locale),color:e.palette.text.secondary}}}}),k=e=>e===1?"Requests in the last hour":`Requests in the last ${L(e)}`;c.font={...c.font,family:"Sen",size:13,weight:"400"};const z=({metrics:e,hoursBack:l,statsSectionId:s})=>{const a=g(),{locationSettings:t}=f(),r=d.useMemo(()=>[...e].sort((i,y)=>i.timestamp.localeCompare(y.timestamp)),[e]),o=d.useMemo(()=>h(a,r,l,t),[a,r,l,t]),n=d.useMemo(()=>R(a,r,t),[a,r,t]);return b.jsx("div",{style:{height:400},children:b.jsx(C,{options:o,data:n,"aria-label":"A feature metrics line chart, with three lines: all requests, positive requests, and negative requests.","aria-describedby":s})})};j.register(v,M,q,S,E,D,T,$);export{z as FeatureMetricsChart,z as default};
|
package/frontend/build/static/{FeatureStaleDialog-p_WEko7Q.js → FeatureStaleDialog-DwV5Mzh6.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as W,H as G,j as t,A as H,m as J,C as O,bf as ie,n as le,q as ce,iN as de,o as ue,s as D,b as K,T as C,u as pe,b8 as me,r as v,b7 as Q,b9 as X,bb as he,aq as Z,c8 as ge,d8 as fe,iO as ve,d2 as be,d7 as M,b3 as V,iP as xe,d6 as Se,d5 as je,h as Te,iQ as ye,bC as ee,iR as Ee,br as te,iS as Ce,iT as Re,iU as Ae,iV as we,iW as ke,hY as Ie,hO as se,iX as De,k as Oe,iY as Pe,iZ as Fe,c3 as ae,aO as N,bz as _e,fY as Ve,f as $,bD as $e,ba as qe,bB as Ne,bI as Ue,c4 as Be,c7 as Le,i_ as Me,i as _,cm as ze,aR as Ye,aS as ne,aV as U,R as We,d9 as Ge,aP as He,bg as z,bd as re,i$ as Je,j0 as Ke,B as Qe,ao as Xe,hN as Ze,j1 as et,cN as tt,j2 as st,fW as at}from"./index-
|
|
1
|
+
import{F as W,H as G,j as t,A as H,m as J,C as O,bf as ie,n as le,q as ce,iN as de,o as ue,s as D,b as K,T as C,u as pe,b8 as me,r as v,b7 as Q,b9 as X,bb as he,aq as Z,c8 as ge,d8 as fe,iO as ve,d2 as be,d7 as M,b3 as V,iP as xe,d6 as Se,d5 as je,h as Te,iQ as ye,bC as ee,iR as Ee,br as te,iS as Ce,iT as Re,iU as Ae,iV as we,iW as ke,hY as Ie,hO as se,iX as De,k as Oe,iY as Pe,iZ as Fe,c3 as ae,aO as N,bz as _e,fY as Ve,f as $,bD as $e,ba as qe,bB as Ne,bI as Ue,c4 as Be,c7 as Le,i_ as Me,i as _,cm as ze,aR as Ye,aS as ne,aV as U,R as We,d9 as Ge,aP as He,bg as z,bd as re,i$ as Je,j0 as Ke,B as Qe,ao as Xe,hN as Ze,j1 as et,cN as tt,j2 as st,fW as at}from"./index-Cz4lAJ3Y.js";var B={},nt=G;Object.defineProperty(B,"__esModule",{value:!0});var oe=B.default=void 0,rt=nt(W()),ot=t,it=(0,rt.default)((0,ot.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");oe=B.default=it;const lt=de(),Nt=({options:e,selectedOptions:r,indeterminateOptions:a,tagType:u,existingTags:o,disabled:l=!1,onChange:s})=>{const i=t.jsx(ue,{fontSize:"small"}),d=p=>p.inputValue?p.inputValue:p.title,g=({key:p,...m},n,{selected:h})=>{const S=(a==null?void 0:a.some(j=>j.title===n.title))??!1;return t.jsxs("li",{...m,children:[t.jsx(O,{condition:!!n.inputValue,show:t.jsx(ie,{sx:{mr:j=>j.spacing(.5)}}),elseShow:t.jsx(le,{icon:i,checkedIcon:t.jsx(ce,{fontSize:"small"}),indeterminateIcon:t.jsx(oe,{fontSize:"small"}),sx:{mr:j=>j.spacing(.5)},checked:h&&!S,indeterminate:S})}),n.title]},p)},f=(p,m)=>{const n=m.inputValue.trim(),h=lt(p,{...m,inputValue:n}),S=p.some(j=>n===j.title);return n.length>=2&&!S&&h.push({inputValue:n,title:`Create new value "${n}"`}),h};return t.jsx(H,{multiple:!0,id:"checkboxes-tag",sx:{marginTop:p=>p.spacing(2),width:500},disableCloseOnSelect:!0,options:e,value:r,isOptionEqualToValue:(p,m)=>m.inputValue&&m.inputValue!==""?p.title===m.inputValue:p.title===m.title,getOptionLabel:d,renderOption:g,filterOptions:f,ListboxProps:{style:{maxHeight:200,overflow:"auto"}},onChange:s,renderInput:p=>t.jsx(J,{...p,label:"Select values",placeholder:"Select values"}),disabled:l})},ct=D("li")({flexDirection:"column"}),Ut=({options:e,value:r,disabled:a=!1,onChange:u})=>{const o=K();return t.jsx(H,{disablePortal:!0,disabled:a,id:"tag-type-select",sx:{marginTop:l=>l.spacing(2),width:500},options:e,disableClearable:!0,value:r,getOptionLabel:l=>l.name,renderOption:({key:l,...s},i)=>t.jsxs(ct,{...s,style:{alignItems:"flex-start",gap:o.spacing(.5)},children:[t.jsx(C,{variant:"body1",children:i.name}),t.jsx(C,{variant:"caption",children:i.description})]},l),renderInput:l=>t.jsx(J,{...l,label:"Tag type",value:r}),onChange:u,ListboxProps:{style:{maxHeight:200,overflow:"auto"}}})},Bt=()=>{const{makeRequest:e,createRequest:r,errors:a,loading:u}=pe({propagateErrors:!0});return{createTag:async s=>{const d=r("api/admin/tags",{method:"POST",body:JSON.stringify(s)});return e(d.caller,d.id)},bulkUpdateTags:async(s,i)=>{const d=`api/admin/projects/${i}/tags`,g=r(d,{method:"PUT",body:JSON.stringify(s)});return e(g.caller,g.id)},errors:a,loading:u}},Lt=(e,r={})=>{const a=async()=>{const g=Q(`api/admin/tags/${e}`);return(await fetch(g,{method:"GET"}).then(X("Tags"))).json()},u=`api/admin/tags/${e}`,{data:o,error:l}=me(!!e,{tags:[]},u,a,r),[s,i]=v.useState(!l&&!o),d=()=>{he(u)};return v.useEffect(()=>{i(!l&&!o)},[o,l]),{tags:(o==null?void 0:o.tags)||[],error:l,loading:s,refetch:d}},dt=D("div")({display:"flex",flexDirection:"column"}),ut=({strategy:e,setStrategy:r,projectId:a,environment:u,editable:o,permission:l=Se})=>{const{trackEvent:s}=Z(),[i,d]=v.useState([]),g=K(),f=e!=null&&e.parameters&&"stickiness"in(e==null?void 0:e.parameters)?String(e.parameters.stickiness):"default";v.useEffect(()=>{d((e.variants||[]).map(n=>({...n,new:o||!1,isValid:!0,id:crypto.randomUUID(),overrides:[]})))},[]),v.useEffect(()=>{r(n=>({...n,variants:i.map(h=>({stickiness:f,name:h.name,weight:h.weight,payload:h.payload,weightType:h.weightType}))}))},[f,JSON.stringify(i)]);const p=(n,h)=>{d(S=>M(S.map(j=>j.id===h?n:j),1e3))},m=()=>{const n=crypto.randomUUID();d(h=>[...h,{name:"",weightType:je.VARIABLE,weight:0,stickiness:f,new:!0,isValid:!1,id:n}]),s("strategy-variants",{props:{eventType:"variant added"}})};return t.jsxs(t.Fragment,{children:[t.jsxs(C,{component:"h3",sx:{m:0,display:"flex",gap:"1ch"},variant:"h3",children:["Variants",t.jsx(ge,{htmlTooltip:!0,tooltip:t.jsxs(t.Fragment,{children:[t.jsx("span",{children:"Variants allow to attach one or more values to this strategy. Variants at the strategy level override variants at the feature level."}),t.jsx(fe,{target:"_blank",href:"https://docs.getunleash.io/concepts/strategy-variants",children:"Learn more"})]})})]}),t.jsxs(dt,{children:[t.jsx(ve,{}),i.map((n,h)=>t.jsx(be,{disableOverrides:!0,variant:n,variants:i,updateVariant:S=>p(S,n.id),removeVariant:()=>d(S=>M(S.filter(j=>j.id!==n.id),1e3)),decorationColor:g.palette.variants[h%g.palette.variants.length]},n.id))]}),t.jsx(V,{onClick:m,variant:"outlined",permission:l,projectId:a,environmentId:u,"data-testid":"ADD_STRATEGY_VARIANT_BUTTON",children:"Add variant"}),t.jsx(xe,{variants:i})]})},pt=D("form")(({theme:e})=>({display:"grid",gap:e.spacing(2)})),Y=D("hr")(({theme:e})=>({width:"100%",height:"1px",margin:e.spacing(2,0),border:"none",background:e.palette.background.elevation2})),mt=D("div")(({theme:e})=>({display:"flex",justifyContent:"end",gap:e.spacing(2),paddingBottom:e.spacing(10)})),ht=({projectId:e,environmentId:r,permission:a,onSubmit:u,onCancel:o,loading:l,strategy:s,setStrategy:i,segments:d,setSegments:g,errors:f})=>{const p=Te("strategyFormConsolidation"),m=ye(s.constraints),{strategyDefinition:n}=ee(s==null?void 0:s.name),{segments:h=[]}=Ee(),S=h.length>0||d.length>0,j=te();if(!n)return null;const P=b=>n.parameters.find(y=>y.name===b),w=(b,y)=>{const E=P(b);if(b!=="groupId"){const I=Fe(E,y);return I?(f.setFormError(b,I),!1):(f.removeFormError(b),!0)}return!0},R=()=>n.parameters.map(b=>b.name).map(b=>{var y;return w(b,(y=s.parameters)==null?void 0:y[b])}).every(Boolean),c=()=>{j(`/projects/${e}/settings/default-strategy`)},k=async b=>{if(b.preventDefault(),R())u();else return},F=(b,y)=>{i(Pe(E=>{E.parameters=E.parameters??{},E.parameters[b]=y})),w(b,y)};return t.jsxs(pt,{onSubmit:k,children:[t.jsx(Ce,{title:s.title||"",setTitle:b=>{i(y=>({...y,title:b}))}}),S?t.jsx(Re,{segments:d,setSegments:g,availableSegments:h}):null,t.jsx(Ae,{strategy:s,setStrategy:i}),t.jsx(Y,{}),p?t.jsx(we,{strategy:s,strategyDefinition:n,updateParameter:F,errors:f}):t.jsx(ke,{strategy:s,strategyDefinition:n,setStrategy:i,validateParameter:w,errors:f}),t.jsx(O,{condition:s.parameters!=null&&"stickiness"in s.parameters,show:t.jsx(ut,{strategy:s,setStrategy:i,environment:r,projectId:e,permission:[Ie,se]})}),t.jsx(Y,{}),t.jsxs(mt,{children:[t.jsx(V,{permission:a,projectId:e,environmentId:r,variant:"contained",color:"primary",type:"submit",disabled:l||!m||f.hasFormErrors(),"data-testid":De,children:"Save strategy"}),t.jsx(Oe,{type:"button",color:"primary",onClick:o||c,disabled:l,children:"Cancel"})]})]})},gt=(e,r)=>{var s,i;const{project:a,refetch:u}=ae(e),o={name:"flexibleRollout",constraints:[],parameters:{rollout:"100",stickiness:a.defaultStickiness||"default",groupId:""}},l=(i=(s=a.environments)==null?void 0:s.find(d=>d.environment===r))==null?void 0:i.defaultStrategy;return{defaultStrategyFallback:o,strategy:l,refetch:u}},Mt=()=>{const e=N("projectId"),r=_e("environmentId"),{refetch:a}=ae(e),{defaultStrategyFallback:u,strategy:o,refetch:l}=gt(e,r),[s,i]=v.useState(o||u),[d,g]=v.useState([]),{updateDefaultStrategy:f,loading:p}=Ve(),{strategyDefinition:m}=ee(s==null?void 0:s.name),{setToastData:n,setToastApiError:h}=$(),S=$e(),{uiConfig:j}=qe(),{unleashUrl:P}=j,w=te(),{trackEvent:R}=Z(),{segments:c,refetchSegments:k}=Ne();v.useEffect(()=>{if(c&&(o!=null&&o.segments)){const E=[];for(const I of o==null?void 0:o.segments)E.push(...c.filter(T=>T.id===I));g(E)}},[JSON.stringify(c),JSON.stringify(o==null?void 0:o.segments)]);const F=ft(s,d),b=async E=>{await f(e,r,E),R("default_strategy",{props:{action:"edit",hasTitle:!!E.title}}),k(),a(),n({text:"Default Strategy updated",type:"success"})},y=async()=>{const E=`/projects/${e}/settings/default-strategy`;try{await b(F),await l(),w(E)}catch(I){h(_(I))}};return!m||!s?null:t.jsx(Ue,{modal:!0,title:Be((s==null?void 0:s.name)??""),description:bt,documentationLink:xt,documentationLinkLabel:St,formatApiCode:()=>vt(e,r,F,m,P),children:t.jsx(ht,{projectId:e,strategy:s,setStrategy:i,segments:d,setSegments:g,environmentId:r,onSubmit:y,loading:p,permission:[Le,se],errors:S,isChangeRequest:!1})})},ft=(e,r)=>({name:e.name,title:e.title,constraints:e.constraints??[],parameters:e.parameters??{},variants:e.variants??[],segments:r.map(a=>a.id),disabled:e.disabled??!1}),vt=(e,r,a,u,o)=>{if(!o)return"";const l={...a,parameters:Me(a.parameters??{},u)},s=`${o}/api/admin/projects/${e}/environments/${r}/default-strategy}`,i=JSON.stringify(l,void 0,2);return`curl --location --request PUT '${s}' \\
|
|
2
2
|
--header 'Authorization: INSERT_API_KEY' \\
|
|
3
3
|
--header 'Content-Type: application/json' \\
|
|
4
4
|
--data-raw '${i}'`},bt=`
|