All checks were successful
ci/woodpecker/push/check_format Pipeline was successful
241 lines
25 KiB
JavaScript
241 lines
25 KiB
JavaScript
import{c as We,_ as Ee,u as De,a as qe,b as Ke}from"./DropDown2.js";import{S as Ue,U as Ae,R as ze,W as Ye,x as je,A as Q,B as l,h as me,r as O,c as F,p as He,w as Xe,b as he,aF as Pe,a8 as m,V as q,aa as i,au as Ge,av as Qe,ai as ge,ak as J,a3 as fe,an as Ce,n as ye,G as ke,ab as V,aM as $e,aD as Re,ba as ve,ae as D,bb as Je,aL as Ze,al as M,b3 as _e,b8 as E,aE as et,aC as xe,ag as Te,aI as tt,aK as nt,aQ as ot,aR as it,ap as rt,b4 as X,aY as de,aS as G,a_ as re,aX as I,aT as c,aW as W,ay as lt,af as at,i as st,bc as ct,aV as L,F as le,b5 as Be,z as we}from"./_plugin-vue_export-helper.js";import{c as dt,s as ut,d as mt,e as ht,g as Ve,h as ft}from"./main.js";import{u as gt,P as pt}from"./Play.js";import{r as bt}from"./index.js";import{S as vt}from"./Scrollbar.js";import{u as _t}from"./use-locale.js";import{t as xt}from"./throttle.js";import{_ as wt}from"./Image.js";import{_ as yt}from"./Select.js";import{N as zt}from"./Icon.js";import"./HelpText.js";import"./Tooltip.js";import"./cssr.js";import"./next-frame-once.js";import"./use-compitable.js";import"./common.js";import"./Input.js";import"./create.js";import"./Add.js";import"./get-slot.js";import"./Avatar.js";import"./utils.js";import"./Tag.js";import"./index2.js";import"./Forward.js";import"./VirtualList.js";import"./Dropdown.js";import"./download.js";function Ct(e){const{textColor2:n,modalColor:r,borderColor:o,fontSize:t,primaryColor:d}=e;return{loaderFontSize:t,loaderTextColor:n,loaderColor:r,loaderBorder:`1px solid ${o}`,loadingColor:d}}const St=Ue({name:"Log",common:ze,peers:{Scrollbar:Ae,Code:We},self:Ct});function kt(e){const{primaryColor:n,opacityDisabled:r,borderRadius:o,textColor3:t}=e;return Object.assign(Object.assign({},dt),{iconColor:t,textColor:"white",loadingColor:n,opacityDisabled:r,railColor:"rgba(0, 0, 0, .14)",railColorActive:n,buttonBoxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.3), inset 0 0 1px 0 rgba(0, 0, 0, 0.05)",buttonColor:"#FFF",railBorderRadiusSmall:o,railBorderRadiusMedium:o,railBorderRadiusLarge:o,buttonBorderRadiusSmall:o,buttonBorderRadiusMedium:o,buttonBorderRadiusLarge:o,boxShadowFocus:`0 0 0 2px ${Ye(n,{alpha:.2})}`})}const $t={common:ze,self:kt};function Rt(e){const{textColor3:n,infoColor:r,errorColor:o,successColor:t,warningColor:d,textColor1:u,textColor2:h,railColor:x,fontWeightStrong:b,fontSize:k}=e;return Object.assign(Object.assign({},ut),{contentFontSize:k,titleFontWeight:b,circleBorder:`2px solid ${n}`,circleBorderInfo:`2px solid ${r}`,circleBorderError:`2px solid ${o}`,circleBorderSuccess:`2px solid ${t}`,circleBorderWarning:`2px solid ${d}`,iconColor:n,iconColorInfo:r,iconColorError:o,iconColorSuccess:t,iconColorWarning:d,titleTextColor:u,contentTextColor:h,metaTextColor:n,lineColor:x})}const Tt={common:ze,self:Rt},Me=je("n-log"),Bt=Q({props:{line:{type:String,default:""}},setup(e){const{trimRef:n,highlightRef:r,languageRef:o,mergedHljsRef:t}=me(Me),d=O(null),u=F(()=>n.value?e.line.trim():e.line);function h(){d.value&&(d.value.innerHTML=x(o.value,u.value))}function x(b,k){const{value:w}=t;return w&&b&&w.getLanguage(b)?w.highlight(k,{language:b}).value:k}return He(()=>{r.value&&h()}),Xe(he(e,"line"),()=>{r.value&&h()}),{highlight:r,selfRef:d,maybeTrimmedLines:u}},render(){const{highlight:e,maybeTrimmedLines:n}=this;return l("pre",{ref:"selfRef"},e?null:n)}}),Vt=Q({name:"LogLoader",props:{clsPrefix:{type:String,required:!0}},setup(){return{locale:_t("Log").localeRef}},render(){const{clsPrefix:e}=this;return l("div",{class:`${e}-log-loader`},l(Pe,{clsPrefix:e,strokeWidth:24,scale:.85}),l("span",{class:`${e}-log-loader__content`},this.locale.loading))}}),Ft=m("log",`
|
|
position: relative;
|
|
box-sizing: border-box;
|
|
transition: border-color .3s var(--n-bezier);
|
|
`,[q("pre",`
|
|
white-space: pre-wrap;
|
|
word-break: break-word;
|
|
margin: 0;
|
|
`),m("log-loader",`
|
|
transition:
|
|
color .3s var(--n-bezier),
|
|
background-color .3s var(--n-bezier),
|
|
border-color .3s var(--n-bezier);
|
|
box-sizing: border-box;
|
|
position: absolute;
|
|
right: 16px;
|
|
top: 8px;
|
|
height: 34px;
|
|
border-radius: 17px;
|
|
line-height: 34px;
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
border: var(--n-loader-border);
|
|
color: var(--n-loader-text-color);
|
|
background-color: var(--n-loader-color);
|
|
font-size: var(--n-loader-font-size);
|
|
`,[mt(),i("content",`
|
|
display: inline-block;
|
|
vertical-align: bottom;
|
|
line-height: 34px;
|
|
padding-left: 40px;
|
|
padding-right: 20px;
|
|
white-space: nowrap;
|
|
`),m("base-loading",`
|
|
color: var(--n-loading-color);
|
|
position: absolute;
|
|
left: 12px;
|
|
top: calc(50% - 10px);
|
|
font-size: 20px;
|
|
width: 20px;
|
|
height: 20px;
|
|
display: inline-block;
|
|
`)])]),Lt=Object.assign(Object.assign({},J.props),{loading:Boolean,trim:Boolean,log:String,fontSize:{type:Number,default:14},lines:{type:Array,default:()=>[]},lineHeight:{type:Number,default:1.25},language:String,rows:{type:Number,default:15},offsetTop:{type:Number,default:0},offsetBottom:{type:Number,default:0},hljs:Object,onReachTop:Function,onReachBottom:Function,onRequireMore:Function}),jt=Q({name:"Log",props:Lt,setup(e){const{mergedClsPrefixRef:n,inlineThemeDisabled:r}=ge(e),o=O(!1),t=F(()=>e.language!==void 0),d=F(()=>`calc(${Math.round(e.rows*e.lineHeight*e.fontSize)}px)`),u=F(()=>{const{log:g}=e;return g?g.split(`
|
|
`):e.lines}),h=O(null),x=J("Log","-log",Ft,St,e,n);function b(g){const p=g.target,R=p.firstElementChild;if(o.value){ye(()=>{o.value=!1});return}const T=p.offsetHeight,C=p.scrollTop,B=R.offsetHeight,a=C,N=B-C-T;if(a<=e.offsetTop){const{onReachTop:$,onRequireMore:v}=e;v&&v("top"),$&&$()}if(N<=e.offsetBottom){const{onReachBottom:$,onRequireMore:v}=e;v&&v("bottom"),$&&$()}}const k=xt(w,300);function w(g){if(o.value){ye(()=>{o.value=!1});return}if(h.value){const{containerRef:p,contentRef:R}=h.value;if(p&&R){const T=p.offsetHeight,C=p.scrollTop,B=R.offsetHeight,a=C,N=B-C-T,$=g.deltaY;if(a===0&&$<0){const{onRequireMore:v}=e;v&&v("top")}if(N<=0&&$>0){const{onRequireMore:v}=e;v&&v("bottom")}}}}function s(g){const{value:p}=h;if(!p)return;const{silent:R,top:T,position:C}=g;R&&(o.value=!0),T!==void 0?p.scrollTo({left:0,top:T}):(C==="bottom"||C==="top")&&p.scrollTo({position:C})}function f(g=!1){ke("log","`scrollToTop` is deprecated, please use `scrollTo({ position: 'top'})` instead."),s({position:"top",silent:g})}function y(g=!1){ke("log","`scrollToTop` is deprecated, please use `scrollTo({ position: 'bottom'})` instead."),s({position:"bottom",silent:g})}fe(Me,{languageRef:he(e,"language"),mergedHljsRef:De(e),trimRef:he(e,"trim"),highlightRef:t});const A={scrollTo:s},K=F(()=>{const{self:{loaderFontSize:g,loaderTextColor:p,loaderColor:R,loaderBorder:T,loadingColor:C},common:{cubicBezierEaseInOut:B}}=x.value;return{"--n-bezier":B,"--n-loader-font-size":g,"--n-loader-border":T,"--n-loader-color":R,"--n-loader-text-color":p,"--n-loading-color":C}}),j=r?Ce("log",void 0,K,e):void 0;return Object.assign(Object.assign({},A),{mergedClsPrefix:n,scrollbarRef:h,mergedTheme:x,styleHeight:d,mergedLines:u,scrollToTop:f,scrollToBottom:y,handleWheel:k,handleScroll:b,cssVars:r?void 0:K,themeClass:j==null?void 0:j.themeClass,onRender:j==null?void 0:j.onRender})},render(){const{mergedClsPrefix:e,mergedTheme:n,onRender:r}=this;return r==null||r(),l("div",{class:[`${e}-log`,this.themeClass],style:[{lineHeight:this.lineHeight,height:this.styleHeight},this.cssVars],onWheelPassive:this.handleWheel},[l(Ge,{ref:"scrollbarRef",theme:n.peers.Scrollbar,themeOverrides:n.peerOverrides.Scrollbar,onScroll:this.handleScroll},{default:()=>l(Ee,{internalNoHighlight:!0,internalFontSize:this.fontSize,theme:n.peers.Code,themeOverrides:n.peerOverrides.Code},{default:()=>this.mergedLines.map((o,t)=>l(Bt,{key:t,line:o}))})}),l(Qe,{name:"fade-in-scale-up-transition"},{default:()=>this.loading?l(Vt,{clsPrefix:e}):null})])}}),Ht=m("switch",`
|
|
height: var(--n-height);
|
|
min-width: var(--n-width);
|
|
vertical-align: middle;
|
|
user-select: none;
|
|
-webkit-user-select: none;
|
|
display: inline-flex;
|
|
outline: none;
|
|
justify-content: center;
|
|
align-items: center;
|
|
`,[i("children-placeholder",`
|
|
height: var(--n-rail-height);
|
|
display: flex;
|
|
flex-direction: column;
|
|
overflow: hidden;
|
|
pointer-events: none;
|
|
visibility: hidden;
|
|
`),i("rail-placeholder",`
|
|
display: flex;
|
|
flex-wrap: none;
|
|
`),i("button-placeholder",`
|
|
width: calc(1.75 * var(--n-rail-height));
|
|
height: var(--n-rail-height);
|
|
`),m("base-loading",`
|
|
position: absolute;
|
|
top: 50%;
|
|
left: 50%;
|
|
transform: translateX(-50%) translateY(-50%);
|
|
font-size: calc(var(--n-button-width) - 4px);
|
|
color: var(--n-loading-color);
|
|
transition: color .3s var(--n-bezier);
|
|
`,[Re({left:"50%",top:"50%",originalTransform:"translateX(-50%) translateY(-50%)"})]),i("checked, unchecked",`
|
|
transition: color .3s var(--n-bezier);
|
|
color: var(--n-text-color);
|
|
box-sizing: border-box;
|
|
position: absolute;
|
|
white-space: nowrap;
|
|
top: 0;
|
|
bottom: 0;
|
|
display: flex;
|
|
align-items: center;
|
|
line-height: 1;
|
|
`),i("checked",`
|
|
right: 0;
|
|
padding-right: calc(1.25 * var(--n-rail-height) - var(--n-offset));
|
|
`),i("unchecked",`
|
|
left: 0;
|
|
justify-content: flex-end;
|
|
padding-left: calc(1.25 * var(--n-rail-height) - var(--n-offset));
|
|
`),q("&:focus",[i("rail",`
|
|
box-shadow: var(--n-box-shadow-focus);
|
|
`)]),V("round",[i("rail","border-radius: calc(var(--n-rail-height) / 2);",[i("button","border-radius: calc(var(--n-button-height) / 2);")])]),$e("disabled",[$e("icon",[V("rubber-band",[V("pressed",[i("rail",[i("button","max-width: var(--n-button-width-pressed);")])]),i("rail",[q("&:active",[i("button","max-width: var(--n-button-width-pressed);")])]),V("active",[V("pressed",[i("rail",[i("button","left: calc(100% - var(--n-offset) - var(--n-button-width-pressed));")])]),i("rail",[q("&:active",[i("button","left: calc(100% - var(--n-offset) - var(--n-button-width-pressed));")])])])])])]),V("active",[i("rail",[i("button","left: calc(100% - var(--n-button-width) - var(--n-offset))")])]),i("rail",`
|
|
overflow: hidden;
|
|
height: var(--n-rail-height);
|
|
min-width: var(--n-rail-width);
|
|
border-radius: var(--n-rail-border-radius);
|
|
cursor: pointer;
|
|
position: relative;
|
|
transition:
|
|
opacity .3s var(--n-bezier),
|
|
background .3s var(--n-bezier),
|
|
box-shadow .3s var(--n-bezier);
|
|
background-color: var(--n-rail-color);
|
|
`,[i("button-icon",`
|
|
color: var(--n-icon-color);
|
|
transition: color .3s var(--n-bezier);
|
|
font-size: calc(var(--n-button-height) - 4px);
|
|
position: absolute;
|
|
left: 0;
|
|
right: 0;
|
|
top: 0;
|
|
bottom: 0;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
line-height: 1;
|
|
`,[Re()]),i("button",`
|
|
align-items: center;
|
|
top: var(--n-offset);
|
|
left: var(--n-offset);
|
|
height: var(--n-button-height);
|
|
width: var(--n-button-width-pressed);
|
|
max-width: var(--n-button-width);
|
|
border-radius: var(--n-button-border-radius);
|
|
background-color: var(--n-button-color);
|
|
box-shadow: var(--n-button-box-shadow);
|
|
box-sizing: border-box;
|
|
cursor: inherit;
|
|
content: "";
|
|
position: absolute;
|
|
transition:
|
|
background-color .3s var(--n-bezier),
|
|
left .3s var(--n-bezier),
|
|
opacity .3s var(--n-bezier),
|
|
max-width .3s var(--n-bezier),
|
|
box-shadow .3s var(--n-bezier);
|
|
`)]),V("active",[i("rail","background-color: var(--n-rail-color-active);")]),V("loading",[i("rail",`
|
|
cursor: wait;
|
|
`)]),V("disabled",[i("rail",`
|
|
cursor: not-allowed;
|
|
opacity: .5;
|
|
`)])]),Pt=Object.assign(Object.assign({},J.props),{size:{type:String,default:"medium"},value:{type:[String,Number,Boolean],default:void 0},loading:Boolean,defaultValue:{type:[String,Number,Boolean],default:!1},disabled:{type:Boolean,default:void 0},round:{type:Boolean,default:!0},"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],checkedValue:{type:[String,Number,Boolean],default:!0},uncheckedValue:{type:[String,Number,Boolean],default:!1},railStyle:Function,rubberBand:{type:Boolean,default:!0},onChange:[Function,Array]});let ae;const Mt=Q({name:"Switch",props:Pt,slots:Object,setup(e){ae===void 0&&(typeof CSS<"u"?typeof CSS.supports<"u"?ae=CSS.supports("width","max(1px)"):ae=!1:ae=!0);const{mergedClsPrefixRef:n,inlineThemeDisabled:r}=ge(e),o=J("Switch","-switch",Ht,$t,e,n),t=Je(e),{mergedSizeRef:d,mergedDisabledRef:u}=t,h=O(e.defaultValue),x=he(e,"value"),b=Ze(x,h),k=F(()=>b.value===e.checkedValue),w=O(!1),s=O(!1),f=F(()=>{const{railStyle:a}=e;if(a)return a({focused:s.value,checked:k.value})});function y(a){const{"onUpdate:value":N,onChange:$,onUpdateValue:v}=e,{nTriggerFormInput:Y,nTriggerFormChange:Z}=t;N&&xe(N,a),v&&xe(v,a),$&&xe($,a),h.value=a,Y(),Z()}function A(){const{nTriggerFormFocus:a}=t;a()}function K(){const{nTriggerFormBlur:a}=t;a()}function j(){e.loading||u.value||(b.value!==e.checkedValue?y(e.checkedValue):y(e.uncheckedValue))}function g(){s.value=!0,A()}function p(){s.value=!1,K(),w.value=!1}function R(a){e.loading||u.value||a.key===" "&&(b.value!==e.checkedValue?y(e.checkedValue):y(e.uncheckedValue),w.value=!1)}function T(a){e.loading||u.value||a.key===" "&&(a.preventDefault(),w.value=!0)}const C=F(()=>{const{value:a}=d,{self:{opacityDisabled:N,railColor:$,railColorActive:v,buttonBoxShadow:Y,buttonColor:Z,boxShadowFocus:se,loadingColor:H,textColor:z,iconColor:ee,[M("buttonHeight",a)]:S,[M("buttonWidth",a)]:te,[M("buttonWidthPressed",a)]:ne,[M("railHeight",a)]:P,[M("railWidth",a)]:U,[M("railBorderRadius",a)]:ce,[M("buttonBorderRadius",a)]:pe},common:{cubicBezierEaseInOut:be}}=o.value;let oe,ie,_;return ae?(oe=`calc((${P} - ${S}) / 2)`,ie=`max(${P}, ${S})`,_=`max(${U}, calc(${U} + ${S} - ${P}))`):(oe=_e((E(P)-E(S))/2),ie=_e(Math.max(E(P),E(S))),_=E(P)>E(S)?U:_e(E(U)+E(S)-E(P))),{"--n-bezier":be,"--n-button-border-radius":pe,"--n-button-box-shadow":Y,"--n-button-color":Z,"--n-button-width":te,"--n-button-width-pressed":ne,"--n-button-height":S,"--n-height":ie,"--n-offset":oe,"--n-opacity-disabled":N,"--n-rail-border-radius":ce,"--n-rail-color":$,"--n-rail-color-active":v,"--n-rail-height":P,"--n-rail-width":U,"--n-width":_,"--n-box-shadow-focus":se,"--n-loading-color":H,"--n-text-color":z,"--n-icon-color":ee}}),B=r?Ce("switch",F(()=>d.value[0]),C,e):void 0;return{handleClick:j,handleBlur:p,handleFocus:g,handleKeyup:R,handleKeydown:T,mergedRailStyle:f,pressed:w,mergedClsPrefix:n,mergedValue:b,checked:k,mergedDisabled:u,cssVars:r?void 0:C,themeClass:B==null?void 0:B.themeClass,onRender:B==null?void 0:B.onRender}},render(){const{mergedClsPrefix:e,mergedDisabled:n,checked:r,mergedRailStyle:o,onRender:t,$slots:d}=this;t==null||t();const{checked:u,unchecked:h,icon:x,"checked-icon":b,"unchecked-icon":k}=d,w=!(ve(x)&&ve(b)&&ve(k));return l("div",{role:"switch","aria-checked":r,class:[`${e}-switch`,this.themeClass,w&&`${e}-switch--icon`,r&&`${e}-switch--active`,n&&`${e}-switch--disabled`,this.round&&`${e}-switch--round`,this.loading&&`${e}-switch--loading`,this.pressed&&`${e}-switch--pressed`,this.rubberBand&&`${e}-switch--rubber-band`],tabindex:this.mergedDisabled?void 0:0,style:this.cssVars,onClick:this.handleClick,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeyup:this.handleKeyup,onKeydown:this.handleKeydown},l("div",{class:`${e}-switch__rail`,"aria-hidden":"true",style:o},D(u,s=>D(h,f=>s||f?l("div",{"aria-hidden":!0,class:`${e}-switch__children-placeholder`},l("div",{class:`${e}-switch__rail-placeholder`},l("div",{class:`${e}-switch__button-placeholder`}),s),l("div",{class:`${e}-switch__rail-placeholder`},l("div",{class:`${e}-switch__button-placeholder`}),f)):null)),l("div",{class:`${e}-switch__button`},D(x,s=>D(b,f=>D(k,y=>l(et,null,{default:()=>this.loading?l(Pe,{key:"loading",clsPrefix:e,strokeWidth:20}):this.checked&&(f||s)?l("div",{class:`${e}-switch__button-icon`,key:f?"checked-icon":"icon"},f||s):!this.checked&&(y||s)?l("div",{class:`${e}-switch__button-icon`,key:y?"unchecked-icon":"icon"},y||s):null})))),D(u,s=>s&&l("div",{key:"checked",class:`${e}-switch__checked`},s)),D(h,s=>s&&l("div",{key:"unchecked",class:`${e}-switch__unchecked`},s)))))}}),Fe=1.25,Ot=m("timeline",`
|
|
position: relative;
|
|
width: 100%;
|
|
display: flex;
|
|
flex-direction: column;
|
|
line-height: ${Fe};
|
|
`,[V("horizontal",`
|
|
flex-direction: row;
|
|
`,[q(">",[m("timeline-item",`
|
|
flex-shrink: 0;
|
|
padding-right: 40px;
|
|
`,[V("dashed-line-type",[q(">",[m("timeline-item-timeline",[i("line",`
|
|
background-image: linear-gradient(90deg, var(--n-color-start), var(--n-color-start) 50%, transparent 50%, transparent 100%);
|
|
background-size: 10px 1px;
|
|
`)])])]),q(">",[m("timeline-item-content",`
|
|
margin-top: calc(var(--n-icon-size) + 12px);
|
|
`,[q(">",[i("meta",`
|
|
margin-top: 6px;
|
|
margin-bottom: unset;
|
|
`)])]),m("timeline-item-timeline",`
|
|
width: 100%;
|
|
height: calc(var(--n-icon-size) + 12px);
|
|
`,[i("line",`
|
|
left: var(--n-icon-size);
|
|
top: calc(var(--n-icon-size) / 2 - 1px);
|
|
right: 0px;
|
|
width: unset;
|
|
height: 2px;
|
|
`)])])])])]),V("right-placement",[m("timeline-item",[m("timeline-item-content",`
|
|
text-align: right;
|
|
margin-right: calc(var(--n-icon-size) + 12px);
|
|
`),m("timeline-item-timeline",`
|
|
width: var(--n-icon-size);
|
|
right: 0;
|
|
`)])]),V("left-placement",[m("timeline-item",[m("timeline-item-content",`
|
|
margin-left: calc(var(--n-icon-size) + 12px);
|
|
`),m("timeline-item-timeline",`
|
|
left: 0;
|
|
`)])]),m("timeline-item",`
|
|
position: relative;
|
|
`,[q("&:last-child",[m("timeline-item-timeline",[i("line",`
|
|
display: none;
|
|
`)]),m("timeline-item-content",[i("meta",`
|
|
margin-bottom: 0;
|
|
`)])]),m("timeline-item-content",[i("title",`
|
|
margin: var(--n-title-margin);
|
|
font-size: var(--n-title-font-size);
|
|
transition: color .3s var(--n-bezier);
|
|
font-weight: var(--n-title-font-weight);
|
|
color: var(--n-title-text-color);
|
|
`),i("content",`
|
|
transition: color .3s var(--n-bezier);
|
|
font-size: var(--n-content-font-size);
|
|
color: var(--n-content-text-color);
|
|
`),i("meta",`
|
|
transition: color .3s var(--n-bezier);
|
|
font-size: 12px;
|
|
margin-top: 6px;
|
|
margin-bottom: 20px;
|
|
color: var(--n-meta-text-color);
|
|
`)]),V("dashed-line-type",[m("timeline-item-timeline",[i("line",`
|
|
--n-color-start: var(--n-line-color);
|
|
transition: --n-color-start .3s var(--n-bezier);
|
|
background-color: transparent;
|
|
background-image: linear-gradient(180deg, var(--n-color-start), var(--n-color-start) 50%, transparent 50%, transparent 100%);
|
|
background-size: 1px 10px;
|
|
`)])]),m("timeline-item-timeline",`
|
|
width: calc(var(--n-icon-size) + 12px);
|
|
position: absolute;
|
|
top: calc(var(--n-title-font-size) * ${Fe} / 2 - var(--n-icon-size) / 2);
|
|
height: 100%;
|
|
`,[i("circle",`
|
|
border: var(--n-circle-border);
|
|
transition:
|
|
background-color .3s var(--n-bezier),
|
|
border-color .3s var(--n-bezier);
|
|
width: var(--n-icon-size);
|
|
height: var(--n-icon-size);
|
|
border-radius: var(--n-icon-size);
|
|
box-sizing: border-box;
|
|
`),i("icon",`
|
|
color: var(--n-icon-color);
|
|
font-size: var(--n-icon-size);
|
|
height: var(--n-icon-size);
|
|
width: var(--n-icon-size);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
`),i("line",`
|
|
transition: background-color .3s var(--n-bezier);
|
|
position: absolute;
|
|
top: var(--n-icon-size);
|
|
left: calc(var(--n-icon-size) / 2 - 1px);
|
|
bottom: 0px;
|
|
width: 2px;
|
|
background-color: var(--n-line-color);
|
|
`)])])]),Nt=Object.assign(Object.assign({},J.props),{horizontal:Boolean,itemPlacement:{type:String,default:"left"},size:{type:String,default:"medium"},iconSize:Number}),Oe=je("n-timeline"),It=Q({name:"Timeline",props:Nt,setup(e,{slots:n}){const{mergedClsPrefixRef:r}=ge(e),o=J("Timeline","-timeline",Ot,Tt,e,r);return fe(Oe,{props:e,mergedThemeRef:o,mergedClsPrefixRef:r}),()=>{const{value:t}=r;return l("div",{class:[`${t}-timeline`,e.horizontal&&`${t}-timeline--horizontal`,`${t}-timeline--${e.size}-size`,!e.horizontal&&`${t}-timeline--${e.itemPlacement}-placement`]},n)}}}),Wt={time:[String,Number],title:String,content:String,color:String,lineType:{type:String,default:"default"},type:{type:String,default:"default"}},Et=Q({name:"TimelineItem",props:Wt,slots:Object,setup(e){const n=me(Oe);n||tt("timeline-item","`n-timeline-item` must be placed inside `n-timeline`."),gt();const{inlineThemeDisabled:r}=ge(),o=F(()=>{const{props:{size:d,iconSize:u},mergedThemeRef:h}=n,{type:x}=e,{self:{titleTextColor:b,contentTextColor:k,metaTextColor:w,lineColor:s,titleFontWeight:f,contentFontSize:y,[M("iconSize",d)]:A,[M("titleMargin",d)]:K,[M("titleFontSize",d)]:j,[M("circleBorder",x)]:g,[M("iconColor",x)]:p},common:{cubicBezierEaseInOut:R}}=h.value;return{"--n-bezier":R,"--n-circle-border":g,"--n-icon-color":p,"--n-content-font-size":y,"--n-content-text-color":k,"--n-line-color":s,"--n-meta-text-color":w,"--n-title-font-size":j,"--n-title-font-weight":f,"--n-title-margin":K,"--n-title-text-color":b,"--n-icon-size":nt(u)||A}}),t=r?Ce("timeline-item",F(()=>{const{props:{size:d,iconSize:u}}=n,{type:h}=e;return`${d[0]}${u||"a"}${h[0]}`}),o,n.props):void 0;return{mergedClsPrefix:n.mergedClsPrefixRef,cssVars:r?void 0:o,themeClass:t==null?void 0:t.themeClass,onRender:t==null?void 0:t.onRender}},render(){const{mergedClsPrefix:e,color:n,onRender:r,$slots:o}=this;return r==null||r(),l("div",{class:[`${e}-timeline-item`,this.themeClass,`${e}-timeline-item--${this.type}-type`,`${e}-timeline-item--${this.lineType}-line-type`],style:this.cssVars},l("div",{class:`${e}-timeline-item-timeline`},l("div",{class:`${e}-timeline-item-timeline__line`}),D(o.icon,t=>t?l("div",{class:`${e}-timeline-item-timeline__icon`,style:{color:n}},t):l("div",{class:`${e}-timeline-item-timeline__circle`,style:{borderColor:n}}))),l("div",{class:`${e}-timeline-item-content`},D(o.header,t=>t||this.title?l("div",{class:`${e}-timeline-item-content__title`},t||this.title):null),l("div",{class:`${e}-timeline-item-content__content`},Te(o.default,()=>[this.content])),l("div",{class:`${e}-timeline-item-content__meta`},Te(o.footer,()=>[this.time]))))}});var ue={},Le;function Dt(){if(Le)return ue;Le=1,Object.defineProperty(ue,"__esModule",{value:!0});const e=bt(),n={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"};return ue.default=(0,e.defineComponent)({name:"Stop",render:function(o,t){return(0,e.openBlock)(),(0,e.createElementBlock)("svg",n,t[0]||(t[0]=[(0,e.createElementVNode)("path",{d:"M392 432H120a40 40 0 0 1-40-40V120a40 40 0 0 1 40-40h272a40 40 0 0 1 40 40v272a40 40 0 0 1-40 40z",fill:"currentColor"},null,-1)]))}}),ue}var qt=Dt();const Kt=ot(qt),Ut={class:"home-container"},At={class:"action-container"},Yt={class:"scroll-container"},Xt={key:0,class:"scroll-label"},Gt={__name:"Log",setup(e){ct(H=>({"687d499d":c(C),"45d247af":c(B),"0d910c52":c(a)}));const n=ht(),{log:r,log_mobile:o,running:t,task_list:d,waiting:u,get_task_id:h,sc_uri:x,speed_msg:b,basement_task_list:k}=Ve(n),{get_tasks:w}=n,s=me("axios"),f=me("mobile"),y=O(!0);function A(H){H||ye(()=>{var z;(z=document.querySelector(".n-scrollbar-content"))==null||z.scrollIntoView(!1)})}He(()=>{w(),se()}),rt(()=>{clearTimeout(h.value)});function K(){t.value=!0,s.get("/start"),w()}function j(){u.value=!0,s.get("/stop").then(H=>{t.value=!H.data,u.value=!1})}O(!0);const g=O(!1),p=O(!0);fe("show_task",g),fe("add_task",p);const R=ft(),{conf:T}=Ve(R),C=F(()=>T.value.theme=="light"?.25:.3),B=F(()=>f.value?"cover, cover":"753px, cover"),a=F(()=>f.value?"25% 0, 50%, 50%":"70% -15%, 50% 50%");function N(){s.get("/stop-maa")}const $=[{label:"停止Maa",key:"maa"}],v=O(!0),Y=O({}),Z=H=>{const z=new Date,ee=new Date(H),S=Math.floor((ee-z)/1e3);if(S<=0)return"正在执行";const te=Math.floor(S/3600),ne=Math.floor(S%3600/60),P=S%60;return`${String(te).padStart(2,"0")}:${String(ne).padStart(2,"0")}:${String(P).padStart(2,"0")}`},se=()=>{d.value.forEach(H=>{Y.value[H.time]=Z(H.time)}),requestAnimationFrame(se)};return(H,z)=>{const ee=wt,S=Et,te=It,ne=vt,P=jt,U=zt,ce=at,pe=qe,be=Ke,oe=yt,ie=Mt;return L(),X("div",Ut,[z[4]||(z[4]=de("div",{class:"log-bg"},null,-1)),c(v)?(L(),G(ee,{key:0,"preview-disabled":"",width:"100%",class:"sc",src:c(x)==""?"/bg2.webp":c(x),"object-fit":"scale-down"},null,8,["src"])):re("",!0),I(ne,{"x-scrollable":"",style:{"max-height":"100px"}},{default:W(()=>[I(te,{horizontal:""},{default:W(()=>[(L(!0),X(le,null,Be(c(d),_=>(L(),X(le,{key:_.time},[Object.keys(_.plan).length?(L(!0),X(le,{key:0},Be(_.plan,(Ne,Se)=>(L(),G(S,{key:Se,title:Se,content:Ne.map(Ie=>Ie||"_").join(", "),time:`${_.time.split("T")[1].split(".")[0]} (剩余时间: ${c(Y)[_.time]})`},null,8,["title","content","time"]))),128)):(L(),G(S,{key:_.time,content:_.meta_data+_.type.display_value,time:`${_.time.split("T")[1].split(".")[0]} (剩余时间: ${c(Y)[_.time]})`},null,8,["content","time"]))],64))),128))]),_:1})]),_:1}),I(P,{class:lt(["log",{"auto-scroll":c(y)}]),log:c(f)?c(o):c(r),language:"mower",style:{"user-select":"text"}},null,8,["class","log"]),de("div",At,[c(t)?(L(),G(pe,{key:0,select:N,options:$,type:"error",up:!0},{default:W(()=>[I(ce,{type:"error",onClick:j,loading:c(u),disabled:c(u)},{icon:W(()=>[I(U,null,{default:W(()=>[I(c(Kt))]),_:1})]),default:W(()=>[c(f)?re("",!0):(L(),X(le,{key:0},[we("停止运行")],64))]),_:1},8,["loading","disabled"])]),_:1})):(L(),G(ce,{key:1,type:"primary",onClick:K,loading:c(u),disabled:c(u)},{icon:W(()=>[I(U,null,{default:W(()=>[I(c(pt))]),_:1})]),default:W(()=>[c(f)?re("",!0):(L(),X(le,{key:0},[we("开始运行")],64))]),_:1},8,["loading","disabled"])),I(be),c(f)?re("",!0):(L(),G(oe,{key:2,checked:c(T).start_automatically,"onUpdate:checked":z[0]||(z[0]=_=>c(T).start_automatically=_)},{default:W(()=>z[2]||(z[2]=[we(" 启动后自动运行 ")])),_:1},8,["checked"])),z[3]||(z[3]=de("div",{class:"expand"},null,-1)),de("div",Yt,[I(ie,{value:c(y),"onUpdate:value":[z[1]||(z[1]=_=>st(y)?y.value=_:null),A]},null,8,["value"]),c(f)?re("",!0):(L(),X("span",Xt,"自动滚动"))])])])}}},$n=it(Gt,[["__scopeId","data-v-bf98bec3"]]);export{$n as default};
|