24 lines
7.6 KiB
JavaScript
24 lines
7.6 KiB
JavaScript
import{N as X,an as Y,ar as H,as as G,ay as q,B as J,ax as Q,j as Z,aY as ee,bA as R,H as A,aF as te,bB as ne,F as E,bm as P,br as oe,r as z,s as re,bt as c,bC as w,bD as F,bx as h,bu as k,bv as n,bw as e,bo as f,k as ae,aX as le,b3 as se,by as S,bE as I,b9 as ie,bz as ce}from"./_plugin-vue_export-helper.js";import{_ as ue,a as de}from"./Play.js";import{_ as _e}from"./TrashOutline.js";import{_ as pe}from"./Input.js";let T=!1;function me(){if(X&&window.CSS&&!T&&(T=!0,"registerProperty"in(window==null?void 0:window.CSS)))try{CSS.registerProperty({name:"--n-color-start",syntax:"<color>",inherits:!1,initialValue:"#0000"}),CSS.registerProperty({name:"--n-color-end",syntax:"<color>",inherits:!1,initialValue:"#0000"})}catch{}}function he(a){const{heightSmall:l,heightMedium:r,heightLarge:t,borderRadius:s}=a;return{color:"#eee",colorEnd:"#ddd",borderRadius:s,heightSmall:l,heightMedium:r,heightLarge:t}}const ve={name:"Skeleton",common:Y,self:he},fe=H([G("skeleton",`
|
|
height: 1em;
|
|
width: 100%;
|
|
transition:
|
|
--n-color-start .3s var(--n-bezier),
|
|
--n-color-end .3s var(--n-bezier),
|
|
background-color .3s var(--n-bezier);
|
|
animation: 2s skeleton-loading infinite cubic-bezier(0.36, 0, 0.64, 1);
|
|
background-color: var(--n-color-start);
|
|
`),H("@keyframes skeleton-loading",`
|
|
0% {
|
|
background: var(--n-color-start);
|
|
}
|
|
40% {
|
|
background: var(--n-color-end);
|
|
}
|
|
80% {
|
|
background: var(--n-color-start);
|
|
}
|
|
100% {
|
|
background: var(--n-color-start);
|
|
}
|
|
`)]),we=Object.assign(Object.assign({},q.props),{text:Boolean,round:Boolean,circle:Boolean,height:[String,Number],width:[String,Number],size:String,repeat:{type:Number,default:1},animated:{type:Boolean,default:!0},sharp:{type:Boolean,default:!0}}),ke=J({name:"Skeleton",inheritAttrs:!1,props:we,setup(a){me();const{mergedClsPrefixRef:l}=Q(a),r=q("Skeleton","-skeleton",fe,ve,a,l);return{mergedClsPrefix:l,style:Z(()=>{var t,s;const y=r.value,{common:{cubicBezierEaseInOut:M}}=y,x=y.self,{color:V,colorEnd:j,borderRadius:O}=x;let b;const{circle:o,sharp:p,round:$,width:d,height:u,size:_,text:B,animated:v}=a;_!==void 0&&(b=x[ee("height",_)]);const i=o?(t=d??u)!==null&&t!==void 0?t:b:d,m=(s=o?d??u:u)!==null&&s!==void 0?s:b;return{display:B?"inline-block":"",verticalAlign:B?"-0.125em":"",borderRadius:o?"50%":$?"4096px":p?"":O,width:typeof i=="number"?R(i):i,height:typeof m=="number"?R(m):m,animation:v?"":"none","--n-bezier":M,"--n-color-start":V,"--n-color-end":j}})}},render(){const{repeat:a,style:l,mergedClsPrefix:r,$attrs:t}=this,s=A("div",te({class:`${r}-skeleton`,style:l},t));return a>1?A(E,null,ne(a,null).map(y=>[s,`
|
|
`])):s}});var D={};Object.defineProperty(D,"__esModule",{value:!0});const L=P,ge={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},ye=(0,L.createElementVNode)("path",{fill:"none",stroke:"currentColor","stroke-linecap":"square","stroke-miterlimit":"10","stroke-width":"44",d:"M416 128L192 384l-96-96"},null,-1),be=[ye];var Ce=D.default=(0,L.defineComponent)({name:"CheckmarkSharp",render:function(l,r){return(0,L.openBlock)(),(0,L.createElementBlock)("svg",ge,be)}}),K={};Object.defineProperty(K,"__esModule",{value:!0});const N=P,xe={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},$e=(0,N.createElementVNode)("path",{d:"M400 145.49L366.51 112L256 222.51L145.49 112L112 145.49L222.51 256L112 366.51L145.49 400L256 289.49L366.51 400L400 366.51L289.49 256L400 145.49z",fill:"currentColor"},null,-1),Be=[$e];var ze=K.default=(0,N.defineComponent)({name:"CloseSharp",render:function(l,r){return(0,N.openBlock)(),(0,N.createElementBlock)("svg",xe,Be)}}),U={};Object.defineProperty(U,"__esModule",{value:!0});const g=P,Se={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Ee=(0,g.createElementVNode)("circle",{cx:"256",cy:"256",r:"48",fill:"currentColor"},null,-1),Le=(0,g.createElementVNode)("circle",{cx:"416",cy:"256",r:"48",fill:"currentColor"},null,-1),Ne=(0,g.createElementVNode)("circle",{cx:"96",cy:"256",r:"48",fill:"currentColor"},null,-1),Pe=[Ee,Le,Ne];var Me=U.default=(0,g.defineComponent)({name:"EllipsisHorizontal",render:function(l,r){return(0,g.openBlock)(),(0,g.createElementBlock)("svg",Se,Pe)}}),W={};Object.defineProperty(W,"__esModule",{value:!0});const C=P,Ve={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},je=(0,C.createElementVNode)("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"44",d:"M358.62 129.28L86.49 402.08L70 442l39.92-16.49l272.8-272.13l-24.1-24.1z"},null,-1),Oe=(0,C.createElementVNode)("path",{d:"M413.07 74.84l-11.79 11.78l24.1 24.1l11.79-11.79a16.51 16.51 0 0 0 0-23.34l-.75-.75a16.51 16.51 0 0 0-23.35 0z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"44"},null,-1),He=[je,Oe];var Re=W.default=(0,C.defineComponent)({name:"Pencil",render:function(l,r){return(0,C.openBlock)(),(0,C.createElementBlock)("svg",Ve,He)}});const Ae={class:"mower-list"},Fe={class:"header"},Ie={class:"header"},Te={key:0},qe={key:3,class:"expand"},De={class:"folder"},Ke={class:"folder-content"},Ue={__name:"MowerManager",setup(a){const l=z(!0),r=z([]),t=z(-1),s=z("");re(()=>{window.addEventListener("pywebviewready",async()=>{r.value=await pywebview.api.get_instances(),l.value=!1})});async function y(){r.value.push({name:"新实例",path:""}),await pywebview.api.add("新实例","")}async function M(o){r.value.splice(o,1),await pywebview.api.remove(o)}function x(o){t.value=o,s.value=r.value[o].name}async function V(){const o=t.value;t.value=-1,r.value[o].name=s.value,await pywebview.api.rename(o,s.value)}function j(){t.value=-1}async function O(o){const p=await pywebview.api.select_path(o);p&&(r.value[o].path=p)}async function b(o){await pywebview.api.start(o)}return(o,p)=>{const $=ke,d=ie,u=le,_=se,B=pe;return c(),w("div",Ae,[l.value?(c(),w(E,{key:0},F(3,v=>e(d,{size:"small",key:v},{header:n(()=>[S("div",Fe,[e($,{text:"",width:"40%"})])]),default:n(()=>[e($,{text:""})]),_:2},1024)),64)):h("",!0),(c(!0),w(E,null,F(r.value,(v,i)=>(c(),k(d,{size:"small",key:i},{header:n(()=>[S("div",Ie,[t.value!=i?(c(),w("div",Te,I(v.name),1)):h("",!0),t.value==-1?(c(),k(_,{key:1,size:"tiny",onClick:m=>x(i)},{icon:n(()=>[e(u,null,{default:n(()=>[e(f(Re))]),_:1})]),_:2},1032,["onClick"])):h("",!0),t.value==-1?(c(),k(_,{key:2,type:"error",ghost:"",size:"tiny",onClick:m=>M(i)},{icon:n(()=>[e(u,null,{default:n(()=>[e(f(_e))]),_:1})]),_:2},1032,["onClick"])):h("",!0),t.value!=i?(c(),w("div",qe)):h("",!0),t.value==-1?(c(),k(_,{key:4,type:"primary",size:"small",disabled:!v.path,onClick:m=>b(i)},{icon:n(()=>[e(u,null,{default:n(()=>[e(f(de))]),_:1})]),_:2},1032,["disabled","onClick"])):h("",!0),t.value==i?(c(),w(E,{key:5},[e(B,{placeholder:"实例名称",value:s.value,"onUpdate:value":p[0]||(p[0]=m=>s.value=m)},null,8,["value"]),e(_,{type:"primary",size:"tiny",circle:"",onClick:V},{icon:n(()=>[e(u,null,{default:n(()=>[e(f(Ce))]),_:1})]),_:1}),e(_,{type:"error",size:"tiny",circle:"",onClick:j},{icon:n(()=>[e(u,null,{default:n(()=>[e(f(ze))]),_:1})]),_:1})],64)):h("",!0)])]),default:n(()=>[S("div",De,[S("code",Ke,I(v.path||"请选择该实例配置文件的保存路径"),1),t.value==-1?(c(),k(_,{key:0,size:"tiny",onClick:m=>O(i)},{icon:n(()=>[e(u,null,{default:n(()=>[e(f(Me))]),_:1})]),_:2},1032,["onClick"])):h("",!0)])]),_:2},1024))),128)),l.value?h("",!0):(c(),k(_,{key:1,size:"large",dashed:"",onClick:y},{icon:n(()=>[e(u,null,{default:n(()=>[e(f(ue))]),_:1})]),default:n(()=>[p[1]||(p[1]=ae(" 添加实例 "))]),_:1}))])}}},We=oe(Ue,[["__scopeId","data-v-4602b0dd"]]),Xe=ce(We);Xe.mount("#app");
|