import{aa as N,r as C,o as r,g as n,a as t,n as S,u as e,t as p,h as a,i as _,F as I,D as $,f,c as k,w as v,b as y}from"./app-BYcXwl4U.js";import{i as T,u as b,c as A}from"./app-a6cKceqE.js";import{_ as M}from"./app-BsFusN7_.js";import{_ as F}from"./app-uhTxLRnQ.js";import{_ as R}from"./app-B6Y8s8wR.js";import{_ as w}from"./app-DmX24te2.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-CO4sV-Ic.js";import"./app-yt37eDzA.js";import"./app-BQ5ggxk2.js";import"./app-D3zbrzdO.js";import"./app-CrjU8lgK.js";function E(){const{utils:h,Tea:l}=T(this);this.updateAllRead=function(){let u=this;h.confirm("确定要设置所有的未读消息为已读吗？",function(){u.$post("/messages/readAll").success(function(){window.location="/messages"})})},this.updatePageRead=function(){let u=this;h.confirm("确定要设置当前页的未读消息为已读吗？",function(){let c=[];u.messages.forEach(function(s){c.push(s.id)}),u.$post("/messages/readPage").params({messageIds:c}).refresh()})}}const P={class:"ui table selectable"},B={style:{position:"relative"}},L={key:0},V=t("span",null," | ",-1),D=["href"],J={key:1},O=t("span",null," | ",-1),j=["href"],z=t("i",{class:"icon check"},null,-1),H=[z],U={style:{padding:"0",margin:"0","word-break":"break-all"}},q={key:0,class:"mt-2"},G=["href"],K={key:1,class:"mt-2"},Q=["href"],W={key:2,class:"mt-2"},X={key:0},Y=t("a",{href:"/servers/certs/acme"},"查看任务»",-1),Z={key:3,class:"mt-2"},ee={key:0,href:"/servers/certs/acme"},se={key:4,class:"mt-2"},te={key:0,href:"/servers/certs/acme"},re={key:5,class:"mt-2"},ne=["href"],ae={key:6,class:"mt-2"},oe=["href"],ie=t("div",{class:"margin"},null,-1),le={__name:"MessageRow",props:["v-message"],setup(h){const l=b(),u=N("$Tea"),c=h,{message:s,params:o}=function(){let d=c.vMessage.params,i=null;return d!=null&&d.length>0&&(i=JSON.parse(d)),{message:C(c.vMessage),params:C(i)}}(),g=function(d){l.popup("/servers/certs/certPopup?certId="+d,{width:"48em"})},x=function(d){u.action("/messages/readPage").params({messageIds:[d]}).post().success(function(){l.reload()})};return(d,i)=>(r(),n("div",null,[t("table",P,[t("tr",{class:S({error:e(s).level=="error",positive:e(s).level=="success",warning:e(s).level=="warning"})},[t("td",B,[t("strong",null,p(e(s).datetime),1),e(s).cluster!=null&&e(s).cluster.id!=null?(r(),n("span",L,[V,t("a",{href:"/clusters/cluster?clusterId="+e(s).cluster.id},"集群："+p(e(s).cluster.name),9,D)])):a("",!0),e(s).node!=null&&e(s).node.id!=null?(r(),n("span",J,[O,t("a",{href:"/clusters/cluster/node?clusterId="+e(s).cluster.id+"&nodeId="+e(s).node.id},"节点："+p(e(s).node.name),9,j)])):a("",!0),t("a",{href:"",style:{position:"absolute",right:"1em"},onClick:i[0]||(i[0]=_(m=>x(e(s).id),["prevent"])),title:"标为已读"},H)])],2),t("tr",{class:S({error:e(s).level=="error",positive:e(s).level=="success",warning:e(s).level=="warning"})},[t("td",null,[t("pre",U,p(e(s).body),1),e(s).type=="HealthCheckFailed"?(r(),n("div",q,[(r(!0),n(I,null,$(e(o),m=>(r(),n("a",{href:"/clusters/cluster/node?clusterId="+e(s).cluster.id+"&nodeId="+m.node.id},p(m.node.name)+": "+p(m.error),9,G))),256))])):a("",!0),e(s).type=="ClusterDNSSyncFailed"?(r(),n("div",K,[t("a",{href:"/dns/clusters/cluster?clusterId="+e(s).cluster.id},"查看问题 »",8,Q)])):a("",!0),e(s).type=="SSLCertExpiring"?(r(),n("div",W,[t("a",{href:"",onClick:i[1]||(i[1]=_(m=>g(e(o).certId),["prevent"]))},"查看证书"),e(o)!=null&&e(o).acmeTaskId>0?(r(),n("span",X,[f("  |  "),Y])):a("",!0)])):a("",!0),e(s).type=="SSLCertACMETaskSuccess"?(r(),n("div",Z,[t("a",{href:"",onClick:i[2]||(i[2]=_(m=>g(e(o).certId),["prevent"]))},"查看证书"),f("  |  "),e(o)!=null&&e(o).acmeTaskId>0?(r(),n("a",ee,"查看任务»")):a("",!0)])):a("",!0),e(s).type=="SSLCertACMETaskFailed"?(r(),n("div",se,[t("a",{href:"",onClick:i[3]||(i[3]=_(m=>g(e(o).certId),["prevent"]))},"查看证书"),f("  |  "),e(o)!=null&&e(o).acmeTaskId>0?(r(),n("a",te,"查看任务»")):a("",!0)])):a("",!0),e(s).type=="ServerNamesAuditingSuccess"?(r(),n("div",re,[t("a",{href:"/servers/server?serverId="+e(o).serverId},"去查看»",8,ne)])):a("",!0),e(s).type=="ServerNamesAuditingFailed"?(r(),n("div",ae,[t("a",{href:"/servers/server?serverId="+e(o).serverId},"去查看»",8,oe)])):a("",!0)])],2)]),ie]))}},Ae={__name:"index",setup(h){const l=A(new E);return(u,c)=>(r(),n(I,null,[e(l).messages.length>0?(r(),k(R,{key:0},{default:v(()=>[y(w,{onClick:c[0]||(c[0]=_(s=>e(l).updatePageRead(),["prevent"]))},{default:v(()=>[f("当前页已读")]),_:1}),y(w,{onClick:c[1]||(c[1]=_(s=>e(l).updateAllRead(),["prevent"]))},{default:v(()=>[f("全部已读")]),_:1})]),_:1})):a("",!0),e(l).messages.length==0?(r(),k(F,{key:1},{default:v(()=>[f("暂时还没有消息。")]),_:1})):a("",!0),(r(!0),n(I,null,$(e(l).messages,s=>(r(),k(le,{"v-message":s,key:s.id},null,8,["v-message"]))),128)),y(M,{data:e(l).page},null,8,["data"])],64))}};export{Ae as default};
