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-DA7OTM4Q.js";import{i as K,c as b}from"./app-BT68AfZ-.js";import{_ as v}from"./app-D4kZhDW_.js";import{_ as m}from"./app-Dapk2SAF.js";import{L as g}from"./app-CjSxNKvA.js";import{N as x}from"./app-scFtFqL8.js";import{N as d}from"./app-BX4pd6U-.js";import{_ as C}from"./app-BWsCS5pa.js";import"./app-z_TsLOhk.js";import"./app-C5ROEzFd.js";import"./app-Bnbo6OlJ.js";import"./app-Dxa5h-uG.js";import"./app-AbPAjGV5.js";import"./app-BqY8p2gl.js";import"./app-C-GI59rl.js";import"./app-DSiZNBrr.js";import"./app-BotiHebp.js";import"./app-DUjqI3OV.js";import"./app-CnGe5nlE.js";import"./app-45ZaIHUI.js";import"./app-KNE_24OY.js";import"./app-SLkqftrw.js";import"./app-BxVwOz69.js";import"./app-WOreqTiW.js";import"./app-DREBJ-ou.js";import"./app-CWBL8eTX.js";import"./app-OC5wWJiS.js";import"./app-Bhreb6Cm.js";import"./app-up4gT9D9.js";import"./app-D29bbm9n.js";import"./app-B_5dka6q.js";import"./app-CQwVTjAx.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};
