import{o as a,g as r,b as t,w as o,u as c,c as h,h as f,F as k,i as u,f as p,t as _,a as A}from"./app-SC54XQDl.js";import{i as K,c as b}from"./app-Ba7ZqSpq.js";import{_ as v}from"./app-COkia88n.js";import{_ as m}from"./app-CWnUJ4gg.js";import{L as g}from"./app-Crd12MWL.js";import{N as x}from"./app-CL60OiIv.js";import{N as d}from"./app-B2C_dtYI.js";import{_ as C}from"./app-D9UgVOV0.js";import"./app-DHsI_tns.js";import"./app-BZGObKCm.js";import"./app-BPIIxVwk.js";import"./app-PPG0ZS4d.js";import"./app-DgoEZtNT.js";import"./app-Ch8j4za4.js";import"./app-Dw0jKdCD.js";import"./app-DnXuoh8P.js";import"./app-CCkWSX4Q.js";import"./app-C8HFiBxn.js";import"./app-BjSCO7rC.js";import"./app-g-bJrEAS.js";import"./app-DZaelcLs.js";import"./app-D_RBJHM6.js";import"./app-CmrRgGIA.js";import"./app-DyP4Nide.js";import"./app-D9TrJBlL.js";import"./app-_Ovp2dOH.js";import"./app-Dhl-Bw0H.js";import"./app-COidJXl1.js";import"./app-C28obFWS.js";import"./app-CkINxBL9.js";import"./app--Lj8zATS.js";import"./app-C2mBgI5Z.js";function I(){const{utils:i}=K(this);this.createAccessKey=function(){i.popup("/acl/accesskeys/createPopup",{callback:function(){i.success("保存成功",function(){i.reload()})}})},this.updateAccessKeyIsOn=function(s,n){let l=this,e="";n?e="确定要启用此AccessKey吗？":e="确定要禁用此AccessKey吗？",i.confirm(e,function(){l.$post(".updateIsOn").params({accessKeyId:s,isOn:n?1:0}).refresh()})},this.deleteAccessKey=function(s){let n=this;i.confirm("确定要删除此AccessKey吗？",function(){n.$post(".delete").params({accessKeyId:s}).refresh()})}}const $={key:1},N={key:0,class:"green"},O={key:1,class:"disabled"},w=["onClick"],B=["onClick"],V=["onClick"],de={__name:"index",setup(i){const s=b(new I);return(n,l)=>(a(),r(k,null,[t(x,null,{tabs:o(()=>[t(d,{href:".",name:"AccessKey列表",active:!0}),t(d,{separator:""}),t(d,{static:"",onClick:l[0]||(l[0]=u(e=>c(s).createAccessKey(),["prevent"])),name:"创建AccessKey","action-create":""}),t(d,{separator:""}),t(d,{static:""},{name:o(()=>[t(v,{content:"AccessKey可以用来访问API接口。",class:"flex"})]),_:1})]),_:1}),c(s).accessKeys.length==0?(a(),h(C,{key:0,"disable-spacing":""},{default:o(()=>[p("暂时还没有AccessKey。")]),_:1})):f("",!0),c(s).accessKeys.length>0?(a(),r("div",$,[t(g,{items:c(s).accessKeys,"row-class":e=>e.isOn?"":"gray"},{default:o(()=>[t(m,{header:"AccessKey ID",class:"description-column",frozen:""},{body:o(({data:e})=>[p(_(e.uniqueId),1)]),_:1}),t(m,{header:"AccessKey密钥",class:"description-column"},{body:o(({data:e})=>[p(_(e.secret),1)]),_:1}),t(m,{header:"备注",class:"description-column"},{body:o(({data:e})=>[p(_(e.description),1)]),_:1}),t(m,{header:"状态",class:"fixed-status-column"},{body:o(({data:e})=>[e.isOn?(a(),r("span",N,"已启用")):(a(),r("span",O,"已禁用"))]),_:1}),t(m,{header:"操作",class:"two op",frozen:"","align-frozen":"right"},{body:o(({data:e})=>[e.isOn?(a(),r("a",{key:0,href:"",onClick:u(y=>c(s).updateAccessKeyIsOn(e.id,!1),["prevent"])},"禁用",8,w)):f("",!0),e.isOn?f("",!0):(a(),r("a",{key:1,href:"",onClick:u(y=>c(s).updateAccessKeyIsOn(e.id,!0),["prevent"])},"启用",8,B)),p("   "),A("a",{href:"",onClick:u(y=>c(s).deleteAccessKey(e.id),["prevent"])},"删除",8,V)]),_:1})]),_:1},8,["items","row-class"])])):f("",!0)],64))}};export{de as default};
