import{r as c,j as e}from"./vendor-codemirror-B1SGo4xl.js";import{C as z,b as F,c as H,d as oe,a as R}from"./card-BIfzBCEy.js";import{f as je,r as q,u as v,B as l,m as Q,s as ve,D as W,a as Y,b as Z,c as ee,d as se,e as te,v as ce,o as be}from"./index-Dungj95X.js";import{I as k}from"./input-CXoUQQLm.js";import{L as C}from"./label-CMpUoC87.js";import{B as _}from"./badge-CGJlVD3L.js";import{u as ne}from"./use-toast-DNZLibQY.js";import{C as I}from"./code-snippet-block-E9P2jHS4.js";import{aj as ae,P as re,L as D,ak as Se,x as Ne,al as Pe,am as Ke,an as we,b as ke,A as Ce,ao as _e,U as De,j as Te}from"./vendor-icons-DmqcWdzX.js";function B(t){if(!t)return"—";const a=new Date(t);return Number.isNaN(a.getTime())?"—":a.toLocaleString()}function T(t=12){const a=new Date;return a.setMonth(a.getMonth()+t),a.toISOString().slice(0,10)}function Le(t){if(!t)return T();const a=new Date(t);return Number.isNaN(a.getTime())?T():a.toISOString().slice(0,10)}function $e(t,a){if(!t||!a)return{pct:0,daysLeft:null};const n=new Date(t).getTime(),s=new Date(a).getTime(),x=Date.now();if(s<=n)return{pct:0,daysLeft:0};const y=Math.max(0,Math.ceil((s-x)/864e5));return{pct:Math.min(100,Math.max(0,(x-n)/(s-n)*100)),daysLeft:y}}function Oe(t){return t?t.length<=10?t:`${t.slice(0,6)}…${t.slice(-4)}`:"—"}function Me(){const{toast:t}=ne(),a=je(),n=ve(),[s,x]=c.useState(null),[y,u]=c.useState(!0),[p,d]=c.useState(!1),[A,N]=c.useState(!1),[P,f]=c.useState(""),[K,m]=c.useState(!1),[j,r]=c.useState("create"),[L,$]=c.useState(""),[w,O]=c.useState(T()),[ie,M]=c.useState(!1),[de,pe]=c.useState(""),U=c.useCallback(async()=>{u(!0);try{const i=q();i&&f(i);const S=await v.getApiAccessKey().catch(()=>({has_token:!1}));x(S)}finally{u(!1)}},[]);c.useEffect(()=>{U()},[U]);const h=P||q(),le=s?.access_key_mask||(s?.prefix?`${s.prefix}.•••••••••••••••••••••••••••••••••`:""),{pct:xe,daysLeft:me}=c.useMemo(()=>$e(s?.created_at,s?.expires_at),[s?.created_at,s?.expires_at]),g=s?.days_left??me,b=!!s?.expired||s?.status==="expired"||g!=null&&g<=0,E=()=>{r("create"),$(""),O(T()),m(!0)},ue=()=>{r("edit"),$(s?.description||""),O(Le(s?.expires_at)),m(!0)},he=async()=>{if(j==="edit"){d(!0);try{const o=await v.updateApiAccessKey({description:L,expires_at:w});x(o),m(!1),t({title:"凭证信息已更新"})}catch(o){t({title:"更新失败",description:o?.message||String(o),variant:"destructive"})}finally{d(!1)}return}const i=!!s?.has_token;if(await a({title:i?"轮换凭证":"签发凭证",description:i?"旧凭证将立即作废,是否继续?":"凭证明文仅显示一次,请妥善保存。",confirmText:i?"轮换":"签发",variant:i?"destructive":"default"})){d(!0);try{const o=await v.regenerateApiAccessKey({description:L,expires_at:w});f(o.token),ce(o.token),pe(o.token),M(!0),m(!1),x({has_token:!0,key_id:o.key_id,prefix:o.prefix,access_key_mask:`${o.prefix}.•••••••••••••••••••••••••••••••••`,description:o.description,created_at:o.created_at,expires_at:o.expires_at,status:"active",expired:!1,days_left:Math.ceil((new Date(o.expires_at).getTime()-Date.now())/864e5)}),t({title:"凭证已签发",description:"已保存至本浏览器,请立即复制"})}catch(o){t({title:"签发失败",description:o?.message||String(o),variant:"destructive"})}finally{d(!1)}}},ge=async()=>{if(await a({title:"吊销凭证",description:"吊销后 Pipeline / curl 调用将全部失败,是否继续?",confirmText:"吊销",variant:"destructive"})){d(!0);try{await v.revokeApiAccessKey(),f(""),ce(""),x({has_token:!1}),t({title:"凭证已吊销"})}catch(S){t({title:"吊销失败",description:S?.message||String(S),variant:"destructive"})}finally{d(!1)}}},X=h?`X-AIOps-Access-Key: ${h}`:"X-AIOps-Access-Key: <你的访问凭证>",G="test-k8s",J="default",V="demo-jar",ye=`curl -X POST '${n}/kubernetes/${G}/namespace/${J}/deployments/${V}/update-image' \\ -H '${X}' \\ -H 'Content-Type: application/json' \\ -d '{"image":"harbor.example.com/app:v1.0","container_name":"main"}'`,Ae=`curl -X POST '${n}/kubernetes/${G}/namespace/${J}/deployments/${V}/restart' \\ -H '${X}'`,fe=b?"bg-red-500":g!=null&&g<=30?"bg-amber-400":"bg-[var(--dg-blue)]";return e.jsxs(e.Fragment,{children:[e.jsxs(z,{"code-path":"src/components/user/ApiAccessKeySection.tsx:229:7",className:"dg-card border-[var(--dg-blue)]/20",children:[e.jsxs(F,{"code-path":"src/components/user/ApiAccessKeySection.tsx:230:9",className:"flex flex-row items-start justify-between gap-4 space-y-0",children:[e.jsxs("div",{"code-path":"src/components/user/ApiAccessKeySection.tsx:231:11",children:[e.jsxs(H,{"code-path":"src/components/user/ApiAccessKeySection.tsx:232:13",className:"text-base flex items-center gap-2 text-[var(--dg-text-primary)]",children:[e.jsx(ae,{"code-path":"src/components/user/ApiAccessKeySection.tsx:233:15",className:"h-4 w-4 text-[var(--dg-blue)]"}),"CI/CD 访问凭证",e.jsx(_,{"code-path":"src/components/user/ApiAccessKeySection.tsx:235:15",className:"text-[10px] bg-[var(--dg-blue)]/15 text-[var(--dg-blue)] border-[var(--dg-blue)]/30",children:"长期有效"})]}),e.jsx(oe,{"code-path":"src/components/user/ApiAccessKeySection.tsx:237:13",className:"text-xs mt-1",children:"每人唯一凭证,Deployment 发布脚本自动引用,不随登录会话过期。"})]}),!y&&!s?.has_token&&e.jsxs(l,{"code-path":"src/components/user/ApiAccessKeySection.tsx:242:13",size:"sm",onClick:E,disabled:p,children:[e.jsx(re,{"code-path":"src/components/user/ApiAccessKeySection.tsx:243:15",className:"h-4 w-4 mr-1"}),"签发凭证"]})]}),e.jsxs(R,{"code-path":"src/components/user/ApiAccessKeySection.tsx:247:9",className:"space-y-4",children:[y?e.jsxs("div",{"code-path":"src/components/user/ApiAccessKeySection.tsx:249:13",className:"flex items-center gap-2 py-8 text-sm text-[var(--dg-text-muted)] justify-center",children:[e.jsx(D,{"code-path":"src/components/user/ApiAccessKeySection.tsx:250:15",className:"h-4 w-4 animate-spin"}),"加载中…"]}):s?.has_token?e.jsx("div",{"code-path":"src/components/user/ApiAccessKeySection.tsx:253:13",className:"rounded-xl border border-[var(--dg-border)] bg-[var(--dg-bg-tertiary)]/40 overflow-hidden",children:e.jsxs("div",{"code-path":"src/components/user/ApiAccessKeySection.tsx:255:15",className:"flex",children:[e.jsx("div",{"code-path":"src/components/user/ApiAccessKeySection.tsx:256:17",className:Q("w-1 shrink-0",b?"bg-red-500":g!=null&&g<=30?"bg-amber-400":"bg-gradient-to-b from-[var(--dg-blue)] to-[var(--dg-purple)]")}),e.jsxs("div",{"code-path":"src/components/user/ApiAccessKeySection.tsx:260:17",className:"flex-1 p-4 space-y-4",children:[e.jsxs("div",{"code-path":"src/components/user/ApiAccessKeySection.tsx:261:19",className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{"code-path":"src/components/user/ApiAccessKeySection.tsx:262:21",className:"space-y-1 min-w-0 flex-1",children:[e.jsx("p",{"code-path":"src/components/user/ApiAccessKeySection.tsx:263:23",className:"text-[10px] uppercase tracking-wider text-[var(--dg-text-muted)]",children:"凭证字符串"}),e.jsxs("div",{"code-path":"src/components/user/ApiAccessKeySection.tsx:264:23",className:"flex items-center gap-2",children:[e.jsx("code",{"code-path":"src/components/user/ApiAccessKeySection.tsx:265:25",className:"flex-1 min-w-0 text-xs font-mono text-[var(--dg-text-primary)] bg-[var(--dg-bg-secondary)] border border-[var(--dg-border)] rounded-md px-3 py-2 truncate block",children:A&&h?h:le}),h&&e.jsx(l,{"code-path":"src/components/user/ApiAccessKeySection.tsx:269:27",variant:"outline",size:"icon",className:"h-9 w-9 shrink-0 border-[var(--dg-border)]",onClick:()=>N(!A),title:A?"隐藏":"显示",children:A?e.jsx(Se,{"code-path":"src/components/user/ApiAccessKeySection.tsx:276:42",className:"h-3.5 w-3.5"}):e.jsx(Ne,{"code-path":"src/components/user/ApiAccessKeySection.tsx:276:79",className:"h-3.5 w-3.5"})})]})]}),e.jsxs("div",{"code-path":"src/components/user/ApiAccessKeySection.tsx:281:21",className:"flex flex-wrap gap-1.5 shrink-0",children:[e.jsxs(l,{"code-path":"src/components/user/ApiAccessKeySection.tsx:282:23",variant:"outline",size:"sm",className:"h-8 text-xs border-[var(--dg-border)]",onClick:ue,disabled:p,children:[e.jsx(Pe,{"code-path":"src/components/user/ApiAccessKeySection.tsx:283:25",className:"h-3 w-3 mr-1"}),"调整"]}),e.jsxs(l,{"code-path":"src/components/user/ApiAccessKeySection.tsx:285:23",variant:"outline",size:"sm",className:"h-8 text-xs border-[var(--dg-border)]",onClick:E,disabled:p,children:[e.jsx(Ke,{"code-path":"src/components/user/ApiAccessKeySection.tsx:286:25",className:"h-3 w-3 mr-1"}),"轮换"]}),e.jsxs(l,{"code-path":"src/components/user/ApiAccessKeySection.tsx:288:23",variant:"outline",size:"sm",className:"h-8 text-xs border-red-500/30 text-red-400",onClick:ge,disabled:p,children:[e.jsx(we,{"code-path":"src/components/user/ApiAccessKeySection.tsx:289:25",className:"h-3 w-3 mr-1"}),"吊销"]})]})]}),e.jsxs("div",{"code-path":"src/components/user/ApiAccessKeySection.tsx:294:19",className:"grid grid-cols-2 sm:grid-cols-3 gap-x-6 gap-y-3 text-xs",children:[e.jsxs("div",{"code-path":"src/components/user/ApiAccessKeySection.tsx:295:21",children:[e.jsx("p",{"code-path":"src/components/user/ApiAccessKeySection.tsx:296:23",className:"text-[var(--dg-text-muted)] mb-0.5",children:"用途说明"}),e.jsx("p",{"code-path":"src/components/user/ApiAccessKeySection.tsx:297:23",className:"text-[var(--dg-text-secondary)]",children:s.description||"未填写"})]}),e.jsxs("div",{"code-path":"src/components/user/ApiAccessKeySection.tsx:299:21",children:[e.jsx("p",{"code-path":"src/components/user/ApiAccessKeySection.tsx:300:23",className:"text-[var(--dg-text-muted)] mb-0.5",children:"凭证标识"}),e.jsx("p",{"code-path":"src/components/user/ApiAccessKeySection.tsx:301:23",className:"font-mono text-[var(--dg-text-secondary)]",title:s.key_id,children:Oe(s.key_id)})]}),e.jsxs("div",{"code-path":"src/components/user/ApiAccessKeySection.tsx:303:21",children:[e.jsx("p",{"code-path":"src/components/user/ApiAccessKeySection.tsx:304:23",className:"text-[var(--dg-text-muted)] mb-0.5",children:"签发时间"}),e.jsx("p",{"code-path":"src/components/user/ApiAccessKeySection.tsx:305:23",className:"text-[var(--dg-text-secondary)]",children:B(s.created_at)})]})]}),e.jsxs("div",{"code-path":"src/components/user/ApiAccessKeySection.tsx:310:19",className:"space-y-1.5",children:[e.jsxs("div",{"code-path":"src/components/user/ApiAccessKeySection.tsx:311:21",className:"flex items-center justify-between text-[11px]",children:[e.jsxs("span",{"code-path":"src/components/user/ApiAccessKeySection.tsx:312:23",className:"flex items-center gap-1 text-[var(--dg-text-muted)]",children:[e.jsx(ke,{"code-path":"src/components/user/ApiAccessKeySection.tsx:313:25",className:"h-3 w-3"}),b?"已过期":g!=null?`剩余 ${g} 天`:"有效期"]}),e.jsxs("span",{"code-path":"src/components/user/ApiAccessKeySection.tsx:316:23",className:"text-[var(--dg-text-muted)]",children:["有效至 ",B(s.expires_at)]})]}),e.jsx("div",{"code-path":"src/components/user/ApiAccessKeySection.tsx:320:21",className:"h-1.5 rounded-full bg-[var(--dg-bg-secondary)] overflow-hidden",children:e.jsx("div",{"code-path":"src/components/user/ApiAccessKeySection.tsx:321:23",className:Q("h-full rounded-full transition-all",fe),style:{width:`${b?100:100-xe}%`}})})]}),e.jsxs("div",{"code-path":"src/components/user/ApiAccessKeySection.tsx:328:19",className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-[11px] text-[var(--dg-text-muted)] pt-1 border-t border-[var(--dg-border)]/60",children:[e.jsxs("span",{"code-path":"src/components/user/ApiAccessKeySection.tsx:329:21",className:"inline-flex items-center gap-1",children:[e.jsx(Ce,{"code-path":"src/components/user/ApiAccessKeySection.tsx:330:23",className:"h-3 w-3"}),"最近调用 ",B(s.last_used_at)]}),s.prefix&&e.jsxs("span",{"code-path":"src/components/user/ApiAccessKeySection.tsx:334:23",children:["前缀 ",e.jsx("code",{"code-path":"src/components/user/ApiAccessKeySection.tsx:334:32",className:"text-[var(--dg-text-secondary)]",children:s.prefix})]}),b&&e.jsx(_,{"code-path":"src/components/user/ApiAccessKeySection.tsx:337:23",variant:"outline",className:"text-[10px] border-red-500/40 text-red-400",children:"需续期或轮换"})]})]})]})}):e.jsxs("div",{"code-path":"src/components/user/ApiAccessKeySection.tsx:344:13",className:"rounded-xl border border-dashed border-[var(--dg-border)] bg-[var(--dg-bg-tertiary)]/30 px-6 py-12 text-center",children:[e.jsx("div",{"code-path":"src/components/user/ApiAccessKeySection.tsx:345:15",className:"mx-auto mb-3 h-12 w-12 rounded-full bg-[var(--dg-blue)]/10 flex items-center justify-center",children:e.jsx(ae,{"code-path":"src/components/user/ApiAccessKeySection.tsx:346:17",className:"h-6 w-6 text-[var(--dg-blue)]"})}),e.jsx("p",{"code-path":"src/components/user/ApiAccessKeySection.tsx:348:15",className:"text-sm text-[var(--dg-text-secondary)]",children:"尚未签发 CI/CD 访问凭证"}),e.jsx("p",{"code-path":"src/components/user/ApiAccessKeySection.tsx:349:15",className:"text-xs text-[var(--dg-text-muted)] mt-1 mb-4",children:"签发后可用于 Pipeline 触发镜像更新、滚动重启等操作"}),e.jsxs(l,{"code-path":"src/components/user/ApiAccessKeySection.tsx:350:15",size:"sm",onClick:E,disabled:p,children:[e.jsx(re,{"code-path":"src/components/user/ApiAccessKeySection.tsx:351:17",className:"h-4 w-4 mr-1"}),"立即签发"]})]}),s?.has_token&&!h&&e.jsx("p",{"code-path":"src/components/user/ApiAccessKeySection.tsx:357:13",className:"text-[11px] text-amber-400/90",children:"本机未缓存凭证明文,请点击「轮换」重新签发一次;签发后将自动填入 Deployment 发布 curl。"}),e.jsxs("div",{"code-path":"src/components/user/ApiAccessKeySection.tsx:360:11",className:"rounded-lg bg-[var(--dg-bg-tertiary)]/60 p-4 space-y-3",children:[e.jsxs("p",{"code-path":"src/components/user/ApiAccessKeySection.tsx:361:13",className:"text-xs font-medium text-[var(--dg-text-secondary)] flex items-center gap-1.5",children:[e.jsx(_e,{"code-path":"src/components/user/ApiAccessKeySection.tsx:362:15",className:"h-3.5 w-3.5 text-purple-400"}),"调用示例"]}),e.jsx(I,{"code-path":"src/components/user/ApiAccessKeySection.tsx:364:13",label:"更新镜像",code:ye,copyLabel:"curl 已复制",copyDisabled:!h,copyDisabledTitle:"请先签发访问凭证"}),e.jsx(I,{"code-path":"src/components/user/ApiAccessKeySection.tsx:371:13",label:"滚动重启",code:Ae,copyLabel:"curl 已复制",copyDisabled:!h,copyDisabledTitle:"请先签发访问凭证"})]})]})]}),e.jsx(W,{"code-path":"src/components/user/ApiAccessKeySection.tsx:382:7",open:K,onOpenChange:m,children:e.jsxs(Y,{"code-path":"src/components/user/ApiAccessKeySection.tsx:383:9",className:"bg-[var(--dg-bg-secondary)] border-[var(--dg-border)] sm:max-w-md",children:[e.jsxs(Z,{"code-path":"src/components/user/ApiAccessKeySection.tsx:384:11",children:[e.jsx(ee,{"code-path":"src/components/user/ApiAccessKeySection.tsx:385:13",className:"text-[var(--dg-text-primary)]",children:j==="edit"?"调整凭证":s?.has_token?"轮换凭证":"签发凭证"}),e.jsx(se,{"code-path":"src/components/user/ApiAccessKeySection.tsx:388:13",className:"text-xs text-[var(--dg-text-muted)]",children:j==="edit"?"修改用途说明与有效期限,凭证字符串不变。":"填写用途并设定有效期,签发后请立即保存明文。"})]}),e.jsxs("div",{"code-path":"src/components/user/ApiAccessKeySection.tsx:392:11",className:"space-y-3 py-2",children:[e.jsxs("div",{"code-path":"src/components/user/ApiAccessKeySection.tsx:393:13",children:[e.jsx(C,{"code-path":"src/components/user/ApiAccessKeySection.tsx:394:15",className:"text-xs text-[var(--dg-text-muted)]",children:"用途说明"}),e.jsx(k,{"code-path":"src/components/user/ApiAccessKeySection.tsx:395:15",value:L,onChange:i=>$(i.target.value),placeholder:"如 Jenkins 流水线、GitLab CI",className:"mt-1 h-9 bg-[var(--dg-bg-tertiary)] border-[var(--dg-border)]"})]}),e.jsxs("div",{"code-path":"src/components/user/ApiAccessKeySection.tsx:402:13",children:[e.jsx(C,{"code-path":"src/components/user/ApiAccessKeySection.tsx:403:15",className:"text-xs text-[var(--dg-text-muted)]",children:"有效至"}),e.jsx(k,{"code-path":"src/components/user/ApiAccessKeySection.tsx:404:15",type:"date",value:w,onChange:i=>O(i.target.value),className:"mt-1 h-9 bg-[var(--dg-bg-tertiary)] border-[var(--dg-border)]"})]})]}),e.jsxs(te,{"code-path":"src/components/user/ApiAccessKeySection.tsx:412:11",children:[e.jsx(l,{"code-path":"src/components/user/ApiAccessKeySection.tsx:413:13",variant:"outline",onClick:()=>m(!1),className:"border-[var(--dg-border)]",children:"取消"}),e.jsxs(l,{"code-path":"src/components/user/ApiAccessKeySection.tsx:414:13",onClick:he,disabled:p||!w,children:[p?e.jsx(D,{"code-path":"src/components/user/ApiAccessKeySection.tsx:415:32",className:"h-4 w-4 animate-spin mr-1"}):null,j==="edit"?"保存":s?.has_token?"轮换":"签发"]})]})]})}),e.jsx(W,{"code-path":"src/components/user/ApiAccessKeySection.tsx:422:7",open:ie,onOpenChange:M,children:e.jsxs(Y,{"code-path":"src/components/user/ApiAccessKeySection.tsx:423:9",className:"bg-[var(--dg-bg-secondary)] border-[var(--dg-border)] sm:max-w-lg",children:[e.jsxs(Z,{"code-path":"src/components/user/ApiAccessKeySection.tsx:424:11",children:[e.jsx(ee,{"code-path":"src/components/user/ApiAccessKeySection.tsx:425:13",className:"text-[var(--dg-text-primary)]",children:"请保存凭证明文"}),e.jsx(se,{"code-path":"src/components/user/ApiAccessKeySection.tsx:426:13",className:"text-xs text-[var(--dg-text-muted)]",children:"仅此一次机会查看完整字符串,关闭后无法再次获取。"})]}),e.jsx(I,{"code-path":"src/components/user/ApiAccessKeySection.tsx:430:11",label:"访问凭证",code:de,copyLabel:"凭证已复制",className:"mt-2"}),e.jsx(te,{"code-path":"src/components/user/ApiAccessKeySection.tsx:436:11",children:e.jsx(l,{"code-path":"src/components/user/ApiAccessKeySection.tsx:437:13",onClick:()=>M(!1),children:"我已保存"})})]})})]})}function Ge(){const{toast:t}=ne(),a=be(r=>r.user),[n,s]=c.useState(null),[x,y]=c.useState(!0),[u,p]=c.useState(""),[d,A]=c.useState(""),[N,P]=c.useState(!1),f=c.useCallback(async()=>{y(!0);try{const r=await v.getProfile();s(r)}finally{y(!1)}},[]);c.useEffect(()=>{f()},[f]);const K=n?.real_name||n?.nickname||a?.nickname||a?.username||"用户",m=n?.username||a?.username||"",j=async()=>{if(!(!u||d.length<6)){P(!0);try{await v.changePassword({old_password:u,new_password:d}),t({title:"密码已修改"}),p(""),A("")}catch(r){t({title:"修改失败",description:r?.message||String(r),variant:"destructive"})}finally{P(!1)}}};return x?e.jsxs("div",{"code-path":"src/components/user/ProfilePage.tsx:57:7",className:"flex items-center justify-center py-24 text-[var(--dg-text-muted)]",children:[e.jsx(D,{"code-path":"src/components/user/ProfilePage.tsx:58:9",className:"h-6 w-6 animate-spin mr-2"}),"加载中..."]}):e.jsxs("div",{"code-path":"src/components/user/ProfilePage.tsx:64:5",className:"max-w-5xl mx-auto space-y-6 pb-8",children:[e.jsxs("div",{"code-path":"src/components/user/ProfilePage.tsx:65:7",className:"flex items-center gap-4",children:[e.jsx("div",{"code-path":"src/components/user/ProfilePage.tsx:66:9",className:"h-16 w-16 rounded-2xl bg-gradient-to-br from-[var(--dg-blue)] to-[var(--dg-purple)] flex items-center justify-center text-white text-2xl font-bold shadow-lg",children:K.charAt(0).toUpperCase()}),e.jsxs("div",{"code-path":"src/components/user/ProfilePage.tsx:69:9",children:[e.jsx("h1",{"code-path":"src/components/user/ProfilePage.tsx:70:11",className:"text-2xl font-bold text-[var(--dg-text-primary)]",children:K}),e.jsxs("p",{"code-path":"src/components/user/ProfilePage.tsx:71:11",className:"text-sm text-[var(--dg-text-muted)]",children:["@",m," · ",n?.email||"—"]}),e.jsx("div",{"code-path":"src/components/user/ProfilePage.tsx:72:11",className:"flex gap-2 mt-2",children:(n?.roles||[]).map(r=>e.jsx(_,{"code-path":"src/components/user/ProfilePage.tsx:74:15",variant:"outline",className:"border-[var(--dg-border)] text-[var(--dg-text-secondary)] text-xs",children:r.name||r},r.id||r.name))})]})]}),e.jsxs("div",{"code-path":"src/components/user/ProfilePage.tsx:82:7",className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[e.jsxs(z,{"code-path":"src/components/user/ProfilePage.tsx:83:9",className:"dg-card",children:[e.jsx(F,{"code-path":"src/components/user/ProfilePage.tsx:84:11",className:"pb-3",children:e.jsxs(H,{"code-path":"src/components/user/ProfilePage.tsx:85:13",className:"text-base flex items-center gap-2 text-[var(--dg-text-primary)]",children:[e.jsx(De,{"code-path":"src/components/user/ProfilePage.tsx:86:15",className:"h-4 w-4 text-[var(--dg-blue)]"}),"基本信息"]})}),e.jsxs(R,{"code-path":"src/components/user/ProfilePage.tsx:89:11",className:"space-y-3 text-sm",children:[e.jsxs("div",{"code-path":"src/components/user/ProfilePage.tsx:90:13",className:"flex justify-between",children:[e.jsx("span",{"code-path":"src/components/user/ProfilePage.tsx:90:51",className:"text-[var(--dg-text-muted)]",children:"用户名"}),e.jsx("span",{"code-path":"src/components/user/ProfilePage.tsx:90:107",className:"font-mono",children:m})]}),e.jsxs("div",{"code-path":"src/components/user/ProfilePage.tsx:91:13",className:"flex justify-between",children:[e.jsx("span",{"code-path":"src/components/user/ProfilePage.tsx:91:51",className:"text-[var(--dg-text-muted)]",children:"邮箱"}),e.jsx("span",{"code-path":"src/components/user/ProfilePage.tsx:91:106",children:n?.email||"—"})]}),e.jsxs("div",{"code-path":"src/components/user/ProfilePage.tsx:92:13",className:"flex justify-between",children:[e.jsx("span",{"code-path":"src/components/user/ProfilePage.tsx:92:51",className:"text-[var(--dg-text-muted)]",children:"手机"}),e.jsx("span",{"code-path":"src/components/user/ProfilePage.tsx:92:106",children:n?.phone||"—"})]}),e.jsxs("div",{"code-path":"src/components/user/ProfilePage.tsx:93:13",className:"flex justify-between",children:[e.jsx("span",{"code-path":"src/components/user/ProfilePage.tsx:93:51",className:"text-[var(--dg-text-muted)]",children:"账号来源"}),e.jsx(_,{"code-path":"src/components/user/ProfilePage.tsx:94:15",variant:"outline",className:"text-xs",children:n?.auth_source==="ldap"?"LDAP":"本地"})]})]})]}),e.jsxs(z,{"code-path":"src/components/user/ProfilePage.tsx:99:9",className:"dg-card",children:[e.jsxs(F,{"code-path":"src/components/user/ProfilePage.tsx:100:11",className:"pb-3",children:[e.jsxs(H,{"code-path":"src/components/user/ProfilePage.tsx:101:13",className:"text-base flex items-center gap-2 text-[var(--dg-text-primary)]",children:[e.jsx(Te,{"code-path":"src/components/user/ProfilePage.tsx:102:15",className:"h-4 w-4 text-emerald-400"}),"安全设置"]}),e.jsx(oe,{"code-path":"src/components/user/ProfilePage.tsx:104:13",className:"text-xs",children:"修改登录密码"})]}),e.jsxs(R,{"code-path":"src/components/user/ProfilePage.tsx:106:11",className:"space-y-3",children:[e.jsxs("div",{"code-path":"src/components/user/ProfilePage.tsx:107:13",children:[e.jsx(C,{"code-path":"src/components/user/ProfilePage.tsx:108:15",className:"text-xs text-[var(--dg-text-muted)]",children:"当前密码"}),e.jsx(k,{"code-path":"src/components/user/ProfilePage.tsx:109:15",type:"password",value:u,onChange:r=>p(r.target.value),className:"mt-1 h-9 bg-[var(--dg-bg-tertiary)] border-[var(--dg-border)]"})]}),e.jsxs("div",{"code-path":"src/components/user/ProfilePage.tsx:111:13",children:[e.jsx(C,{"code-path":"src/components/user/ProfilePage.tsx:112:15",className:"text-xs text-[var(--dg-text-muted)]",children:"新密码"}),e.jsx(k,{"code-path":"src/components/user/ProfilePage.tsx:113:15",type:"password",value:d,onChange:r=>A(r.target.value),className:"mt-1 h-9 bg-[var(--dg-bg-tertiary)] border-[var(--dg-border)]"})]}),e.jsxs(l,{"code-path":"src/components/user/ProfilePage.tsx:115:13",size:"sm",onClick:j,disabled:N||!u||d.length<6,children:[N?e.jsx(D,{"code-path":"src/components/user/ProfilePage.tsx:116:28",className:"h-4 w-4 animate-spin mr-1"}):null,"保存密码"]})]})]})]}),e.jsx(Me,{"code-path":"src/components/user/ProfilePage.tsx:123:7"})]})}export{Ge as default};