Restrict index generation to folders under sd-webui only,Remove unused code

pull/75/head
zanllp 2023-05-03 21:10:22 +08:00
parent 6bc7f4ca1e
commit 8eaff565cc
19 changed files with 41 additions and 50 deletions

View File

@ -8,7 +8,7 @@
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
<script type="module" crossorigin src="/infinite_image_browsing/fe-static/assets/index-1910535d.js"></script>
<script type="module" crossorigin src="/infinite_image_browsing/fe-static/assets/index-e6108883.js"></script>
<link rel="stylesheet" href="/infinite_image_browsing/fe-static/assets/index-19e73083.css">
</head>

View File

@ -275,7 +275,7 @@ def infinite_image_browsing_api(_: Any, app: FastAPI, **kwargs):
import mimetypes
if not os.path.exists(filename):
raise HTTPException(status_code=404)
raise HTTPException(status_code=404)
if not os.path.isfile(filename):
raise HTTPException(status_code=400, detail=f"{filename} is not a file")
# 根据文件后缀名获取媒体类型
@ -364,20 +364,27 @@ def infinite_image_browsing_api(_: Any, app: FastAPI, **kwargs):
x.to_file_info() for x in ImageTag.get_images_by_tags(conn, {"and": ids})
]
@app.get(db_pre+ "/img_selected_custom_tag")
@app.get(db_pre + "/img_selected_custom_tag")
async def get_img_selected_custom_tag(path: str):
path = os.path.normpath(path)
if not need_cache(path):
return []
conn = DataBase.get_conn()
img = DbImg.get(conn, path)
if not img:
if DbImg.count(conn) == 0:
raise HTTPException(400, "你需要先通过图像搜索页生成索引" if locale == "zh" else "You need to generate an index through the image search page first.")
raise HTTPException(
400,
"你需要先通过图像搜索页生成索引"
if locale == "zh"
else "You need to generate an index through the image search page first.",
)
update_image_data([os.path.dirname(path)])
img = DbImg.get(conn, path)
assert img
# tags = Tag.get_all_custom_tag()
return ImageTag.get_tags_for_image(conn, img.id, type='custom')
return ImageTag.get_tags_for_image(conn, img.id, type="custom")
class ToggleCustomTagToImgReq(BaseModel):
img_path: str
tag_id: int
@ -386,8 +393,17 @@ def infinite_image_browsing_api(_: Any, app: FastAPI, **kwargs):
async def toggle_custom_tag_to_img(req: ToggleCustomTagToImgReq):
conn = DataBase.get_conn()
path = os.path.normpath(req.img_path)
if not need_cache(path):
raise HTTPException(
400,
"非 Stable Diffusion webui 文件夹下不支持切换 tag如果有需要请提 Issue"
if locale == "zh"
else "Tag toggleing is not supported outside the Stable Diffusion webui folder. Please open an issue if you have any questions.",
)
img = DbImg.get(conn, path)
tags = ImageTag.get_tags_for_image(conn=conn, image_id=img.id, type='custom', tag_id=req.tag_id)
tags = ImageTag.get_tags_for_image(
conn=conn, image_id=img.id, type="custom", tag_id=req.tag_id
)
is_remove = len(tags)
if is_remove:
ImageTag.remove(conn, img.id, tags[0].id)

View File

@ -1 +1 @@
import{d as E,r as S,aW as L,x as H,o as c,l as T,c as a,m as o,n as e,p as V,q as z,t as F,A as Q,y as A,I as f,H as R,aL as j,K,O as W}from"./index-1910535d.js";import{u as J,b as X,f as Y,c as Z,d as ee,e as se,h as le,j as te,k as ie,t as ae,L as ne,R as oe,l as re,S as ce}from"./fullScreenContextMenu-6840fc57.js";import{g as de,M as ue}from"./db-a198dd17.js";import"./index-e8340756.js";import"./_baseIteratee-a75bab2f.js";import"./button-94a44b87.js";const me={class:"hint"},pe={key:1,class:"preview-switch"},ve=E({__name:"MatchedImageGrid",props:{tabIdx:null,paneIdx:null,selectedTagIds:null,id:null},setup($){const d=$,l=S(),k=L();H(()=>d.selectedTagIds,async()=>{var s;const{res:i}=k.pushAction(()=>de(d.selectedTagIds));l.value=await i,(s=u.value)==null||s.scrollToItem(0)},{immediate:!0});const u=S(),g={tabIdx:-1,target:"local",paneIdx:-1,walkMode:!1},{stackViewEl:B,multiSelectedIdxs:I,stack:G}=J().toRefs(),{itemSize:w,gridItems:N}=X(g),{showMenuIdx:m}=Y();Z();const{showGenInfo:r,imageGenInfo:x,q:O,onContextMenuClick:P,onFileItemClick:U}=ee(g,{openNext:j}),{previewIdx:n,previewing:C,onPreviewVisibleChange:q,previewImgMove:_,canPreview:b}=se(d,{scroller:u,files:l}),y=async(i,s,p)=>{G.value=[{curr:"",files:l.value}];const v=I.value;await P(i,s,p),i.key==="deleteFiles"&&(l.value=l.value.filter((h,t)=>!v.includes(t)))};return(i,s)=>{const p=K,v=ue,h=ce;return c(),T("div",{class:"container",ref_key:"stackViewEl",ref:B},[a(h,{size:"large",spinning:!e(k).isIdle},{default:o(()=>[a(v,{visible:e(r),"onUpdate:visible":s[1]||(s[1]=t=>V(r)?r.value=t:null),width:"70vw","mask-closable":"",onOk:s[2]||(s[2]=t=>r.value=!1)},{cancelText:o(()=>[]),default:o(()=>[a(p,{active:"",loading:!e(O).isIdle},{default:o(()=>[z("div",{style:{width:"100%","word-break":"break-all","white-space":"pre-line","max-height":"70vh",overflow:"auto"},onDblclick:s[0]||(s[0]=t=>e(le)(e(x),"copied"))},[z("div",me,F(i.$t("doubleClickToCopy")),1),Q(" "+F(e(x)),1)],32)]),_:1},8,["loading"])]),_:1},8,["visible"]),l.value?(c(),A(e(te),{key:0,ref_key:"scroller",ref:u,class:"file-list",items:l.value,"item-size":e(w).first,"key-field":"fullpath","item-secondary-size":e(w).second,gridItems:e(N)},{default:o(({item:t,index:M})=>[a(ie,{idx:M,file:t,"show-menu-idx":e(m),"onUpdate:showMenuIdx":s[3]||(s[3]=D=>V(m)?m.value=D:null),onFileItemClick:e(U),"full-screen-preview-image-url":l.value[e(n)]?e(ae)(l.value[e(n)]):"",selected:e(I).includes(M),onContextMenuClick:y,onPreviewVisibleChange:e(q)},null,8,["idx","file","show-menu-idx","onFileItemClick","full-screen-preview-image-url","selected","onPreviewVisibleChange"])]),_:1},8,["items","item-size","item-secondary-size","gridItems"])):f("",!0),e(C)?(c(),T("div",pe,[a(e(ne),{onClick:s[4]||(s[4]=t=>e(_)("prev")),class:R({disable:!e(b)("prev")})},null,8,["class"]),a(e(oe),{onClick:s[5]||(s[5]=t=>e(_)("next")),class:R({disable:!e(b)("next")})},null,8,["class"])])):f("",!0)]),_:1},8,["spinning"]),e(C)&&l.value&&l.value[e(n)]?(c(),A(re,{key:0,file:l.value[e(n)],idx:e(n),onContextMenuClick:y},null,8,["file","idx"])):f("",!0)],512)}}});const Ce=W(ve,[["__scopeId","data-v-e3714b4b"]]);export{Ce as default};
import{d as E,r as S,aW as L,x as H,o as c,l as T,c as a,m as o,n as e,p as V,q as z,t as F,A as Q,y as A,I as f,H as R,aL as j,K,O as W}from"./index-e6108883.js";import{u as J,b as X,f as Y,c as Z,d as ee,e as se,h as le,j as te,k as ie,t as ae,L as ne,R as oe,l as re,S as ce}from"./fullScreenContextMenu-a7dc9328.js";import{g as de,M as ue}from"./db-f6fd6969.js";import"./index-11bf855b.js";import"./_baseIteratee-876167b2.js";import"./button-8149e0ea.js";const me={class:"hint"},pe={key:1,class:"preview-switch"},ve=E({__name:"MatchedImageGrid",props:{tabIdx:null,paneIdx:null,selectedTagIds:null,id:null},setup($){const d=$,l=S(),k=L();H(()=>d.selectedTagIds,async()=>{var s;const{res:i}=k.pushAction(()=>de(d.selectedTagIds));l.value=await i,(s=u.value)==null||s.scrollToItem(0)},{immediate:!0});const u=S(),g={tabIdx:-1,target:"local",paneIdx:-1,walkMode:!1},{stackViewEl:B,multiSelectedIdxs:I,stack:G}=J().toRefs(),{itemSize:w,gridItems:N}=X(g),{showMenuIdx:m}=Y();Z();const{showGenInfo:r,imageGenInfo:x,q:O,onContextMenuClick:P,onFileItemClick:U}=ee(g,{openNext:j}),{previewIdx:n,previewing:C,onPreviewVisibleChange:q,previewImgMove:_,canPreview:b}=se(d,{scroller:u,files:l}),y=async(i,s,p)=>{G.value=[{curr:"",files:l.value}];const v=I.value;await P(i,s,p),i.key==="deleteFiles"&&(l.value=l.value.filter((h,t)=>!v.includes(t)))};return(i,s)=>{const p=K,v=ue,h=ce;return c(),T("div",{class:"container",ref_key:"stackViewEl",ref:B},[a(h,{size:"large",spinning:!e(k).isIdle},{default:o(()=>[a(v,{visible:e(r),"onUpdate:visible":s[1]||(s[1]=t=>V(r)?r.value=t:null),width:"70vw","mask-closable":"",onOk:s[2]||(s[2]=t=>r.value=!1)},{cancelText:o(()=>[]),default:o(()=>[a(p,{active:"",loading:!e(O).isIdle},{default:o(()=>[z("div",{style:{width:"100%","word-break":"break-all","white-space":"pre-line","max-height":"70vh",overflow:"auto"},onDblclick:s[0]||(s[0]=t=>e(le)(e(x),"copied"))},[z("div",me,F(i.$t("doubleClickToCopy")),1),Q(" "+F(e(x)),1)],32)]),_:1},8,["loading"])]),_:1},8,["visible"]),l.value?(c(),A(e(te),{key:0,ref_key:"scroller",ref:u,class:"file-list",items:l.value,"item-size":e(w).first,"key-field":"fullpath","item-secondary-size":e(w).second,gridItems:e(N)},{default:o(({item:t,index:M})=>[a(ie,{idx:M,file:t,"show-menu-idx":e(m),"onUpdate:showMenuIdx":s[3]||(s[3]=D=>V(m)?m.value=D:null),onFileItemClick:e(U),"full-screen-preview-image-url":l.value[e(n)]?e(ae)(l.value[e(n)]):"",selected:e(I).includes(M),onContextMenuClick:y,onPreviewVisibleChange:e(q)},null,8,["idx","file","show-menu-idx","onFileItemClick","full-screen-preview-image-url","selected","onPreviewVisibleChange"])]),_:1},8,["items","item-size","item-secondary-size","gridItems"])):f("",!0),e(C)?(c(),T("div",pe,[a(e(ne),{onClick:s[4]||(s[4]=t=>e(_)("prev")),class:R({disable:!e(b)("prev")})},null,8,["class"]),a(e(oe),{onClick:s[5]||(s[5]=t=>e(_)("next")),class:R({disable:!e(b)("next")})},null,8,["class"])])):f("",!0)]),_:1},8,["spinning"]),e(C)&&l.value&&l.value[e(n)]?(c(),A(re,{key:0,file:l.value[e(n)],idx:e(n),onContextMenuClick:y},null,8,["file","idx"])):f("",!0)],512)}}});const Ce=W(ve,[["__scopeId","data-v-e3714b4b"]]);export{Ce as default};

View File

@ -1 +1 @@
import{ao as W,an as J,c0 as K,bP as X,d as Y,v as Z,aW as ee,T as P,r as $,U as ae,ab as te,o as c,l as g,I as b,s as B,q as S,c as C,n as d,S as se,y as T,m as A,A as I,t as _,B as z,H as ne,c4 as oe,z as D,b4 as re,c5 as le,bm as E,R as M,O as ie}from"./index-1910535d.js";import{I as ue,_ as ce}from"./index-c76b3455.js";import"./index-d2ade588.js";import{c as F,u as de,e as pe,M as me,r as ge}from"./db-a198dd17.js";import{b as ve}from"./_baseIteratee-a75bab2f.js";import{B as U}from"./button-94a44b87.js";function fe(s,n,t,l){for(var u=-1,a=s==null?0:s.length;++u<a;){var o=s[u];n(l,o,t(o),s)}return l}function _e(s){return function(n,t,l){for(var u=-1,a=Object(n),o=l(n),v=o.length;v--;){var k=o[s?v:++u];if(t(a[k],k,a)===!1)break}return n}}var ye=_e();const he=ye;function be(s,n){return s&&he(s,n,W)}function ke(s,n){return function(t,l){if(t==null)return t;if(!J(t))return s(t,l);for(var u=t.length,a=n?u:-1,o=Object(t);(n?a--:++a<u)&&l(o[a],a,o)!==!1;);return t}}var Ce=ke(be);const Ie=Ce;function we(s,n,t,l){return Ie(s,function(u,a,o){n(l,u,t(u),o)}),l}function xe(s,n){return function(t,l){var u=K(t)?fe:we,a=n?n():{};return u(t,s,ve(l),a)}}var $e=Object.prototype,Be=$e.hasOwnProperty,Se=xe(function(s,n,t){Be.call(s,t)?s[t].push(n):X(s,t,[n])});const Te=Se,Ae={class:"container"},Oe={class:"search-bar"},Pe={key:0,class:"generate-idx-hint"},Me={class:"list-container"},Ne={class:"cat-name"},ze=["onClick"],De=["onClickCapture"],Ee=Y({__name:"TagSearch",props:{tabIdx:null,paneIdx:null},setup(s){const n=s,t=Z(),l=ee(),u=P(()=>!l.isIdle),a=$(),o=$(new Set),v=P(()=>a.value?a.value.tags.slice().sort((e,r)=>r.count-e.count):[]),k=["custom","Model","lora","pos","size","Postprocess upscaler","Postprocess upscale by","Sampler"].reduce((e,r,m)=>(e[r]=m,e),{}),V=P(()=>Object.entries(Te(v.value,e=>e.type)).sort((e,r)=>k[e[0]]-k[r[0]])),q=ae();te(async()=>{a.value=await F(),a.value.img_count&&a.value.expired&&N()});const N=async()=>{l.pushAction(async()=>{await de(),a.value=await F()})},G=()=>{t.openTagSearchMatchedImageGridInRight(n.tabIdx,q,Array.from(o.value))},O=(e,r=!1)=>(r?`[${e.type}] `:"")+(e.display_name?`${e.display_name} : ${e.name}`:e.name),w=$(!1),y=$(""),R=async()=>{var r,m,f;if(!y.value){w.value=!1;return}const e=await l.pushAction(()=>pe({tag_name:y.value})).res;e.type!=="custom"&&E.error(M("existInOtherType")),(r=a.value)!=null&&r.tags.find(h=>h.id===e.id)?E.error(M("alreadyExists")):((m=a.value)==null||m.tags.push(e),(f=t.conf)==null||f.all_custom_tags.push(e)),y.value="",w.value=!1},j=e=>{me.confirm({title:M("confirmDelete"),async onOk(){var m,f,h,x;await ge({tag_id:e});const r=((m=a.value)==null?void 0:m.tags.findIndex(i=>i.id===e))??-1;(f=a.value)==null||f.tags.splice(r,1),(x=t.conf)==null||x.all_custom_tags.splice((h=t.conf)==null?void 0:h.all_custom_tags.findIndex(i=>i.id===e),1)}})};return(e,r)=>{const m=U,f=ue,h=U,x=ce;return c(),g("div",Ae,[b("",!0),a.value?(c(),g(B,{key:1},[S("div",null,[S("div",Oe,[C(d(se),{conv:{value:i=>i.id,text:O,optionText:i=>O(i,!0)},mode:"multiple",style:{width:"100%"},options:d(v),value:Array.from(o.value),disabled:!d(v).length,placeholder:"Select tags to match images","onUpdate:value":r[0]||(r[0]=i=>o.value=new Set(i))},null,8,["conv","options","value","disabled"]),a.value.expired||!a.value.img_count?(c(),T(m,{key:0,onClick:N,loading:!d(l).isIdle,type:"primary"},{default:A(()=>[I(_(a.value.img_count===0?e.$t("generateIndexHint"):e.$t("UpdateIndex")),1)]),_:1},8,["loading"])):(c(),T(m,{key:1,type:"primary",onClick:G,loading:!d(l).isIdle,disabled:!o.value.size},{default:A(()=>[I(_(e.$t("search")),1)]),_:1},8,["loading","disabled"]))])]),d(v).filter(i=>i.type!=="custom").length?b("",!0):(c(),g("p",Pe,_(e.$t("needGenerateIdx")),1)),S("div",Me,[(c(!0),g(B,null,z(d(V),([i,H])=>(c(),g("ul",{class:"tag-list",key:i},[S("h3",Ne,_(e.$t(i)),1),(c(!0),g(B,null,z(H,(p,L)=>(c(),g("li",{key:p.id,class:ne(["tag",{selected:o.value.has(p.id)}]),onClick:Q=>o.value.has(p.id)?o.value.delete(p.id):o.value.add(p.id)},[o.value.has(p.id)?(c(),T(d(oe),{key:0})):b("",!0),I(" "+_(O(p))+" ",1),i==="custom"&&L!==0?(c(),g("span",{key:1,class:"remove",onClickCapture:D(Q=>j(p.id),["stop"])},[C(d(re))],40,De)):b("",!0)],10,ze))),128)),i==="custom"?(c(),g("li",{key:0,class:"tag",onClick:r[2]||(r[2]=p=>w.value=!0)},[w.value?(c(),T(x,{key:0,compact:""},{default:A(()=>[C(f,{value:y.value,"onUpdate:value":r[1]||(r[1]=p=>y.value=p),style:{width:"128px"},loading:d(u),"allow-clear":"",size:"small"},null,8,["value","loading"]),C(h,{size:"small",type:"primary",onClickCapture:D(R,["stop"]),loading:d(u)},{default:A(()=>[I(_(y.value?e.$t("submit"):e.$t("cancel")),1)]),_:1},8,["onClickCapture","loading"])]),_:1})):(c(),g(B,{key:1},[C(d(le)),I(" "+_(e.$t("add")),1)],64))])):b("",!0)]))),128))])],64)):b("",!0)])}}});const je=ie(Ee,[["__scopeId","data-v-c4b1e490"]]);export{je as default};
import{ao as W,an as J,c0 as K,bP as X,d as Y,v as Z,aW as ee,T as P,r as $,U as ae,ab as te,o as c,l as g,I as b,s as B,q as S,c as C,n as d,S as se,y as T,m as A,A as I,t as _,B as z,H as ne,c4 as oe,z as D,b4 as re,c5 as le,bm as E,R as M,O as ie}from"./index-e6108883.js";import{I as ue,_ as ce}from"./index-3bd0c66f.js";import"./index-9679c7d2.js";import{c as F,u as de,e as pe,M as me,r as ge}from"./db-f6fd6969.js";import{b as ve}from"./_baseIteratee-876167b2.js";import{B as U}from"./button-8149e0ea.js";function fe(s,n,t,l){for(var u=-1,a=s==null?0:s.length;++u<a;){var o=s[u];n(l,o,t(o),s)}return l}function _e(s){return function(n,t,l){for(var u=-1,a=Object(n),o=l(n),v=o.length;v--;){var k=o[s?v:++u];if(t(a[k],k,a)===!1)break}return n}}var ye=_e();const he=ye;function be(s,n){return s&&he(s,n,W)}function ke(s,n){return function(t,l){if(t==null)return t;if(!J(t))return s(t,l);for(var u=t.length,a=n?u:-1,o=Object(t);(n?a--:++a<u)&&l(o[a],a,o)!==!1;);return t}}var Ce=ke(be);const Ie=Ce;function we(s,n,t,l){return Ie(s,function(u,a,o){n(l,u,t(u),o)}),l}function xe(s,n){return function(t,l){var u=K(t)?fe:we,a=n?n():{};return u(t,s,ve(l),a)}}var $e=Object.prototype,Be=$e.hasOwnProperty,Se=xe(function(s,n,t){Be.call(s,t)?s[t].push(n):X(s,t,[n])});const Te=Se,Ae={class:"container"},Oe={class:"search-bar"},Pe={key:0,class:"generate-idx-hint"},Me={class:"list-container"},Ne={class:"cat-name"},ze=["onClick"],De=["onClickCapture"],Ee=Y({__name:"TagSearch",props:{tabIdx:null,paneIdx:null},setup(s){const n=s,t=Z(),l=ee(),u=P(()=>!l.isIdle),a=$(),o=$(new Set),v=P(()=>a.value?a.value.tags.slice().sort((e,r)=>r.count-e.count):[]),k=["custom","Model","lora","pos","size","Postprocess upscaler","Postprocess upscale by","Sampler"].reduce((e,r,m)=>(e[r]=m,e),{}),V=P(()=>Object.entries(Te(v.value,e=>e.type)).sort((e,r)=>k[e[0]]-k[r[0]])),q=ae();te(async()=>{a.value=await F(),a.value.img_count&&a.value.expired&&N()});const N=async()=>{l.pushAction(async()=>{await de(),a.value=await F()})},G=()=>{t.openTagSearchMatchedImageGridInRight(n.tabIdx,q,Array.from(o.value))},O=(e,r=!1)=>(r?`[${e.type}] `:"")+(e.display_name?`${e.display_name} : ${e.name}`:e.name),w=$(!1),y=$(""),R=async()=>{var r,m,f;if(!y.value){w.value=!1;return}const e=await l.pushAction(()=>pe({tag_name:y.value})).res;e.type!=="custom"&&E.error(M("existInOtherType")),(r=a.value)!=null&&r.tags.find(h=>h.id===e.id)?E.error(M("alreadyExists")):((m=a.value)==null||m.tags.push(e),(f=t.conf)==null||f.all_custom_tags.push(e)),y.value="",w.value=!1},j=e=>{me.confirm({title:M("confirmDelete"),async onOk(){var m,f,h,x;await ge({tag_id:e});const r=((m=a.value)==null?void 0:m.tags.findIndex(i=>i.id===e))??-1;(f=a.value)==null||f.tags.splice(r,1),(x=t.conf)==null||x.all_custom_tags.splice((h=t.conf)==null?void 0:h.all_custom_tags.findIndex(i=>i.id===e),1)}})};return(e,r)=>{const m=U,f=ue,h=U,x=ce;return c(),g("div",Ae,[b("",!0),a.value?(c(),g(B,{key:1},[S("div",null,[S("div",Oe,[C(d(se),{conv:{value:i=>i.id,text:O,optionText:i=>O(i,!0)},mode:"multiple",style:{width:"100%"},options:d(v),value:Array.from(o.value),disabled:!d(v).length,placeholder:"Select tags to match images","onUpdate:value":r[0]||(r[0]=i=>o.value=new Set(i))},null,8,["conv","options","value","disabled"]),a.value.expired||!a.value.img_count?(c(),T(m,{key:0,onClick:N,loading:!d(l).isIdle,type:"primary"},{default:A(()=>[I(_(a.value.img_count===0?e.$t("generateIndexHint"):e.$t("UpdateIndex")),1)]),_:1},8,["loading"])):(c(),T(m,{key:1,type:"primary",onClick:G,loading:!d(l).isIdle,disabled:!o.value.size},{default:A(()=>[I(_(e.$t("search")),1)]),_:1},8,["loading","disabled"]))])]),d(v).filter(i=>i.type!=="custom").length?b("",!0):(c(),g("p",Pe,_(e.$t("needGenerateIdx")),1)),S("div",Me,[(c(!0),g(B,null,z(d(V),([i,H])=>(c(),g("ul",{class:"tag-list",key:i},[S("h3",Ne,_(e.$t(i)),1),(c(!0),g(B,null,z(H,(p,L)=>(c(),g("li",{key:p.id,class:ne(["tag",{selected:o.value.has(p.id)}]),onClick:Q=>o.value.has(p.id)?o.value.delete(p.id):o.value.add(p.id)},[o.value.has(p.id)?(c(),T(d(oe),{key:0})):b("",!0),I(" "+_(O(p))+" ",1),i==="custom"&&L!==0?(c(),g("span",{key:1,class:"remove",onClickCapture:D(Q=>j(p.id),["stop"])},[C(d(re))],40,De)):b("",!0)],10,ze))),128)),i==="custom"?(c(),g("li",{key:0,class:"tag",onClick:r[2]||(r[2]=p=>w.value=!0)},[w.value?(c(),T(x,{key:0,compact:""},{default:A(()=>[C(f,{value:y.value,"onUpdate:value":r[1]||(r[1]=p=>y.value=p),style:{width:"128px"},loading:d(u),"allow-clear":"",size:"small"},null,8,["value","loading"]),C(h,{size:"small",type:"primary",onClickCapture:D(R,["stop"]),loading:d(u)},{default:A(()=>[I(_(y.value?e.$t("submit"):e.$t("cancel")),1)]),_:1},8,["onClickCapture","loading"])]),_:1})):(c(),g(B,{key:1},[C(d(le)),I(" "+_(e.$t("add")),1)],64))])):b("",!0)]))),128))])],64)):b("",!0)])}}});const je=ie(Ee,[["__scopeId","data-v-c4b1e490"]]);export{je as default};

View File

@ -1 +1 @@
import{cj as A,ck as O,cc as _,c2 as b,cl as m,bi as C,ao as w,aN as h,cm as E,aP as g,cn as R,aL as x,c0 as D}from"./index-1910535d.js";var G=A(Object.getPrototypeOf,Object);const J=G;function y(e,n){for(var r=0;r<n.length;r++){var t=n[r];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,O(t.key),t)}}function Q(e,n,r){return n&&y(e.prototype,n),r&&y(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function W(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function M(e){return function(n){return n==null?void 0:n[e]}}var L=function(){return _()&&window.document.documentElement},a,X=function(){if(!L())return!1;if(a!==void 0)return a;var n=document.createElement("div");return n.style.display="flex",n.style.flexDirection="column",n.style.rowGap="1px",n.appendChild(document.createElement("div")),n.appendChild(document.createElement("div")),document.body.appendChild(n),a=n.scrollHeight===1,document.body.removeChild(n),a},F=1,I=2;function S(e,n,r,t){var i=r.length,o=i,s=!t;if(e==null)return!o;for(e=Object(e);i--;){var f=r[i];if(s&&f[2]?f[1]!==e[f[0]]:!(f[0]in e))return!1}for(;++i<o;){f=r[i];var u=f[0],l=e[u],c=f[1];if(s&&f[2]){if(l===void 0&&!(u in e))return!1}else{var d=new b;if(t)var p=t(l,c,u,e,n,d);if(!(p===void 0?m(c,l,F|I,t,d):p))return!1}}return!0}function P(e){return e===e&&!C(e)}function U(e){for(var n=w(e),r=n.length;r--;){var t=n[r],i=e[t];n[r]=[t,i,P(i)]}return n}function v(e,n){return function(r){return r==null?!1:r[e]===n&&(n!==void 0||e in Object(r))}}function K(e){var n=U(e);return n.length==1&&n[0][2]?v(n[0][0],n[0][1]):function(r){return r===e||S(r,e,n)}}function N(e,n,r){var t=e==null?void 0:h(e,n);return t===void 0?r:t}var T=1,$=2;function q(e,n){return E(e)&&P(n)?v(g(e),n):function(r){var t=N(r,e);return t===void 0&&t===n?R(r,e):m(n,t,T|$)}}function H(e){return function(n){return h(n,e)}}function k(e){return E(e)?M(g(e)):H(e)}function Y(e){return typeof e=="function"?e:e==null?x:typeof e=="object"?D(e)?q(e[0],e[1]):K(e):k(e)}export{Q as _,W as a,Y as b,L as c,X as d,J as g};
import{cj as A,ck as O,cc as _,c2 as b,cl as m,bi as C,ao as w,aN as h,cm as E,aP as g,cn as R,aL as x,c0 as D}from"./index-e6108883.js";var G=A(Object.getPrototypeOf,Object);const J=G;function y(e,n){for(var r=0;r<n.length;r++){var t=n[r];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,O(t.key),t)}}function Q(e,n,r){return n&&y(e.prototype,n),r&&y(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function W(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function M(e){return function(n){return n==null?void 0:n[e]}}var L=function(){return _()&&window.document.documentElement},a,X=function(){if(!L())return!1;if(a!==void 0)return a;var n=document.createElement("div");return n.style.display="flex",n.style.flexDirection="column",n.style.rowGap="1px",n.appendChild(document.createElement("div")),n.appendChild(document.createElement("div")),document.body.appendChild(n),a=n.scrollHeight===1,document.body.removeChild(n),a},F=1,I=2;function S(e,n,r,t){var i=r.length,o=i,s=!t;if(e==null)return!o;for(e=Object(e);i--;){var f=r[i];if(s&&f[2]?f[1]!==e[f[0]]:!(f[0]in e))return!1}for(;++i<o;){f=r[i];var u=f[0],l=e[u],c=f[1];if(s&&f[2]){if(l===void 0&&!(u in e))return!1}else{var d=new b;if(t)var p=t(l,c,u,e,n,d);if(!(p===void 0?m(c,l,F|I,t,d):p))return!1}}return!0}function P(e){return e===e&&!C(e)}function U(e){for(var n=w(e),r=n.length;r--;){var t=n[r],i=e[t];n[r]=[t,i,P(i)]}return n}function v(e,n){return function(r){return r==null?!1:r[e]===n&&(n!==void 0||e in Object(r))}}function K(e){var n=U(e);return n.length==1&&n[0][2]?v(n[0][0],n[0][1]):function(r){return r===e||S(r,e,n)}}function N(e,n,r){var t=e==null?void 0:h(e,n);return t===void 0?r:t}var T=1,$=2;function q(e,n){return E(e)&&P(n)?v(g(e),n):function(r){var t=N(r,e);return t===void 0&&t===n?R(r,e):m(n,t,T|$)}}function H(e){return function(n){return h(n,e)}}function k(e){return E(e)?M(g(e)):H(e)}function Y(e){return typeof e=="function"?e:e==null?x:typeof e=="object"?D(e)?q(e[0],e[1]):K(e):k(e)}export{Q as _,W as a,Y as b,L as c,X as d,J as g};

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{c as w,Q as z,d as L,v as B,R as y,T as I,o,l,q as n,t as r,I as h,n as d,z as v,s as k,B as g,m as F,A as M,U as D,V as N,W as V,X as j,Y as H,O as P}from"./index-1910535d.js";import{B as R}from"./button-94a44b87.js";var A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M688 312v-48c0-4.4-3.6-8-8-8H296c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8zm-392 88c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H296zm376 116c-119.3 0-216 96.7-216 216s96.7 216 216 216 216-96.7 216-216-96.7-216-216-216zm107.5 323.5C750.8 868.2 712.6 884 672 884s-78.8-15.8-107.5-44.5C535.8 810.8 520 772.6 520 732s15.8-78.8 44.5-107.5C593.2 595.8 631.4 580 672 580s78.8 15.8 107.5 44.5C808.2 653.2 824 691.4 824 732s-15.8 78.8-44.5 107.5zM761 656h-44.3c-2.6 0-5 1.2-6.5 3.3l-63.5 87.8-23.1-31.9a7.92 7.92 0 00-6.5-3.3H573c-6.5 0-10.3 7.4-6.5 12.7l73.8 102.1c3.2 4.4 9.7 4.4 12.9 0l114.2-158c3.9-5.3.1-12.7-6.4-12.7zM440 852H208V148h560v344c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V108c0-17.7-14.3-32-32-32H168c-17.7 0-32 14.3-32 32v784c0 17.7 14.3 32 32 32h272c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"}}]},name:"file-done",theme:"outlined"};const E=A;function S(a){for(var c=1;c<arguments.length;c++){var t=arguments[c]!=null?Object(arguments[c]):{},i=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(t).filter(function(u){return Object.getOwnPropertyDescriptor(t,u).enumerable}))),i.forEach(function(u){T(a,u,t[u])})}return a}function T(a,c,t){return c in a?Object.defineProperty(a,c,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[c]=t,a}var C=function(c,t){var i=S({},c,t.attrs);return w(z,S({},i,{icon:E}),null)};C.displayName="FileDoneOutlined";C.inheritAttrs=!1;const W=C,Q=a=>(j("data-v-e015a41c"),a=a(),H(),a),G={class:"container"},U={class:"header"},X=Q(()=>n("div",{"flex-placeholder":""},null,-1)),Y={class:"last-record"},J=["onClick"],Z={class:"content"},K={key:0,class:"quick-start"},ee={key:1,class:"quick-start"},te=["onClick"],se={class:"quick-start__text line-clamp-1"},ne={class:"quick-start"},ae=["onClick"],oe={class:"quick-start__text line-clamp-1"},le={key:2,class:"quick-start"},ce=["onClick"],re={class:"quick-start__text line-clamp-1"},ie=L({__name:"emptyStartup",props:{tabIdx:null,paneIdx:null},setup(a){const c=a,t=B(),i={local:y("local"),"tag-search":y("imgSearch"),"global-setting":y("globalSettings")},u=(e,p,f=!1)=>{let _;switch(e){case"tag-search-matched-image-grid":return;case"global-setting":case"tag-search":case"empty":_={type:e,name:i[e],key:Date.now()+D()};break;case"local":_={type:e,name:i[e],key:Date.now()+D(),path:p,walkMode:f}}const s=t.tabList[c.tabIdx];s.panes.splice(c.paneIdx,1,_),s.key=_.key},m=I(()=>{var e;return(e=t.lastTabListRecord)==null?void 0:e[1]});console.log(m.value);const O=I(()=>t.autoCompletedDirList.filter(({key:e})=>e==="outdir_txt2img_samples"||e==="outdir_img2img_samples"||e==="outdir_extras_samples"||e==="outdir_save"||e==="outdir_samples")),q=window.parent!==window,$=()=>window.parent.open("/infinite_image_browsing"),x=()=>{N(m.value),t.tabList=m.value.tabs.map(e=>V(e,!0)),t.tabList.forEach(e=>{e.panes.forEach(p=>{typeof p.name!="string"&&(p.name="")})})};return(e,p)=>{var _;const f=R;return o(),l("div",G,[n("div",U,[n("h1",null,r(e.$t("welcome")),1),X,q?(o(),l("div",{key:0,class:"last-record",onClick:$},[n("a",null,r(e.$t("openInNewWindow")),1)])):h("",!0),n("div",Y,[(_=d(m))!=null&&_.tabs.length?(o(),l("a",{key:0,onClick:v(x,["prevent"])},r(e.$t("restoreLastRecord")),9,J)):h("",!0)])]),n("div",Z,[d(O).length?(o(),l("div",K,[n("h2",null,r(e.$t("walkMode")),1),n("ul",null,[(o(!0),l(k,null,g(d(O),s=>(o(),l("li",{key:s.dir,class:"quick-start__item"},[w(f,{onClick:b=>u("local",s.dir,!0),ghost:"",type:"primary",block:""},{default:F(()=>[M(r(s.zh),1)]),_:2},1032,["onClick"])]))),128))])])):h("",!0),d(t).autoCompletedDirList.length?(o(),l("div",ee,[n("h2",null,r(e.$t("launchFromQuickMove")),1),n("ul",null,[(o(!0),l(k,null,g(d(t).autoCompletedDirList,s=>(o(),l("li",{key:s.key,class:"quick-start__item",onClick:v(b=>u("local",s.dir),["prevent"])},[n("span",se,r(s.zh),1)],8,te))),128))])])):h("",!0),n("div",ne,[n("h2",null,r(e.$t("launch")),1),n("ul",null,[(o(!0),l(k,null,g(Object.keys(i),s=>(o(),l("li",{key:s,class:"quick-start__item",onClick:v(b=>u(s),["prevent"])},[n("span",oe,r(i[s]),1)],8,ae))),128))])]),d(t).recent.length?(o(),l("div",le,[n("h2",null,r(e.$t("recent")),1),n("ul",null,[(o(!0),l(k,null,g(d(t).recent,s=>(o(),l("li",{key:s.key,class:"quick-start__item",onClick:v(b=>u("local",s.path),["prevent"])},[w(d(W),{class:"quick-start__icon"}),n("span",re,r(s.path),1)],8,ce))),128))])])):h("",!0)])])}}});const _e=P(ie,[["__scopeId","data-v-e015a41c"]]);export{_e as default};
import{c as w,Q as z,d as L,v as B,R as y,T as I,o,l,q as n,t as r,I as h,n as d,z as v,s as k,B as g,m as F,A as M,U as D,V as N,W as V,X as j,Y as H,O as P}from"./index-e6108883.js";import{B as R}from"./button-8149e0ea.js";var A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M688 312v-48c0-4.4-3.6-8-8-8H296c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8zm-392 88c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H296zm376 116c-119.3 0-216 96.7-216 216s96.7 216 216 216 216-96.7 216-216-96.7-216-216-216zm107.5 323.5C750.8 868.2 712.6 884 672 884s-78.8-15.8-107.5-44.5C535.8 810.8 520 772.6 520 732s15.8-78.8 44.5-107.5C593.2 595.8 631.4 580 672 580s78.8 15.8 107.5 44.5C808.2 653.2 824 691.4 824 732s-15.8 78.8-44.5 107.5zM761 656h-44.3c-2.6 0-5 1.2-6.5 3.3l-63.5 87.8-23.1-31.9a7.92 7.92 0 00-6.5-3.3H573c-6.5 0-10.3 7.4-6.5 12.7l73.8 102.1c3.2 4.4 9.7 4.4 12.9 0l114.2-158c3.9-5.3.1-12.7-6.4-12.7zM440 852H208V148h560v344c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V108c0-17.7-14.3-32-32-32H168c-17.7 0-32 14.3-32 32v784c0 17.7 14.3 32 32 32h272c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"}}]},name:"file-done",theme:"outlined"};const E=A;function S(a){for(var c=1;c<arguments.length;c++){var t=arguments[c]!=null?Object(arguments[c]):{},i=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(t).filter(function(u){return Object.getOwnPropertyDescriptor(t,u).enumerable}))),i.forEach(function(u){T(a,u,t[u])})}return a}function T(a,c,t){return c in a?Object.defineProperty(a,c,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[c]=t,a}var C=function(c,t){var i=S({},c,t.attrs);return w(z,S({},i,{icon:E}),null)};C.displayName="FileDoneOutlined";C.inheritAttrs=!1;const W=C,Q=a=>(j("data-v-e015a41c"),a=a(),H(),a),G={class:"container"},U={class:"header"},X=Q(()=>n("div",{"flex-placeholder":""},null,-1)),Y={class:"last-record"},J=["onClick"],Z={class:"content"},K={key:0,class:"quick-start"},ee={key:1,class:"quick-start"},te=["onClick"],se={class:"quick-start__text line-clamp-1"},ne={class:"quick-start"},ae=["onClick"],oe={class:"quick-start__text line-clamp-1"},le={key:2,class:"quick-start"},ce=["onClick"],re={class:"quick-start__text line-clamp-1"},ie=L({__name:"emptyStartup",props:{tabIdx:null,paneIdx:null},setup(a){const c=a,t=B(),i={local:y("local"),"tag-search":y("imgSearch"),"global-setting":y("globalSettings")},u=(e,p,f=!1)=>{let _;switch(e){case"tag-search-matched-image-grid":return;case"global-setting":case"tag-search":case"empty":_={type:e,name:i[e],key:Date.now()+D()};break;case"local":_={type:e,name:i[e],key:Date.now()+D(),path:p,walkMode:f}}const s=t.tabList[c.tabIdx];s.panes.splice(c.paneIdx,1,_),s.key=_.key},m=I(()=>{var e;return(e=t.lastTabListRecord)==null?void 0:e[1]});console.log(m.value);const O=I(()=>t.autoCompletedDirList.filter(({key:e})=>e==="outdir_txt2img_samples"||e==="outdir_img2img_samples"||e==="outdir_extras_samples"||e==="outdir_save"||e==="outdir_samples")),q=window.parent!==window,$=()=>window.parent.open("/infinite_image_browsing"),x=()=>{N(m.value),t.tabList=m.value.tabs.map(e=>V(e,!0)),t.tabList.forEach(e=>{e.panes.forEach(p=>{typeof p.name!="string"&&(p.name="")})})};return(e,p)=>{var _;const f=R;return o(),l("div",G,[n("div",U,[n("h1",null,r(e.$t("welcome")),1),X,q?(o(),l("div",{key:0,class:"last-record",onClick:$},[n("a",null,r(e.$t("openInNewWindow")),1)])):h("",!0),n("div",Y,[(_=d(m))!=null&&_.tabs.length?(o(),l("a",{key:0,onClick:v(x,["prevent"])},r(e.$t("restoreLastRecord")),9,J)):h("",!0)])]),n("div",Z,[d(O).length?(o(),l("div",K,[n("h2",null,r(e.$t("walkMode")),1),n("ul",null,[(o(!0),l(k,null,g(d(O),s=>(o(),l("li",{key:s.dir,class:"quick-start__item"},[w(f,{onClick:b=>u("local",s.dir,!0),ghost:"",type:"primary",block:""},{default:F(()=>[M(r(s.zh),1)]),_:2},1032,["onClick"])]))),128))])])):h("",!0),d(t).autoCompletedDirList.length?(o(),l("div",ee,[n("h2",null,r(e.$t("launchFromQuickMove")),1),n("ul",null,[(o(!0),l(k,null,g(d(t).autoCompletedDirList,s=>(o(),l("li",{key:s.key,class:"quick-start__item",onClick:v(b=>u("local",s.dir),["prevent"])},[n("span",se,r(s.zh),1)],8,te))),128))])])):h("",!0),n("div",ne,[n("h2",null,r(e.$t("launch")),1),n("ul",null,[(o(!0),l(k,null,g(Object.keys(i),s=>(o(),l("li",{key:s,class:"quick-start__item",onClick:v(b=>u(s),["prevent"])},[n("span",oe,r(i[s]),1)],8,ae))),128))])]),d(t).recent.length?(o(),l("div",le,[n("h2",null,r(e.$t("recent")),1),n("ul",null,[(o(!0),l(k,null,g(d(t).recent,s=>(o(),l("li",{key:s.key,class:"quick-start__item",onClick:v(b=>u("local",s.path),["prevent"])},[w(d(W),{class:"quick-start__icon"}),n("span",re,r(s.path),1)],8,ce))),128))])])):h("",!0)])])}}});const _e=P(ie,[["__scopeId","data-v-e015a41c"]]);export{_e 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

View File

@ -1 +1 @@
import{aM as n,c9 as c}from"./index-1910535d.js";import{g as a}from"./_baseIteratee-a75bab2f.js";var i="[object Object]",s=Function.prototype,p=Object.prototype,e=s.toString,f=p.hasOwnProperty,b=e.call(Object);function l(o){if(!n(o)||c(o)!=i)return!1;var r=a(o);if(r===null)return!0;var t=f.call(r,"constructor")&&r.constructor;return typeof t=="function"&&t instanceof t&&e.call(t)==b}export{l as i};
import{aM as n,c9 as c}from"./index-e6108883.js";import{g as a}from"./_baseIteratee-876167b2.js";var i="[object Object]",s=Function.prototype,p=Object.prototype,e=s.toString,f=p.hasOwnProperty,b=e.call(Object);function l(o){if(!n(o)||c(o)!=i)return!1;var r=a(o);if(r===null)return!0;var t=f.call(r,"constructor")&&r.constructor;return typeof t=="function"&&t instanceof t&&e.call(t)==b}export{l as i};

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>Vite App</title>
<script type="module" crossorigin src="/infinite_image_browsing/fe-static/assets/index-1910535d.js"></script>
<script type="module" crossorigin src="/infinite_image_browsing/fe-static/assets/index-e6108883.js"></script>
<link rel="stylesheet" href="/infinite_image_browsing/fe-static/assets/index-19e73083.css">
</head>

View File

@ -1,21 +0,0 @@
import { axiosInst } from '.'
export interface UserInfo {
uid: string
username: string
}
export const getUserInfo = async () => {
const resp = await axiosInst.get('/user')
return resp.data as UserInfo | undefined
}
export const loginByBduss = async (bduss: string) => {
const resp = await axiosInst.post('/user/login', {
bduss
})
return resp.data as UserInfo
}
export const logout = async () => {
const resp = await axiosInst.post('/user/logout')
return resp.data as {}
}

View File

@ -317,11 +317,7 @@ export function useLocation (props: Props) {
}
try {
np.value?.start()
const prev = basePath.value
const { files } = await getTargetFolderFiles(
'local',
Path.join(...prev, file.name)
)
const { files } = await getTargetFolderFiles('local',file.fullpath)
stack.value.push({
files,
curr: file.name