mower-ng/ui/dist/assets/DebugConsole.js
zhbaor 16993bfabd
All checks were successful
ci/woodpecker/push/check_format Pipeline was successful
更新依赖
2024-12-30 10:25:16 +08:00

73 lines
6.6 KiB
JavaScript

import{I as K,a as U}from"./IosArrowForward.js";import{az as z,ax as b,aJ as w,ay as m,b6 as J,b7 as Q,aB as S,B as A,aA as W,aL as X,D as q,b as G,c as M,aE as Y,H as p,x as Z,d as F,bn as ee,r as C,p as oe,w as re,bR as V,bS as i,bQ as _,bT as s,bV as j,b_ as N,bN as r,F as T,bU as H,bX as L,bW as le,i as ne,bm as te,bo as se,A as ie}from"./_plugin-vue_export-helper.js";import{b3 as ae,b1 as de,z as ce,_ as ue,b4 as ve,D as be}from"./main.js";const me=z([b("list",`
--n-merged-border-color: var(--n-border-color);
--n-merged-color: var(--n-color);
--n-merged-color-hover: var(--n-color-hover);
margin: 0;
font-size: var(--n-font-size);
transition:
background-color .3s var(--n-bezier),
color .3s var(--n-bezier),
border-color .3s var(--n-bezier);
padding: 0;
list-style-type: none;
color: var(--n-text-color);
background-color: var(--n-merged-color);
`,[w("show-divider",[b("list-item",[z("&:not(:last-child)",[m("divider",`
background-color: var(--n-merged-border-color);
`)])])]),w("clickable",[b("list-item",`
cursor: pointer;
`)]),w("bordered",`
border: 1px solid var(--n-merged-border-color);
border-radius: var(--n-border-radius);
`),w("hoverable",[b("list-item",`
border-radius: var(--n-border-radius);
`,[z("&:hover",`
background-color: var(--n-merged-color-hover);
`,[m("divider",`
background-color: transparent;
`)])])]),w("bordered, hoverable",[b("list-item",`
padding: 12px 20px;
`),m("header, footer",`
padding: 12px 20px;
`)]),m("header, footer",`
padding: 12px 0;
box-sizing: border-box;
transition: border-color .3s var(--n-bezier);
`,[z("&:not(:last-child)",`
border-bottom: 1px solid var(--n-merged-border-color);
`)]),b("list-item",`
position: relative;
padding: 12px 0;
box-sizing: border-box;
display: flex;
flex-wrap: nowrap;
align-items: center;
transition:
background-color .3s var(--n-bezier),
border-color .3s var(--n-bezier);
`,[m("prefix",`
margin-right: 20px;
flex: 0;
`),m("suffix",`
margin-left: 20px;
flex: 0;
`),m("main",`
flex: 1;
`),m("divider",`
height: 1px;
position: absolute;
bottom: 0;
left: 0;
right: 0;
background-color: transparent;
transition: background-color .3s var(--n-bezier);
pointer-events: none;
`)])]),J(b("list",`
--n-merged-color-hover: var(--n-color-hover-modal);
--n-merged-color: var(--n-color-modal);
--n-merged-border-color: var(--n-border-color-modal);
`)),Q(b("list",`
--n-merged-color-hover: var(--n-color-hover-popover);
--n-merged-color: var(--n-color-popover);
--n-merged-border-color: var(--n-border-color-popover);
`))]),pe=Object.assign(Object.assign({},S.props),{size:{type:String,default:"medium"},bordered:Boolean,clickable:Boolean,hoverable:Boolean,showDivider:{type:Boolean,default:!0}}),O=Z("n-list"),_e=A({name:"List",props:pe,setup(e){const{mergedClsPrefixRef:o,inlineThemeDisabled:l,mergedRtlRef:v}=W(e),c=X("List",v,o),n=S("List","-list",me,ae,e,o);q(O,{showDividerRef:G(e,"showDivider"),mergedClsPrefixRef:o});const g=M(()=>{const{common:{cubicBezierEaseInOut:f},self:{fontSize:R,textColor:t,color:d,colorModal:B,colorPopover:D,borderColor:k,borderColorModal:P,borderColorPopover:I,borderRadius:y,colorHover:$,colorHoverModal:E,colorHoverPopover:h}}=n.value;return{"--n-font-size":R,"--n-bezier":f,"--n-text-color":t,"--n-color":d,"--n-border-radius":y,"--n-border-color":k,"--n-border-color-modal":P,"--n-border-color-popover":I,"--n-color-modal":B,"--n-color-popover":D,"--n-color-hover":$,"--n-color-hover-modal":E,"--n-color-hover-popover":h}}),u=l?Y("list",void 0,g,e):void 0;return{mergedClsPrefix:o,rtlEnabled:c,cssVars:l?void 0:g,themeClass:u==null?void 0:u.themeClass,onRender:u==null?void 0:u.onRender}},render(){var e;const{$slots:o,mergedClsPrefix:l,onRender:v}=this;return v==null||v(),p("ul",{class:[`${l}-list`,this.rtlEnabled&&`${l}-list--rtl`,this.bordered&&`${l}-list--bordered`,this.showDivider&&`${l}-list--show-divider`,this.hoverable&&`${l}-list--hoverable`,this.clickable&&`${l}-list--clickable`,this.themeClass],style:this.cssVars},o.header?p("div",{class:`${l}-list__header`},o.header()):null,(e=o.default)===null||e===void 0?void 0:e.call(o),o.footer?p("div",{class:`${l}-list__footer`},o.footer()):null)}}),ge=A({name:"ListItem",setup(){const e=F(O,null);return e||ee("list-item","`n-list-item` must be placed in `n-list`."),{showDivider:e.showDividerRef,mergedClsPrefix:e.mergedClsPrefixRef}},render(){const{$slots:e,mergedClsPrefix:o}=this;return p("li",{class:`${o}-list-item`},e.prefix?p("div",{class:`${o}-list-item__prefix`},e.prefix()):null,e.default?p("div",{class:`${o}-list-item__main`},e):null,e.suffix?p("div",{class:`${o}-list-item__suffix`},e.suffix()):null,this.showDivider&&p("div",{class:`${o}-list-item__divider`}))}}),fe={style:{"text-align":"center",margin:"0"}},Ce={__name:"DebugConsole",setup(e){const o=F("axios"),l=C([]),v=C(""),c=C([]),n=C(0),g=C(null);oe(()=>{o.get("/debug/log").then(({data:t})=>{l.value=t}),u("runtime.log")});function u(t){v.value=t,o.get(`/debug/log/${t}`).then(({data:d})=>{n.value=0,c.value=d,n.value=c.value.length-1})}const f=M(()=>{var t;return(t=c.value[n.value])==null?void 0:t.screenshot}),R=M(()=>`/debug/screenshot/${f.value}`);return re(n,()=>{var t;(t=g.value)==null||t.scrollTo({top:0})}),(t,d)=>{const B=ge,D=_e,k=ce,P=ue,I=ve,y=te,$=se,E=be,h=de;return _(),V(h,{style:{width:"100%",height:"100%",gap:"0","overflow-y":"hidden"}},{default:i(()=>[s(k,{style:{width:"220px"}},{default:i(()=>[s(D,{hoverable:"",clickable:"",bordered:""},{default:i(()=>[(_(!0),j(T,null,N(r(l),a=>(_(),V(B,{onClick:x=>u(a)},{default:i(()=>[ie(L(a),1)]),_:2},1032,["onClick"]))),256))]),_:1})]),_:1}),s(h,{vertical:"",style:{flex:"1",height:"100%",overflow:"hidden"}},{default:i(()=>[H("h2",fe,L(r(v)),1),r(f)?(_(),V(P,{key:0,src:r(R),alt:r(f),width:"100%",style:{"max-height":"50%"},"object-fit":"scale-down"},null,8,["src","alt"])):le("",!0),s(k,{ref_key:"log_scroll",ref:g,style:{width:"100%"},"content-style":"font-size: 16px; user-select: text; padding: 0 12px"},{default:i(()=>{var a;return[(_(!0),j(T,null,N((a=r(c)[r(n)])==null?void 0:a.log,x=>(_(),j("div",null,[H("code",null,L(x),1)]))),256))]}),_:1},512),s(h,{align:"center",style:{padding:"0 12px 6px"}},{default:i(()=>[s(I,{style:{flex:"1"},"show-tooltip":"",value:r(n),"onUpdate:value":d[0]||(d[0]=a=>ne(n)?n.value=a:null),min:0,max:r(c).length-1,"format-tooltip":a=>{var x;return(x=r(c)[a])==null?void 0:x.time}},null,8,["value","max","format-tooltip"]),s(E,null,{default:i(()=>[s($,{disabled:r(n)==0,onClick:d[1]||(d[1]=a=>n.value--)},{icon:i(()=>[s(y,null,{default:i(()=>[s(r(K))]),_:1})]),_:1},8,["disabled"]),s($,{disabled:r(n)==r(c).length-1,onClick:d[2]||(d[2]=a=>n.value++)},{icon:i(()=>[s(y,null,{default:i(()=>[s(r(U))]),_:1})]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1})]),_:1})}}};export{Ce as default};