import"./rolldown-runtime-BM3Ffeng.js";import{Q as e,X as t,a as n,b as r,d as i,dt as a,f as o}from"./element-plus-vendor-BF9PNysW.js";import{A as s,Ct as c,D as l,N as u,O as d,P as f,Pt as p,Tt as m,Z as h,bt as g,et as _,gt as v,ht as y}from"./vue-vendor-DMUmTARL.js";import{sn as b}from"./icons-vendor-Db5MGAkr.js";import{D as x,b as S,l as C,n as w,v as T,y as E}from"./index-BcZTP2Ia.js";import{n as D,t as O}from"./AdminSearchFormItem-D96zWAX5.js";import{t as k}from"./el-date-picker-plus-Rh9KnJdb.js";import{t as A}from"./AdminSettingLayout-CzCwKa9p.js";import{t as j}from"./admin-form-header-tKNGDxjB.js";import{t as M}from"./route-block-D7Rwj2No.js";import{t as N}from"./AdminPagination-CjCpakvb.js";var P=e=>w({url:`/api/admin/login/log/list`,method:`get`,data:e}),F=()=>w({url:`/api/admin/login/log/config`,method:`get`}),I=e=>w({url:`/api/admin/login/log/config`,method:`put`,data:{loginLogMode:e}}),L={class:`flex h-full flex-col`},R={class:`inline-flex items-center gap-1`,"data-admin-search-field":`登录日志模式`},z={__name:`index`,setup(w){let M=C(),z=T(),B=c({page:1,limit:10,username:``,password:``,result:``,ip:``,userAgent:``,referer:``,dateFrom:``,dateTo:``,searchDate:[],total:0}),V=m(),H=m(!1),U=()=>{H.value=!0,P(B).then(e=>{V.value=e.data,B.total=e.dataCount}).finally(()=>{H.value=!1})},W=m(`off`),G=()=>{F().then(e=>{W.value=e.data?.loginLogMode??`off`})},K=e=>{I(e).then(()=>{z.success(`登录日志模式已更新`),U()})};return h(()=>{U(),G()}),(c,m)=>{let h=j,C=a,w=O,T=k,P=D,F=o,I=b,z=t,G=e,q=r,J=i,Y=N,X=A,Z=n;return _(),s(`div`,L,[f(X,null,{default:y(()=>[f(h,{title:`登录日志`,"hide-bottom-border":``}),f(P,{"model-value":p(B),loading:p(H),onSearch:U,onReset:U},{default:y(()=>[f(w,{label:`用户名`,prop:`username`},{default:y(()=>[f(C,{modelValue:p(B).username,"onUpdate:modelValue":m[0]||=e=>p(B).username=e},null,8,[`modelValue`])]),_:1}),f(w,{label:`密码`,prop:`password`},{default:y(()=>[f(C,{modelValue:p(B).password,"onUpdate:modelValue":m[1]||=e=>p(B).password=e},null,8,[`modelValue`])]),_:1}),f(w,{label:`登录结果`,prop:`result`},{default:y(()=>[f(C,{modelValue:p(B).result,"onUpdate:modelValue":m[2]||=e=>p(B).result=e},null,8,[`modelValue`])]),_:1}),f(w,{label:`请求 IP`,prop:`ip`},{default:y(()=>[f(C,{modelValue:p(B).ip,"onUpdate:modelValue":m[3]||=e=>p(B).ip=e},null,8,[`modelValue`])]),_:1}),f(w,{label:`UserAgent`,prop:`userAgent`},{default:y(()=>[f(C,{modelValue:p(B).userAgent,"onUpdate:modelValue":m[4]||=e=>p(B).userAgent=e},null,8,[`modelValue`])]),_:1}),f(w,{label:`Referer`,prop:`referer`},{default:y(()=>[f(C,{modelValue:p(B).referer,"onUpdate:modelValue":m[5]||=e=>p(B).referer=e},null,8,[`modelValue`])]),_:1}),f(w,{label:`登录时间`,prop:`searchDate`},{default:y(()=>[f(T,{modelValue:p(B).searchDate,"onUpdate:modelValue":m[6]||=e=>p(B).searchDate=e,shortcuts:p(x),type:`daterange`,"value-format":p(E),"default-time":p(S),"range-separator":`至`,"start-placeholder":`开始时间`,"end-placeholder":`结束时间`},null,8,[`modelValue`,`shortcuts`,`value-format`,`default-time`])]),_:1})]),_:1},8,[`model-value`,`loading`]),v((_(),d(J,{border:``,data:p(V),size:p(M).adminTable.size},{default:y(()=>[f(F,{label:`用户名`,prop:`username`}),f(F,{label:`密码`,prop:`password`},{header:y(()=>[l(`span`,R,[m[15]||=u(` 密码 `,-1),f(q,{placement:`bottom`,width:280,trigger:`click`},{reference:y(()=>[f(I,{class:`inline h-4 w-4 cursor-pointer align-text-bottom text-gray-400 transition-colors hover:text-blue-500`,title:`登录日志模式`})]),default:y(()=>[l(`div`,null,[m[14]||=l(`div`,{class:`mb-2 font-medium`},`登录日志模式`,-1),f(G,{modelValue:p(W),"onUpdate:modelValue":m[7]||=e=>g(W)?W.value=e:null,class:`flex flex-col items-start gap-1`,onChange:K},{default:y(()=>[f(z,{value:`off`},{default:y(()=>[...m[10]||=[u(`关闭日志`,-1)]]),_:1}),f(z,{value:`all`},{default:y(()=>[...m[11]||=[u(`全部记录`,-1)]]),_:1}),f(z,{value:`ignoreSuccessPwd`},{default:y(()=>[...m[12]||=[u(`不记录成功密码`,-1)]]),_:1}),f(z,{value:`ignoreAllPwd`},{default:y(()=>[...m[13]||=[u(`不记录密码`,-1)]]),_:1})]),_:1},8,[`modelValue`])])]),_:1})])]),_:1}),f(F,{width:`250`,"show-overflow-tooltip":``,prop:`result`,label:`登录结果`}),f(F,{width:`180`,prop:`createTime`,label:`登录时间`}),f(F,{width:`100`,"show-overflow-tooltip":``,prop:`ip`,label:`请求 IP`}),f(F,{"show-overflow-tooltip":``,prop:`userAgent`,label:`UserAgent`}),f(F,{"show-overflow-tooltip":``,prop:`referer`,label:`Referer`})]),_:1},8,[`data`,`size`])),[[Z,p(H)]]),f(Y,{page:p(B).page,"onUpdate:page":m[8]||=e=>p(B).page=e,limit:p(B).limit,"onUpdate:limit":m[9]||=e=>p(B).limit=e,total:p(B).total,onChange:U},null,8,[`page`,`limit`,`total`])]),_:1})])}}};typeof M==`function`&&M(z);export{z as default};