mower-ng/ui/dist/assets/DebugConsole.js
zhbaor 389c1834b4
All checks were successful
ci/woodpecker/push/check_format Pipeline was successful
前端显示截图
2024-12-07 10:27:10 +08:00

73 lines
6.8 KiB
JavaScript

import{_ as U,a as X}from"./IosArrowForward.js";import{ar as z,as as v,av as C,au as b,a_ as q,bT as A,ay as S,B as O,ax as G,b0 as J,D as Q,b as W,j as L,aC as Y,H as p,z as Z,c as F,bH as ee,r as k,s as oe,w as re,bu as V,bv as i,bt as _,bw as s,bC as H,bD as M,bo as r,F as T,by as N,bE as I,bx as te,i as le,aX as ne,b3 as se,k as ie}from"./_plugin-vue_export-helper.js";import{ak as ae}from"./main.js";import{S as de,_ as ce,a as ue}from"./Scrollbar.js";import{_ as me}from"./Flex.js";import{_ as ve}from"./Slider.js";import"./utils.js";import"./use-locale.js";import"./download.js";import"./get-slot.js";const be=z([v("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);
`,[C("show-divider",[v("list-item",[z("&:not(:last-child)",[b("divider",`
background-color: var(--n-merged-border-color);
`)])])]),C("clickable",[v("list-item",`
cursor: pointer;
`)]),C("bordered",`
border: 1px solid var(--n-merged-border-color);
border-radius: var(--n-border-radius);
`),C("hoverable",[v("list-item",`
border-radius: var(--n-border-radius);
`,[z("&:hover",`
background-color: var(--n-merged-color-hover);
`,[b("divider",`
background-color: transparent;
`)])])]),C("bordered, hoverable",[v("list-item",`
padding: 12px 20px;
`),b("header, footer",`
padding: 12px 20px;
`)]),b("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);
`)]),v("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);
`,[b("prefix",`
margin-right: 20px;
flex: 0;
`),b("suffix",`
margin-left: 20px;
flex: 0;
`),b("main",`
flex: 1;
`),b("divider",`
height: 1px;
position: absolute;
bottom: 0;
left: 0;
right: 0;
background-color: transparent;
transition: background-color .3s var(--n-bezier);
pointer-events: none;
`)])]),q(v("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);
`)),A(v("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}}),K=Z("n-list"),_e=O({name:"List",props:pe,setup(e){const{mergedClsPrefixRef:o,inlineThemeDisabled:t,mergedRtlRef:m}=G(e),c=J("List",m,o),l=S("List","-list",be,ae,e,o);Q(K,{showDividerRef:W(e,"showDivider"),mergedClsPrefixRef:o});const f=L(()=>{const{common:{cubicBezierEaseInOut:g},self:{fontSize:R,textColor:n,color:d,colorModal:B,colorPopover:D,borderColor:w,borderColorModal:P,borderColorPopover:j,borderRadius:y,colorHover:$,colorHoverModal:E,colorHoverPopover:h}}=l.value;return{"--n-font-size":R,"--n-bezier":g,"--n-text-color":n,"--n-color":d,"--n-border-radius":y,"--n-border-color":w,"--n-border-color-modal":P,"--n-border-color-popover":j,"--n-color-modal":B,"--n-color-popover":D,"--n-color-hover":$,"--n-color-hover-modal":E,"--n-color-hover-popover":h}}),u=t?Y("list",void 0,f,e):void 0;return{mergedClsPrefix:o,rtlEnabled:c,cssVars:t?void 0:f,themeClass:u==null?void 0:u.themeClass,onRender:u==null?void 0:u.onRender}},render(){var e;const{$slots:o,mergedClsPrefix:t,onRender:m}=this;return m==null||m(),p("ul",{class:[`${t}-list`,this.rtlEnabled&&`${t}-list--rtl`,this.bordered&&`${t}-list--bordered`,this.showDivider&&`${t}-list--show-divider`,this.hoverable&&`${t}-list--hoverable`,this.clickable&&`${t}-list--clickable`,this.themeClass],style:this.cssVars},o.header?p("div",{class:`${t}-list__header`},o.header()):null,(e=o.default)===null||e===void 0?void 0:e.call(o),o.footer?p("div",{class:`${t}-list__footer`},o.footer()):null)}}),fe=O({name:"ListItem",setup(){const e=F(K,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`}))}}),ge={style:{"text-align":"center",margin:"0"}},De={__name:"DebugConsole",setup(e){const o=F("axios"),t=k([]),m=k(""),c=k([]),l=k(0),f=k(null);oe(()=>{o.get("/debug/log").then(({data:n})=>{t.value=n}),u("runtime.log")});function u(n){m.value=n,o.get(`/debug/log/${n}`).then(({data:d})=>{l.value=0,c.value=d,l.value=c.value.length-1})}const g=L(()=>{var n;return(n=c.value[l.value])==null?void 0:n.screenshot}),R=L(()=>`/debug/screenshot/${g.value}`);return re(l,()=>{var n;(n=f.value)==null||n.scrollTo({top:0})}),(n,d)=>{const B=fe,D=_e,w=de,P=ce,j=ve,y=ne,$=se,E=ue,h=me;return _(),V(h,{style:{width:"100%",height:"100%",gap:"0","overflow-y":"hidden"}},{default:i(()=>[s(w,{style:{width:"220px"}},{default:i(()=>[s(D,{hoverable:"",clickable:"",bordered:""},{default:i(()=>[(_(!0),H(T,null,M(r(t),a=>(_(),V(B,{onClick:x=>u(a)},{default:i(()=>[ie(I(a),1)]),_:2},1032,["onClick"]))),256))]),_:1})]),_:1}),s(h,{vertical:"",style:{flex:"1",height:"100%",overflow:"hidden"}},{default:i(()=>[N("h2",ge,I(r(m)),1),r(g)?(_(),V(P,{key:0,src:r(R),alt:r(g),width:"100%",style:{"max-height":"50%"},"object-fit":"scale-down"},null,8,["src","alt"])):te("",!0),s(w,{ref_key:"log_scroll",ref:f,style:{width:"100%"},"content-style":"font-size: 16px; user-select: text; padding: 0 12px"},{default:i(()=>{var a;return[(_(!0),H(T,null,M((a=r(c)[r(l)])==null?void 0:a.log,x=>(_(),H("div",null,[N("code",null,I(x),1)]))),256))]}),_:1},512),s(h,{align:"center",style:{padding:"0 12px 6px"}},{default:i(()=>[s(j,{style:{flex:"1"},"show-tooltip":"",value:r(l),"onUpdate:value":d[0]||(d[0]=a=>le(l)?l.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(l)==0,onClick:d[1]||(d[1]=a=>l.value--)},{icon:i(()=>[s(y,null,{default:i(()=>[s(r(U))]),_:1})]),_:1},8,["disabled"]),s($,{disabled:r(l)==r(c).length-1,onClick:d[2]||(d[2]=a=>l.value++)},{icon:i(()=>[s(y,null,{default:i(()=>[s(r(X))]),_:1})]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1})]),_:1})}}};export{De as default};