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-BYcXwl4U.js";import{i as K,c as b}from"./app-a6cKceqE.js";import{_ as v}from"./app-Wy4FFEmL.js";import{_ as m}from"./app-BqeukU67.js";import{L as g}from"./app-W_y7sflh.js";import{N as x}from"./app-DCd54JMo.js";import{N as d}from"./app-CabATHnR.js";import{_ as C}from"./app-uhTxLRnQ.js";import"./app-CJCAnMrx.js";import"./app-Cp3gmk2J.js";import"./app--MWyBMkA.js";import"./app-BG60hdvp.js";import"./app-CNARLpXE.js";import"./app-SxAW7vhf.js";import"./app-D5k1HLu9.js";import"./app-ysQ8KbGS.js";import"./app-BDgR0DSb.js";import"./app-Cc2zXvHs.js";import"./app-DPDEogA0.js";import"./app-aSafd0Me.js";import"./app-BHl80pFw.js";import"./app-Btbk6LWy.js";import"./app-CrkKi1Ag.js";import"./app-u5shTDG_.js";import"./app-MrAtUXr3.js";import"./app-BWSI2Z1R.js";import"./app-DxjODhok.js";import"./app-BhzV4gWo.js";import"./app-CO4sV-Ic.js";import"./app-yt37eDzA.js";import"./app-BQ5ggxk2.js";import"./app-D3zbrzdO.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};
