Implement automatic refresh in walk mode

pull/694/head
zanllp 2024-07-17 07:58:32 +08:00
parent ae3a2f044c
commit fdf35eb308
34 changed files with 161 additions and 46 deletions

View File

@ -13,7 +13,7 @@ Promise.resolve().then(async () => {
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Infinite Image Browsing</title>
<script type="module" crossorigin src="/infinite_image_browsing/fe-static/assets/index-60751f65.js"></script>
<script type="module" crossorigin src="/infinite_image_browsing/fe-static/assets/index-1961a2a7.js"></script>
<link rel="stylesheet" href="/infinite_image_browsing/fe-static/assets/index-faeceb7f.css">
</head>

View File

@ -32,7 +32,8 @@ from scripts.iib.tool import (
is_exe_ver,
backup_db_file,
get_current_commit_hash,
get_current_tag
get_current_tag,
get_file_info_by_path
)
from fastapi import FastAPI, HTTPException, Header, Response
from fastapi.staticfiles import StaticFiles
@ -259,6 +260,9 @@ def infinite_image_browsing_api(app: FastAPI, **kwargs):
class PathsReq(BaseModel):
paths: List[str]
@app.get(f"{api_base}/hello")
async def greeting():
return "hello"
@ -514,6 +518,15 @@ def infinite_image_browsing_api(app: FastAPI, **kwargs):
raise HTTPException(status_code=400, detail=str(e))
return {"files": filter_allowed_files(files)}
@app.post(api_base + "/batch_get_files_info", dependencies=[Depends(verify_secret)])
async def batch_get_files_info(req: PathsReq):
res = {}
for path in req.paths:
check_path_trust(path)
res[path] = get_file_info_by_path(path)
return res
@app.get(api_base + "/image-thumbnail", dependencies=[Depends(verify_secret)])
async def thumbnail(path: str, t: str, size: str = "256x256"):
@ -710,9 +723,6 @@ def infinite_image_browsing_api(app: FastAPI, **kwargs):
else:
return FileResponse(file_full_path)
class PathsReq(BaseModel):
paths: List[str]
class OpenFolderReq(BaseModel):
path: str

View File

@ -14,6 +14,7 @@ import zipfile
from PIL import Image
import shutil
sd_img_dirs = [
"outdir_txt2img_samples",
"outdir_img2img_samples",
@ -677,4 +678,36 @@ def map_dict_keys(value_dict, map_dict=None):
if map_dict is None:
return value_dict
else:
return {map_dict.get(key, key): value for key, value in value_dict.items()}
return {map_dict.get(key, key): value for key, value in value_dict.items()}
def get_file_info_by_path(fullpath: str, is_under_scanned_path = True):
stat = os.stat(fullpath)
date = get_formatted_date(stat.st_mtime)
name = os.path.basename(fullpath)
created_time = get_created_date_by_stat(stat)
if os.path.isfile(fullpath):
bytes = stat.st_size
size = human_readable_size(bytes)
return {
"type": "file",
"date": date,
"size": size,
"name": name,
"bytes": bytes,
"created_time": created_time,
"fullpath": fullpath,
"is_under_scanned_path": is_under_scanned_path,
}
elif os.path.isdir(fullpath):
return {
"type": "dir",
"date": date,
"created_time": created_time,
"size": "-",
"name": name,
"is_under_scanned_path": is_under_scanned_path,
"fullpath": fullpath,
}
return {}

View File

@ -1 +1 @@
import{d as E,by as $,r as f,k as M,_ as T,a as c,ak as W,h as g,c as v,P as z}from"./index-60751f65.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:z.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,m=d.expose,o=f(a.checked===void 0?a.defaultChecked:a.checked),i=f();M(function(){return a.checked},function(){o.value=a.checked}),m({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,_=T(a,G),q=t.class,D=t.onFocus,j=t.onBlur,w=t.onKeydown,A=t.onKeypress,F=t.onKeyup,k=c(c({},_),t),O=Object.keys(k).reduce(function(y,u){return(u.substr(0,5)==="aria-"||u.substr(0,5)==="data-"||u==="role")&&(y[u]=k[u]),y},{}),R=W(e,q,(n={},g(n,"".concat(e,"-checked"),o.value),g(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};
import{d as E,by as $,r as f,k as M,_ as T,a as c,ak as W,h as g,c as v,P as z}from"./index-1961a2a7.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:z.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,m=d.expose,o=f(a.checked===void 0?a.defaultChecked:a.checked),i=f();M(function(){return a.checked},function(){o.value=a.checked}),m({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,_=T(a,G),q=t.class,D=t.onFocus,j=t.onBlur,w=t.onKeydown,A=t.onKeypress,F=t.onKeyup,k=c(c({},_),t),O=Object.keys(k).reduce(function(y,u){return(u.substr(0,5)==="aria-"||u.substr(0,5)==="data-"||u==="role")&&(y[u]=k[u]),y},{}),R=W(e,q,(n={},g(n,"".concat(e,"-checked"),o.value),g(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

3
vue/dist/assets/FileItem-97e3c353.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
import{d as a,O as t,Q as s,c as n,cK as _,W as o}from"./index-60751f65.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,O as t,Q as s,c as n,cK as _,W as o}from"./index-1961a2a7.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};

View File

@ -1 +1 @@
import{d as ne,k as R,aw as ie,X as ae,O as u,Q as k,c as s,$ as e,Z as o,a1 as V,R as r,E as re,T as a,S as m,Y as D,aa as de,V as _,ab as z,ad as ce,ae as ue,ag as B,aK as pe,aL as me,bP as ge,W as fe}from"./index-60751f65.js";import{S as ve}from"./index-a6945554.js";import{L as Ie,R as ke,f as _e,M as we}from"./MultiSelectKeep-38167d1d.js";import{c as Ce,d as he,F as Se}from"./FileItem-497c47ae.js";import{c as be,u as xe}from"./hook-4f760f88.js";import{a as ye}from"./functionalCallableComp-a162d668.js";import"./shortcut-ff083b3f.js";import"./Checkbox-5eeb59a1.js";/* empty css */import"./index-082f03a8.js";const Me=d=>(pe("data-v-fbf8262b"),d=d(),me(),d),Ae={class:"hint"},Te={class:"action-bar"},$e=Me(()=>r("div",{style:{padding:"16px 0 512px"}},null,-1)),Fe={key:1},Re={class:"no-res-hint"},Ve={class:"hint"},De={key:2,class:"preview-switch"},ze=ne({__name:"MatchedImageGrid",props:{tabIdx:{},paneIdx:{},selectedTagIds:{},id:{}},setup(d){const g=d,f=be(t=>ge(g.selectedTagIds,t)),{queue:G,images:i,onContextMenuClickU:w,stackViewEl:E,previewIdx:c,previewing:C,onPreviewVisibleChange:L,previewImgMove:h,canPreview:S,itemSize:b,gridItems:N,showGenInfo:p,imageGenInfo:x,q:P,multiSelectedIdxs:v,onFileItemClick:U,scroller:y,showMenuIdx:I,onFileDragStart:J,onFileDragEnd:K,cellWidth:O,onScroll:M,saveAllFileAsJson:q,props:Q,saveLoadedFileAsJson:W}=xe(f);R(()=>g.selectedTagIds,async()=>{var t;await f.reset(),await ie(),(t=y.value)==null||t.scrollToItem(0),M()},{immediate:!0}),R(()=>g,async t=>{Q.value=t},{deep:!0,immediate:!0});const X=ae(),{onClearAllSelected:Y,onSelectAll:Z,onReverseSelect:j}=Ce();return(t,l)=>{const H=we,ee=ce,te=ue,A=B,le=B,se=ve;return u(),k("div",{class:"container",ref_key:"stackViewEl",ref:E},[s(H,{show:!!e(v).length||e(X).keepMultiSelect,onClearAllSelected:e(Y),onSelectAll:e(Z),onReverseSelect:e(j)},null,8,["show","onClearAllSelected","onSelectAll","onReverseSelect"]),s(se,{size:"large",spinning:!e(G).isIdle},{default:o(()=>{var T,$;return[s(te,{visible:e(p),"onUpdate:visible":l[1]||(l[1]=n=>V(p)?p.value=n:null),width:"70vw","mask-closable":"",onOk:l[2]||(l[2]=n=>p.value=!1)},{cancelText:o(()=>[]),default:o(()=>[s(ee,{active:"",loading:!e(P).isIdle},{default:o(()=>[r("div",{style:{width:"100%","word-break":"break-all","white-space":"pre-line","max-height":"70vh",overflow:"auto"},onDblclick:l[0]||(l[0]=n=>e(re)(e(x)))},[r("div",Ae,a(t.$t("doubleClickToCopy")),1),m(" "+a(e(x)),1)],32)]),_:1},8,["loading"])]),_:1},8,["visible"]),r("div",Te,[s(A,{onClick:e(W)},{default:o(()=>[m(a(t.$t("saveLoadedImageAsJson")),1)]),_:1},8,["onClick"]),s(A,{onClick:e(q)},{default:o(()=>[m(a(t.$t("saveAllAsJson")),1)]),_:1},8,["onClick"])]),(T=e(i))!=null&&T.length?(u(),D(e(he),{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(N),onScroll:e(M)},{after:o(()=>[$e]),default:o(({item:n,index:F})=>[s(Se,{idx:F,file:n,"cell-width":e(O),"show-menu-idx":e(I),"onUpdate:showMenuIdx":l[3]||(l[3]=oe=>V(I)?I.value=oe:null),onDragstart:e(J),onDragend:e(K),onFileItemClick:e(U),"full-screen-preview-image-url":e(i)[e(c)]?e(de)(e(i)[e(c)]):"",selected:e(v).includes(F),onContextMenuClick:e(w),onPreviewVisibleChange:e(L),"is-selected-mutil-files":e(v).length>1},null,8,["idx","file","cell-width","show-menu-idx","onDragstart","onDragend","onFileItemClick","full-screen-preview-image-url","selected","onContextMenuClick","onPreviewVisibleChange","is-selected-mutil-files"])]),_: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())?(u(),k("div",Fe,[r("div",Re,[r("p",Ve,a(t.$t("tagSearchNoResultsMessage")),1),s(le,{onClick:l[4]||(l[4]=n=>e(ye)()),type:"primary"},{default:o(()=>[m(a(t.$t("rebuildImageIndex")),1)]),_:1})])])):_("",!0),e(C)?(u(),k("div",De,[s(e(Ie),{onClick:l[5]||(l[5]=n=>e(h)("prev")),class:z({disable:!e(S)("prev")})},null,8,["class"]),s(e(ke),{onClick:l[6]||(l[6]=n=>e(h)("next")),class:z({disable:!e(S)("next")})},null,8,["class"])])):_("",!0)]}),_:1},8,["spinning"]),e(C)&&e(i)&&e(i)[e(c)]?(u(),D(_e,{key:0,file:e(i)[e(c)],idx:e(c),onContextMenuClick:e(w)},null,8,["file","idx","onContextMenuClick"])):_("",!0)],512)}}});const qe=fe(ze,[["__scopeId","data-v-fbf8262b"]]);export{qe as default};
import{d as ne,k as R,aw as ie,X as ae,O as u,Q as k,c as s,$ as e,Z as o,a1 as V,R as r,E as re,T as a,S as m,Y as D,aa as de,V as _,ab as z,ad as ce,ae as ue,ag as B,aK as pe,aL as me,bP as ge,W as fe}from"./index-1961a2a7.js";import{S as ve}from"./index-374f1119.js";import{L as Ie,R as ke,f as _e,M as we}from"./MultiSelectKeep-95a62820.js";import{c as Ce,d as he,F as Se}from"./FileItem-97e3c353.js";import{c as be,u as xe}from"./hook-384ae324.js";import{a as ye}from"./functionalCallableComp-0536b145.js";import"./shortcut-14bd4711.js";import"./Checkbox-0e82a685.js";/* empty css */import"./index-8dbf40be.js";const Me=d=>(pe("data-v-fbf8262b"),d=d(),me(),d),Ae={class:"hint"},Te={class:"action-bar"},$e=Me(()=>r("div",{style:{padding:"16px 0 512px"}},null,-1)),Fe={key:1},Re={class:"no-res-hint"},Ve={class:"hint"},De={key:2,class:"preview-switch"},ze=ne({__name:"MatchedImageGrid",props:{tabIdx:{},paneIdx:{},selectedTagIds:{},id:{}},setup(d){const g=d,f=be(t=>ge(g.selectedTagIds,t)),{queue:G,images:i,onContextMenuClickU:w,stackViewEl:E,previewIdx:c,previewing:C,onPreviewVisibleChange:L,previewImgMove:h,canPreview:S,itemSize:b,gridItems:N,showGenInfo:p,imageGenInfo:x,q:P,multiSelectedIdxs:v,onFileItemClick:U,scroller:y,showMenuIdx:I,onFileDragStart:J,onFileDragEnd:K,cellWidth:O,onScroll:M,saveAllFileAsJson:q,props:Q,saveLoadedFileAsJson:W}=xe(f);R(()=>g.selectedTagIds,async()=>{var t;await f.reset(),await ie(),(t=y.value)==null||t.scrollToItem(0),M()},{immediate:!0}),R(()=>g,async t=>{Q.value=t},{deep:!0,immediate:!0});const X=ae(),{onClearAllSelected:Y,onSelectAll:Z,onReverseSelect:j}=Ce();return(t,l)=>{const H=we,ee=ce,te=ue,A=B,le=B,se=ve;return u(),k("div",{class:"container",ref_key:"stackViewEl",ref:E},[s(H,{show:!!e(v).length||e(X).keepMultiSelect,onClearAllSelected:e(Y),onSelectAll:e(Z),onReverseSelect:e(j)},null,8,["show","onClearAllSelected","onSelectAll","onReverseSelect"]),s(se,{size:"large",spinning:!e(G).isIdle},{default:o(()=>{var T,$;return[s(te,{visible:e(p),"onUpdate:visible":l[1]||(l[1]=n=>V(p)?p.value=n:null),width:"70vw","mask-closable":"",onOk:l[2]||(l[2]=n=>p.value=!1)},{cancelText:o(()=>[]),default:o(()=>[s(ee,{active:"",loading:!e(P).isIdle},{default:o(()=>[r("div",{style:{width:"100%","word-break":"break-all","white-space":"pre-line","max-height":"70vh",overflow:"auto"},onDblclick:l[0]||(l[0]=n=>e(re)(e(x)))},[r("div",Ae,a(t.$t("doubleClickToCopy")),1),m(" "+a(e(x)),1)],32)]),_:1},8,["loading"])]),_:1},8,["visible"]),r("div",Te,[s(A,{onClick:e(W)},{default:o(()=>[m(a(t.$t("saveLoadedImageAsJson")),1)]),_:1},8,["onClick"]),s(A,{onClick:e(q)},{default:o(()=>[m(a(t.$t("saveAllAsJson")),1)]),_:1},8,["onClick"])]),(T=e(i))!=null&&T.length?(u(),D(e(he),{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(N),onScroll:e(M)},{after:o(()=>[$e]),default:o(({item:n,index:F})=>[s(Se,{idx:F,file:n,"cell-width":e(O),"show-menu-idx":e(I),"onUpdate:showMenuIdx":l[3]||(l[3]=oe=>V(I)?I.value=oe:null),onDragstart:e(J),onDragend:e(K),onFileItemClick:e(U),"full-screen-preview-image-url":e(i)[e(c)]?e(de)(e(i)[e(c)]):"",selected:e(v).includes(F),onContextMenuClick:e(w),onPreviewVisibleChange:e(L),"is-selected-mutil-files":e(v).length>1},null,8,["idx","file","cell-width","show-menu-idx","onDragstart","onDragend","onFileItemClick","full-screen-preview-image-url","selected","onContextMenuClick","onPreviewVisibleChange","is-selected-mutil-files"])]),_: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())?(u(),k("div",Fe,[r("div",Re,[r("p",Ve,a(t.$t("tagSearchNoResultsMessage")),1),s(le,{onClick:l[4]||(l[4]=n=>e(ye)()),type:"primary"},{default:o(()=>[m(a(t.$t("rebuildImageIndex")),1)]),_:1})])])):_("",!0),e(C)?(u(),k("div",De,[s(e(Ie),{onClick:l[5]||(l[5]=n=>e(h)("prev")),class:z({disable:!e(S)("prev")})},null,8,["class"]),s(e(ke),{onClick:l[6]||(l[6]=n=>e(h)("next")),class:z({disable:!e(S)("next")})},null,8,["class"])])):_("",!0)]}),_:1},8,["spinning"]),e(C)&&e(i)&&e(i)[e(c)]?(u(),D(_e,{key:0,file:e(i)[e(c)],idx:e(c),onContextMenuClick:e(w)},null,8,["file","idx","onContextMenuClick"])):_("",!0)],512)}}});const qe=fe(ze,[["__scopeId","data-v-fbf8262b"]]);export{qe 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

View File

@ -1 +1 @@
import{d as v,cL as C,bZ as I,O as l,Q as _,R as f,c,Z as r,S as h,T as d,$ as e,Y as F,aa as z,cc as B,cM as $,ag as x,W as R}from"./index-60751f65.js";import{u as S,a as E,k as T,F as V,d as A}from"./FileItem-497c47ae.js";import"./functionalCallableComp-a162d668.js";import"./index-082f03a8.js";/* empty css */const L={class:"actions-panel actions"},N={key:0,class:"file-list"},U={class:"hint"},H=v({__name:"batchDownload",props:{tabIdx:{},paneIdx:{},id:{}},setup(O){const{stackViewEl:w}=S().toRefs(),{itemSize:p,gridItems:k,cellWidth:b}=E(),i=T(),{selectdFiles:n}=C(i),u=I(),y=async t=>{const s=B(t);s&&i.addFiles(s.nodes)},D=async()=>{u.pushAction(async()=>{const t=await $.value.post("/zip",{paths:n.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=>{n.value.splice(t,1)};return(t,s)=>{const a=x;return l(),_("div",{class:"container",ref_key:"stackViewEl",ref:w,onDrop:y},[f("div",L,[c(a,{onClick:s[0]||(s[0]=o=>e(i).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(n).length?(l(),F(e(A),{key:1,ref:"scroller",class:"file-list",items:e(n).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(V,{idx:m,file:o,"cell-width":e(b),"enable-close-icon":"",onCloseIconClick:Q=>g(m),"full-screen-preview-image-url":e(z)(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",N,[f("p",U,d(t.$t("batchDownloaDDragAndDropHint")),1)]))],544)}}});const Y=R(H,[["__scopeId","data-v-aab31da2"]]);export{Y as default};
import{d as v,cL as C,bZ as I,O as l,Q as _,R as f,c,Z as r,S as h,T as d,$ as e,Y as F,aa as z,cc as B,cM as $,ag as x,W as R}from"./index-1961a2a7.js";import{u as S,a as E,k as T,F as V,d as A}from"./FileItem-97e3c353.js";import"./functionalCallableComp-0536b145.js";import"./index-8dbf40be.js";/* empty css */const L={class:"actions-panel actions"},N={key:0,class:"file-list"},U={class:"hint"},H=v({__name:"batchDownload",props:{tabIdx:{},paneIdx:{},id:{}},setup(O){const{stackViewEl:w}=S().toRefs(),{itemSize:p,gridItems:k,cellWidth:b}=E(),i=T(),{selectdFiles:n}=C(i),u=I(),y=async t=>{const s=B(t);s&&i.addFiles(s.nodes)},D=async()=>{u.pushAction(async()=>{const t=await $.value.post("/zip",{paths:n.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=>{n.value.splice(t,1)};return(t,s)=>{const a=x;return l(),_("div",{class:"container",ref_key:"stackViewEl",ref:w,onDrop:y},[f("div",L,[c(a,{onClick:s[0]||(s[0]=o=>e(i).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(n).length?(l(),F(e(A),{key:1,ref:"scroller",class:"file-list",items:e(n).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(V,{idx:m,file:o,"cell-width":e(b),"enable-close-icon":"",onCloseIconClick:Q=>g(m),"full-screen-preview-image-url":e(z)(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",N,[f("p",U,d(t.$t("batchDownloaDDragAndDropHint")),1)]))],544)}}});const Y=R(H,[["__scopeId","data-v-aab31da2"]]);export{Y as default};

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
import{c as o,A as g,cM as i,cq as b,X as w,ae as c,df as y,dg as h,ag as x,cj as O,aa as S,x as l,dh as F,az as I,v as M,r as m,af as v,q as _,S as k,di as D}from"./index-1961a2a7.js";var j={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"};const P=j;function p(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?Object(arguments[e]):{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),n.forEach(function(r){V(a,r,t[r])})}return a}function V(a,e,t){return e in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}var d=function(e,t){var n=p({},e,t.attrs);return o(g,p({},n,{icon:P}),null)};d.displayName="DownloadOutlined";d.inheritAttrs=!1;const C=d,R=async a=>(await i.value.get("/files",{params:{folder_path:a}})).data,T=async a=>(await i.value.post("/delete_files",{file_paths:a})).data,U=async(a,e,t)=>(await i.value.post("/move_files",{file_paths:a,dest:e,create_dest_folder:t})).data,A=async(a,e,t)=>(await i.value.post("/copy_files",{file_paths:a,dest:e,create_dest_folder:t})).data,N=async a=>{await i.value.post("/mkdirs",{dest_folder:a})},E=async a=>(await i.value.post("/batch_get_files_info",{paths:a})).data,H=a=>{const e=m("");return new Promise(t=>{c.confirm({title:l("inputFolderName"),content:()=>o(v,{value:e.value,"onUpdate:value":n=>e.value=n},null),async onOk(){if(!e.value)return;const n=_(a,e.value);await N(n),t()}})})},$=()=>o("p",{style:{background:"var(--zp-secondary-background)",padding:"8px",borderLeft:"4px solid var(--primary-color)"}},[k("Tips: "),l("multiSelectTips")]),q=(a,e)=>{const t=b(),n=w(),r=s=>{var u;return!!((u=t.tagMap.get(a.fullpath))!=null&&u.some(f=>f.id===s))};c.confirm({width:"80vw",title:a.name,icon:null,content:()=>o("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"}},[o("video",{style:{maxHeight:y?"80vh":"60vh",maxWidth:"100%",minWidth:"70%"},src:h(a),controls:!0,autoplay:!0},null),o("div",{style:{marginTop:"4px"}},[n.conf.all_custom_tags.map(s=>o("div",{key:s.id,onClick:()=>e==null?void 0:e(s.id),style:{background:r(s.id)?t.getColor(s.name):"var(--zp-primary-background)",color:r(s.id)?"white":t.getColor(s.name),margin:"2px",padding:"2px 16px","border-radius":"4px",display:"inline-block",cursor:"pointer","font-weight":"bold",transition:".5s all ease",border:`2px solid ${t.getColor(s.name)}`,"user-select":"none"}},[s.name]))]),o("div",{class:"actions",style:{marginTop:"16px"}},[o(x,{onClick:()=>O([S(a,!0)])},{icon:o(C,null,null),default:l("download")})])]),maskClosable:!0,wrapClassName:"hidden-antd-btns-modal"})},B=()=>{c.confirm({title:l("confirmRebuildImageIndex"),onOk:async()=>{await F(),I.emit("searchIndexExpired"),M.success(l("rebuildComplete"))}})},G=a=>{const e=m(a.split(/[\\/]/).pop()??"");return new Promise(t=>{c.confirm({title:l("rename"),content:()=>o(v,{value:e.value,"onUpdate:value":n=>e.value=n},null),async onOk(){if(!e.value)return;const n=await D({path:a,name:e.value});t(n.new_path)}})})};export{$ as M,B as a,G as b,A as c,T as d,E as e,q as f,R as g,U as m,H as o};

View File

@ -1 +0,0 @@
import{c as o,A as g,cM as i,cq as b,X as w,ae as c,df as y,dg as h,ag as x,cj as O,aa as S,x as l,dh as F,az as I,v as M,r as m,af as v,q as k,S as D,di as _}from"./index-60751f65.js";var j={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"};const P=j;function p(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?Object(arguments[e]):{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),n.forEach(function(r){V(a,r,t[r])})}return a}function V(a,e,t){return e in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}var d=function(e,t){var n=p({},e,t.attrs);return o(g,p({},n,{icon:P}),null)};d.displayName="DownloadOutlined";d.inheritAttrs=!1;const C=d,R=async a=>(await i.value.get("/files",{params:{folder_path:a}})).data,T=async a=>(await i.value.post("/delete_files",{file_paths:a})).data,U=async(a,e,t)=>(await i.value.post("/move_files",{file_paths:a,dest:e,create_dest_folder:t})).data,A=async(a,e,t)=>(await i.value.post("/copy_files",{file_paths:a,dest:e,create_dest_folder:t})).data,N=async a=>{await i.value.post("/mkdirs",{dest_folder:a})},E=a=>{const e=m("");return new Promise(t=>{c.confirm({title:l("inputFolderName"),content:()=>o(v,{value:e.value,"onUpdate:value":n=>e.value=n},null),async onOk(){if(!e.value)return;const n=k(a,e.value);await N(n),t()}})})},H=()=>o("p",{style:{background:"var(--zp-secondary-background)",padding:"8px",borderLeft:"4px solid var(--primary-color)"}},[D("Tips: "),l("multiSelectTips")]),$=(a,e)=>{const t=b(),n=w(),r=s=>{var u;return!!((u=t.tagMap.get(a.fullpath))!=null&&u.some(f=>f.id===s))};c.confirm({width:"80vw",title:a.name,icon:null,content:()=>o("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"}},[o("video",{style:{maxHeight:y?"80vh":"60vh",maxWidth:"100%",minWidth:"70%"},src:h(a),controls:!0,autoplay:!0},null),o("div",{style:{marginTop:"4px"}},[n.conf.all_custom_tags.map(s=>o("div",{key:s.id,onClick:()=>e==null?void 0:e(s.id),style:{background:r(s.id)?t.getColor(s.name):"var(--zp-primary-background)",color:r(s.id)?"white":t.getColor(s.name),margin:"2px",padding:"2px 16px","border-radius":"4px",display:"inline-block",cursor:"pointer","font-weight":"bold",transition:".5s all ease",border:`2px solid ${t.getColor(s.name)}`,"user-select":"none"}},[s.name]))]),o("div",{class:"actions",style:{marginTop:"16px"}},[o(x,{onClick:()=>O([S(a,!0)])},{icon:o(C,null,null),default:l("download")})])]),maskClosable:!0,wrapClassName:"hidden-antd-btns-modal"})},q=()=>{c.confirm({title:l("confirmRebuildImageIndex"),onOk:async()=>{await F(),I.emit("searchIndexExpired"),M.success(l("rebuildComplete"))}})},B=a=>{const e=m(a.split(/[\\/]/).pop()??"");return new Promise(t=>{c.confirm({title:l("rename"),content:()=>o(v,{value:e.value,"onUpdate:value":n=>e.value=n},null),async onOk(){if(!e.value)return;const n=await _({path:a,name:e.value});t(n.new_path)}})})};export{H as M,q as a,B as b,A as c,T as d,$ as e,R as g,U as m,E as o};

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
import{u as w,a as y,F as k,d as x}from"./FileItem-497c47ae.js";import{d as F,X as b,cq as h,r as D,b9 as I,bd as C,O as E,Q as V,c as n,Z as z,$ as e,aa as S,cc as B,cN as R,W as $}from"./index-60751f65.js";import"./functionalCallableComp-a162d668.js";import"./index-082f03a8.js";/* empty css */const q=F({__name:"gridView",props:{tabIdx:{},paneIdx:{},id:{},removable:{type:Boolean},allowDragAndDrop:{type:Boolean},files:{},paneKey:{}},setup(p){const o=p,d=b(),{stackViewEl:m}=w().toRefs(),{itemSize:i,gridItems:u,cellWidth:f}=y(),g=h(),s=D(o.files??[]),_=async a=>{const l=B(a);o.allowDragAndDrop&&l&&(s.value=R([...s.value,...l.nodes]))},v=a=>{s.value.splice(a,1)};return I(()=>{d.pageFuncExportMap.set(o.paneKey,{getFiles:()=>C(s.value),setFiles:a=>s.value=a})}),(a,l)=>(E(),V("div",{class:"container",ref_key:"stackViewEl",ref:m,onDrop:_},[n(e(x),{ref:"scroller",class:"file-list",items:s.value.slice(),"item-size":e(i).first,"key-field":"fullpath","item-secondary-size":e(i).second,gridItems:e(u)},{default:z(({item:t,index:r})=>{var c;return[n(k,{idx:r,file:t,"cell-width":e(f),"enable-close-icon":o.removable,onCloseIconClick:A=>v(r),"full-screen-preview-image-url":e(S)(t),"extra-tags":(c=t==null?void 0:t.tags)==null?void 0:c.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 H=$(q,[["__scopeId","data-v-f35f4802"]]);export{H as default};
import{u as w,a as y,F as k,d as x}from"./FileItem-97e3c353.js";import{d as F,X as b,cq as h,r as D,b9 as I,bd as C,O as E,Q as V,c as n,Z as z,$ as e,aa as S,cc as B,cN as R,W as $}from"./index-1961a2a7.js";import"./functionalCallableComp-0536b145.js";import"./index-8dbf40be.js";/* empty css */const q=F({__name:"gridView",props:{tabIdx:{},paneIdx:{},id:{},removable:{type:Boolean},allowDragAndDrop:{type:Boolean},files:{},paneKey:{}},setup(p){const o=p,d=b(),{stackViewEl:m}=w().toRefs(),{itemSize:i,gridItems:u,cellWidth:f}=y(),g=h(),s=D(o.files??[]),_=async a=>{const l=B(a);o.allowDragAndDrop&&l&&(s.value=R([...s.value,...l.nodes]))},v=a=>{s.value.splice(a,1)};return I(()=>{d.pageFuncExportMap.set(o.paneKey,{getFiles:()=>C(s.value),setFiles:a=>s.value=a})}),(a,l)=>(E(),V("div",{class:"container",ref_key:"stackViewEl",ref:m,onDrop:_},[n(e(x),{ref:"scroller",class:"file-list",items:s.value.slice(),"item-size":e(i).first,"key-field":"fullpath","item-secondary-size":e(i).second,gridItems:e(u)},{default:z(({item:t,index:r})=>{var c;return[n(k,{idx:r,file:t,"cell-width":e(f),"enable-close-icon":o.removable,onCloseIconClick:A=>v(r),"full-screen-preview-image-url":e(S)(t),"extra-tags":(c=t==null?void 0:t.tags)==null?void 0:c.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 H=$(q,[["__scopeId","data-v-f35f4802"]]);export{H as default};

View File

@ -1 +1 @@
import{ai as F,r as g,c7 as D,c8 as A,H as b,B as N,bZ as z,bm as G,c9 as H}from"./index-60751f65.js";import{u as L,a as O,b as Q,e as j}from"./FileItem-497c47ae.js";import{a as B,b as T,c as U}from"./MultiSelectKeep-38167d1d.js";let W=0;const Z=()=>++W,K=(o,i,{dataUpdateStrategy:l="replace"}={})=>{const n=F([""]),c=g(!1),t=g(),a=g(!1);let f=g(-1);const v=new Set,w=e=>{var s;l==="replace"?t.value=e:l==="merge"&&(b((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=>A(void 0,void 0,void 0,function*(){if(a.value||c.value&&typeof e>"u")return!1;a.value=!0;const s=Z();f.value=s;try{let r;if(typeof e=="number"){if(r=n[e],typeof r!="string")return!1}else r=n[n.length-1];const I=yield o(r);if(v.has(s))return v.delete(s),!1;w(i(I));const u=I.cursor;if((e===n.length-1||typeof e!="number")&&(c.value=!u.has_next,u.has_next)){const y=u.next_cursor||u.next;b(typeof y=="string"),n.push(y)}}finally{f.value===s&&(a.value=!1)}return!0}),p=()=>{v.add(f.value),a.value=!1},S=(e=!1)=>A(void 0,void 0,void 0,function*(){const{refetch:s,force:r}=typeof e=="object"?e:{refetch:e};r&&p(),b(!a.value),n.splice(0,n.length,""),a.value=!1,t.value=void 0,c.value=!1,s&&(yield d())}),h=()=>({next:()=>A(void 0,void 0,void 0,function*(){if(a.value)throw new Error("不允许同时迭代");return{done:!(yield d()),value:t.value}})});return D({abort:p,load:c,next:d,res:t,loading:a,cursorStack:n,reset:S,[Symbol.asyncIterator]:h,iter:{[Symbol.asyncIterator]:h}})},ee=o=>F(K(o,i=>i.files,{dataUpdateStrategy:"merge"})),te=o=>{const i=F(new Set),l=N(()=>(o.res??[]).filter(m=>!i.has(m.fullpath))),n=z(),{stackViewEl:c,multiSelectedIdxs:t,stack:a,scroller:f,props:v}=L({images:l}).toRefs(),{itemSize:w,gridItems:d,cellWidth:p,onScroll:S}=O({fetchNext:()=>o.next()}),{showMenuIdx:h}=Q(),{onFileDragStart:e,onFileDragEnd:s}=B(),{showGenInfo:r,imageGenInfo:I,q:u,onContextMenuClick:y,onFileItemClick:C}=T({openNext:G}),{previewIdx:_,previewing:E,onPreviewVisibleChange:M,previewImgMove:J,canPreview:P}=U(),R=async(m,x,q)=>{a.value=[{curr:"",files:l.value}],await y(m,x,q)};j("removeFiles",async({paths:m})=>{m.forEach(x=>i.add(x))});const k=()=>{H(l.value)};return{images:l,scroller:f,queue:n,iter:o,onContextMenuClickU:R,stackViewEl:c,previewIdx:_,previewing:E,onPreviewVisibleChange:M,previewImgMove:J,canPreview:P,itemSize:w,gridItems:d,showGenInfo:r,imageGenInfo:I,q:u,onContextMenuClick:y,onFileItemClick:C,showMenuIdx:h,multiSelectedIdxs:t,onFileDragStart:e,onFileDragEnd:s,cellWidth:p,onScroll:S,saveLoadedFileAsJson:k,saveAllFileAsJson:async()=>{for(;!o.load;)await o.next();k()},props:v}};export{ee as c,te as u};
import{ai as F,r as g,c7 as D,c8 as A,H as b,B as N,bZ as z,bm as G,c9 as H}from"./index-1961a2a7.js";import{u as L,a as O,b as Q,e as j}from"./FileItem-97e3c353.js";import{a as B,b as T,c as U}from"./MultiSelectKeep-95a62820.js";let W=0;const Z=()=>++W,K=(o,i,{dataUpdateStrategy:l="replace"}={})=>{const n=F([""]),c=g(!1),t=g(),a=g(!1);let f=g(-1);const v=new Set,w=e=>{var s;l==="replace"?t.value=e:l==="merge"&&(b((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=>A(void 0,void 0,void 0,function*(){if(a.value||c.value&&typeof e>"u")return!1;a.value=!0;const s=Z();f.value=s;try{let r;if(typeof e=="number"){if(r=n[e],typeof r!="string")return!1}else r=n[n.length-1];const I=yield o(r);if(v.has(s))return v.delete(s),!1;w(i(I));const u=I.cursor;if((e===n.length-1||typeof e!="number")&&(c.value=!u.has_next,u.has_next)){const y=u.next_cursor||u.next;b(typeof y=="string"),n.push(y)}}finally{f.value===s&&(a.value=!1)}return!0}),p=()=>{v.add(f.value),a.value=!1},S=(e=!1)=>A(void 0,void 0,void 0,function*(){const{refetch:s,force:r}=typeof e=="object"?e:{refetch:e};r&&p(),b(!a.value),n.splice(0,n.length,""),a.value=!1,t.value=void 0,c.value=!1,s&&(yield d())}),h=()=>({next:()=>A(void 0,void 0,void 0,function*(){if(a.value)throw new Error("不允许同时迭代");return{done:!(yield d()),value:t.value}})});return D({abort:p,load:c,next:d,res:t,loading:a,cursorStack:n,reset:S,[Symbol.asyncIterator]:h,iter:{[Symbol.asyncIterator]:h}})},ee=o=>F(K(o,i=>i.files,{dataUpdateStrategy:"merge"})),te=o=>{const i=F(new Set),l=N(()=>(o.res??[]).filter(m=>!i.has(m.fullpath))),n=z(),{stackViewEl:c,multiSelectedIdxs:t,stack:a,scroller:f,props:v}=L({images:l}).toRefs(),{itemSize:w,gridItems:d,cellWidth:p,onScroll:S}=O({fetchNext:()=>o.next()}),{showMenuIdx:h}=Q(),{onFileDragStart:e,onFileDragEnd:s}=B(),{showGenInfo:r,imageGenInfo:I,q:u,onContextMenuClick:y,onFileItemClick:C}=T({openNext:G}),{previewIdx:_,previewing:E,onPreviewVisibleChange:M,previewImgMove:J,canPreview:P}=U(),R=async(m,x,q)=>{a.value=[{curr:"",files:l.value}],await y(m,x,q)};j("removeFiles",async({paths:m})=>{m.forEach(x=>i.add(x))});const k=()=>{H(l.value)};return{images:l,scroller:f,queue:n,iter:o,onContextMenuClickU:R,stackViewEl:c,previewIdx:_,previewing:E,onPreviewVisibleChange:M,previewImgMove:J,canPreview:P,itemSize:w,gridItems:d,showGenInfo:r,imageGenInfo:I,q:u,onContextMenuClick:y,onFileItemClick:C,showMenuIdx:h,multiSelectedIdxs:t,onFileDragStart:e,onFileDragEnd:s,cellWidth:p,onScroll:S,saveLoadedFileAsJson:k,saveAllFileAsJson:async()=>{for(;!o.load;)await o.next();k()},props:v}};export{ee as c,te as u};

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
import{d as z,by as D,as as A,cI as j,aw as k,l as V,cJ as B,cd as y,e as $,c as a,_ as T,h as r,a as P,bE as J,P as b}from"./index-60751f65.js";var M=["class","style"],O=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 W(t,n){return!!t&&!!n&&!isNaN(Number(n))}function F(t){var n=t.indicator;p=typeof n=="function"?n:function(){return a(n,null,null)}}const G=z({compatConfig:{MODE:3},name:"ASpin",inheritAttrs:!1,props:D(O(),{size:"default",spinning:!0,wrapperClassName:""}),setup:function(){return{originalUpdateSpinning:null,configProvider:A("configProvider",j)}},data:function(){var n=this.spinning,e=this.delay,i=W(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,N=o.wrapperClassName,l=this.$attrs,v=l.class,_=l.style,C=T(l,M),S=this.configProvider,U=S.getPrefixCls,E=S.direction,s=U("spin",x),u=this.sSpinning,I=(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"),E==="rtl"),r(i,v,!!v),i),m=a("div",P(P({},C),{},{style:_,class:I}),[this.renderIndicator(s),d?a("div",{class:"".concat(s,"-text")},[d]):null]),g=J(this);if(g&&g.length){var c,w=(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:w,key:"container"},[g])])}return m}});export{G as S,F as s};
import{d as z,by as D,as as A,cI as j,aw as k,l as V,cJ as B,cd as y,e as $,c as a,_ as T,h as r,a as P,bE as J,P as b}from"./index-1961a2a7.js";var M=["class","style"],O=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 W(t,n){return!!t&&!!n&&!isNaN(Number(n))}function F(t){var n=t.indicator;p=typeof n=="function"?n:function(){return a(n,null,null)}}const G=z({compatConfig:{MODE:3},name:"ASpin",inheritAttrs:!1,props:D(O(),{size:"default",spinning:!0,wrapperClassName:""}),setup:function(){return{originalUpdateSpinning:null,configProvider:A("configProvider",j)}},data:function(){var n=this.spinning,e=this.delay,i=W(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,N=o.wrapperClassName,l=this.$attrs,v=l.class,_=l.style,C=T(l,M),S=this.configProvider,U=S.getPrefixCls,E=S.direction,s=U("spin",x),u=this.sSpinning,I=(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"),E==="rtl"),r(i,v,!!v),i),m=a("div",P(P({},C),{},{style:_,class:I}),[this.renderIndicator(s),d?a("div",{class:"".concat(s,"-text")},[d]):null]),g=J(this);if(g&&g.length){var c,w=(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:w,key:"container"},[g])])}return m}});export{G as S,F as s};

View File

@ -1 +1 @@
import{r as F,o as P,cF as K,as as L,B as i,au as T,av as I,d as B,u as $,cG as _,b as y,bc as V,cH as A,ak as E,h as c,c as M,a as G}from"./index-60751f65.js";const W=function(){var o=F(!1);return P(function(){o.value=K()}),o};var D=Symbol("rowContextKey"),k=function(r){T(D,r)},H=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 U=function(){return{align:String,justify:String,prefixCls:String,gutter:{type:[Number,Array,Object],default:0},wrap:{type:Boolean,default:void 0}}},q=B({compatConfig:{MODE:3},name:"ARow",props:U(),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}),S=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 w=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});k({gutter:w,supportFlexGap:S,wrap:i(function(){return r.wrap})});var R=i(function(){var e;return E(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=w.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),S.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=q;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=B({compatConfig:{MODE:3},name:"ACol",props:Q(),setup:function(r,N){var m=N.slots,v=H(),d=v.gutter,h=v.supportFlexGap,j=v.wrap,x=$("col",r),S=x.prefixCls,w=x.direction,R=i(function(){var e,t=r.span,n=r.order,s=r.offset,l=r.push,b=r.pull,a=S.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"),w.value==="rtl"),f))}),E(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,cF as K,as as L,B as i,au as T,av as I,d as B,u as $,cG as _,b as y,bc as V,cH as A,ak as E,h as c,c as M,a as G}from"./index-1961a2a7.js";const W=function(){var o=F(!1);return P(function(){o.value=K()}),o};var D=Symbol("rowContextKey"),k=function(r){T(D,r)},H=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 U=function(){return{align:String,justify:String,prefixCls:String,gutter:{type:[Number,Array,Object],default:0},wrap:{type:Boolean,default:void 0}}},q=B({compatConfig:{MODE:3},name:"ARow",props:U(),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}),S=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 w=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});k({gutter:w,supportFlexGap:S,wrap:i(function(){return r.wrap})});var R=i(function(){var e;return E(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=w.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),S.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=q;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=B({compatConfig:{MODE:3},name:"ACol",props:Q(),setup:function(r,N){var m=N.slots,v=H(),d=v.gutter,h=v.supportFlexGap,j=v.wrap,x=$("col",r),S=x.prefixCls,w=x.direction,R=i(function(){var e,t=r.span,n=r.order,s=r.offset,l=r.push,b=r.pull,a=S.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"),w.value==="rtl"),f))}),E(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};

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
import{d as x,X as $,aH as g,dj as b,r as w,O as p,Q as d,R as a,c as r,Z as i,S as u,T as n,U as B,a3 as I,$ as m,t as R,v as _,x as v,af as W,ag as D,dk as N,W as V}from"./index-60751f65.js";/* empty css */const F={class:"container"},L={class:"actions"},T={class:"desc"},U={class:"snapshot"},j=x({__name:"index",props:{tabIdx:{},paneIdx:{},id:{},paneKey:{}},setup(q){const h=$(),t=g(),f=e=>{h.tabList=R(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(B,null,I(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=V(j,[["__scopeId","data-v-292fd2a3"]]);export{G as default};
import{d as x,X as $,aH as g,dj as b,r as w,O as p,Q as d,R as a,c as r,Z as i,S as u,T as n,U as B,a3 as I,$ as m,t as R,v as _,x as v,af as W,ag as D,dk as N,W as V}from"./index-1961a2a7.js";/* empty css */const F={class:"container"},L={class:"actions"},T={class:"desc"},U={class:"snapshot"},j=x({__name:"index",props:{tabIdx:{},paneIdx:{},id:{},paneKey:{}},setup(q){const h=$(),t=g(),f=e=>{h.tabList=R(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(B,null,I(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=V(j,[["__scopeId","data-v-292fd2a3"]]);export{G as default};

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
import{R as y,C as v}from"./index-9c194ca4.js";import{bL as f,c as d,A as w,d as P,O as a,Q as c,R as r,U as S,a3 as O,aD as b,Z as R,S as u,T as p,$,ag as V,W as L,J as x,cr as _,cE as m}from"./index-60751f65.js";const A=f(y),E=f(v);var H={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=H;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"],D=P({__name:"HistoryRecord",props:{records:{}},emits:["reuseRecord"],setup(t){return(e,s)=>{const n=V;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($(z)),u(" "+p(e.records.isPinned(i)?e.$t("unpin"):e.$t("pin")),1)],8,B)])]))),128))])])}}});const T=L(D,[["__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:x()+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-7e005f25.js";import{bL as f,c as d,A as w,d as P,O as a,Q as c,R as r,U as S,a3 as O,aD as b,Z as R,S as u,T as p,$,ag as V,W as L,J as x,cr as _,cE as m}from"./index-1961a2a7.js";const A=f(y),E=f(v);var H={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=H;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"],D=P({__name:"HistoryRecord",props:{records:{}},emits:["reuseRecord"],setup(t){return(e,s)=>{const n=V;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($(z)),u(" "+p(e.records.isPinned(i)?e.$t("unpin"):e.$t("pin")),1)],8,B)])]))),128))])])}}});const T=L(D,[["__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:x()+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

1
vue/dist/assets/stackView-2be9c993.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
vue/dist/index.html vendored
View File

@ -7,7 +7,7 @@
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Infinite Image Browsing</title>
<script type="module" crossorigin src="/infinite_image_browsing/fe-static/assets/index-60751f65.js"></script>
<script type="module" crossorigin src="/infinite_image_browsing/fe-static/assets/index-1961a2a7.js"></script>
<link rel="stylesheet" href="/infinite_image_browsing/fe-static/assets/index-faeceb7f.css">
</head>

View File

@ -1,3 +1,4 @@
import { Dict } from '@/util'
import { axiosInst } from '.'
export interface FileNodeInfo {
@ -51,3 +52,9 @@ export const copyFiles = async (
export const mkdirs = async (dest_folder: string) => {
await axiosInst.value.post('/mkdirs', { dest_folder })
}
export const batchGetFilesInfo = async (paths: string[]) => {
const resp = await axiosInst.value.post('/batch_get_files_info', { paths })
return resp.data as Dict<FileNodeInfo>
}

View File

@ -50,14 +50,12 @@ const genDiffToPrevious = ref<GenDiffInfo>()
const genDiffToNext = ref<GenDiffInfo>()
const calcGenInfoDiff = debounce(() => {
const { getGenDiff, file, idx } = props
if (!getGenDiff) return
if (!getGenDiff) return
genDiffToNext.value = getGenDiff(file.gen_info_obj, idx, 1, file)
genDiffToPrevious.value = getGenDiff(file.gen_info_obj, idx, -1, file)
}, 200 + 100 * Math.random())
watch(() => props.getGenDiffWatchDep?.(props.idx), () => {
genDiffToNext.value = undefined
genDiffToPrevious.value = undefined
calcGenInfoDiff()
}, { immediate: true, deep: true })

View File

@ -93,7 +93,7 @@ export function useLocation () {
])
pane.nameFallbackStr = title
global.recent = global.recent.filter((v) => v.key !== pane.key)
global.recent.unshift({ path: loc, key: pane.key, mode: props.value.mode})
global.recent.unshift({ path: loc, key: pane.key, mode: props.value.mode })
if (global.recent.length > 20) {
global.recent = global.recent.slice(0, 20)
}
@ -159,7 +159,7 @@ export function useLocation () {
await handleToScannedOnly(path)
}
// 初始化页面的tag,diff,文件夹方面有些加载时间长的无法依靠watch location
delay(500).then(() => eventEmitter.value.emit('viewableAreaFilesChange'))
delay(500).then(() => eventEmitter.value.emit('viewableAreaFilesChange'))
}
@ -226,7 +226,24 @@ export function useLocation () {
useGlobalEventListen(
'returnToIIB',
makeAsyncFunctionSingle(async () => {
if (props.value.mode === 'walk') return
if (props.value.mode === 'walk' && walker.value) {
const currpos = scroller.value?.$_endIndex ?? 64
if (currpos < 128 && await walker.value.isExpired()) {
const hide = message.loading(t('autoUpdate'), 0)
try {
const updatePromsie = new Promise<void>(resolve => {
walker.value!.seamlessRefresh(currpos).then(() => {
eventEmitter.value.emit('loadNextDir') // 确认铺满和更新tag显示期间还能执行
resolve()
})
})
await Promise.all([updatePromsie, delay(1500)]) // 最少显示1.5s
} finally {
hide()
}
}
return
}
try {
np.value?.start()
const { files } = await getTargetFolderFiles(currLocation.value)

View File

@ -1,4 +1,4 @@
import { FileNodeInfo, getTargetFolderFiles } from '@/api/files'
import { FileNodeInfo, getTargetFolderFiles, batchGetFilesInfo } from '@/api/files'
import { first } from 'lodash-es'
import { SortMethod, sortFiles } from './fileSort'
import { isMediaFile } from '@/util'
@ -11,18 +11,18 @@ interface TreeNode {
export class Walker {
root: TreeNode
execQueue: { fn: () => Promise<TreeNode>; info: FileNodeInfo }[] = []
constructor(entryPath: string, private sortMethod = SortMethod.CREATED_TIME_DESC) {
constructor(private entryPath: string, private sortMethod = SortMethod.CREATED_TIME_DESC) {
this.root = {
children: [],
info: {
name: entryPath,
name: this.entryPath,
size: '-',
bytes: 0,
created_time: '',
is_under_scanned_path: true,
date: '',
type: 'dir',
fullpath: entryPath
fullpath: this.entryPath
}
}
this.fetchChildren(this.root)
@ -34,7 +34,7 @@ export class Walker {
return this.fetchChildren(this.root)
}
get images() {
get images () {
const getImg = (node: TreeNode): FileNodeInfo[] => {
return node.children
.map((child) => {
@ -51,11 +51,11 @@ export class Walker {
return getImg(this.root)
}
get isCompleted() {
get isCompleted () {
return this.execQueue.length === 0
}
private async fetchChildren(par: TreeNode): Promise<TreeNode> {
private async fetchChildren (par: TreeNode): Promise<TreeNode> {
// console.log('fetch', par.info.fullpath)
const { files } = await getTargetFolderFiles(par.info.fullpath)
par.children = sortFiles(files, this.sortMethod).map((v) => ({
@ -73,7 +73,10 @@ export class Walker {
) // 用队列来实现dfs
return par
}
async next() {
async next () {
if (this.root.info.date === '') {
this.root.info = (await batchGetFilesInfo([this.entryPath]))[this.entryPath]
}
const pkg = first(this.execQueue)
if (!pkg) {
return null
@ -83,4 +86,51 @@ export class Walker {
this.root = { ...this.root }
return res
}
/**
* 使batchGetFilesInfo
*/
/**
*
* @returns
*/
async isExpired () {
const Alldirs = [this.root.info]
const getDirs = (node: TreeNode) => {
for (const child of node.children) {
if (child.info.type === 'dir') {
Alldirs.push(child.info)
getDirs(child)
}
}
}
getDirs(this.root)
const currNodesinfo = await batchGetFilesInfo(Alldirs.map((v) => v.fullpath))
for (const node of Alldirs) {
if (JSON.stringify(node) !== JSON.stringify(currNodesinfo[node.fullpath])) {
return true
}
}
return false
}
/**
*
* currPos:
*/
async seamlessRefresh (currPos: number) {
console.log('seamlessRefresh', currPos)
const newWalker = new Walker(this.entryPath, this.sortMethod)
while (!newWalker.isCompleted || newWalker.images.length < currPos) {
await newWalker.next()
}
this.root = { ...newWalker.root }
this.execQueue = newWalker.execQueue.slice()
}
}