1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1115],{1115:function(e,a,n){"use strict";n.r(a),n.d(a,{AdminCachePanel:function(){return v}});var s=n(7437),i=n(2265),l=n(1994),t=n(2431),c=n(1817),r=n(9076),d=n(9205);let o=(0,d.Z)("CircleGauge",[["path",{d:"M15.6 2.7a10 10 0 1 0 5.7 5.7",key:"1e0p6d"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M13.4 10.6 19 5",key:"1kr7tw"}]]);var h=n(4286);let _=(0,d.Z)("LockKeyhole",[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]]);var m=n(3247),u=n(6040),p=n(6039),C=n(9788),x=n.n(C);let g=["resettable","lock","runtime","protected"],j={resettable:"å¯éè½½ç¼å",lock:"éé®",runtime:"è¿è¡ææ°æ®",protected:"åä¿æ¤é®"};function v(e){var a,n,d,C,v;let{token:A,onUnauthorized:b,onNotice:f}=e,[N,P]=(0,i.useState)(null),[k,w]=(0,i.useState)(!0),[S,Z]=(0,i.useState)(!1),[z,E]=(0,i.useState)(""),[R,M]=(0,i.useState)("all"),H=(0,i.useCallback)(async function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];e&&w(!0);try{let e=await u.N.cache.list(A);P(e)}catch(e){if(e instanceof u.k&&401===e.status){b();return}f("error",e instanceof Error?e.message:"ç¼åå表å 载失败")}finally{e&&w(!1)}},[f,b,A]);(0,i.useEffect)(()=>{H()},[H]);let q=null!==(a=null==N?void 0:N.entries)&&void 0!==a?a:[],L=z.trim().toLowerCase(),K=(0,i.useMemo)(()=>q.filter(e=>{var a,n;return("all"===R||e.group===R)&&(!L||"".concat(e.key," ").concat(null!==(a=e.preview)&&void 0!==a?a:""," ").concat(null!==(n=e.protectedReason)&&void 0!==n?n:"").toLowerCase().includes(L))}),[q,R,L]),T=(0,i.useMemo)(()=>{let e=new Map;for(let a of g)e.set(a,[]);for(let n of K){var a;null===(a=e.get(n.group))||void 0===a||a.push(n)}return g.map(a=>{var n;return{group:a,label:j[a],entries:null!==(n=e.get(a))&&void 0!==n?n:[]}}).filter(e=>e.entries.length>0)},[K]);async function V(){if(!S){Z(!0);try{let e=await u.N.cache.reload(A);await H(!1),e.warnings.length>0?f("info","ç¼åå·²éè½½ï¼åå¨ ".concat(e.warnings.length," æ¡é¢çæç¤º")):f("success","ç¼åå·²ç»éè½½å®æ")}catch(e){if(e instanceof u.k&&401===e.status){b();return}f("error",e instanceof Error?e.message:"ç¼åé载失败")}finally{Z(!1)}}}let F=null==N?void 0:N.overview;return(0,s.jsxs)("div",{className:x().wrap,children:[(0,s.jsxs)("section",{className:x().hero,children:[(0,s.jsxs)("div",{className:x().heroCopy,children:[(0,s.jsx)("span",{className:x().eyebrow,children:"SYSTEM \xb7 CACHE"}),(0,s.jsx)("h3",{className:x().title,children:"Redis ç¼åç»´æ¤"}),(0,s.jsx)("p",{className:x().text,children:"è¿éå±ç¤ºå½å Redis é®ç©ºé´ãä¸å¡ç¼åå¯éè½½ï¼ç»è®¡ä¸è¿è¡ææ°æ®ä¿çã"})]}),(0,s.jsxs)("div",{className:x().heroActions,children:[(0,s.jsxs)("button",{type:"button",className:x().secondaryAction,onClick:()=>void H(),children:[(0,s.jsx)(t.Z,{size:15}),(0,s.jsx)("span",{children:"å·æ°å表"})]}),(0,s.jsxs)("button",{type:"button",className:x().primaryAction,onClick:()=>void V(),disabled:S,children:[S?(0,s.jsx)(c.Z,{className:x().spin,size:15}):(0,s.jsx)(r.Z,{size:15}),(0,s.jsx)("span",{children:S?"æ£å¨éè½½":"ä¸é®éè½½ç¼å"})]})]})]}),(0,s.jsxs)("section",{className:x().metrics,children:[(0,s.jsx)(y,{label:"å
¨é¨é®",value:(0,p.q1)(null!==(n=null==F?void 0:F.totalKeys)&&void 0!==n?n:0),detail:N?"æ´æ°äº ".concat(new Date(N.refreshedAt).toLocaleString("zh-CN",{hour12:!1,month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})):"çå¾
æ«æ",icon:(0,s.jsx)(o,{size:16})}),(0,s.jsx)(y,{label:"å¯éè½½",value:(0,p.q1)(null!==(d=null==F?void 0:F.resettableKeys)&&void 0!==d?d:0),detail:"æç« / æ ç¾ / 彿¡£ / ç¸å / æç´¢",icon:(0,s.jsx)(t.Z,{size:16})}),(0,s.jsx)(y,{label:"è¿è¡æ",value:(0,p.q1)(null!==(C=null==F?void 0:F.runtimeKeys)&&void 0!==C?C:0),detail:"计æ°ãç¹èµãæ¶èãçæå»é",icon:(0,s.jsx)(h.Z,{size:16})}),(0,s.jsx)(y,{label:"éé®",value:(0,p.q1)(null!==(v=null==F?void 0:F.lockKeys)&&void 0!==v?v:0),detail:"ç¼åå»ç©¿ä¿æ¤é",icon:(0,s.jsx)(_,{size:16})})]}),(0,s.jsxs)("section",{className:x().toolbar,children:[(0,s.jsxs)("label",{className:x().searchField,children:[(0,s.jsx)(m.Z,{size:16}),(0,s.jsx)("input",{value:z,onChange:e=>E(e.target.value),placeholder:"æç´¢ key / é¢è§ / ä¿æ¤åå "})]}),(0,s.jsx)("div",{className:x().filters,children:["all",...g].map(e=>(0,s.jsx)("button",{type:"button",className:(0,l.Z)(x().filterChip,R===e&&x().filterChipActive),onClick:()=>M(e),children:"all"===e?"å
¨é¨":j[e]},e))})]}),k?(0,s.jsxs)("div",{className:x().loadingState,children:[(0,s.jsx)(c.Z,{className:x().spin,size:16}),(0,s.jsx)("span",{children:"æ£å¨æ«æ Redis é®ç©ºé´"})]}):0===T.length?(0,s.jsx)("div",{className:x().emptyState,children:"å½åç鿡件䏿²¡æå¹é
çç¼åé®ã"}):(0,s.jsx)("div",{className:x().groupStack,children:T.map(e=>(0,s.jsxs)("section",{className:x().groupSection,children:[(0,s.jsxs)("div",{className:x().groupHead,children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:x().groupEyebrow,children:e.label}),(0,s.jsxs)("strong",{children:[(0,p.q1)(e.entries.length)," 个é®"]})]}),(0,s.jsx)("span",{className:x().groupMeta,children:"resettable"===e.group?"å¯è¢«ä¸é®éè½½å é¤å¹¶éæ°é¢ç":"lock"===e.group?"ç¨äºçç¹ç¼åäºæ¥":"runtime"===e.group?"è¿è¡ä¸ç¶æï¼é»è®¤ä¿ç":"æªçº³å
¥ä¸å¡ç¼åç½åå"})]}),(0,s.jsx)("div",{className:x().cardGrid,children:e.entries.map(e=>(0,s.jsxs)("article",{className:x().card,"data-group":e.group,children:[(0,s.jsxs)("div",{className:x().cardHead,children:[(0,s.jsx)("strong",{className:x().key,children:e.key}),(0,s.jsxs)("div",{className:x().badges,children:[(0,s.jsx)("span",{className:x().badge,children:e.redisType}),(0,s.jsx)("span",{className:x().badge,children:null==e.ttlSeconds?"TTL â":"TTL ".concat(e.ttlSeconds,"s")}),(0,s.jsx)("span",{className:(0,l.Z)(x().badge,e.resettable?x().badgeWarm:x().badgeCool),children:e.resettable?"å¯éè½½":"ä¿æ¤ä¸"})]})]}),(0,s.jsxs)("div",{className:x().metaRow,children:[(0,s.jsxs)("span",{children:["è§æ¨¡ ",(0,p.q1)(e.size)]}),(0,s.jsx)("span",{children:j[e.group]})]}),(0,s.jsx)("p",{className:x().preview,children:e.preview||"æ é¢è§"}),e.protectedReason?(0,s.jsx)("div",{className:x().reason,children:e.protectedReason}):(0,s.jsx)("div",{className:x().reasonReady,children:"å é¤åä¼èªå¨éå»ºå¹¶åæ¥å
Œ
±é¡µé¢ã"})]},e.key))})]},e.group))})]})}function y(e){let{label:a,value:n,detail:i,icon:l}=e;return(0,s.jsxs)("div",{className:x().metricCard,children:[(0,s.jsxs)("div",{className:x().metricHead,children:[(0,s.jsx)("span",{children:a}),l]}),(0,s.jsx)("strong",{children:n}),(0,s.jsx)("small",{children:i})]})}},9076:function(e,a,n){"use strict";n.d(a,{Z:function(){return s}});let s=(0,n(9205).Z)("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]])},4286:function(e,a,n){"use strict";n.d(a,{Z:function(){return s}});let s=(0,n(9205).Z)("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",ke
1y:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},9788:function(e){e.exports={wrap:"AdminCachePanel_wrap__j1rdn",hero:"AdminCachePanel_hero__zlW6g",metricCard:"AdminCachePanel_metricCard__EcHb7",toolbar:"AdminCachePanel_toolbar____SKj",groupSection:"AdminCachePanel_groupSection___PYDk",card:"AdminCachePanel_card__fKnjn",loadingState:"AdminCachePanel_loadingState__056Iy",emptyState:"AdminCachePanel_emptyState__UqbK0",heroCopy:"AdminCachePanel_heroCopy__pVTbw",heroActions:"AdminCachePanel_heroActions__G1i51",metrics:"AdminCachePanel_metrics__bkK8n",filters:"AdminCachePanel_filters__h_uWF",groupStack:"AdminCachePanel_groupStack__ylImC",eyebrow:"AdminCachePanel_eyebrow__sVCYF",groupEyebrow:"AdminCachePanel_groupEyebrow__3BJCO",metricHead:"AdminCachePanel_metricHead__0fuEs",groupMeta:"AdminCachePanel_groupMeta__kQLRl",badge:"AdminCachePanel_badge__IwPer",metaRow:"AdminCachePanel_metaRow__Vtn5D",reason:"AdminCachePanel_reason__8njdt",reasonReady:"AdminCachePanel_reasonReady__uPv1Z",title:"AdminCachePanel_title__zhf3V",text:"AdminCachePanel_text__FTm6P",preview:"AdminCachePanel_preview__d669R",groupHead:"AdminCachePanel_groupHead__ll_it",cardHead:"AdminCachePanel_cardHead__EOVAB",badges:"AdminCachePanel_badges__qmf_V",primaryAction:"AdminCachePanel_primaryAction__NQQp1",secondaryAction:"AdminCachePanel_secondaryAction__x0ApZ",filterChip:"AdminCachePanel_filterChip__BCoH8",filterChipActive:"AdminCachePanel_filterChipActive__ELuDi",badgeWarm:"AdminCachePanel_badgeWarm__LXeIY",badgeCool:"AdminCachePanel_badgeCool__eToNI",searchField:"AdminCachePanel_searchField__BEgtH",cardGrid:"AdminCachePanel_cardGrid__vB08d",key:"AdminCachePanel_key__h18s0",spin:"AdminCachePanel_spin__P_3Ml"}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.