Add support for disabling sync to implement simple settings isolation mechanism, storing related data only in the browser
parent
1722d32810
commit
5bd21bc258
|
|
@ -13,7 +13,7 @@ Promise.resolve().then(async () => {
|
||||||
<link rel="icon" href="/favicon.ico" />
|
<link rel="icon" href="/favicon.ico" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Infinite Image Browsing</title>
|
<title>Infinite Image Browsing</title>
|
||||||
<script type="module" crossorigin src="/infinite_image_browsing/fe-static/assets/index-7121bf77.js"></script>
|
<script type="module" crossorigin src="/infinite_image_browsing/fe-static/assets/index-ca84e2c1.js"></script>
|
||||||
<link rel="stylesheet" href="/infinite_image_browsing/fe-static/assets/index-c05ac913.css">
|
<link rel="stylesheet" href="/infinite_image_browsing/fe-static/assets/index-c05ac913.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
import{d as E,bz as $,r as f,m as z,_ as M,a as c,al as T,h as m,c as v,P as W}from"./index-7121bf77.js";var G=["prefixCls","name","id","type","disabled","readonly","tabindex","autofocus","value","required"],H={prefixCls:String,name:String,id:String,type:String,defaultChecked:{type:[Boolean,Number],default:void 0},checked:{type:[Boolean,Number],default:void 0},disabled:Boolean,tabindex:{type:[Number,String]},readonly:Boolean,autofocus:Boolean,value:W.any,required:Boolean};const L=E({compatConfig:{MODE:3},name:"Checkbox",inheritAttrs:!1,props:$(H,{prefixCls:"rc-checkbox",type:"checkbox",defaultChecked:!1}),emits:["click","change"],setup:function(a,d){var t=d.attrs,h=d.emit,g=d.expose,o=f(a.checked===void 0?a.defaultChecked:a.checked),i=f();z(function(){return a.checked},function(){o.value=a.checked}),g({focus:function(){var e;(e=i.value)===null||e===void 0||e.focus()},blur:function(){var e;(e=i.value)===null||e===void 0||e.blur()}});var l=f(),x=function(e){if(!a.disabled){a.checked===void 0&&(o.value=e.target.checked),e.shiftKey=l.value;var r={target:c(c({},a),{},{checked:e.target.checked}),stopPropagation:function(){e.stopPropagation()},preventDefault:function(){e.preventDefault()},nativeEvent:e};a.checked!==void 0&&(i.value.checked=!!a.checked),h("change",r),l.value=!1}},C=function(e){h("click",e),l.value=e.shiftKey};return function(){var n,e=a.prefixCls,r=a.name,s=a.id,p=a.type,b=a.disabled,K=a.readonly,P=a.tabindex,B=a.autofocus,S=a.value,N=a.required,_=M(a,G),q=t.class,D=t.onFocus,j=t.onBlur,w=t.onKeydown,A=t.onKeypress,F=t.onKeyup,y=c(c({},_),t),O=Object.keys(y).reduce(function(k,u){return(u.substr(0,5)==="aria-"||u.substr(0,5)==="data-"||u==="role")&&(k[u]=y[u]),k},{}),R=T(e,q,(n={},m(n,"".concat(e,"-checked"),o.value),m(n,"".concat(e,"-disabled"),b),n)),V=c(c({name:r,id:s,type:p,readonly:K,disabled:b,tabindex:P,class:"".concat(e,"-input"),checked:!!o.value,autofocus:B,value:S},O),{},{onChange:x,onClick:C,onFocus:D,onBlur:j,onKeydown:w,onKeypress:A,onKeyup:F,required:N});return v("span",{class:R},[v("input",c({ref:i},V),null),v("span",{class:"".concat(e,"-inner")},null)])}}});export{L as V};
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
||||||
import{d as a,S as t,T as s,c as n,cw as _,Z as o}from"./index-7121bf77.js";const c={class:"img-sli-container"},i=a({__name:"ImgSliPagePane",props:{paneIdx:{},tabIdx:{},left:{},right:{}},setup(l){return(e,r)=>(t(),s("div",c,[n(_,{left:e.left,right:e.right},null,8,["left","right"])]))}});const d=o(i,[["__scopeId","data-v-ae3fb9a8"]]);export{d as default};
|
import{d as a,S as t,T as s,c as n,cx as _,Z as o}from"./index-ca84e2c1.js";const c={class:"img-sli-container"},i=a({__name:"ImgSliPagePane",props:{paneIdx:{},tabIdx:{},left:{},right:{}},setup(l){return(e,r)=>(t(),s("div",c,[n(_,{left:e.left,right:e.right},null,8,["left","right"])]))}});const d=o(i,[["__scopeId","data-v-ae3fb9a8"]]);export{d as default};
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
import{d as ce,m as F,ax as re,$ as pe,S as p,T as I,c as s,a2 as e,a1 as n,a4 as R,U as d,J as ue,W as o,V as m,a0 as V,ad as me,Y as k,ae as G,ag as ge,R as fe,ai as z,aN as ve,aO as he,bD as Ie,Z as ke}from"./index-ca84e2c1.js";import{S as _e}from"./index-9529bc7a.js";import{L as Ce,R as we,f as Se,M as be}from"./MultiSelectKeep-0247e53e.js";import{c as xe,d as ye,F as Me}from"./FileItem-0cdb6688.js";import{c as Ae,u as De}from"./hook-a34ebc4e.js";import{a as Te}from"./functionalCallableComp-99e06f58.js";import"./shortcut-9796cf9e.js";import"./index-a438629e.js";/* empty css */import"./index-a1e9101b.js";const $e=c=>(ve("data-v-caebce58"),c=c(),he(),c),Fe={class:"hint"},Re={class:"action-bar"},Ve=$e(()=>d("div",{style:{padding:"16px 0 512px"}},null,-1)),Ge={key:1},ze={class:"no-res-hint"},Be={class:"hint"},Ne={key:2,class:"preview-switch"},Ue=ce({__name:"MatchedImageGrid",props:{tabIdx:{},paneIdx:{},selectedTagIds:{},id:{}},setup(c){const g=c,f=Ae(t=>Ie(g.selectedTagIds,t)),{queue:B,images:i,onContextMenuClickU:_,stackViewEl:N,previewIdx:r,previewing:C,onPreviewVisibleChange:U,previewImgMove:w,canPreview:S,itemSize:b,gridItems:J,showGenInfo:u,imageGenInfo:x,q:E,multiSelectedIdxs:v,onFileItemClick:L,scroller:y,showMenuIdx:h,onFileDragStart:O,onFileDragEnd:P,cellWidth:K,onScroll:M,saveAllFileAsJson:W,props:q,saveLoadedFileAsJson:Q,changeIndchecked:Y,seedChangeChecked:Z,getGenDiff:j,getGenDiffWatchDep:H}=De(f);F(()=>g.selectedTagIds,async()=>{var t;await f.reset(),await re(),(t=y.value)==null||t.scrollToItem(0),M()},{immediate:!0}),F(()=>g,async t=>{q.value=t},{deep:!0,immediate:!0});const X=pe(),{onClearAllSelected:ee,onSelectAll:te,onReverseSelect:le}=xe();return(t,l)=>{const se=be,ne=ge,ae=fe,A=z,ie=z,oe=_e;return p(),I("div",{class:"container",ref_key:"stackViewEl",ref:N},[s(se,{show:!!e(v).length||e(X).keepMultiSelect,onClearAllSelected:e(ee),onSelectAll:e(te),onReverseSelect:e(le)},null,8,["show","onClearAllSelected","onSelectAll","onReverseSelect"]),s(oe,{size:"large",spinning:!e(B).isIdle},{default:n(()=>{var D,T;return[s(ae,{visible:e(u),"onUpdate:visible":l[1]||(l[1]=a=>R(u)?u.value=a:null),width:"70vw","mask-closable":"",onOk:l[2]||(l[2]=a=>u.value=!1)},{cancelText:n(()=>[]),default:n(()=>[s(ne,{active:"",loading:!e(E).isIdle},{default:n(()=>[d("div",{style:{width:"100%","word-break":"break-all","white-space":"pre-line","max-height":"70vh",overflow:"auto"},onDblclick:l[0]||(l[0]=a=>e(ue)(e(x)))},[d("div",Fe,o(t.$t("doubleClickToCopy")),1),m(" "+o(e(x)),1)],32)]),_:1},8,["loading"])]),_:1},8,["visible"]),d("div",Re,[s(A,{onClick:e(Q)},{default:n(()=>[m(o(t.$t("saveLoadedImageAsJson")),1)]),_:1},8,["onClick"]),s(A,{onClick:e(W)},{default:n(()=>[m(o(t.$t("saveAllAsJson")),1)]),_:1},8,["onClick"])]),(D=e(i))!=null&&D.length?(p(),V(e(ye),{key:0,ref_key:"scroller",ref:y,class:"file-list",items:e(i),"item-size":e(b).first,"key-field":"fullpath","item-secondary-size":e(b).second,gridItems:e(J),onScroll:e(M)},{after:n(()=>[Ve]),default:n(({item:a,index:$})=>[s(Me,{idx:$,file:a,"cell-width":e(K),"show-menu-idx":e(h),"onUpdate:showMenuIdx":l[3]||(l[3]=de=>R(h)?h.value=de:null),onDragstart:e(O),onDragend:e(P),onFileItemClick:e(L),"full-screen-preview-image-url":e(i)[e(r)]?e(me)(e(i)[e(r)]):"",selected:e(v).includes($),onContextMenuClick:e(_),onPreviewVisibleChange:e(U),"is-selected-mutil-files":e(v).length>1,"enable-change-indicator":e(Y),"seed-change-checked":e(Z),"get-gen-diff":e(j),"get-gen-diff-watch-dep":e(H)},null,8,["idx","file","cell-width","show-menu-idx","onDragstart","onDragend","onFileItemClick","full-screen-preview-image-url","selected","onContextMenuClick","onPreviewVisibleChange","is-selected-mutil-files","enable-change-indicator","seed-change-checked","get-gen-diff","get-gen-diff-watch-dep"])]),_:1},8,["items","item-size","item-secondary-size","gridItems","onScroll"])):e(f).load&&t.selectedTagIds.and_tags.length===1&&!((T=t.selectedTagIds.folder_paths_str)!=null&&T.trim())?(p(),I("div",Ge,[d("div",ze,[d("p",Be,o(t.$t("tagSearchNoResultsMessage")),1),s(ie,{onClick:l[4]||(l[4]=a=>e(Te)()),type:"primary"},{default:n(()=>[m(o(t.$t("rebuildImageIndex")),1)]),_:1})])])):k("",!0),e(C)?(p(),I("div",Ne,[s(e(Ce),{onClick:l[5]||(l[5]=a=>e(w)("prev")),class:G({disable:!e(S)("prev")})},null,8,["class"]),s(e(we),{onClick:l[6]||(l[6]=a=>e(w)("next")),class:G({disable:!e(S)("next")})},null,8,["class"])])):k("",!0)]}),_:1},8,["spinning"]),e(C)&&e(i)&&e(i)[e(r)]?(p(),V(Se,{key:0,file:e(i)[e(r)],idx:e(r),onContextMenuClick:e(_)},null,8,["file","idx","onContextMenuClick"])):k("",!0)],512)}}});const Ze=ke(Ue,[["__scopeId","data-v-caebce58"]]);export{Ze as default};
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
import{d as ce,m as F,ax as re,$ as pe,S as p,T as I,c as s,a2 as e,a1 as n,a4 as R,U as d,J as ue,W as o,V as m,a0 as V,ad as me,Y as k,ae as B,ag as ge,R as fe,ai as G,aL as ve,aM as he,bB as Ie,Z as ke}from"./index-7121bf77.js";import{S as _e}from"./index-9fa37e1a.js";import{L as Ce,R as we,f as Se,M as be}from"./MultiSelectKeep-f4a261fe.js";import{c as xe,d as Me,F as ye}from"./FileItem-bd2b52d3.js";import{c as Ae,u as Te}from"./hook-09425c8b.js";import{a as $e}from"./functionalCallableComp-b717558c.js";import"./shortcut-d44a4a8f.js";import"./Checkbox-2d906c91.js";/* empty css */import"./index-b50a3f23.js";const De=c=>(ve("data-v-caebce58"),c=c(),he(),c),Fe={class:"hint"},Re={class:"action-bar"},Ve=De(()=>d("div",{style:{padding:"16px 0 512px"}},null,-1)),Be={key:1},Ge={class:"no-res-hint"},ze={class:"hint"},Ue={key:2,class:"preview-switch"},Je=ce({__name:"MatchedImageGrid",props:{tabIdx:{},paneIdx:{},selectedTagIds:{},id:{}},setup(c){const g=c,f=Ae(t=>Ie(g.selectedTagIds,t)),{queue:z,images:i,onContextMenuClickU:_,stackViewEl:U,previewIdx:r,previewing:C,onPreviewVisibleChange:J,previewImgMove:w,canPreview:S,itemSize:b,gridItems:L,showGenInfo:u,imageGenInfo:x,q:N,multiSelectedIdxs:v,onFileItemClick:E,scroller:M,showMenuIdx:h,onFileDragStart:P,onFileDragEnd:K,cellWidth:O,onScroll:y,saveAllFileAsJson:W,props:q,saveLoadedFileAsJson:Q,changeIndchecked:Y,seedChangeChecked:Z,getGenDiff:j,getGenDiffWatchDep:H}=Te(f);F(()=>g.selectedTagIds,async()=>{var t;await f.reset(),await re(),(t=M.value)==null||t.scrollToItem(0),y()},{immediate:!0}),F(()=>g,async t=>{q.value=t},{deep:!0,immediate:!0});const X=pe(),{onClearAllSelected:ee,onSelectAll:te,onReverseSelect:le}=xe();return(t,l)=>{const se=be,ne=ge,ae=fe,A=G,ie=G,oe=_e;return p(),I("div",{class:"container",ref_key:"stackViewEl",ref:U},[s(se,{show:!!e(v).length||e(X).keepMultiSelect,onClearAllSelected:e(ee),onSelectAll:e(te),onReverseSelect:e(le)},null,8,["show","onClearAllSelected","onSelectAll","onReverseSelect"]),s(oe,{size:"large",spinning:!e(z).isIdle},{default:n(()=>{var T,$;return[s(ae,{visible:e(u),"onUpdate:visible":l[1]||(l[1]=a=>R(u)?u.value=a:null),width:"70vw","mask-closable":"",onOk:l[2]||(l[2]=a=>u.value=!1)},{cancelText:n(()=>[]),default:n(()=>[s(ne,{active:"",loading:!e(N).isIdle},{default:n(()=>[d("div",{style:{width:"100%","word-break":"break-all","white-space":"pre-line","max-height":"70vh",overflow:"auto"},onDblclick:l[0]||(l[0]=a=>e(ue)(e(x)))},[d("div",Fe,o(t.$t("doubleClickToCopy")),1),m(" "+o(e(x)),1)],32)]),_:1},8,["loading"])]),_:1},8,["visible"]),d("div",Re,[s(A,{onClick:e(Q)},{default:n(()=>[m(o(t.$t("saveLoadedImageAsJson")),1)]),_:1},8,["onClick"]),s(A,{onClick:e(W)},{default:n(()=>[m(o(t.$t("saveAllAsJson")),1)]),_:1},8,["onClick"])]),(T=e(i))!=null&&T.length?(p(),V(e(Me),{key:0,ref_key:"scroller",ref:M,class:"file-list",items:e(i),"item-size":e(b).first,"key-field":"fullpath","item-secondary-size":e(b).second,gridItems:e(L),onScroll:e(y)},{after:n(()=>[Ve]),default:n(({item:a,index:D})=>[s(ye,{idx:D,file:a,"cell-width":e(O),"show-menu-idx":e(h),"onUpdate:showMenuIdx":l[3]||(l[3]=de=>R(h)?h.value=de:null),onDragstart:e(P),onDragend:e(K),onFileItemClick:e(E),"full-screen-preview-image-url":e(i)[e(r)]?e(me)(e(i)[e(r)]):"",selected:e(v).includes(D),onContextMenuClick:e(_),onPreviewVisibleChange:e(J),"is-selected-mutil-files":e(v).length>1,"enable-change-indicator":e(Y),"seed-change-checked":e(Z),"get-gen-diff":e(j),"get-gen-diff-watch-dep":e(H)},null,8,["idx","file","cell-width","show-menu-idx","onDragstart","onDragend","onFileItemClick","full-screen-preview-image-url","selected","onContextMenuClick","onPreviewVisibleChange","is-selected-mutil-files","enable-change-indicator","seed-change-checked","get-gen-diff","get-gen-diff-watch-dep"])]),_:1},8,["items","item-size","item-secondary-size","gridItems","onScroll"])):e(f).load&&t.selectedTagIds.and_tags.length===1&&!(($=t.selectedTagIds.folder_paths_str)!=null&&$.trim())?(p(),I("div",Be,[d("div",Ge,[d("p",ze,o(t.$t("tagSearchNoResultsMessage")),1),s(ie,{onClick:l[4]||(l[4]=a=>e($e)()),type:"primary"},{default:n(()=>[m(o(t.$t("rebuildImageIndex")),1)]),_:1})])])):k("",!0),e(C)?(p(),I("div",Ue,[s(e(Ce),{onClick:l[5]||(l[5]=a=>e(w)("prev")),class:B({disable:!e(S)("prev")})},null,8,["class"]),s(e(we),{onClick:l[6]||(l[6]=a=>e(w)("next")),class:B({disable:!e(S)("next")})},null,8,["class"])])):k("",!0)]}),_:1},8,["spinning"]),e(C)&&e(i)&&e(i)[e(r)]?(p(),V(Se,{key:0,file:e(i)[e(r)],idx:e(r),onContextMenuClick:e(_)},null,8,["file","idx","onContextMenuClick"])):k("",!0)],512)}}});const Ze=ke(Je,[["__scopeId","data-v-caebce58"]]);export{Ze as default};
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
||||||
import{d as v,cx as C,bL as I,S as l,T as _,U as f,c,a1 as r,V as h,W as d,a2 as e,a0 as F,ad as x,bZ as z,cy as B,ai as S,Z as $}from"./index-7121bf77.js";import{u as R,a as V,k as E,F as T,d as A}from"./FileItem-bd2b52d3.js";import"./functionalCallableComp-b717558c.js";/* empty css */import"./index-b50a3f23.js";const L={class:"actions-panel actions"},U={key:0,class:"file-list"},N={class:"hint"},H=v({__name:"batchDownload",props:{tabIdx:{},paneIdx:{},id:{}},setup(W){const{stackViewEl:w}=R().toRefs(),{itemSize:p,gridItems:k,cellWidth:b}=V(),n=E(),{selectdFiles:i}=C(n),u=I(),y=async t=>{const s=z(t);s&&n.addFiles(s.nodes)},D=async()=>{u.pushAction(async()=>{const t=await B.value.post("/zip",{paths:i.value.map(o=>o.fullpath)},{responseType:"blob"}),s=window.URL.createObjectURL(new Blob([t.data])),a=document.createElement("a");a.href=s,a.setAttribute("download",`iib_${new Date().toLocaleString()}.zip`),document.body.appendChild(a),a.click()})},g=t=>{i.value.splice(t,1)};return(t,s)=>{const a=S;return l(),_("div",{class:"container",ref_key:"stackViewEl",ref:w,onDrop:y},[f("div",L,[c(a,{onClick:s[0]||(s[0]=o=>e(n).selectdFiles=[])},{default:r(()=>[h(d(t.$t("clear")),1)]),_:1}),c(a,{onClick:D,type:"primary",loading:!e(u).isIdle},{default:r(()=>[h(d(t.$t("zipDownload")),1)]),_:1},8,["loading"])]),e(i).length?(l(),F(e(A),{key:1,ref:"scroller",class:"file-list",items:e(i).slice(),"item-size":e(p).first,"key-field":"fullpath","item-secondary-size":e(p).second,gridItems:e(k)},{default:r(({item:o,index:m})=>[c(T,{idx:m,file:o,"cell-width":e(b),"enable-close-icon":"",onCloseIconClick:Z=>g(m),"full-screen-preview-image-url":e(x)(o),"enable-right-click-menu":!1},null,8,["idx","file","cell-width","onCloseIconClick","full-screen-preview-image-url"])]),_:1},8,["items","item-size","item-secondary-size","gridItems"])):(l(),_("div",U,[f("p",N,d(t.$t("batchDownloaDDragAndDropHint")),1)]))],544)}}});const J=$(H,[["__scopeId","data-v-aab31da2"]]);export{J as default};
|
import{d as v,cy as C,bN as I,S as l,T as _,U as f,c,a1 as r,V as h,W as d,a2 as e,a0 as z,ad as F,b$ as B,cz as $,ai as x,Z as S}from"./index-ca84e2c1.js";import{u as R,a as V,k as E,F as T,d as A}from"./FileItem-0cdb6688.js";import"./functionalCallableComp-99e06f58.js";/* empty css */import"./index-a1e9101b.js";const N={class:"actions-panel actions"},U={key:0,class:"file-list"},L={class:"hint"},H=v({__name:"batchDownload",props:{tabIdx:{},paneIdx:{},id:{}},setup(W){const{stackViewEl:w}=R().toRefs(),{itemSize:p,gridItems:k,cellWidth:b}=V(),n=E(),{selectdFiles:i}=C(n),u=I(),y=async t=>{const s=B(t);s&&n.addFiles(s.nodes)},D=async()=>{u.pushAction(async()=>{const t=await $.value.post("/zip",{paths:i.value.map(o=>o.fullpath)},{responseType:"blob"}),s=window.URL.createObjectURL(new Blob([t.data])),a=document.createElement("a");a.href=s,a.setAttribute("download",`iib_${new Date().toLocaleString()}.zip`),document.body.appendChild(a),a.click()})},g=t=>{i.value.splice(t,1)};return(t,s)=>{const a=x;return l(),_("div",{class:"container",ref_key:"stackViewEl",ref:w,onDrop:y},[f("div",N,[c(a,{onClick:s[0]||(s[0]=o=>e(n).selectdFiles=[])},{default:r(()=>[h(d(t.$t("clear")),1)]),_:1}),c(a,{onClick:D,type:"primary",loading:!e(u).isIdle},{default:r(()=>[h(d(t.$t("zipDownload")),1)]),_:1},8,["loading"])]),e(i).length?(l(),z(e(A),{key:1,ref:"scroller",class:"file-list",items:e(i).slice(),"item-size":e(p).first,"key-field":"fullpath","item-secondary-size":e(p).second,gridItems:e(k)},{default:r(({item:o,index:m})=>[c(T,{idx:m,file:o,"cell-width":e(b),"enable-close-icon":"",onCloseIconClick:j=>g(m),"full-screen-preview-image-url":e(F)(o),"enable-right-click-menu":!1},null,8,["idx","file","cell-width","onCloseIconClick","full-screen-preview-image-url"])]),_:1},8,["items","item-size","item-secondary-size","gridItems"])):(l(),_("div",U,[f("p",L,d(t.$t("batchDownloaDDragAndDropHint")),1)]))],544)}}});const J=S(H,[["__scopeId","data-v-aab31da2"]]);export{J as default};
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
||||||
import{u as w,a as y,F as k,d as x}from"./FileItem-bd2b52d3.js";import{d as b,$ as F,cd as h,r as D,ba as I,be as C,S as z,T as E,c,a1 as S,a2 as e,ad as V,bZ as B,cz as R,Z as T}from"./index-7121bf77.js";import"./functionalCallableComp-b717558c.js";/* empty css */import"./index-b50a3f23.js";const $=b({__name:"gridView",props:{tabIdx:{},paneIdx:{},id:{},removable:{type:Boolean},allowDragAndDrop:{type:Boolean},files:{},paneKey:{}},setup(p){const o=p,d=F(),{stackViewEl:m}=w().toRefs(),{itemSize:i,gridItems:u,cellWidth:f}=y(),g=h(),a=D(o.files??[]),_=async s=>{const l=B(s);o.allowDragAndDrop&&l&&(a.value=R([...a.value,...l.nodes]))},v=s=>{a.value.splice(s,1)};return I(()=>{d.pageFuncExportMap.set(o.paneKey,{getFiles:()=>C(a.value),setFiles:s=>a.value=s})}),(s,l)=>(z(),E("div",{class:"container",ref_key:"stackViewEl",ref:m,onDrop:_},[c(e(x),{ref:"scroller",class:"file-list",items:a.value.slice(),"item-size":e(i).first,"key-field":"fullpath","item-secondary-size":e(i).second,gridItems:e(u)},{default:S(({item:t,index:r})=>{var n;return[c(k,{idx:r,file:t,"cell-width":e(f),"enable-close-icon":o.removable,onCloseIconClick:A=>v(r),"full-screen-preview-image-url":e(V)(t),"extra-tags":(n=t==null?void 0:t.tags)==null?void 0:n.map(e(g).tagConvert),"enable-right-click-menu":!1},null,8,["idx","file","cell-width","enable-close-icon","onCloseIconClick","full-screen-preview-image-url","extra-tags"])]}),_:1},8,["items","item-size","item-secondary-size","gridItems"])],544))}});const M=T($,[["__scopeId","data-v-f35f4802"]]);export{M as default};
|
import{u as w,a as y,F as k,d as x}from"./FileItem-0cdb6688.js";import{d as b,$ as F,cf as h,r as D,bc as I,bg as C,S as E,T as S,c,a1 as V,a2 as e,ad as z,b$ as B,cA as $,Z as A}from"./index-ca84e2c1.js";import"./functionalCallableComp-99e06f58.js";/* empty css */import"./index-a1e9101b.js";const R=b({__name:"gridView",props:{tabIdx:{},paneIdx:{},id:{},removable:{type:Boolean},allowDragAndDrop:{type:Boolean},files:{},paneKey:{}},setup(p){const o=p,d=F(),{stackViewEl:m}=w().toRefs(),{itemSize:i,gridItems:u,cellWidth:f}=y(),g=h(),a=D(o.files??[]),_=async s=>{const l=B(s);o.allowDragAndDrop&&l&&(a.value=$([...a.value,...l.nodes]))},v=s=>{a.value.splice(s,1)};return I(()=>{d.pageFuncExportMap.set(o.paneKey,{getFiles:()=>C(a.value),setFiles:s=>a.value=s})}),(s,l)=>(E(),S("div",{class:"container",ref_key:"stackViewEl",ref:m,onDrop:_},[c(e(x),{ref:"scroller",class:"file-list",items:a.value.slice(),"item-size":e(i).first,"key-field":"fullpath","item-secondary-size":e(i).second,gridItems:e(u)},{default:V(({item:t,index:r})=>{var n;return[c(k,{idx:r,file:t,"cell-width":e(f),"enable-close-icon":o.removable,onCloseIconClick:T=>v(r),"full-screen-preview-image-url":e(z)(t),"extra-tags":(n=t==null?void 0:t.tags)==null?void 0:n.map(e(g).tagConvert),"enable-right-click-menu":!1},null,8,["idx","file","cell-width","enable-close-icon","onCloseIconClick","full-screen-preview-image-url","extra-tags"])]}),_:1},8,["items","item-size","item-secondary-size","gridItems"])],544))}});const N=A(R,[["__scopeId","data-v-f35f4802"]]);export{N as default};
|
||||||
|
|
@ -1 +1 @@
|
||||||
import{ak as k,r as g,l as P,k as b,L as A,E as R,bL as q,bn as G,bV as z}from"./index-7121bf77.js";import{u as O,a as Q,b as j,e as H}from"./FileItem-bd2b52d3.js";import{a as T,b as U,c as V,d as W}from"./MultiSelectKeep-f4a261fe.js";let B=0;const K=()=>++B,X=(n,i,{dataUpdateStrategy:l="replace"}={})=>{const a=k([""]),c=g(!1),t=g(),o=g(!1);let f=g(-1);const v=new Set,w=e=>{var s;l==="replace"?t.value=e:l==="merge"&&(A((Array.isArray(t.value)||typeof t.value>"u")&&Array.isArray(e),"数据更新策略为合并时仅可用于值为数组的情况"),t.value=[...(s=t==null?void 0:t.value)!==null&&s!==void 0?s:[],...e])},d=e=>b(void 0,void 0,void 0,function*(){if(o.value||c.value&&typeof e>"u")return!1;o.value=!0;const s=K();f.value=s;try{let r;if(typeof e=="number"){if(r=a[e],typeof r!="string")return!1}else r=a[a.length-1];const h=yield n(r);if(v.has(s))return v.delete(s),!1;w(i(h));const u=h.cursor;if((e===a.length-1||typeof e!="number")&&(c.value=!u.has_next,u.has_next)){const y=u.next_cursor||u.next;A(typeof y=="string"),a.push(y)}}finally{f.value===s&&(o.value=!1)}return!0}),m=()=>{v.add(f.value),o.value=!1},x=(e=!1)=>b(void 0,void 0,void 0,function*(){const{refetch:s,force:r}=typeof e=="object"?e:{refetch:e};r&&m(),A(!o.value),a.splice(0,a.length,""),o.value=!1,t.value=void 0,c.value=!1,s&&(yield d())}),I=()=>({next:()=>b(void 0,void 0,void 0,function*(){if(o.value)throw new Error("不允许同时迭代");return{done:!(yield d()),value:t.value}})});return P({abort:m,load:c,next:d,res:t,loading:o,cursorStack:a,reset:x,[Symbol.asyncIterator]:I,iter:{[Symbol.asyncIterator]:I}})},te=n=>k(X(n,i=>i.files,{dataUpdateStrategy:"merge"})),se=n=>{const i=k(new Set),l=R(()=>(n.res??[]).filter(p=>!i.has(p.fullpath))),a=q(),{stackViewEl:c,multiSelectedIdxs:t,stack:o,scroller:f,props:v}=O({images:l}).toRefs(),{itemSize:w,gridItems:d,cellWidth:m,onScroll:x}=Q({fetchNext:()=>n.next()}),{showMenuIdx:I}=j(),{onFileDragStart:e,onFileDragEnd:s}=T(),{showGenInfo:r,imageGenInfo:h,q:u,onContextMenuClick:y,onFileItemClick:C}=U({openNext:G}),{previewIdx:E,previewing:_,onPreviewVisibleChange:M,previewImgMove:D,canPreview:J}=V({loadNext:()=>n.next()}),L=async(p,S,N)=>{o.value=[{curr:"",files:l.value}],await y(p,S,N)};H("removeFiles",async({paths:p})=>{p.forEach(S=>i.add(S))});const F=()=>{z(l.value)};return{images:l,scroller:f,queue:a,iter:n,onContextMenuClickU:L,stackViewEl:c,previewIdx:E,previewing:_,onPreviewVisibleChange:M,previewImgMove:D,canPreview:J,itemSize:w,gridItems:d,showGenInfo:r,imageGenInfo:h,q:u,onContextMenuClick:y,onFileItemClick:C,showMenuIdx:I,multiSelectedIdxs:t,onFileDragStart:e,onFileDragEnd:s,cellWidth:m,onScroll:x,saveLoadedFileAsJson:F,saveAllFileAsJson:async()=>{for(;!n.load;)await n.next();F()},props:v,...W()}};export{te as c,se as u};
|
import{ak as k,r as g,l as R,k as b,L as A,E as q,bN as G,bp as L,bX as z}from"./index-ca84e2c1.js";import{u as O,a as Q,b as j,e as H}from"./FileItem-0cdb6688.js";import{a as T,b as U,c as W,d as X}from"./MultiSelectKeep-0247e53e.js";let B=0;const K=()=>++B,V=(n,i,{dataUpdateStrategy:l="replace"}={})=>{const a=k([""]),c=g(!1),t=g(),o=g(!1);let f=g(-1);const v=new Set,w=e=>{var s;l==="replace"?t.value=e:l==="merge"&&(A((Array.isArray(t.value)||typeof t.value>"u")&&Array.isArray(e),"数据更新策略为合并时仅可用于值为数组的情况"),t.value=[...(s=t==null?void 0:t.value)!==null&&s!==void 0?s:[],...e])},d=e=>b(void 0,void 0,void 0,function*(){if(o.value||c.value&&typeof e>"u")return!1;o.value=!0;const s=K();f.value=s;try{let r;if(typeof e=="number"){if(r=a[e],typeof r!="string")return!1}else r=a[a.length-1];const h=yield n(r);if(v.has(s))return v.delete(s),!1;w(i(h));const u=h.cursor;if((e===a.length-1||typeof e!="number")&&(c.value=!u.has_next,u.has_next)){const y=u.next_cursor||u.next;A(typeof y=="string"),a.push(y)}}finally{f.value===s&&(o.value=!1)}return!0}),m=()=>{v.add(f.value),o.value=!1},x=(e=!1)=>b(void 0,void 0,void 0,function*(){const{refetch:s,force:r}=typeof e=="object"?e:{refetch:e};r&&m(),A(!o.value),a.splice(0,a.length,""),o.value=!1,t.value=void 0,c.value=!1,s&&(yield d())}),I=()=>({next:()=>b(void 0,void 0,void 0,function*(){if(o.value)throw new Error("不允许同时迭代");return{done:!(yield d()),value:t.value}})});return R({abort:m,load:c,next:d,res:t,loading:o,cursorStack:a,reset:x,[Symbol.asyncIterator]:I,iter:{[Symbol.asyncIterator]:I}})},te=n=>k(V(n,i=>i.files,{dataUpdateStrategy:"merge"})),se=n=>{const i=k(new Set),l=q(()=>(n.res??[]).filter(p=>!i.has(p.fullpath))),a=G(),{stackViewEl:c,multiSelectedIdxs:t,stack:o,scroller:f,props:v}=O({images:l}).toRefs(),{itemSize:w,gridItems:d,cellWidth:m,onScroll:x}=Q({fetchNext:()=>n.next()}),{showMenuIdx:I}=j(),{onFileDragStart:e,onFileDragEnd:s}=T(),{showGenInfo:r,imageGenInfo:h,q:u,onContextMenuClick:y,onFileItemClick:C}=U({openNext:L}),{previewIdx:E,previewing:_,onPreviewVisibleChange:M,previewImgMove:N,canPreview:D}=W({loadNext:()=>n.next()}),J=async(p,S,P)=>{o.value=[{curr:"",files:l.value}],await y(p,S,P)};H("removeFiles",async({paths:p})=>{p.forEach(S=>i.add(S))});const F=()=>{z(l.value)};return{images:l,scroller:f,queue:a,iter:n,onContextMenuClickU:J,stackViewEl:c,previewIdx:E,previewing:_,onPreviewVisibleChange:M,previewImgMove:N,canPreview:D,itemSize:w,gridItems:d,showGenInfo:r,imageGenInfo:h,q:u,onContextMenuClick:y,onFileItemClick:C,showMenuIdx:I,multiSelectedIdxs:t,onFileDragStart:e,onFileDragEnd:s,cellWidth:m,onScroll:x,saveLoadedFileAsJson:F,saveAllFileAsJson:async()=>{for(;!n.load;)await n.next();F()},props:v,...X()}};export{te as c,se as u};
|
||||||
|
|
@ -1 +1 @@
|
||||||
import{d as x,$,aI as g,dj as b,r as w,S as p,T as d,U as a,c as r,a1 as i,V as u,W as n,X as I,a6 as B,a2 as m,x as V,y as _,z as v,ah as W,ai as D,dk as N,Z as R}from"./index-7121bf77.js";/* empty css */const F={class:"container"},L={class:"actions"},T={class:"uni-desc"},U={class:"snapshot"},j=x({__name:"index",props:{tabIdx:{},paneIdx:{},id:{},paneKey:{}},setup(q){const h=$(),t=g(),f=e=>{h.tabList=V(e.tabs)},k=b(async e=>{await N(`workspace_snapshot_${e.id}`),t.snapshots=t.snapshots.filter(c=>c.id!==e.id),_.success(v("deleteSuccess"))}),o=w(""),y=async()=>{if(!o.value){_.error(v("nameRequired"));return}const e=t.createSnapshot(o.value);await t.addSnapshot(e),_.success(v("saveCompleted"))};return(e,c)=>{const C=W,l=D;return p(),d("div",F,[a("div",L,[r(C,{value:o.value,"onUpdate:value":c[0]||(c[0]=s=>o.value=s),placeholder:e.$t("name"),style:{"max-width":"300px"}},null,8,["value","placeholder"]),r(l,{type:"primary",onClick:y},{default:i(()=>[u(n(e.$t("saveWorkspaceSnapshot")),1)]),_:1})]),a("p",T,n(e.$t("WorkspaceSnapshotDesc")),1),a("ul",U,[(p(!0),d(I,null,B(m(t).snapshots,s=>(p(),d("li",{key:s.id},[a("div",null,[a("span",null,n(s.name),1)]),a("div",null,[r(l,{onClick:S=>f(s)},{default:i(()=>[u(n(e.$t("restore")),1)]),_:2},1032,["onClick"]),r(l,{onClick:S=>m(k)(s)},{default:i(()=>[u(n(e.$t("remove")),1)]),_:2},1032,["onClick"])])]))),128))])])}}});const E=R(j,[["__scopeId","data-v-2c44013c"]]);export{E as default};
|
import{d as x,$,aI as g,dk as b,r as w,S as p,T as d,U as a,c as r,a1 as i,V as u,W as n,X as I,a6 as B,a2 as m,x as V,y as _,z as v,ah as W,ai as D,dl as N,Z as R}from"./index-ca84e2c1.js";/* empty css */const F={class:"container"},L={class:"actions"},T={class:"uni-desc"},U={class:"snapshot"},q=x({__name:"index",props:{tabIdx:{},paneIdx:{},id:{},paneKey:{}},setup(z){const h=$(),t=g(),f=e=>{h.tabList=V(e.tabs)},k=b(async e=>{await N(`workspace_snapshot_${e.id}`),t.snapshots=t.snapshots.filter(c=>c.id!==e.id),_.success(v("deleteSuccess"))}),o=w(""),y=async()=>{if(!o.value){_.error(v("nameRequired"));return}const e=t.createSnapshot(o.value);await t.addSnapshot(e),_.success(v("saveCompleted"))};return(e,c)=>{const C=W,l=D;return p(),d("div",F,[a("div",L,[r(C,{value:o.value,"onUpdate:value":c[0]||(c[0]=s=>o.value=s),placeholder:e.$t("name"),style:{"max-width":"300px"}},null,8,["value","placeholder"]),r(l,{type:"primary",onClick:y},{default:i(()=>[u(n(e.$t("saveWorkspaceSnapshot")),1)]),_:1})]),a("p",T,n(e.$t("WorkspaceSnapshotDesc")),1),a("ul",U,[(p(!0),d(I,null,B(m(t).snapshots,s=>(p(),d("li",{key:s.id},[a("div",null,[a("span",null,n(s.name),1)]),a("div",null,[r(l,{onClick:S=>f(s)},{default:i(()=>[u(n(e.$t("restore")),1)]),_:2},1032,["onClick"]),r(l,{onClick:S=>m(k)(s)},{default:i(()=>[u(n(e.$t("remove")),1)]),_:2},1032,["onClick"])])]))),128))])])}}});const G=R(q,[["__scopeId","data-v-2c44013c"]]);export{G as default};
|
||||||
|
|
@ -1 +1 @@
|
||||||
import{r as F,o as P,cq as K,at as L,E as i,av as T,aw as I,d as E,u as $,cr as _,b as y,bd as V,cs as A,al as B,h as c,c as M,a as G}from"./index-7121bf77.js";const W=function(){var o=F(!1);return P(function(){o.value=K()}),o};var D=Symbol("rowContextKey"),q=function(r){T(D,r)},U=function(){return L(D,{gutter:i(function(){}),wrap:i(function(){}),supportFlexGap:i(function(){})})};I("top","middle","bottom","stretch");I("start","end","center","space-around","space-between");var k=function(){return{align:String,justify:String,prefixCls:String,gutter:{type:[Number,Array,Object],default:0},wrap:{type:Boolean,default:void 0}}},H=E({compatConfig:{MODE:3},name:"ARow",props:k(),setup:function(r,N){var m=N.slots,v=$("row",r),d=v.prefixCls,h=v.direction,j,x=F({xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0,xxxl:!0}),w=W();P(function(){j=_.subscribe(function(e){var t=r.gutter||0;(!Array.isArray(t)&&y(t)==="object"||Array.isArray(t)&&(y(t[0])==="object"||y(t[1])==="object"))&&(x.value=e)})}),V(function(){_.unsubscribe(j)});var S=i(function(){var e=[0,0],t=r.gutter,n=t===void 0?0:t,s=Array.isArray(n)?n:[n,0];return s.forEach(function(l,b){if(y(l)==="object")for(var a=0;a<A.length;a++){var p=A[a];if(x.value[p]&&l[p]!==void 0){e[b]=l[p];break}}else e[b]=l||0}),e});q({gutter:S,supportFlexGap:w,wrap:i(function(){return r.wrap})});var R=i(function(){var e;return B(d.value,(e={},c(e,"".concat(d.value,"-no-wrap"),r.wrap===!1),c(e,"".concat(d.value,"-").concat(r.justify),r.justify),c(e,"".concat(d.value,"-").concat(r.align),r.align),c(e,"".concat(d.value,"-rtl"),h.value==="rtl"),e))}),O=i(function(){var e=S.value,t={},n=e[0]>0?"".concat(e[0]/-2,"px"):void 0,s=e[1]>0?"".concat(e[1]/-2,"px"):void 0;return n&&(t.marginLeft=n,t.marginRight=n),w.value?t.rowGap="".concat(e[1],"px"):s&&(t.marginTop=s,t.marginBottom=s),t});return function(){var e;return M("div",{class:R.value,style:O.value},[(e=m.default)===null||e===void 0?void 0:e.call(m)])}}});const Y=H;function J(o){return typeof o=="number"?"".concat(o," ").concat(o," auto"):/^\d+(\.\d+)?(px|em|rem|%)$/.test(o)?"0 0 ".concat(o):o}var Q=function(){return{span:[String,Number],order:[String,Number],offset:[String,Number],push:[String,Number],pull:[String,Number],xs:{type:[String,Number,Object],default:void 0},sm:{type:[String,Number,Object],default:void 0},md:{type:[String,Number,Object],default:void 0},lg:{type:[String,Number,Object],default:void 0},xl:{type:[String,Number,Object],default:void 0},xxl:{type:[String,Number,Object],default:void 0},xxxl:{type:[String,Number,Object],default:void 0},prefixCls:String,flex:[String,Number]}};const Z=E({compatConfig:{MODE:3},name:"ACol",props:Q(),setup:function(r,N){var m=N.slots,v=U(),d=v.gutter,h=v.supportFlexGap,j=v.wrap,x=$("col",r),w=x.prefixCls,S=x.direction,R=i(function(){var e,t=r.span,n=r.order,s=r.offset,l=r.push,b=r.pull,a=w.value,p={};return["xs","sm","md","lg","xl","xxl","xxxl"].forEach(function(g){var f,u={},C=r[g];typeof C=="number"?u.span=C:y(C)==="object"&&(u=C||{}),p=G(G({},p),{},(f={},c(f,"".concat(a,"-").concat(g,"-").concat(u.span),u.span!==void 0),c(f,"".concat(a,"-").concat(g,"-order-").concat(u.order),u.order||u.order===0),c(f,"".concat(a,"-").concat(g,"-offset-").concat(u.offset),u.offset||u.offset===0),c(f,"".concat(a,"-").concat(g,"-push-").concat(u.push),u.push||u.push===0),c(f,"".concat(a,"-").concat(g,"-pull-").concat(u.pull),u.pull||u.pull===0),c(f,"".concat(a,"-rtl"),S.value==="rtl"),f))}),B(a,(e={},c(e,"".concat(a,"-").concat(t),t!==void 0),c(e,"".concat(a,"-order-").concat(n),n),c(e,"".concat(a,"-offset-").concat(s),s),c(e,"".concat(a,"-push-").concat(l),l),c(e,"".concat(a,"-pull-").concat(b),b),e),p)}),O=i(function(){var e=r.flex,t=d.value,n={};if(t&&t[0]>0){var s="".concat(t[0]/2,"px");n.paddingLeft=s,n.paddingRight=s}if(t&&t[1]>0&&!h.value){var l="".concat(t[1]/2,"px");n.paddingTop=l,n.paddingBottom=l}return e&&(n.flex=J(e),j.value===!1&&!n.minWidth&&(n.minWidth=0)),n});return function(){var e;return M("div",{class:R.value,style:O.value},[(e=m.default)===null||e===void 0?void 0:e.call(m)])}}});export{Z as C,Y as R};
|
import{r as F,o as P,cr as K,at as L,E as i,av as T,aw as I,d as E,u as $,cs as _,b as y,bf as V,ct as A,al as B,h as c,c as M,a as G}from"./index-ca84e2c1.js";const W=function(){var o=F(!1);return P(function(){o.value=K()}),o};var D=Symbol("rowContextKey"),U=function(r){T(D,r)},k=function(){return L(D,{gutter:i(function(){}),wrap:i(function(){}),supportFlexGap:i(function(){})})};I("top","middle","bottom","stretch");I("start","end","center","space-around","space-between");var q=function(){return{align:String,justify:String,prefixCls:String,gutter:{type:[Number,Array,Object],default:0},wrap:{type:Boolean,default:void 0}}},H=E({compatConfig:{MODE:3},name:"ARow",props:q(),setup:function(r,N){var m=N.slots,v=$("row",r),d=v.prefixCls,h=v.direction,j,x=F({xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0,xxxl:!0}),w=W();P(function(){j=_.subscribe(function(e){var t=r.gutter||0;(!Array.isArray(t)&&y(t)==="object"||Array.isArray(t)&&(y(t[0])==="object"||y(t[1])==="object"))&&(x.value=e)})}),V(function(){_.unsubscribe(j)});var S=i(function(){var e=[0,0],t=r.gutter,n=t===void 0?0:t,s=Array.isArray(n)?n:[n,0];return s.forEach(function(l,b){if(y(l)==="object")for(var a=0;a<A.length;a++){var p=A[a];if(x.value[p]&&l[p]!==void 0){e[b]=l[p];break}}else e[b]=l||0}),e});U({gutter:S,supportFlexGap:w,wrap:i(function(){return r.wrap})});var R=i(function(){var e;return B(d.value,(e={},c(e,"".concat(d.value,"-no-wrap"),r.wrap===!1),c(e,"".concat(d.value,"-").concat(r.justify),r.justify),c(e,"".concat(d.value,"-").concat(r.align),r.align),c(e,"".concat(d.value,"-rtl"),h.value==="rtl"),e))}),O=i(function(){var e=S.value,t={},n=e[0]>0?"".concat(e[0]/-2,"px"):void 0,s=e[1]>0?"".concat(e[1]/-2,"px"):void 0;return n&&(t.marginLeft=n,t.marginRight=n),w.value?t.rowGap="".concat(e[1],"px"):s&&(t.marginTop=s,t.marginBottom=s),t});return function(){var e;return M("div",{class:R.value,style:O.value},[(e=m.default)===null||e===void 0?void 0:e.call(m)])}}});const Y=H;function J(o){return typeof o=="number"?"".concat(o," ").concat(o," auto"):/^\d+(\.\d+)?(px|em|rem|%)$/.test(o)?"0 0 ".concat(o):o}var Q=function(){return{span:[String,Number],order:[String,Number],offset:[String,Number],push:[String,Number],pull:[String,Number],xs:{type:[String,Number,Object],default:void 0},sm:{type:[String,Number,Object],default:void 0},md:{type:[String,Number,Object],default:void 0},lg:{type:[String,Number,Object],default:void 0},xl:{type:[String,Number,Object],default:void 0},xxl:{type:[String,Number,Object],default:void 0},xxxl:{type:[String,Number,Object],default:void 0},prefixCls:String,flex:[String,Number]}};const Z=E({compatConfig:{MODE:3},name:"ACol",props:Q(),setup:function(r,N){var m=N.slots,v=k(),d=v.gutter,h=v.supportFlexGap,j=v.wrap,x=$("col",r),w=x.prefixCls,S=x.direction,R=i(function(){var e,t=r.span,n=r.order,s=r.offset,l=r.push,b=r.pull,a=w.value,p={};return["xs","sm","md","lg","xl","xxl","xxxl"].forEach(function(g){var f,u={},C=r[g];typeof C=="number"?u.span=C:y(C)==="object"&&(u=C||{}),p=G(G({},p),{},(f={},c(f,"".concat(a,"-").concat(g,"-").concat(u.span),u.span!==void 0),c(f,"".concat(a,"-").concat(g,"-order-").concat(u.order),u.order||u.order===0),c(f,"".concat(a,"-").concat(g,"-offset-").concat(u.offset),u.offset||u.offset===0),c(f,"".concat(a,"-").concat(g,"-push-").concat(u.push),u.push||u.push===0),c(f,"".concat(a,"-").concat(g,"-pull-").concat(u.pull),u.pull||u.pull===0),c(f,"".concat(a,"-rtl"),S.value==="rtl"),f))}),B(a,(e={},c(e,"".concat(a,"-").concat(t),t!==void 0),c(e,"".concat(a,"-order-").concat(n),n),c(e,"".concat(a,"-offset-").concat(s),s),c(e,"".concat(a,"-push-").concat(l),l),c(e,"".concat(a,"-pull-").concat(b),b),e),p)}),O=i(function(){var e=r.flex,t=d.value,n={};if(t&&t[0]>0){var s="".concat(t[0]/2,"px");n.paddingLeft=s,n.paddingRight=s}if(t&&t[1]>0&&!h.value){var l="".concat(t[1]/2,"px");n.paddingTop=l,n.paddingBottom=l}return e&&(n.flex=J(e),j.value===!1&&!n.minWidth&&(n.minWidth=0)),n});return function(){var e;return M("div",{class:R.value,style:O.value},[(e=m.default)===null||e===void 0?void 0:e.call(m)])}}});export{Z as C,Y as R};
|
||||||
|
|
@ -1 +1 @@
|
||||||
import{d as w,bz as D,at as A,ct as j,ax as k,n as V,cu as B,b_ as y,e as $,c as a,_ as T,h as r,a as P,cv as M,P as b}from"./index-7121bf77.js";var O=["class","style"],W=function(){return{prefixCls:String,spinning:{type:Boolean,default:void 0},size:String,wrapperClassName:String,tip:b.any,delay:Number,indicator:b.any}},p=null;function q(t,n){return!!t&&!!n&&!isNaN(Number(n))}function G(t){var n=t.indicator;p=typeof n=="function"?n:function(){return a(n,null,null)}}const H=w({compatConfig:{MODE:3},name:"ASpin",inheritAttrs:!1,props:D(W(),{size:"default",spinning:!0,wrapperClassName:""}),setup:function(){return{originalUpdateSpinning:null,configProvider:A("configProvider",j)}},data:function(){var n=this.spinning,e=this.delay,i=q(n,e);return{sSpinning:n&&!i}},created:function(){this.originalUpdateSpinning=this.updateSpinning,this.debouncifyUpdateSpinning(this.$props)},mounted:function(){this.updateSpinning()},updated:function(){var n=this;k(function(){n.debouncifyUpdateSpinning(),n.updateSpinning()})},beforeUnmount:function(){this.cancelExistingSpin()},methods:{debouncifyUpdateSpinning:function(n){var e=n||this.$props,i=e.delay;i&&(this.cancelExistingSpin(),this.updateSpinning=V(this.originalUpdateSpinning,i))},updateSpinning:function(){var n=this.spinning,e=this.sSpinning;e!==n&&(this.sSpinning=n)},cancelExistingSpin:function(){var n=this.updateSpinning;n&&n.cancel&&n.cancel()},renderIndicator:function(n){var e="".concat(n,"-dot"),i=B(this,"indicator");return i===null?null:(Array.isArray(i)&&(i=i.length===1?i[0]:i),y(i)?$(i,{class:e}):p&&y(p())?$(p(),{class:e}):a("span",{class:"".concat(e," ").concat(n,"-dot-spin")},[a("i",{class:"".concat(n,"-dot-item")},null),a("i",{class:"".concat(n,"-dot-item")},null),a("i",{class:"".concat(n,"-dot-item")},null),a("i",{class:"".concat(n,"-dot-item")},null)]))}},render:function(){var n,e,i,o=this.$props,f=o.size,x=o.prefixCls,h=o.tip,d=h===void 0?(n=(e=this.$slots).tip)===null||n===void 0?void 0:n.call(e):h,_=o.wrapperClassName,l=this.$attrs,v=l.class,N=l.style,C=T(l,O),S=this.configProvider,U=S.getPrefixCls,z=S.direction,s=U("spin",x),u=this.sSpinning,E=(i={},r(i,s,!0),r(i,"".concat(s,"-sm"),f==="small"),r(i,"".concat(s,"-lg"),f==="large"),r(i,"".concat(s,"-spinning"),u),r(i,"".concat(s,"-show-text"),!!d),r(i,"".concat(s,"-rtl"),z==="rtl"),r(i,v,!!v),i),m=a("div",P(P({},C),{},{style:N,class:E}),[this.renderIndicator(s),d?a("div",{class:"".concat(s,"-text")},[d]):null]),g=M(this);if(g&&g.length){var c,I=(c={},r(c,"".concat(s,"-container"),!0),r(c,"".concat(s,"-blur"),u),c);return a("div",{class:["".concat(s,"-nested-loading"),_]},[u&&a("div",{key:"loading"},[m]),a("div",{class:I,key:"container"},[g])])}return m}});export{H as S,G as s};
|
import{d as z,bB as D,at as A,cu as j,ax as k,n as B,cv as V,c0 as y,e as $,c as a,_ as T,h as r,a as P,cw as M,P as b}from"./index-ca84e2c1.js";var O=["class","style"],W=function(){return{prefixCls:String,spinning:{type:Boolean,default:void 0},size:String,wrapperClassName:String,tip:b.any,delay:Number,indicator:b.any}},p=null;function q(t,n){return!!t&&!!n&&!isNaN(Number(n))}function G(t){var n=t.indicator;p=typeof n=="function"?n:function(){return a(n,null,null)}}const H=z({compatConfig:{MODE:3},name:"ASpin",inheritAttrs:!1,props:D(W(),{size:"default",spinning:!0,wrapperClassName:""}),setup:function(){return{originalUpdateSpinning:null,configProvider:A("configProvider",j)}},data:function(){var n=this.spinning,e=this.delay,i=q(n,e);return{sSpinning:n&&!i}},created:function(){this.originalUpdateSpinning=this.updateSpinning,this.debouncifyUpdateSpinning(this.$props)},mounted:function(){this.updateSpinning()},updated:function(){var n=this;k(function(){n.debouncifyUpdateSpinning(),n.updateSpinning()})},beforeUnmount:function(){this.cancelExistingSpin()},methods:{debouncifyUpdateSpinning:function(n){var e=n||this.$props,i=e.delay;i&&(this.cancelExistingSpin(),this.updateSpinning=B(this.originalUpdateSpinning,i))},updateSpinning:function(){var n=this.spinning,e=this.sSpinning;e!==n&&(this.sSpinning=n)},cancelExistingSpin:function(){var n=this.updateSpinning;n&&n.cancel&&n.cancel()},renderIndicator:function(n){var e="".concat(n,"-dot"),i=V(this,"indicator");return i===null?null:(Array.isArray(i)&&(i=i.length===1?i[0]:i),y(i)?$(i,{class:e}):p&&y(p())?$(p(),{class:e}):a("span",{class:"".concat(e," ").concat(n,"-dot-spin")},[a("i",{class:"".concat(n,"-dot-item")},null),a("i",{class:"".concat(n,"-dot-item")},null),a("i",{class:"".concat(n,"-dot-item")},null),a("i",{class:"".concat(n,"-dot-item")},null)]))}},render:function(){var n,e,i,o=this.$props,f=o.size,x=o.prefixCls,h=o.tip,d=h===void 0?(n=(e=this.$slots).tip)===null||n===void 0?void 0:n.call(e):h,N=o.wrapperClassName,l=this.$attrs,v=l.class,_=l.style,C=T(l,O),S=this.configProvider,U=S.getPrefixCls,w=S.direction,s=U("spin",x),u=this.sSpinning,E=(i={},r(i,s,!0),r(i,"".concat(s,"-sm"),f==="small"),r(i,"".concat(s,"-lg"),f==="large"),r(i,"".concat(s,"-spinning"),u),r(i,"".concat(s,"-show-text"),!!d),r(i,"".concat(s,"-rtl"),w==="rtl"),r(i,v,!!v),i),m=a("div",P(P({},C),{},{style:_,class:E}),[this.renderIndicator(s),d?a("div",{class:"".concat(s,"-text")},[d]):null]),g=M(this);if(g&&g.length){var c,I=(c={},r(c,"".concat(s,"-container"),!0),r(c,"".concat(s,"-blur"),u),c);return a("div",{class:["".concat(s,"-nested-loading"),N]},[u&&a("div",{key:"loading"},[m]),a("div",{class:I,key:"container"},[g])])}return m}});export{H as S,G as s};
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
||||||
import{R as y,C as v}from"./index-2355288a.js";import{cm as f,c as d,A as w,d as P,S as a,T as c,U as r,X as S,a6 as O,aE as b,a1 as R,V as u,W as p,a2 as V,ai as $,Z as x,O as H,I as _,Q as m}from"./index-7121bf77.js";const A=f(y),E=f(v);var L={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3-15.4 12.3-16.6 35.4-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8z"}}]},name:"pushpin",theme:"filled"};const C=L;function h(t){for(var e=1;e<arguments.length;e++){var s=arguments[e]!=null?Object(arguments[e]):{},n=Object.keys(s);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(s).filter(function(i){return Object.getOwnPropertyDescriptor(s,i).enumerable}))),n.forEach(function(i){N(t,i,s[i])})}return t}function N(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}var l=function(e,s){var n=h({},e,s.attrs);return d(w,h({},n,{icon:C}),null)};l.displayName="PushpinFilled";l.inheritAttrs=!1;const z=l,F={class:"record-container"},I={style:{flex:"1"}},k={class:"rec-actions"},B=["onClick"],j=P({__name:"HistoryRecord",props:{records:{}},emits:["reuseRecord"],setup(t){return(e,s)=>{const n=$;return a(),c("div",null,[r("ul",F,[(a(!0),c(S,null,O(e.records.getRecords(),i=>(a(),c("li",{key:i.id,class:"record"},[r("div",I,[b(e.$slots,"default",{record:i},void 0,!0)]),r("div",k,[d(n,{onClick:g=>e.$emit("reuseRecord",i),type:"primary"},{default:R(()=>[u(p(e.$t("restore")),1)]),_:2},1032,["onClick"]),r("div",{class:"pin",onClick:g=>e.records.switchPin(i)},[d(V(z)),u(" "+p(e.records.isPinned(i)?e.$t("unpin"):e.$t("pin")),1)],8,B)])]))),128))])])}}});const T=x(j,[["__scopeId","data-v-834a248f"]]);class o{constructor(e=128,s=[],n=[]){this.maxLength=e,this.records=s,this.pinnedValues=n}isPinned(e){return this.pinnedValues.some(s=>s.id===e.id)}add(e){this.records.length>=this.maxLength&&this.records.pop(),this.records.unshift({...e,id:H()+Date.now(),time:new Date().toLocaleString()})}pin(e){const s=this.records.findIndex(n=>n.id===e.id);s!==-1&&this.records.splice(s,1),this.pinnedValues.push(e)}unpin(e){const s=this.pinnedValues.findIndex(n=>n.id===e.id);s!==-1&&this.pinnedValues.splice(s,1),this.records.unshift(e)}switchPin(e){this.isPinned(e)?this.unpin(e):this.pin(e)}getRecords(){return[...this.pinnedValues,...this.records]}}const q=_(`${m}fuzzy-search-HistoryRecord`,new o,{serializer:{read:t=>{const e=JSON.parse(t);return new o(e.maxLength,e.records,e.pinnedValues)},write:JSON.stringify}}),M=_(`${m}tag-search-HistoryRecord`,new o,{serializer:{read:t=>{const e=JSON.parse(t);return new o(e.maxLength,e.records,e.pinnedValues)},write:JSON.stringify}});export{T as H,E as _,A as a,q as f,M as t};
|
import{R as y,C as v}from"./index-3b3dc640.js";import{cn as f,c as d,A as w,d as P,S as a,T as c,U as r,X as S,a6 as O,aE as b,a1 as R,V as u,W as p,a2 as V,ai as $,Z as x,O as H,I as _,Q as m}from"./index-ca84e2c1.js";const A=f(y),E=f(v);var L={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3-15.4 12.3-16.6 35.4-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8z"}}]},name:"pushpin",theme:"filled"};const C=L;function h(t){for(var e=1;e<arguments.length;e++){var s=arguments[e]!=null?Object(arguments[e]):{},n=Object.keys(s);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(s).filter(function(i){return Object.getOwnPropertyDescriptor(s,i).enumerable}))),n.forEach(function(i){N(t,i,s[i])})}return t}function N(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}var l=function(e,s){var n=h({},e,s.attrs);return d(w,h({},n,{icon:C}),null)};l.displayName="PushpinFilled";l.inheritAttrs=!1;const z=l,F={class:"record-container"},I={style:{flex:"1"}},k={class:"rec-actions"},B=["onClick"],j=P({__name:"HistoryRecord",props:{records:{}},emits:["reuseRecord"],setup(t){return(e,s)=>{const n=$;return a(),c("div",null,[r("ul",F,[(a(!0),c(S,null,O(e.records.getRecords(),i=>(a(),c("li",{key:i.id,class:"record"},[r("div",I,[b(e.$slots,"default",{record:i},void 0,!0)]),r("div",k,[d(n,{onClick:g=>e.$emit("reuseRecord",i),type:"primary"},{default:R(()=>[u(p(e.$t("restore")),1)]),_:2},1032,["onClick"]),r("div",{class:"pin",onClick:g=>e.records.switchPin(i)},[d(V(z)),u(" "+p(e.records.isPinned(i)?e.$t("unpin"):e.$t("pin")),1)],8,B)])]))),128))])])}}});const T=x(j,[["__scopeId","data-v-834a248f"]]);class o{constructor(e=128,s=[],n=[]){this.maxLength=e,this.records=s,this.pinnedValues=n}isPinned(e){return this.pinnedValues.some(s=>s.id===e.id)}add(e){this.records.length>=this.maxLength&&this.records.pop(),this.records.unshift({...e,id:H()+Date.now(),time:new Date().toLocaleString()})}pin(e){const s=this.records.findIndex(n=>n.id===e.id);s!==-1&&this.records.splice(s,1),this.pinnedValues.push(e)}unpin(e){const s=this.pinnedValues.findIndex(n=>n.id===e.id);s!==-1&&this.pinnedValues.splice(s,1),this.records.unshift(e)}switchPin(e){this.isPinned(e)?this.unpin(e):this.pin(e)}getRecords(){return[...this.pinnedValues,...this.records]}}const q=_(`${m}fuzzy-search-HistoryRecord`,new o,{serializer:{read:t=>{const e=JSON.parse(t);return new o(e.maxLength,e.records,e.pinnedValues)},write:JSON.stringify}}),M=_(`${m}tag-search-HistoryRecord`,new o,{serializer:{read:t=>{const e=JSON.parse(t);return new o(e.maxLength,e.records,e.pinnedValues)},write:JSON.stringify}});export{T as H,E as _,A as a,q as f,M as t};
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -7,7 +7,7 @@
|
||||||
<link rel="icon" href="/favicon.ico" />
|
<link rel="icon" href="/favicon.ico" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Infinite Image Browsing</title>
|
<title>Infinite Image Browsing</title>
|
||||||
<script type="module" crossorigin src="/infinite_image_browsing/fe-static/assets/index-7121bf77.js"></script>
|
<script type="module" crossorigin src="/infinite_image_browsing/fe-static/assets/index-ca84e2c1.js"></script>
|
||||||
<link rel="stylesheet" href="/infinite_image_browsing/fe-static/assets/index-c05ac913.css">
|
<link rel="stylesheet" href="/infinite_image_browsing/fe-static/assets/index-c05ac913.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import { computed, h, ref } from 'vue'
|
||||||
import 'ant-design-vue/es/input/style/index.css'
|
import 'ant-design-vue/es/input/style/index.css'
|
||||||
import sjcl from 'sjcl'
|
import sjcl from 'sjcl'
|
||||||
import { tauriConf } from '@/util/tauriAppConf'
|
import { tauriConf } from '@/util/tauriAppConf'
|
||||||
import { Dict } from '@/util'
|
import { Dict, isSync } from '@/util'
|
||||||
import { FileNodeInfo } from './files'
|
import { FileNodeInfo } from './files'
|
||||||
|
|
||||||
export const apiBase = computed(() =>
|
export const apiBase = computed(() =>
|
||||||
|
|
@ -107,7 +107,15 @@ export interface GlobalConf {
|
||||||
|
|
||||||
export const getGlobalSetting = async () => {
|
export const getGlobalSetting = async () => {
|
||||||
const resp = await axiosInst.value.get('/global_setting')
|
const resp = await axiosInst.value.get('/global_setting')
|
||||||
return resp.data as GlobalConf
|
const data = resp.data as GlobalConf
|
||||||
|
try {
|
||||||
|
if (!isSync()) {
|
||||||
|
data.app_fe_setting = {} as any
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
|
}
|
||||||
|
return data
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getVersion = async () => {
|
export const getVersion = async () => {
|
||||||
|
|
@ -159,9 +167,11 @@ export const batchGetDirTop4MediaInfo = async (paths: string[]) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
export const setAppFeSetting = async (name: keyof GlobalConf['app_fe_setting'], setting: Record<string, any>) => {
|
export const setAppFeSetting = async (name: keyof GlobalConf['app_fe_setting'], setting: Record<string, any>) => {
|
||||||
|
if (!isSync()) return
|
||||||
await axiosInst.value.post('/app_fe_setting', { name, value: JSON.stringify(setting) })
|
await axiosInst.value.post('/app_fe_setting', { name, value: JSON.stringify(setting) })
|
||||||
}
|
}
|
||||||
|
|
||||||
export const removeAppFeSetting = async (name: keyof GlobalConf['app_fe_setting']) => {
|
export const removeAppFeSetting = async (name: keyof GlobalConf['app_fe_setting']) => {
|
||||||
|
if (!isSync()) return
|
||||||
await axiosInst.value.delete('/app_fe_setting', { data: { name } })
|
await axiosInst.value.delete('/app_fe_setting', { data: { name } })
|
||||||
}
|
}
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
import type { IIBI18nMap } from '.'
|
import type { IIBI18nMap } from '.'
|
||||||
|
|
||||||
export const en: IIBI18nMap = {
|
export const en: IIBI18nMap = {
|
||||||
|
sync: 'Sync',
|
||||||
|
syncDesc: 'When you need to achieve simple setting isolation between multiple devices or users, you can turn off this option. Most of the settings of IIB will only be saved to the current browser (isolation in the case of cross-domain), and will not be synchronized to the server.',
|
||||||
readonlyModeSettingPageDesc: 'You are currently in read-only mode. You can adjust the settings, but these changes will not be saved.',
|
readonlyModeSettingPageDesc: 'You are currently in read-only mode. You can adjust the settings, but these changes will not be saved.',
|
||||||
syncHistoryToLocal: 'Sync History to Local',
|
syncHistoryToLocal: 'Sync History to Local',
|
||||||
showCommaInGenInfoPanel: 'Show Comma in Generation Info Panel',
|
showCommaInGenInfoPanel: 'Show Comma in Generation Info Panel',
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
export const zhHans = {
|
export const zhHans = {
|
||||||
|
sync: '同步',
|
||||||
|
syncDesc: '当你需要实现多设备或者多用户之间的简单设置隔离时你可以关闭这个选项, IIB的大部分设置将只会保存到当前浏览器上(跨域的情况下也是隔离),不会同步到服务器',
|
||||||
readonlyModeSettingPageDesc: '当前为只读模式,你可以调整调整设置,但这些更改不会被保存',
|
readonlyModeSettingPageDesc: '当前为只读模式,你可以调整调整设置,但这些更改不会被保存',
|
||||||
syncHistoryToLocal: '同步历史到本地',
|
syncHistoryToLocal: '同步历史到本地',
|
||||||
showCommaInGenInfoPanel: '在生成信息面板中显示逗号',
|
showCommaInGenInfoPanel: '在生成信息面板中显示逗号',
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
import type { IIBI18nMap } from '.'
|
import type { IIBI18nMap } from '.'
|
||||||
|
|
||||||
export const zhHant: Partial<IIBI18nMap> = {
|
export const zhHant: Partial<IIBI18nMap> = {
|
||||||
|
sync: '同步',
|
||||||
|
syncDesc: '當你需要實現多設備或者多用戶之間的簡單設置隔離時你可以關閉這個選項, IIB的大部分設置將只會保存到當前瀏覽器上(跨域的情況下也是隔離),不會同步到服務器',
|
||||||
readonlyModeSettingPageDesc: '當前為只讀模式,你可以調整調整設置,但這些更改不會被保存',
|
readonlyModeSettingPageDesc: '當前為只讀模式,你可以調整調整設置,但這些更改不會被保存',
|
||||||
syncHistoryToLocal: '同步歷史到本地',
|
syncHistoryToLocal: '同步歷史到本地',
|
||||||
showCommaInGenInfoPanel: '在生成信息面板中顯示逗號',
|
showCommaInGenInfoPanel: '在生成信息面板中顯示逗號',
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { Snapshot, useWorkspeaceSnapshot } from '@/store/useWorkspeaceSnapshot'
|
||||||
import { uniqueId } from 'lodash-es'
|
import { uniqueId } from 'lodash-es'
|
||||||
import { computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { ok } from 'vue3-ts-util'
|
import { ok } from 'vue3-ts-util'
|
||||||
import { FileDoneOutlined, LockOutlined, PlusOutlined } from '@/icon'
|
import { FileDoneOutlined, LockOutlined, PlusOutlined, QuestionCircleOutlined } from '@/icon'
|
||||||
import { t } from '@/i18n'
|
import { t } from '@/i18n'
|
||||||
import { cloneDeep } from 'lodash-es'
|
import { cloneDeep } from 'lodash-es'
|
||||||
import { useImgSliStore } from '@/store/useImgSli'
|
import { useImgSliStore } from '@/store/useImgSli'
|
||||||
|
|
@ -15,6 +15,7 @@ import { onMounted } from 'vue'
|
||||||
import { hasNewRelease, version, latestCommit } from '@/util/versionManager'
|
import { hasNewRelease, version, latestCommit } from '@/util/versionManager'
|
||||||
import { isTauri } from '@/util/env'
|
import { isTauri } from '@/util/env'
|
||||||
import { message } from 'ant-design-vue'
|
import { message } from 'ant-design-vue'
|
||||||
|
import { useSettingSync } from '@/util'
|
||||||
|
|
||||||
const global = useGlobalStore()
|
const global = useGlobalStore()
|
||||||
const imgsli = useImgSliStore()
|
const imgsli = useImgSliStore()
|
||||||
|
|
@ -32,6 +33,9 @@ onMounted(() => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const sync = useSettingSync()
|
||||||
|
|
||||||
|
|
||||||
const compCnMap: Partial<Record<TabPane['type'], string>> = {
|
const compCnMap: Partial<Record<TabPane['type'], string>> = {
|
||||||
local: t('local'),
|
local: t('local'),
|
||||||
'tag-search': t('imgSearch'),
|
'tag-search': t('imgSearch'),
|
||||||
|
|
@ -154,19 +158,23 @@ const modes = computed(() => {
|
||||||
<LockOutlined title="Access Control mode" style="vertical-align: text-bottom;" />
|
<LockOutlined title="Access Control mode" style="vertical-align: text-bottom;" />
|
||||||
</div>
|
</div>
|
||||||
<div flex-placeholder />
|
<div flex-placeholder />
|
||||||
|
|
||||||
<a href="https://github.com/zanllp/sd-webui-infinite-image-browsing" target="_blank"
|
<a href="https://github.com/zanllp/sd-webui-infinite-image-browsing" target="_blank"
|
||||||
class="last-record">Github</a>
|
class="quick-action">Github</a>
|
||||||
<a href="https://github.com/zanllp/sd-webui-infinite-image-browsing/blob/main/.env.example" target="_blank"
|
<a href="https://github.com/zanllp/sd-webui-infinite-image-browsing/blob/main/.env.example" target="_blank"
|
||||||
class="last-record">{{ $t('privacyAndSecurity') }}</a>
|
class="quick-action">{{ $t('privacyAndSecurity') }}</a>
|
||||||
<a-badge :count="hasNewRelease ? 'new' : null" :offset="[2,0]" color="geekblue">
|
<a-badge :count="hasNewRelease ? 'new' : null" :offset="[2,0]" color="geekblue">
|
||||||
<a href="https://github.com/zanllp/sd-webui-infinite-image-browsing/releases" target="_blank"
|
<a href="https://github.com/zanllp/sd-webui-infinite-image-browsing/releases" target="_blank"
|
||||||
class="last-record">Releases</a>
|
class="quick-action">Releases</a>
|
||||||
</a-badge>
|
</a-badge>
|
||||||
<a href="https://github.com/zanllp/sd-webui-infinite-image-browsing/wiki/Change-log" target="_blank"
|
<a href="https://github.com/zanllp/sd-webui-infinite-image-browsing/wiki/Change-log" target="_blank"
|
||||||
class="last-record">{{ $t('changlog') }}</a>
|
class="quick-action">{{ $t('changlog') }}</a>
|
||||||
<a href="https://github.com/zanllp/sd-webui-infinite-image-browsing/issues/90" target="_blank"
|
<a href="https://github.com/zanllp/sd-webui-infinite-image-browsing/issues/90" target="_blank"
|
||||||
class="last-record">{{ $t('faq') }}</a>
|
class="quick-action">{{ $t('faq') }}</a>
|
||||||
|
<div class="quick-action" v-if="!isTauri">
|
||||||
|
{{ $t('sync') }} <a-tooltip :title="$t('syncDesc')">
|
||||||
|
<QuestionCircleOutlined/>
|
||||||
|
</a-tooltip> : <a-switch v-model:checked="sync" />
|
||||||
|
</div>
|
||||||
<a-radio-group v-model:value="global.darkModeControl" button-style="solid">
|
<a-radio-group v-model:value="global.darkModeControl" button-style="solid">
|
||||||
<a-radio-button value="light">Light</a-radio-button>
|
<a-radio-button value="light">Light</a-radio-button>
|
||||||
<a-radio-button value="auto">Auto</a-radio-button>
|
<a-radio-button value="auto">Auto</a-radio-button>
|
||||||
|
|
@ -341,19 +349,23 @@ const modes = computed(() => {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.last-record {
|
.quick-action {
|
||||||
margin-right: 16px;
|
margin-right: 16px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: var(--zp-secondary);
|
color: var(--zp-secondary);
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.last-record a {
|
.quick-action a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: var(--zp-secondary);
|
color: var(--zp-secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.last-record a:hover {
|
.quick-action a:hover {
|
||||||
color: var(--zp-primary);
|
color: var(--zp-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ import { VNode, computed, onMounted, reactive, toRaw, watch } from 'vue'
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { WithRequired } from 'vue3-ts-util'
|
import { WithRequired } from 'vue3-ts-util'
|
||||||
import * as Path from '../util/path'
|
import * as Path from '../util/path'
|
||||||
|
import { prefix } from '@/util/const'
|
||||||
|
|
||||||
interface TabPaneBase {
|
interface TabPaneBase {
|
||||||
name: string | VNode
|
name: string | VNode
|
||||||
|
|
@ -200,7 +201,7 @@ function cellWidthMap(x: number): number {
|
||||||
}
|
}
|
||||||
|
|
||||||
export const useGlobalStore = defineStore(
|
export const useGlobalStore = defineStore(
|
||||||
'useGlobalStore',
|
prefix + 'useGlobalStore',
|
||||||
() => {
|
() => {
|
||||||
const conf = ref<GlobalConf>()
|
const conf = ref<GlobalConf>()
|
||||||
const quickMovePaths = ref([] as ReturnTypeAsync<typeof getQuickMovePaths>)
|
const quickMovePaths = ref([] as ReturnTypeAsync<typeof getQuickMovePaths>)
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import { toRaw, watch } from 'vue'
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { prefix } from '@/util/const'
|
import { prefix } from '@/util/const'
|
||||||
import { Tab, copyTabFilterWorkspaceSnapShot, useGlobalStore } from './useGlobalStore'
|
import { Tab, copyTabFilterWorkspaceSnapShot, useGlobalStore } from './useGlobalStore'
|
||||||
|
import { isSync } from '@/util'
|
||||||
|
|
||||||
export interface Snapshot {
|
export interface Snapshot {
|
||||||
id: string
|
id: string
|
||||||
|
|
@ -28,7 +29,7 @@ export const useWorkspeaceSnapshot = defineStore(
|
||||||
const snapshots = ref<Snapshot[]>([])
|
const snapshots = ref<Snapshot[]>([])
|
||||||
|
|
||||||
watch(() => g.conf?.app_fe_setting, setting => {
|
watch(() => g.conf?.app_fe_setting, setting => {
|
||||||
if (setting) {
|
if (setting && isSync()) {
|
||||||
const keys = Object.keys(setting)
|
const keys = Object.keys(setting)
|
||||||
const snapshotKeys = keys.filter((v) => v.startsWith('workspace_snapshot_'))
|
const snapshotKeys = keys.filter((v) => v.startsWith('workspace_snapshot_'))
|
||||||
const snapshotList = snapshotKeys.map((key) => (setting as any)[key])
|
const snapshotList = snapshotKeys.map((key) => (setting as any)[key])
|
||||||
|
|
@ -46,5 +47,11 @@ export const useWorkspeaceSnapshot = defineStore(
|
||||||
snapshots,
|
snapshots,
|
||||||
addSnapshot
|
addSnapshot
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
persist: {
|
||||||
|
// debug: true,
|
||||||
|
paths: ['snapshots']
|
||||||
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,9 @@ import { reactive } from 'vue'
|
||||||
|
|
||||||
import { Modal } from 'ant-design-vue'
|
import { Modal } from 'ant-design-vue'
|
||||||
import { FetchQueue, idKey, typedEventEmitter, type UniqueId} from 'vue3-ts-util'
|
import { FetchQueue, idKey, typedEventEmitter, type UniqueId} from 'vue3-ts-util'
|
||||||
|
import { useLocalStorage } from '@vueuse/core'
|
||||||
export * from './file'
|
export * from './file'
|
||||||
|
import { prefix } from './const'
|
||||||
|
|
||||||
export const parentWindow = () => {
|
export const parentWindow = () => {
|
||||||
return parent.window as any as Window & {
|
return parent.window as any as Window & {
|
||||||
|
|
@ -202,3 +204,12 @@ export const actionConfirm = <T extends (...args: any[]) => void> (fn: T, msg ?:
|
||||||
}
|
}
|
||||||
return (...args: Parameters<T>) => Modal.confirm({ content: msg, onOk: () => fn(...args) })
|
return (...args: Parameters<T>) => Modal.confirm({ content: msg, onOk: () => fn(...args) })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const settingSyncKey = prefix + 'sync'
|
||||||
|
export const isSync = () => {
|
||||||
|
return localStorage.getItem(settingSyncKey) === 'true'
|
||||||
|
}
|
||||||
|
export const useSettingSync = () => {
|
||||||
|
const sync = useLocalStorage(settingSyncKey, true)
|
||||||
|
return sync
|
||||||
|
}
|
||||||
|
|
@ -1,17 +1,25 @@
|
||||||
import { Ref, computed, onMounted, reactive, toRefs, watch } from 'vue'
|
import { Ref, computed, onMounted, reactive, toRefs, watch } from 'vue'
|
||||||
import { debounce } from 'lodash-es'
|
import { debounce, cloneDeep } from 'lodash-es'
|
||||||
import { useGlobalStore } from '@/store/useGlobalStore'
|
import { useGlobalStore } from '@/store/useGlobalStore'
|
||||||
import { setAppFeSetting } from '@/api'
|
import { setAppFeSetting } from '@/api'
|
||||||
|
import { useLocalStorage } from '@vueuse/core'
|
||||||
|
import { prefix } from './const'
|
||||||
|
|
||||||
type LayoutConf = { enable: boolean, panelWidth: number, alwaysOn: boolean }
|
type LayoutConf = { enable: boolean, panelWidth: number, alwaysOn: boolean }
|
||||||
let lastState: LayoutConf | null = null
|
let lastState: LayoutConf | null = null
|
||||||
|
|
||||||
|
|
||||||
export const useFullscreenLayout = () => {
|
export const useFullscreenLayout = () => {
|
||||||
const g = useGlobalStore()
|
const g = useGlobalStore()
|
||||||
const state = reactive<LayoutConf>(lastState ?? g.conf?.app_fe_setting?.fullscreen_layout ?? { enable: false, panelWidth: 384, alwaysOn: true })
|
// 只存储和提供给state的值
|
||||||
|
const storageState = useLocalStorage(prefix + 'fullscreen_layout', { enable: false, panelWidth: 384, alwaysOn: true })
|
||||||
|
const state = reactive<LayoutConf>(lastState ?? g.conf?.app_fe_setting?.fullscreen_layout ?? cloneDeep(storageState.value))
|
||||||
|
|
||||||
const panelwidtrhStyleVarName = '--iib-lr-layout-info-panel-width'
|
const panelwidtrhStyleVarName = '--iib-lr-layout-info-panel-width'
|
||||||
const lrLayoutContainerOffset = computed(() => state.alwaysOn && state.enable ? state.panelWidth : 0)
|
const lrLayoutContainerOffset = computed(() => state.alwaysOn && state.enable ? state.panelWidth : 0)
|
||||||
|
|
||||||
watch(state, () => {
|
watch(state, (val) => {
|
||||||
|
storageState.value = cloneDeep(val)
|
||||||
onUpdate(state, panelwidtrhStyleVarName, lrLayoutContainerOffset)
|
onUpdate(state, panelwidtrhStyleVarName, lrLayoutContainerOffset)
|
||||||
sync(state)
|
sync(state)
|
||||||
lastState = state
|
lastState = state
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue