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-DnroACXc.js";import{i as K,c as b}from"./app-DckefXYL.js";import{_ as v}from"./app-35Uyu21k.js";import{_ as m}from"./app-KcnMuQGX.js";import{L as g}from"./app-DM6WPmnv.js";import{N as x}from"./app-C9iVkiu5.js";import{N as d}from"./app-CUPmXIij.js";import{_ as C}from"./app-DezwSKU9.js";import"./app-uFawAv7F.js";import"./app-BJhJ7lM8.js";import"./app-Dd07dUxy.js";import"./app-CYYQ_Zep.js";import"./app-Dpl5YSiv.js";import"./app-CF8nmC-F.js";import"./app-NVAx7Sc3.js";import"./app-CF0qXH5Q.js";import"./app-xECxwo4T.js";import"./app-BtWF1kMA.js";import"./app-B0NrURRk.js";import"./app-CGj1gg44.js";import"./app-B4bUdtyo.js";import"./app-BeuOvIof.js";import"./app-DSjO_8RR.js";import"./app-CZGZgDLc.js";import"./app-DrIi-dNq.js";import"./app-zueB50zj.js";import"./app-Co2SIBzr.js";import"./app-Cu6FD8m8.js";import"./app-R-vSvFIF.js";import"./app-HaDoyrq5.js";import"./app-Cmxxk_WX.js";import"./app-B09rlSqG.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};
