Merge pull request #12 from zanllp/adj-cache

调整缓存策略,修复独立允许时的几个小问题
pull/13/head
zanllp 2023-04-06 23:24:19 +08:00 committed by GitHub
commit e8018eb5e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
24 changed files with 125 additions and 71 deletions

View File

@ -1,24 +1,23 @@
;(() => { ;(() => {
const html = `<!DOCTYPE html> const html = `<!DOCTYPE html>
<html lang="en"> <html lang="en">
<head>
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Expires" content="0" />
<meta charset="UTF-8" />
<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="/baidu_netdisk/fe-static/assets/index-0bae835f.js"></script>
<link rel="stylesheet" href="/baidu_netdisk/fe-static/assets/index-a2045d1f.css">
</head>
<head> <body>
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate"> <div id="zanllp_dev_gradio_fe"></div>
<meta http-equiv="Expires" content="0">
<meta charset="UTF-8"> </body>
<link rel="icon" href="/favicon.ico"> </html>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> `
<title>Vite App</title>
<script type="module" crossorigin src="/baidu_netdisk/fe-static/assets/index-db76c961.js"></script>
<link rel="stylesheet" href="/baidu_netdisk/fe-static/assets/index-a2045d1f.css">
</head>
<body>
<div id="zanllp_dev_gradio_fe"></div>
</body>
</html>`
const asyncCheck = async (getter, checkSize = 100, timeout = 1000) => { const asyncCheck = async (getter, checkSize = 100, timeout = 1000) => {
return new Promise((x) => { return new Promise((x) => {
const check = (num = 0) => { const check = (num = 0) => {

View File

@ -1,6 +1,7 @@
from datetime import datetime, timedelta
import os import os
import time import time
from scripts.tool import human_readable_size from scripts.tool import human_readable_size, is_valid_image_path
from fastapi import FastAPI, HTTPException from fastapi import FastAPI, HTTPException
from fastapi.staticfiles import StaticFiles from fastapi.staticfiles import StaticFiles
import re import re
@ -162,7 +163,6 @@ def baidu_netdisk_api(_: Any, app: FastAPI):
conf = {} conf = {}
try: try:
from modules.shared import opts from modules.shared import opts
conf = opts.data conf = opts.data
except: except:
pass pass
@ -314,6 +314,44 @@ def baidu_netdisk_api(_: Any, app: FastAPI):
headers={"Cache-Control": "max-age=31536000", "ETag": hash}, headers={"Cache-Control": "max-age=31536000", "ETag": hash},
) )
forever_cache_path = []
try:
from modules.shared import opts
conf = opts.data
def get_config_path(conf):
# 获取配置项
keys = ['outdir_txt2img_samples', 'outdir_img2img_samples', 'outdir_save',
'outdir_extras_samples', 'additional_networks_extra_lora_path',
'outdir_grids', 'outdir_img2img_grids', 'outdir_samples', 'outdir_txt2img_grids']
paths = [conf.get(key) for key in keys]
# 判断路径是否有效并转为绝对路径
abs_paths = []
for path in paths:
if os.path.isabs(path): # 已经是绝对路径
abs_path = path
else: # 转为绝对路径
abs_path = os.path.join(os.getcwd(), path)
if os.path.exists(abs_path): # 判断路径是否存在
abs_paths.append(abs_path)
return abs_paths
forever_cache_path = get_config_path(conf)
except:
pass
def need_cache(path, parent_paths = forever_cache_path):
"""
判断 path 是否是 parent_paths 中某个路径的子路径
"""
try:
for parent_path in parent_paths:
if os.path.commonpath([path, parent_path]) == parent_path:
return True
except:
pass
return False
@app.get(pre+"/file") @app.get(pre+"/file")
async def get_file(filename: str, disposition: Optional[str] = None): async def get_file(filename: str, disposition: Optional[str] = None):
import mimetypes import mimetypes
@ -325,6 +363,9 @@ def baidu_netdisk_api(_: Any, app: FastAPI):
headers = {} headers = {}
if disposition: if disposition:
headers["Content-Disposition"] = f'attachment; filename="{disposition}"' headers["Content-Disposition"] = f'attachment; filename="{disposition}"'
if need_cache(filename) and is_valid_image_path(filename): # 认为永远不变,不要协商缓存了试试
headers["Cache-Control"] = "public, max-age=31536000"
headers["Expires"] = (datetime.now() + timedelta(days=365)).strftime("%a, %d %b %Y %H:%M:%S GMT")
return FileResponse( return FileResponse(
filename, filename,

View File

@ -2,6 +2,9 @@ import os
import platform import platform
import re import re
import imghdr
def human_readable_size(size_bytes): def human_readable_size(size_bytes):
""" """
@ -70,6 +73,21 @@ def debounce(delay):
return decorator return decorator
def is_valid_image_path(path):
"""
判断给定的路径是否是图像文件
"""
abs_path = os.path.abspath(path) # 转为绝对路径
if not os.path.exists(abs_path): # 判断路径是否存在
return False
if not os.path.isfile(abs_path): # 判断是否是文件
return False
if not imghdr.what(abs_path): # 判断是否是图像文件
return False
return True
is_dev = "APP_ENV" in os.environ and os.environ["APP_ENV"] == "dev" is_dev = "APP_ENV" in os.environ and os.environ["APP_ENV"] == "dev"
cwd = os.path.normpath(os.path.join(__file__, "../../")) cwd = os.path.normpath(os.path.join(__file__, "../../"))
is_win = platform.system().lower().find("windows") != -1 is_win = platform.system().lower().find("windows") != -1

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
.container[data-v-641b4c1a]{padding:20px;background-color:var(--zp-secondary-background);height:100%;overflow:auto}.header[data-v-641b4c1a]{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}.header h1[data-v-641b4c1a]{font-size:28px;font-weight:700;color:var(--zp-primary)}.last-record[data-v-641b4c1a]{margin-left:8px;font-size:14px;color:var(--zp-tertiary)}.last-record a[data-v-641b4c1a]{text-decoration:none;color:var(--zp-tertiary)}.last-record a[data-v-641b4c1a]:hover{color:var(--zp-primary)}.content[data-v-641b4c1a]{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));grid-gap:20px}.quick-start[data-v-641b4c1a]{background-color:var(--zp-primary-background);border-radius:8px;box-shadow:0 1px 2px #0000001a;padding:20px}.quick-start ul[data-v-641b4c1a]{list-style:none;padding:4px}.quick-start h2[data-v-641b4c1a]{margin-top:0;margin-bottom:20px;font-size:20px;font-weight:700;color:var(--zp-primary)}.quick-start__item[data-v-641b4c1a]{margin-bottom:10px;padding:4px 8px;display:flex;align-items:center}.quick-start__item[data-v-641b4c1a]:hover{background:var(--zp-secondary-background);border-radius:4px;color:var(--primary-color);cursor:pointer}.quick-start__text[data-v-641b4c1a]{flex:1;font-size:16px}.quick-start__icon[data-v-641b4c1a]{margin-right:8px}

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 +0,0 @@
.container[data-v-59c3a115]{padding:20px;background-color:var(--zp-secondary-background);height:100%;overflow:auto}.header[data-v-59c3a115]{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}.header h1[data-v-59c3a115]{font-size:28px;font-weight:700;color:var(--zp-primary)}.last-record[data-v-59c3a115]{margin-left:8px;font-size:14px;color:var(--zp-tertiary)}.last-record a[data-v-59c3a115]{text-decoration:none;color:var(--zp-tertiary)}.last-record a[data-v-59c3a115]:hover{color:var(--zp-primary)}.content[data-v-59c3a115]{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));grid-gap:20px}.quick-start[data-v-59c3a115]{background-color:var(--zp-primary-background);border-radius:8px;box-shadow:0 1px 2px #0000001a;padding:20px}.quick-start ul[data-v-59c3a115]{list-style:none;padding:4px}.quick-start h2[data-v-59c3a115]{margin-top:0;margin-bottom:20px;font-size:20px;font-weight:700;color:var(--zp-primary)}.quick-start__item[data-v-59c3a115]{margin-bottom:10px;padding:4px 8px;display:flex;align-items:center}.quick-start__item[data-v-59c3a115]:hover{background:var(--zp-secondary-background);border-radius:4px;color:var(--primary-color);cursor:pointer}.quick-start__text[data-v-59c3a115]{flex:1;font-size:16px}.quick-start__icon[data-v-59c3a115]{margin-right:8px}

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,4 +1,4 @@
import{i as Pe,I as P,t as Ie,f as Be,C as Oe,a as Fe,r as ie,E as Ne}from"./index-b5d5ff22.js";import{d as X,u as te,k as q,a as S,c as R,_ as f,e as ce,P as $e,r as F,F as Ee,by as Ve,I as Te,G as ne,h as ae,g as je,a1 as H,U as ke,$ as _e,a0 as J,o as De,a6 as Ge,bz as Le,bA as Ue,a4 as Re,Y as He,l as Ze,X as ee,L as de,A as Ye,N as qe}from"./index-db76c961.js";import{i as Xe}from"./index-cc52f0df.js";import{B as Qe}from"./button-aabb1317.js";const We=X({compatConfig:{MODE:3},name:"AInputGroup",props:{prefixCls:String,size:{type:String},compact:{type:Boolean,default:void 0},onMouseenter:{type:Function},onMouseleave:{type:Function},onFocus:{type:Function},onBlur:{type:Function}},setup:function(e,n){var a=n.slots,c=te("input-group",e),p=c.prefixCls,m=c.direction,i=q(function(){var l,d=p.value;return l={},S(l,"".concat(d),!0),S(l,"".concat(d,"-lg"),e.size==="large"),S(l,"".concat(d,"-sm"),e.size==="small"),S(l,"".concat(d,"-compact"),e.compact),S(l,"".concat(d,"-rtl"),m.value==="rtl"),l});return function(){var l;return R("span",{class:i.value,onMouseenter:e.onMouseenter,onMouseleave:e.onMouseleave,onFocus:e.onFocus,onBlur:e.onBlur},[(l=a.default)===null||l===void 0?void 0:l.call(a)])}}});var oe=/iPhone/i,fe=/iPod/i,ge=/iPad/i,le=/\bAndroid(?:.+)Mobile\b/i,me=/Android/i,Z=/\bAndroid(?:.+)SD4930UR\b/i,K=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,k=/Windows Phone/i,pe=/\bWindows(?:.+)ARM\b/i,be=/BlackBerry/i,he=/BB10/i,xe=/Opera Mini/i,ye=/\b(CriOS|Chrome)(?:.+)Mobile/i,Ce=/Mobile(?:.+)Firefox\b/i;function r(o,e){return o.test(e)}function ze(o){var e=o||(typeof navigator<"u"?navigator.userAgent:""),n=e.split("[FBAN");if(typeof n[1]<"u"){var a=n,c=ce(a,1);e=c[0]}if(n=e.split("Twitter"),typeof n[1]<"u"){var p=n,m=ce(p,1);e=m[0]}var i={apple:{phone:r(oe,e)&&!r(k,e),ipod:r(fe,e),tablet:!r(oe,e)&&r(ge,e)&&!r(k,e),device:(r(oe,e)||r(fe,e)||r(ge,e))&&!r(k,e)},amazon:{phone:r(Z,e),tablet:!r(Z,e)&&r(K,e),device:r(Z,e)||r(K,e)},android:{phone:!r(k,e)&&r(Z,e)||!r(k,e)&&r(le,e),tablet:!r(k,e)&&!r(Z,e)&&!r(le,e)&&(r(K,e)||r(me,e)),device:!r(k,e)&&(r(Z,e)||r(K,e)||r(le,e)||r(me,e))||r(/\bokhttp\b/i,e)},windows:{phone:r(k,e),tablet:r(pe,e),device:r(k,e)||r(pe,e)},other:{blackberry:r(be,e),blackberry10:r(he,e),opera:r(xe,e),firefox:r(Ce,e),chrome:r(ye,e),device:r(be,e)||r(he,e)||r(xe,e)||r(Ce,e)||r(ye,e)},any:null,phone:null,tablet:null};return i.any=i.apple.device||i.android.device||i.windows.device||i.other.device,i.phone=i.apple.phone||i.android.phone||i.windows.phone,i.tablet=i.apple.tablet||i.android.tablet||i.windows.tablet,i}var Ke=f(f({},ze()),{},{isMobile:ze});const Je=Ke;var et=["disabled","loading","addonAfter","suffix"];const tt=X({compatConfig:{MODE:3},name:"AInputSearch",inheritAttrs:!1,props:f(f({},Pe()),{},{inputPrefixCls:String,enterButton:$e.any,onSearch:{type:Function}}),setup:function(e,n){var a=n.slots,c=n.attrs,p=n.expose,m=n.emit,i=F(),l=function(){var u;(u=i.value)===null||u===void 0||u.focus()},d=function(){var u;(u=i.value)===null||u===void 0||u.blur()};p({focus:l,blur:d});var y=function(u){m("update:value",u.target.value),u&&u.target&&u.type==="click"&&m("search",u.target.value,u),m("change",u)},b=function(u){var C;document.activeElement===((C=i.value)===null||C===void 0?void 0:C.input)&&u.preventDefault()},A=function(u){var C;m("search",(C=i.value)===null||C===void 0?void 0:C.stateValue,u),Je.tablet||i.value.focus()},I=te("input-search",e),E=I.prefixCls,V=I.getPrefixCls,N=I.direction,w=I.size,s=q(function(){return V("input",e.inputPrefixCls)});return function(){var g,u,C,M,_,B=e.disabled,$=e.loading,L=e.addonAfter,j=L===void 0?(g=a.addonAfter)===null||g===void 0?void 0:g.call(a):L,Q=e.suffix,W=Q===void 0?(u=a.suffix)===null||u===void 0?void 0:u.call(a):Q,re=Ee(e,et),h=e.enterButton,t=h===void 0?(C=(M=a.enterButton)===null||M===void 0?void 0:M.call(a))!==null&&C!==void 0?C:!1:h;t=t||t==="";var v=typeof t=="boolean"?R(Ve,null,null):null,x="".concat(E.value,"-button"),z=Array.isArray(t)?t[0]:t,T,U=z.type&&Xe(z.type)&&z.type.__ANT_BUTTON;if(U||z.tagName==="button")T=Te(z,f({onMousedown:b,onClick:A,key:"enterButton"},U?{class:x,size:w.value}:{}),!1);else{var D=v&&!t;T=R(Qe,{class:x,type:t?"primary":void 0,size:w.value,disabled:B,key:"enterButton",onMousedown:b,onClick:A,loading:$,icon:D?v:null},{default:function(){return[D?null:v||t]}})}j&&(T=[T,j]);var G=ne(E.value,(_={},S(_,"".concat(E.value,"-rtl"),N.value==="rtl"),S(_,"".concat(E.value,"-").concat(w.value),!!w.value),S(_,"".concat(E.value,"-with-button"),!!t),_),c.class);return R(P,f(f(f({ref:i},ae(re,["onUpdate:value","onSearch","enterButton"])),c),{},{onPressEnter:A,size:w.value,prefixCls:s.value,addonAfter:T,suffix:W,onChange:y,class:G,disabled:B}),a)}}});var nt=` import{i as Pe,I as P,t as Ie,f as Be,C as Oe,a as Fe,r as ie,E as Ne}from"./index-c5e49c67.js";import{d as X,u as te,k as q,a as S,c as R,_ as f,e as ce,P as $e,r as F,F as Ee,by as Ve,I as Te,G as ne,h as ae,g as je,a1 as H,U as ke,$ as _e,a0 as J,o as De,a6 as Ge,bz as Le,bA as Ue,a4 as Re,Y as He,l as Ze,X as ee,L as de,A as Ye,N as qe}from"./index-0bae835f.js";import{i as Xe}from"./index-64cb9bcf.js";import{B as Qe}from"./button-16c6e1d4.js";const We=X({compatConfig:{MODE:3},name:"AInputGroup",props:{prefixCls:String,size:{type:String},compact:{type:Boolean,default:void 0},onMouseenter:{type:Function},onMouseleave:{type:Function},onFocus:{type:Function},onBlur:{type:Function}},setup:function(e,n){var a=n.slots,c=te("input-group",e),p=c.prefixCls,m=c.direction,i=q(function(){var l,d=p.value;return l={},S(l,"".concat(d),!0),S(l,"".concat(d,"-lg"),e.size==="large"),S(l,"".concat(d,"-sm"),e.size==="small"),S(l,"".concat(d,"-compact"),e.compact),S(l,"".concat(d,"-rtl"),m.value==="rtl"),l});return function(){var l;return R("span",{class:i.value,onMouseenter:e.onMouseenter,onMouseleave:e.onMouseleave,onFocus:e.onFocus,onBlur:e.onBlur},[(l=a.default)===null||l===void 0?void 0:l.call(a)])}}});var oe=/iPhone/i,fe=/iPod/i,ge=/iPad/i,le=/\bAndroid(?:.+)Mobile\b/i,me=/Android/i,Z=/\bAndroid(?:.+)SD4930UR\b/i,K=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,k=/Windows Phone/i,pe=/\bWindows(?:.+)ARM\b/i,be=/BlackBerry/i,he=/BB10/i,xe=/Opera Mini/i,ye=/\b(CriOS|Chrome)(?:.+)Mobile/i,Ce=/Mobile(?:.+)Firefox\b/i;function r(o,e){return o.test(e)}function ze(o){var e=o||(typeof navigator<"u"?navigator.userAgent:""),n=e.split("[FBAN");if(typeof n[1]<"u"){var a=n,c=ce(a,1);e=c[0]}if(n=e.split("Twitter"),typeof n[1]<"u"){var p=n,m=ce(p,1);e=m[0]}var i={apple:{phone:r(oe,e)&&!r(k,e),ipod:r(fe,e),tablet:!r(oe,e)&&r(ge,e)&&!r(k,e),device:(r(oe,e)||r(fe,e)||r(ge,e))&&!r(k,e)},amazon:{phone:r(Z,e),tablet:!r(Z,e)&&r(K,e),device:r(Z,e)||r(K,e)},android:{phone:!r(k,e)&&r(Z,e)||!r(k,e)&&r(le,e),tablet:!r(k,e)&&!r(Z,e)&&!r(le,e)&&(r(K,e)||r(me,e)),device:!r(k,e)&&(r(Z,e)||r(K,e)||r(le,e)||r(me,e))||r(/\bokhttp\b/i,e)},windows:{phone:r(k,e),tablet:r(pe,e),device:r(k,e)||r(pe,e)},other:{blackberry:r(be,e),blackberry10:r(he,e),opera:r(xe,e),firefox:r(Ce,e),chrome:r(ye,e),device:r(be,e)||r(he,e)||r(xe,e)||r(Ce,e)||r(ye,e)},any:null,phone:null,tablet:null};return i.any=i.apple.device||i.android.device||i.windows.device||i.other.device,i.phone=i.apple.phone||i.android.phone||i.windows.phone,i.tablet=i.apple.tablet||i.android.tablet||i.windows.tablet,i}var Ke=f(f({},ze()),{},{isMobile:ze});const Je=Ke;var et=["disabled","loading","addonAfter","suffix"];const tt=X({compatConfig:{MODE:3},name:"AInputSearch",inheritAttrs:!1,props:f(f({},Pe()),{},{inputPrefixCls:String,enterButton:$e.any,onSearch:{type:Function}}),setup:function(e,n){var a=n.slots,c=n.attrs,p=n.expose,m=n.emit,i=F(),l=function(){var u;(u=i.value)===null||u===void 0||u.focus()},d=function(){var u;(u=i.value)===null||u===void 0||u.blur()};p({focus:l,blur:d});var y=function(u){m("update:value",u.target.value),u&&u.target&&u.type==="click"&&m("search",u.target.value,u),m("change",u)},b=function(u){var C;document.activeElement===((C=i.value)===null||C===void 0?void 0:C.input)&&u.preventDefault()},A=function(u){var C;m("search",(C=i.value)===null||C===void 0?void 0:C.stateValue,u),Je.tablet||i.value.focus()},I=te("input-search",e),E=I.prefixCls,V=I.getPrefixCls,N=I.direction,w=I.size,s=q(function(){return V("input",e.inputPrefixCls)});return function(){var g,u,C,M,_,B=e.disabled,$=e.loading,L=e.addonAfter,j=L===void 0?(g=a.addonAfter)===null||g===void 0?void 0:g.call(a):L,Q=e.suffix,W=Q===void 0?(u=a.suffix)===null||u===void 0?void 0:u.call(a):Q,re=Ee(e,et),h=e.enterButton,t=h===void 0?(C=(M=a.enterButton)===null||M===void 0?void 0:M.call(a))!==null&&C!==void 0?C:!1:h;t=t||t==="";var v=typeof t=="boolean"?R(Ve,null,null):null,x="".concat(E.value,"-button"),z=Array.isArray(t)?t[0]:t,T,U=z.type&&Xe(z.type)&&z.type.__ANT_BUTTON;if(U||z.tagName==="button")T=Te(z,f({onMousedown:b,onClick:A,key:"enterButton"},U?{class:x,size:w.value}:{}),!1);else{var D=v&&!t;T=R(Qe,{class:x,type:t?"primary":void 0,size:w.value,disabled:B,key:"enterButton",onMousedown:b,onClick:A,loading:$,icon:D?v:null},{default:function(){return[D?null:v||t]}})}j&&(T=[T,j]);var G=ne(E.value,(_={},S(_,"".concat(E.value,"-rtl"),N.value==="rtl"),S(_,"".concat(E.value,"-").concat(w.value),!!w.value),S(_,"".concat(E.value,"-with-button"),!!t),_),c.class);return R(P,f(f(f({ref:i},ae(re,["onUpdate:value","onSearch","enterButton"])),c),{},{onPressEnter:A,size:w.value,prefixCls:s.value,addonAfter:T,suffix:W,onChange:y,class:G,disabled:B}),a)}}});var nt=`
min-height:0 !important; min-height:0 !important;
max-height:none !important; max-height:none !important;
height:0 !important; height:0 !important;

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{b as s}from"./index-62b9b247.js";import{bB as n,aF as t}from"./index-db76c961.js";function i(e,o){return e&&e.length?n(e,s(o)):[]}const r=(e,o)=>(t.success({content:o??`已复制内容 "${e}" 到粘贴板`}),navigator.clipboard.writeText(e));export{r as c,i as u}; import{b as s}from"./index-b3a928ed.js";import{bB as n,aF as t}from"./index-0bae835f.js";function i(e,o){return e&&e.length?n(e,s(o)):[]}const r=(e,o)=>(t.success({content:o??`已复制内容 "${e}" 到粘贴板`}),navigator.clipboard.writeText(e));export{r as c,i as u};

View File

@ -1 +1 @@
import{u as p}from"./useTaskListStore-1884d2b8.js";import{d as u,r as d,k as g,$ as f,a0 as m,n as t,p as s,aV as l,ag as k,b2 as D,z as y,q as L,D as v}from"./index-db76c961.js";const x={class:"container"},h=u({__name:"logDetail",props:{logDetailId:null},setup(r){const n=r,c=p(),a=d(),o=g(()=>c.taskLogMap.get(n.logDetailId));return f(o,async()=>{await m();const e=a.value;e&&(e.scrollTop=e.scrollHeight)},{deep:!0}),(e,B)=>(t(),s("div",x,[l("ul",{class:"list",ref_key:"logListEl",ref:a},[(t(!0),s(k,null,D(L(o),(i,_)=>(t(),s("li",{key:_},[l("pre",null,y(i.log),1)]))),128))],512)]))}});const T=v(h,[["__scopeId","data-v-59148842"]]);export{T as default}; import{u as p}from"./useTaskListStore-c2c36cab.js";import{d as u,r as d,k as g,$ as f,a0 as m,n as t,p as s,aV as l,ag as k,b2 as D,z as y,q as L,D as v}from"./index-0bae835f.js";const x={class:"container"},h=u({__name:"logDetail",props:{logDetailId:null},setup(r){const n=r,c=p(),a=d(),o=g(()=>c.taskLogMap.get(n.logDetailId));return f(o,async()=>{await m();const e=a.value;e&&(e.scrollTop=e.scrollHeight)},{deep:!0}),(e,B)=>(t(),s("div",x,[l("ul",{class:"list",ref_key:"logListEl",ref:a},[(t(!0),s(k,null,D(L(o),(i,_)=>(t(),s("li",{key:_},[l("pre",null,y(i.log),1)]))),128))],512)]))}});const T=v(h,[["__scopeId","data-v-59148842"]]);export{T as default};

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{cE as r,r as e,m as t,aH as i,cF as d}from"./index-db76c961.js";const v=r("useTaskListStore",()=>{const a=e(new Map),n=t(new i),u=e(3),o=e([]),c=t([]),l=e(-1),s=e(null);return{checkBaiduyunInstalled:async()=>(s.value===null&&(s.value=d()),s.value),baiduyunInstalled:s,pollInterval:u,taskLogMap:a,queue:n,tasks:o,showDirAutoCompletedIdx:l,pendingBaiduyunTaskQueue:c}},{persist:{paths:["pollInterval","tasks"],key:"useTaskListStore-v0.0.1"}});export{v as u}; import{cE as r,r as e,m as t,aH as i,cF as d}from"./index-0bae835f.js";const v=r("useTaskListStore",()=>{const a=e(new Map),n=t(new i),u=e(3),o=e([]),c=t([]),l=e(-1),s=e(null);return{checkBaiduyunInstalled:async()=>(s.value===null&&(s.value=d()),s.value),baiduyunInstalled:s,pollInterval:u,taskLogMap:a,queue:n,tasks:o,showDirAutoCompletedIdx:l,pendingBaiduyunTaskQueue:c}},{persist:{paths:["pollInterval","tasks"],key:"useTaskListStore-v0.0.1"}});export{v as u};

32
vue/dist/index.html vendored
View File

@ -1,20 +1,18 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head>
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Expires" content="0" />
<meta charset="UTF-8" />
<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="/baidu_netdisk/fe-static/assets/index-0bae835f.js"></script>
<link rel="stylesheet" href="/baidu_netdisk/fe-static/assets/index-a2045d1f.css">
</head>
<head> <body>
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate"> <div id="zanllp_dev_gradio_fe"></div>
<meta http-equiv="Expires" content="0">
<meta charset="UTF-8"> </body>
<link rel="icon" href="/favicon.ico"> </html>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vite App</title>
<script type="module" crossorigin src="/baidu_netdisk/fe-static/assets/index-db76c961.js"></script>
<link rel="stylesheet" href="/baidu_netdisk/fe-static/assets/index-a2045d1f.css">
</head>
<body>
<div id="zanllp_dev_gradio_fe"></div>
</body>
</html>

View File

@ -1,18 +1,16 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head>
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Expires" content="0" />
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<head> <body>
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate"> <div id="zanllp_dev_gradio_fe"></div>
<meta http-equiv="Expires" content="0"> <script type="module" src="/src/main.ts"></script>
<meta charset="UTF-8"> </body>
<link rel="icon" href="/favicon.ico"> </html>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vite App</title>
</head>
<body>
<div id="zanllp_dev_gradio_fe"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>

View File

@ -69,15 +69,15 @@ const openInNewWindow = () => window.parent.open('/baidu_netdisk')
</li> </li>
</ul> </ul>
</div> </div>
<div class="quick-start"> <div class="quick-start" v-if="walkModeSupportedDir.length">
<h2>使用 Walk 模式浏览图片</h2> <h2>使用 Walk 模式浏览图片</h2>
<ul v-if="walkModeSupportedDir.length"> <ul >
<li v-for="item in walkModeSupportedDir" :key="item.dir" class="quick-start__item"> <li v-for="item in walkModeSupportedDir" :key="item.dir" class="quick-start__item">
<AButton @click="openInCurrentTab('local', item.dir, true)" ghost type="primary" block>{{ item.zh }}</AButton> <AButton @click="openInCurrentTab('local', item.dir, true)" ghost type="primary" block>{{ item.zh }}</AButton>
</li> </li>
</ul> </ul>
</div> </div>
<div class="quick-start"> <div class="quick-start" v-if="global.autoCompletedDirList.length">
<h2>从快速移动启动</h2> <h2>从快速移动启动</h2>
<ul> <ul>
<li v-for="dir in global.autoCompletedDirList" :key="dir.key" class="quick-start__item" <li v-for="dir in global.autoCompletedDirList" :key="dir.key" class="quick-start__item"
@ -88,7 +88,7 @@ const openInNewWindow = () => window.parent.open('/baidu_netdisk')
</div> </div>
<div class="quick-start"> <div class="quick-start" v-if="global.recent.length">
<h2>最近</h2> <h2>最近</h2>
<ul> <ul>
<li v-for="item in global.recent" :key="item.key" class="quick-start__item" <li v-for="item in global.recent" :key="item.key" class="quick-start__item"

View File

@ -27,7 +27,7 @@ export const getAutoCompletedTagList = async ({
cwd: sd_cwd, cwd: sd_cwd,
home home
} }
const exists = await checkPathExists(Object.values(pathMap)) const exists = await checkPathExists(Object.values(pathMap).filter(v => v))
type Keys = keyof typeof pathMap type Keys = keyof typeof pathMap
const cnMap: Record<Keys, string> = { const cnMap: Record<Keys, string> = {
outdir_txt2img_samples: '文生图的输出目录', outdir_txt2img_samples: '文生图的输出目录',