Files
aiops/backend/static/assets/CloudAccountManager-DWaqgfr4.js
T
Logan.Li 5fad2db0c6 fix(k8s): 可视化编辑器 YAML 解析失败(managedFields 清理)
- 先解析原始 YAML 再对象级剥离,避免 cleanYAML 破坏结构
- managedFields 从 METADATA_LINE_KEYS 移除,改整块删除含数组项
- YamlViewer 同步使用 parseEditableManifest
2026-06-26 14:53:20 +08:00

2 lines
24 KiB
JavaScript

import{j as e,r as a}from"./vendor-codemirror-C7mXSpXt.js";import{B as d,D as R,a as W,b as Q,c as V,d as $,e as G}from"./index-BBDEBVET.js";import{I as h}from"./input-e2KnvZus.js";import{L as u}from"./label-J75lkt_x.js";import{C as N,a as y}from"./card-D4L46nh3.js";import{B as A}from"./badge-D4cmFHTS.js";import{c as v}from"./account-BLs7Zqry.js";import{R as _,P as F,S as X,ag as S,C as Z,a as q,d as k,T as J,i as U,L as Y}from"./vendor-icons-Aso0-eeY.js";const L={aws:{viewBox:"0 0 24 24",color:"#FF9900",path:"M6.763 10.036c0 .296.032.535.088.71.064.176.144.368.256.576.04.063.056.127.056.183 0 .08-.048.16-.152.24l-.503.335a.383.383 0 0 1-.208.072c-.08 0-.16-.04-.24-.112a2.47 2.47 0 0 1-.288-.375 6.18 6.18 0 0 1-.248-.471c-.622.734-1.405 1.101-2.347 1.101-.671 0-1.205-.191-1.596-.574-.391-.384-.59-.894-.59-1.533 0-.678.239-1.23.726-1.644.487-.415 1.133-.623 1.955-.623.272 0 .551.024.846.064.296.04.6.104.918.176v-.583c0-.607-.127-1.03-.375-1.277-.255-.248-.686-.367-1.3-.367-.28 0-.568.031-.863.103-.295.072-.583.16-.862.272a2.287 2.287 0 0 1-.28.104.488.488 0 0 1-.127.023c-.112 0-.168-.08-.168-.247v-.391c0-.128.016-.224.056-.28a.597.597 0 0 1 .224-.167c.279-.144.614-.264 1.005-.36a4.84 4.84 0 0 1 1.246-.151c.95 0 1.644.216 2.091.647.439.43.662 1.085.662 1.963v2.586zm-3.24 1.21c.265 0 .538-.048.822-.144.283-.096.535-.271.742-.51.128-.152.224-.32.264-.512.04-.191.072-.423.072-.694v-.335a6.66 6.66 0 0 0-.735-.136 6.02 6.02 0 0 0-.75-.048c-.535 0-.926.104-1.19.32-.263.215-.39.518-.39.917 0 .375.095.654.295.846.191.2.47.296.838.296zm3.89.527c-.073 0-.12-.016-.152-.048-.032-.024-.064-.08-.088-.152L6.155 5.563a.715.715 0 0 1-.032-.16c0-.128.064-.2.192.2h.703c.08 0 .136.016.168.048.032.024.064.08.088.152l1.348 5.298 1.252-5.298c.024-.08.056-.128.088-.152a.355.355 0 0 1 .176-.048h.575c.08 0 .136.016.176.048.032.024.072.08.088.152l1.268 5.362 1.39-5.362c.024-.08.056-.128.088-.152a.344.344 0 0 1 .168-.048h.67c.128 0 .2.072.2.2 0 .04-.008.072-.016.112 0 0-.04.128-.088.152l-1.916 6.15c-.032.08-.064.128-.096.152a.355.355 0 0 1-.176.048h-.622c-.08 0-.136-.016-.176-.048-.032-.024-.064-.08-.088-.152l-1.26-5.186-1.252 5.178c-.024.08-.056.128-.088.152a.355.355 0 0 1-.176.048h-.623zm9.166.215c-.367 0-.734-.04-1.094-.127-.359-.088-.638-.184-.822-.296-.112-.064-.191-.136-.223-.2a.498.498 0 0 1-.032-.128v-.399c0-.167.064-.247.183-.247a.45.45 0 0 1 .144.024c.048.016.12.048.2.08.271.12.566.215.878.279.319.064.63.096.95.096.502 0 .893-.088 1.164-.264a.86.86 0 0 0 .415-.758.777.777 0 0 0-.215-.55c-.144-.151-.423-.287-.83-.415l-1.188-.367c-.598-.192-1.044-.471-1.316-.838a1.95 1.95 0 0 1-.415-1.205c0-.351.072-.662.215-.918.144-.255.335-.479.575-.654.24-.184.51-.319.822-.415.311-.096.638-.136.982-.136.176 0 .36.008.535.032.184.024.351.056.518.088.152.04.303.08.439.127.136.048.24.096.311.144a.66.66 0 0 1 .176.144.298.298 0 0 1 .048.184v.359c0 .168-.064.256-.183.256a.83.83 0 0 1-.304-.096 3.68 3.68 0 0 0-1.548-.311c-.463 0-.83.072-1.085.231-.255.16-.39.4-.39.743 0 .351.128.59.383.758.255.168.702.335 1.331.48.583.135 1.005.311 1.268.518.263.207.39.495.39.862 0 .367-.128.662-.375.902-.247.247-.67.375-1.26.375zm2.004 1.332c-2.637 1.948-6.488 2.984-9.793 2.984-4.635 0-8.81-1.715-11.966-4.566-.255-.224-.024-.335.271-.144 3.41 1.987 7.622 3.183 11.966 3.183 2.936 0 6.158-.61 9.119-1.876.44-.207.815.287.383.615zm1.078-1.23c-.336-.431-2.223-.2-3.073-.103-.255.024-.295-.192-.064-.351 1.5-1.053 3.962-.75 4.246-.4.287.359-.08 2.824-1.484 4.004-.215.184-.423.088-.319-.151.311-.774 1.005-2.51.662-2.956v-.443z"},azure:{viewBox:"0 0 24 24",color:"#0078D4",path:"M5.483 21.3H24L14.025 4.013l-3.022 5.915 5.99 9.357H8.787l-3.304 6.015zM8.7 3.197L0 21.3h6.395l4.49-8.51L8.7 3.196z"},gcp:{viewBox:"0 0 24 24",color:"#4285F4",path:"M12.19 2.38a9.344 9.344 0 0 0-9.234 6.893c.053-.02-.055.013 0 0-3.875 2.551-3.922 8.11-.247 10.941l.006-.007-.007.03a6.717 6.717 0 0 0 4.077 1.356h5.173l.03.03h5.192c6.687.053 9.376-8.605 3.835-12.35a9.365 9.365 0 0 0-2.821-4.552l-.043.043.006-.05A9.344 9.344 0 0 0 12.19 2.38zm-.358 4.146c1.244-.04 2.518.368 3.486 1.15a5.186 5.186 0 0 1 1.862 4.078v.518c3.53-.07 3.53 5.262 0 5.193h-5.193l-.008.009v-.04H6.785a2.59 2.59 0 0 1-1.067-.23h.001a2.597 2.597 0 1 1 3.437-3.437l3.013-3.012A6.747 6.747 0 0 0 8.11 8.24c.018-.01.04-.026.054-.023a5.186 5.186 0 0 1 3.67-1.69z"},aliyun:{viewBox:"0 0 24 24",color:"#FF6A00",path:"M3.996 4.517h5.291L8.01 6.324 4.153 7.506a1.668 1.668 0 0 0-1.165 1.601v5.786a1.668 1.668 0 0 0 1.165 1.6l3.857 1.183 1.277 1.807H3.996A3.996 3.996 0 0 1 0 15.487V8.513a3.996 3.996 0 0 1 3.996-3.996m16.008 0h-5.291l1.277 1.807 3.857 1.182c.715.227 1.17.889 1.165 1.601v5.786a1.668 1.668 0 0 1-1.165 1.6l-3.857 1.183-1.277 1.807h5.291A3.996 3.996 0 0 0 24 15.487V8.513a3.996 3.996 0 0 0-3.996-3.996m-4.007 8.345H8.002v-1.804h7.995Z"},tencent:{viewBox:"220 60 620 430",color:"#006EFF",paths:[{fill:"#006EFF",d:"M685.3,188.5c-24.7-66.3-88-110.4-158.8-110.5c-84.8,0-152.2,62.8-165.3,140.8c6.5,0,13.1-2.1,21.8-2.1c8.7,0,19.6,2.1,28.3,2.1c10.9-54.2,58.7-93.2,115.3-93.2c47.8,0,89.2,28.2,108.7,69.3c0,0,2.2,2.2,2.2,0C652.6,192.8,670,188.5,685.3,188.5L685.3,188.5"},{fill:"#00C8DC",d:"M456.9,242.6c-23.9-17.3-47.9-26-76.1-26c-33.9,0-66.2,14.2-89.2,39c-48.4,49.7-47.4,129.2,2.2,177.7c21.7,19.5,43.5,30.3,69.6,32.5l50-47.7h-28.3c-28.3-2.1-45.7-10.8-56.5-21.6c-30-29.6-30.9-77.6-2.2-108.3c15.2-15.2,32.6-21.7,54.4-21.7c13.1,0,32.6,2.1,52.2,21.6c8.7,8.7,32.6,26,41.3,34.7h2.1l32.6-32.5v-2.2C493.9,273,470,253.5,456.9,242.6"},{fill:"#00A3FF",d:"M724.4,396.5c-8.7,8.7-26.1,21.7-56.5,21.7h-187c56.5-54.1,104.4-99.6,108.8-104c8.3-8.4,17-16.3,26.1-23.8c21.8-19.5,39.1-21.7,54.4-21.7c21.7,0,39.1,8.7,54.4,21.6C754.9,318.5,754.9,368.4,724.4,396.5z M761.4,255.6c-23-24.8-55.3-39-89.2-39c-30.4,0-56.5,10.9-80.5,28.2c-8.8,8.7-21.8,17.3-32.7,30.3c-8.7,8.7-195.7,190.7-195.7,190.7c10.9,2.2,23.9,2.2,34.8,2.2h237.1c17.4,0,30.5,0,43.5-2.2c30-2.2,58.3-14.4,80.5-34.7C809.2,383.5,809.2,303.4,761.4,255.6L761.4,255.6"}]},huawei:{viewBox:"0 0 24 24",color:"#FF0000",path:"M3.67 6.14S1.82 7.91 1.72 9.78v.35c.08 1.51 1.22 2.4 1.22 2.4 1.83 1.79 6.26 4.04 7.3 4.55 0 0 .06.03.1-.01l.02-.04v-.04C7.52 10.8 3.67 6.14 3.67 6.14zM9.65 18.6c-.02-.08-.1-.08-.1-.08l-7.38.26c.8 1.43 2.15 2.53 3.56 2.2.96-.25 3.16-1.78 3.88-2.3.06-.05.04-.09.04-.09zm.08-.78C6.49 15.63.21 12.28.21 12.28c-.15.46-.2.9-.21 1.3v.07c0 1.07.4 1.82.4 1.82.8 1.69 2.34 2.2 2.34 2.2.7.3 1.4.31 1.4.31.12.02 4.4 0 5.54 0 .05 0 .08-.05.08-.05v-.06c0-.03-.03-.05-.03-.05zM9.06 3.19a3.42 3.42 0 00-2.57 3.15v.41c.03.6.16 1.05.16 1.05.66 2.9 3.86 7.65 4.55 8.65.05.05.1.03.1.03a.1.1 0 00.06-.1c1.06-10.6-1.11-13.42-1.11-13.42-.32.02-1.19.23-1.19.23zm8.299 2.27s-.49-1.8-2.44-2.28c0 0-.57-.14-1.17-.22 0 0-2.18 2.81-1.12 13.43.01.07.06.08.06.08.07.03.1-.03.1-.03.72-1.03 3.9-5.76 4.55-8.64 0 0 .36-1.4.02-2.34zm-2.92 13.07s-.07 0-.09.05c0 0-.01.07.03.1.7.51 2.85 2 3.88 2.3 0 0 .16.05.43.06h.14c.69-.02 1.9-.37 3-2.26l-7.4-.25zm7.83-8.41c.14-2.06-1.94-3.97-1.94-3.98 0 0-3.85 4.66-6.67 10.8 0 0-.03.08.02.13l.04.01h.06c1.06-.53 5.46-2.77 7.28-4.54 0 0 1.15-.93 1.21-2.42zm1.52 2.14s-6.28 3.37-9.52 5.55c0 0-.05.04-.03.11 0 0 .03.06.07.06 1.16 0 5.56 0 5.67-.02 0 0 .57-.02 1.27-.29 0 0 1.56-.5 2.37-2.27 0 0 .73-1.45.17-3.14z"}};function ee({provider:t,className:p="h-5 w-5"}){const n=L[t]||L.aliyun;return e.jsx("svg",{"code-path":"src/components/icons/CloudBrandIcon.tsx:69:5",className:p,viewBox:n.viewBox,fill:"currentColor",style:{color:n.color},role:"img","aria-label":t,children:n.paths?n.paths.map((m,x)=>e.jsx("path",{"code-path":"src/components/icons/CloudBrandIcon.tsx:79:11",d:m.d,fill:m.fill||"currentColor"},x)):e.jsx("path",{"code-path":"src/components/icons/CloudBrandIcon.tsx:82:9",d:n.path})})}function ce(t){return{aws:"#FF9900",azure:"#0078D4",gcp:"#4285F4",aliyun:"#FF6A00",tencent:"#006EFF",huawei:"#FF0000"}[t]||"#64748B"}const se={aws:"AWS",aliyun:"阿里云",tencent:"腾讯云",huawei:"华为云",azure:"Azure",gcp:"GCP"};function pe(){const[t,p]=a.useState([]),[n,m]=a.useState(!0),[x,B]=a.useState(""),[M,D]=a.useState("all"),[E,i]=a.useState(!1),[b,f]=a.useState(!1),[o,w]=a.useState(null),[s,l]=a.useState({name:"",provider:"aliyun",access_key:"",secret_key:"",monthly_cost:"",status:"active"}),I=()=>{w(null),l({name:"",provider:"aliyun",access_key:"",secret_key:"",monthly_cost:"",status:"active"})},K=()=>{I(),i(!0)},P=c=>{w(c),l({name:c.name||"",provider:c.provider||"aliyun",access_key:"",secret_key:"",monthly_cost:String(c.monthly_cost??0),status:c.status||"active"}),i(!0)},H=async()=>{if(!(!s.name.trim()||!s.provider.trim()))try{f(!0);const c={name:s.name.trim(),provider:s.provider,access_key:s.access_key.trim(),secret_key:s.secret_key.trim(),monthly_cost:Number(s.monthly_cost)||0,status:s.status};o?await v.updateAccount(o.id,c):await v.createAccount(c),i(!1),g()}catch(c){console.error(o?"更新云账号失败:":"创建云账号失败:",c)}finally{f(!1)}},g=async()=>{try{m(!0);const c=await v.getAccounts();p(c?.list||[])}catch(c){console.error("加载云账号列表失败:",c),p([])}finally{m(!1)}};a.useEffect(()=>{g()},[]);const O=async c=>{try{await v.deleteAccount(c),g()}catch(r){console.error("删除云账号失败:",r)}},z=t.filter(c=>{const r=c.access_key||c.accessKey||"",j=(c.name||"").toLowerCase().includes(x.toLowerCase())||r.toLowerCase().includes(x.toLowerCase()),C=M==="all"||c.provider===M;return j&&C});return t.length,t.filter(c=>c.status==="active").length,t.filter(c=>c.status==="inactive").length,t.filter(c=>c.status==="error").length,e.jsxs("div",{"code-path":"src/components/cloud/CloudAccountManager.tsx:156:5",className:"space-y-6",children:[e.jsxs("div",{"code-path":"src/components/cloud/CloudAccountManager.tsx:158:7",className:"flex items-center justify-between",children:[e.jsxs("div",{"code-path":"src/components/cloud/CloudAccountManager.tsx:159:9",children:[e.jsx("h1",{"code-path":"src/components/cloud/CloudAccountManager.tsx:160:11",className:"text-2xl font-bold text-slate-100",children:"云账号管理"}),e.jsx("p",{"code-path":"src/components/cloud/CloudAccountManager.tsx:161:11",className:"text-slate-400 mt-1",children:"管理多云平台的访问凭证和账号信息"})]}),e.jsxs("div",{"code-path":"src/components/cloud/CloudAccountManager.tsx:163:9",className:"flex items-center gap-2",children:[e.jsxs(d,{"code-path":"src/components/cloud/CloudAccountManager.tsx:164:11",variant:"outline",onClick:g,className:"border-slate-700 text-slate-300",children:[e.jsx(_,{"code-path":"src/components/cloud/CloudAccountManager.tsx:165:13",className:`h-4 w-4 mr-2 ${n?"animate-spin":""}`}),"刷新"]}),e.jsxs(d,{"code-path":"src/components/cloud/CloudAccountManager.tsx:168:11",className:"bg-blue-600 hover:bg-blue-700",onClick:K,children:[e.jsx(F,{"code-path":"src/components/cloud/CloudAccountManager.tsx:169:13",className:"h-4 w-4 mr-2"}),"添加账号"]})]})]}),e.jsxs("div",{"code-path":"src/components/cloud/CloudAccountManager.tsx:176:7",className:"flex items-center gap-4",children:[e.jsxs("div",{"code-path":"src/components/cloud/CloudAccountManager.tsx:177:9",className:"relative flex-1 max-w-md",children:[e.jsx(X,{"code-path":"src/components/cloud/CloudAccountManager.tsx:178:11",className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-slate-400"}),e.jsx(h,{"code-path":"src/components/cloud/CloudAccountManager.tsx:179:11",placeholder:"搜索账号名称或AccessKey...",value:x,onChange:c=>B(c.target.value),className:"pl-10 bg-slate-800 border-slate-700 text-slate-100"})]}),e.jsxs("select",{"code-path":"src/components/cloud/CloudAccountManager.tsx:186:9",value:M,onChange:c=>D(c.target.value),className:"px-3 py-2 bg-slate-800 border border-slate-700 rounded-md text-slate-100 text-sm",children:[e.jsx("option",{"code-path":"src/components/cloud/CloudAccountManager.tsx:191:11",value:"all",children:"全部平台"}),e.jsx("option",{"code-path":"src/components/cloud/CloudAccountManager.tsx:192:11",value:"aws",children:"AWS"}),e.jsx("option",{"code-path":"src/components/cloud/CloudAccountManager.tsx:193:11",value:"aliyun",children:"阿里云"}),e.jsx("option",{"code-path":"src/components/cloud/CloudAccountManager.tsx:194:11",value:"tencent",children:"腾讯云"}),e.jsx("option",{"code-path":"src/components/cloud/CloudAccountManager.tsx:195:11",value:"huawei",children:"华为云"}),e.jsx("option",{"code-path":"src/components/cloud/CloudAccountManager.tsx:196:11",value:"azure",children:"Azure"})]})]}),n?e.jsx(N,{"code-path":"src/components/cloud/CloudAccountManager.tsx:202:9",className:"bg-slate-800 border-slate-700",children:e.jsxs(y,{"code-path":"src/components/cloud/CloudAccountManager.tsx:203:11",className:"p-12 text-center text-slate-500",children:[e.jsx(_,{"code-path":"src/components/cloud/CloudAccountManager.tsx:204:13",className:"h-6 w-6 animate-spin mx-auto mb-3"}),"加载中..."]})}):z.length===0?e.jsx(N,{"code-path":"src/components/cloud/CloudAccountManager.tsx:209:9",className:"bg-slate-800 border-slate-700",children:e.jsx(y,{"code-path":"src/components/cloud/CloudAccountManager.tsx:210:11",className:"p-12 text-center text-slate-500",children:"暂无云账号数据"})}):e.jsx("div",{"code-path":"src/components/cloud/CloudAccountManager.tsx:213:9",className:"grid grid-cols-2 gap-4",children:z.map(c=>{const r=c.access_key||c.accessKey||"",j=c.server_count??c.serverCount??0,C=c.last_sync||c.lastSync||c.created_at||"-",T=c.monthly_cost??c.monthlyCost??0;return e.jsx(N,{"code-path":"src/components/cloud/CloudAccountManager.tsx:220:15",className:"bg-slate-800 border-slate-700",children:e.jsxs(y,{"code-path":"src/components/cloud/CloudAccountManager.tsx:221:17",className:"p-4",children:[e.jsxs("div",{"code-path":"src/components/cloud/CloudAccountManager.tsx:222:19",className:"flex items-start justify-between",children:[e.jsxs("div",{"code-path":"src/components/cloud/CloudAccountManager.tsx:223:21",className:"flex items-start gap-3",children:[e.jsx("div",{"code-path":"src/components/cloud/CloudAccountManager.tsx:224:23",className:"w-10 h-10 rounded-lg bg-slate-800 flex items-center justify-center",style:{borderBottom:`2px solid ${ce(c.provider)}`},children:e.jsx(ee,{"code-path":"src/components/cloud/CloudAccountManager.tsx:225:25",provider:c.provider,className:"h-6 w-6"})}),e.jsxs("div",{"code-path":"src/components/cloud/CloudAccountManager.tsx:227:23",children:[e.jsx("h3",{"code-path":"src/components/cloud/CloudAccountManager.tsx:228:25",className:"font-medium text-slate-100",children:c.name}),e.jsx("p",{"code-path":"src/components/cloud/CloudAccountManager.tsx:229:25",className:"text-sm text-slate-400 mt-0.5",children:se[c.provider]||c.provider}),e.jsxs("div",{"code-path":"src/components/cloud/CloudAccountManager.tsx:230:25",className:"flex items-center gap-3 mt-2",children:[r&&e.jsxs(A,{"code-path":"src/components/cloud/CloudAccountManager.tsx:232:29",variant:"secondary",className:"bg-slate-700 text-slate-300",children:[e.jsx(S,{"code-path":"src/components/cloud/CloudAccountManager.tsx:233:31",className:"h-3 w-3 mr-1"}),r.slice(0,8),"..."]}),c.status==="active"&&e.jsxs(A,{"code-path":"src/components/cloud/CloudAccountManager.tsx:238:29",className:"bg-green-500/20 text-green-400 border-0",children:[e.jsx(Z,{"code-path":"src/components/cloud/CloudAccountManager.tsx:239:31",className:"h-3 w-3 mr-1"}),"正常"]}),c.status==="inactive"&&e.jsxs(A,{"code-path":"src/components/cloud/CloudAccountManager.tsx:244:29",className:"bg-slate-500/20 text-slate-400 border-0",children:[e.jsx(q,{"code-path":"src/components/cloud/CloudAccountManager.tsx:245:31",className:"h-3 w-3 mr-1"}),"已停用"]}),c.status==="error"&&e.jsxs(A,{"code-path":"src/components/cloud/CloudAccountManager.tsx:250:29",className:"bg-red-500/20 text-red-400 border-0",children:[e.jsx(S,{"code-path":"src/components/cloud/CloudAccountManager.tsx:251:31",className:"h-3 w-3 mr-1"}),"异常"]})]})]})]}),e.jsxs("div",{"code-path":"src/components/cloud/CloudAccountManager.tsx:258:21",className:"flex items-center gap-1",children:[e.jsx(d,{"code-path":"src/components/cloud/CloudAccountManager.tsx:259:23",variant:"ghost",size:"icon",className:"h-8 w-8 text-slate-400 hover:text-blue-400",onClick:()=>P(c),children:e.jsx(k,{"code-path":"src/components/cloud/CloudAccountManager.tsx:265:25",className:"h-4 w-4"})}),e.jsx(d,{"code-path":"src/components/cloud/CloudAccountManager.tsx:267:23",variant:"ghost",size:"icon",className:"h-8 w-8 text-slate-400 hover:text-red-400",onClick:()=>O(c.id),children:e.jsx(J,{"code-path":"src/components/cloud/CloudAccountManager.tsx:273:25",className:"h-4 w-4"})})]})]}),e.jsxs("div",{"code-path":"src/components/cloud/CloudAccountManager.tsx:277:19",className:"grid grid-cols-3 gap-4 mt-4 pt-4 border-t border-slate-700",children:[e.jsxs("div",{"code-path":"src/components/cloud/CloudAccountManager.tsx:278:21",children:[e.jsx("p",{"code-path":"src/components/cloud/CloudAccountManager.tsx:279:23",className:"text-xs text-slate-400",children:"月费用"}),e.jsxs("p",{"code-path":"src/components/cloud/CloudAccountManager.tsx:280:23",className:"text-lg font-medium text-emerald-400",children:["¥",Number(T).toLocaleString()]})]}),e.jsxs("div",{"code-path":"src/components/cloud/CloudAccountManager.tsx:282:21",children:[e.jsx("p",{"code-path":"src/components/cloud/CloudAccountManager.tsx:283:23",className:"text-xs text-slate-400",children:"服务器数"}),e.jsx("p",{"code-path":"src/components/cloud/CloudAccountManager.tsx:284:23",className:"text-lg font-medium text-slate-100",children:j})]}),e.jsxs("div",{"code-path":"src/components/cloud/CloudAccountManager.tsx:286:21",children:[e.jsx("p",{"code-path":"src/components/cloud/CloudAccountManager.tsx:287:23",className:"text-xs text-slate-400",children:"最后同步"}),e.jsx("p",{"code-path":"src/components/cloud/CloudAccountManager.tsx:288:23",className:"text-sm text-slate-300",children:C!=="-"?new Date(C).toLocaleString():"-"})]})]})]})},c.id)})}),e.jsx(R,{"code-path":"src/components/cloud/CloudAccountManager.tsx:301:7",open:E,onOpenChange:i,children:e.jsxs(W,{"code-path":"src/components/cloud/CloudAccountManager.tsx:302:9",className:"bg-slate-800 border-slate-700 text-slate-100 max-w-lg",children:[e.jsxs(Q,{"code-path":"src/components/cloud/CloudAccountManager.tsx:303:11",children:[e.jsxs(V,{"code-path":"src/components/cloud/CloudAccountManager.tsx:304:13",className:"text-slate-100 flex items-center gap-2",children:[e.jsx(U,{"code-path":"src/components/cloud/CloudAccountManager.tsx:305:15",className:"h-5 w-5 text-blue-400"}),o?"编辑云账号":"添加云账号"]}),e.jsx($,{"code-path":"src/components/cloud/CloudAccountManager.tsx:308:13",className:"text-slate-400",children:o?"修改账号信息和访问凭证,留空则保持原凭证不变":"录入多云平台的访问凭证,用于资源同步与成本统计"})]}),e.jsxs("div",{"code-path":"src/components/cloud/CloudAccountManager.tsx:313:11",className:"space-y-4 py-2",children:[e.jsxs("div",{"code-path":"src/components/cloud/CloudAccountManager.tsx:314:13",className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{"code-path":"src/components/cloud/CloudAccountManager.tsx:315:15",className:"space-y-1.5",children:[e.jsxs(u,{"code-path":"src/components/cloud/CloudAccountManager.tsx:316:17",className:"text-slate-300",children:["账号名称 ",e.jsx("span",{"code-path":"src/components/cloud/CloudAccountManager.tsx:317:24",className:"text-red-400",children:"*"})]}),e.jsx(h,{"code-path":"src/components/cloud/CloudAccountManager.tsx:319:17",placeholder:"阿里云生产账号",value:s.name,onChange:c=>l({...s,name:c.target.value}),className:"bg-slate-900 border-slate-700 text-slate-100 placeholder:text-slate-500"})]}),e.jsxs("div",{"code-path":"src/components/cloud/CloudAccountManager.tsx:326:15",className:"space-y-1.5",children:[e.jsxs(u,{"code-path":"src/components/cloud/CloudAccountManager.tsx:327:17",className:"text-slate-300",children:["云平台 ",e.jsx("span",{"code-path":"src/components/cloud/CloudAccountManager.tsx:328:23",className:"text-red-400",children:"*"})]}),e.jsxs("select",{"code-path":"src/components/cloud/CloudAccountManager.tsx:330:17",value:s.provider,onChange:c=>l({...s,provider:c.target.value}),className:"w-full px-3 py-2 bg-slate-900 border border-slate-700 rounded-md text-slate-100 text-sm",children:[e.jsx("option",{"code-path":"src/components/cloud/CloudAccountManager.tsx:335:19",value:"aliyun",children:"阿里云"}),e.jsx("option",{"code-path":"src/components/cloud/CloudAccountManager.tsx:336:19",value:"tencent",children:"腾讯云"}),e.jsx("option",{"code-path":"src/components/cloud/CloudAccountManager.tsx:337:19",value:"aws",children:"AWS"}),e.jsx("option",{"code-path":"src/components/cloud/CloudAccountManager.tsx:338:19",value:"huawei",children:"华为云"}),e.jsx("option",{"code-path":"src/components/cloud/CloudAccountManager.tsx:339:19",value:"azure",children:"Azure"})]})]})]}),e.jsxs("div",{"code-path":"src/components/cloud/CloudAccountManager.tsx:344:13",className:"space-y-1.5",children:[e.jsxs(u,{"code-path":"src/components/cloud/CloudAccountManager.tsx:345:15",className:"text-slate-300",children:["AccessKey",o&&e.jsx("span",{"code-path":"src/components/cloud/CloudAccountManager.tsx:347:36",className:"text-xs text-slate-500 ml-2",children:"留空保持不变"})]}),e.jsx(h,{"code-path":"src/components/cloud/CloudAccountManager.tsx:349:15",placeholder:"LTAI...",value:s.access_key,onChange:c=>l({...s,access_key:c.target.value}),className:"bg-slate-900 border-slate-700 text-slate-100 placeholder:text-slate-500 font-mono text-sm"})]}),e.jsxs("div",{"code-path":"src/components/cloud/CloudAccountManager.tsx:357:13",className:"space-y-1.5",children:[e.jsxs(u,{"code-path":"src/components/cloud/CloudAccountManager.tsx:358:15",className:"text-slate-300",children:["SecretKey",o&&e.jsx("span",{"code-path":"src/components/cloud/CloudAccountManager.tsx:360:36",className:"text-xs text-slate-500 ml-2",children:"留空保持不变"})]}),e.jsx(h,{"code-path":"src/components/cloud/CloudAccountManager.tsx:362:15",type:"password",placeholder:"••••••••",value:s.secret_key,onChange:c=>l({...s,secret_key:c.target.value}),className:"bg-slate-900 border-slate-700 text-slate-100 placeholder:text-slate-500 font-mono text-sm"})]}),e.jsxs("div",{"code-path":"src/components/cloud/CloudAccountManager.tsx:371:13",className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{"code-path":"src/components/cloud/CloudAccountManager.tsx:372:15",className:"space-y-1.5",children:[e.jsx(u,{"code-path":"src/components/cloud/CloudAccountManager.tsx:373:17",className:"text-slate-300",children:"月费用 (元)"}),e.jsx(h,{"code-path":"src/components/cloud/CloudAccountManager.tsx:374:17",type:"number",min:"0",placeholder:"0",value:s.monthly_cost,onChange:c=>l({...s,monthly_cost:c.target.value}),className:"bg-slate-900 border-slate-700 text-slate-100 placeholder:text-slate-500"})]}),e.jsxs("div",{"code-path":"src/components/cloud/CloudAccountManager.tsx:383:15",className:"space-y-1.5",children:[e.jsx(u,{"code-path":"src/components/cloud/CloudAccountManager.tsx:384:17",className:"text-slate-300",children:"状态"}),e.jsxs("select",{"code-path":"src/components/cloud/CloudAccountManager.tsx:385:17",value:s.status,onChange:c=>l({...s,status:c.target.value}),className:"w-full px-3 py-2 bg-slate-900 border border-slate-700 rounded-md text-slate-100 text-sm",children:[e.jsx("option",{"code-path":"src/components/cloud/CloudAccountManager.tsx:390:19",value:"active",children:"正常"}),e.jsx("option",{"code-path":"src/components/cloud/CloudAccountManager.tsx:391:19",value:"inactive",children:"已停用"}),e.jsx("option",{"code-path":"src/components/cloud/CloudAccountManager.tsx:392:19",value:"error",children:"异常"})]})]})]})]}),e.jsxs(G,{"code-path":"src/components/cloud/CloudAccountManager.tsx:398:11",children:[e.jsx(d,{"code-path":"src/components/cloud/CloudAccountManager.tsx:399:13",variant:"outline",onClick:()=>i(!1),className:"border-slate-700 text-slate-300 hover:bg-slate-700",children:"取消"}),e.jsxs(d,{"code-path":"src/components/cloud/CloudAccountManager.tsx:402:13",className:"bg-blue-600 hover:bg-blue-700",disabled:!s.name.trim()||b,onClick:H,children:[b?e.jsx(Y,{"code-path":"src/components/cloud/CloudAccountManager.tsx:407:29",className:"h-4 w-4 mr-2 animate-spin"}):o?e.jsx(k,{"code-path":"src/components/cloud/CloudAccountManager.tsx:407:98",className:"h-4 w-4 mr-2"}):e.jsx(F,{"code-path":"src/components/cloud/CloudAccountManager.tsx:407:136",className:"h-4 w-4 mr-2"}),o?"保存修改":"创建账号"]})]})]})})]})}export{pe as CloudAccountManager};