支持移动文件
parent
67f3a38618
commit
f2f14e65e6
|
|
@ -8,8 +8,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-2860dd7c.js"></script>
|
||||
<link rel="stylesheet" href="/baidu_netdisk/fe-static/assets/index-a2045d1f.css">
|
||||
<script type="module" crossorigin src="/baidu_netdisk/fe-static/assets/index-c3c57935.js"></script>
|
||||
<link rel="stylesheet" href="/baidu_netdisk/fe-static/assets/index-85d7437d.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
from datetime import datetime, timedelta
|
||||
import os
|
||||
import shutil
|
||||
import time
|
||||
from scripts.tool import human_readable_size, is_valid_image_path, temp_path
|
||||
from fastapi import FastAPI, HTTPException
|
||||
|
|
@ -253,6 +254,21 @@ def baidu_netdisk_api(_: Any, app: FastAPI):
|
|||
else:
|
||||
exec_ops(["rm", *req.file_paths]) #没检查是否失败,暂时先这样
|
||||
|
||||
class MoveFilesReq(BaseModel):
|
||||
file_paths: list[str]
|
||||
dest: str
|
||||
|
||||
@app.post(pre+"/move_files/{target}")
|
||||
async def move_files(req: MoveFilesReq, target: Literal["local", "netdisk"]):
|
||||
if target == "local":
|
||||
for path in req.file_paths:
|
||||
try:
|
||||
shutil.move(path, req.dest)
|
||||
except OSError as e:
|
||||
raise HTTPException(400, detail=f"移动文件{path}到{req.dest}时出错:{e}")
|
||||
else:
|
||||
exec_ops(["mv", *req.file_paths, req.dest]) #没检查是否失败,暂时先这样
|
||||
|
||||
@app.get(pre + "/files/{target}")
|
||||
async def get_target_floder_files(
|
||||
target: Literal["local", "netdisk"], folder_path: str
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ declare module '@vue/runtime-core' {
|
|||
AMenu: typeof import('ant-design-vue/es')['Menu']
|
||||
AMenuItem: typeof import('ant-design-vue/es')['MenuItem']
|
||||
AModal: typeof import('ant-design-vue/es')['Modal']
|
||||
AProgress: typeof import('ant-design-vue/es')['Progress']
|
||||
ARow: typeof import('ant-design-vue/es')['Row']
|
||||
ASelect: typeof import('ant-design-vue/es')['Select']
|
||||
ASkeleton: typeof import('ant-design-vue/es')['Skeleton']
|
||||
|
|
@ -30,6 +31,9 @@ declare module '@vue/runtime-core' {
|
|||
ASwitch: typeof import('ant-design-vue/es')['Switch']
|
||||
ATabPane: typeof import('ant-design-vue/es')['TabPane']
|
||||
ATabs: typeof import('ant-design-vue/es')['Tabs']
|
||||
ATag: typeof import('ant-design-vue/es')['Tag']
|
||||
ATextarea: typeof import('ant-design-vue/es')['Textarea']
|
||||
ATooltip: typeof import('ant-design-vue/es')['Tooltip']
|
||||
RouterLink: typeof import('vue-router')['RouterLink']
|
||||
RouterView: typeof import('vue-router')['RouterView']
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +0,0 @@
|
|||
.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}
|
||||
|
|
@ -0,0 +1 @@
|
|||
.container[data-v-41719860]{padding:20px;background-color:var(--zp-secondary-background);height:100%;overflow:auto}.header[data-v-41719860]{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}.header h1[data-v-41719860]{font-size:28px;font-weight:700;color:var(--zp-primary)}.last-record[data-v-41719860]{margin-left:8px;font-size:14px;color:var(--zp-tertiary)}.last-record a[data-v-41719860]{text-decoration:none;color:var(--zp-tertiary)}.last-record a[data-v-41719860]:hover{color:var(--zp-primary)}.content[data-v-41719860]{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));grid-gap:20px}.quick-start[data-v-41719860]{background-color:var(--zp-primary-background);border-radius:8px;box-shadow:0 1px 2px #0000001a;padding:20px}.quick-start ul[data-v-41719860]{list-style:none;padding:4px}.quick-start h2[data-v-41719860]{margin-top:0;margin-bottom:20px;font-size:20px;font-weight:700;color:var(--zp-primary)}.quick-start__item[data-v-41719860]{margin-bottom:10px;padding:4px 8px;display:flex;align-items:center}.quick-start__item[data-v-41719860]:hover{background:var(--zp-secondary-background);border-radius:4px;color:var(--primary-color);cursor:pointer}.quick-start__text[data-v-41719860]{flex:1;font-size:16px}.quick-start__icon[data-v-41719860]{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
|
|
@ -1 +1 @@
|
|||
import{b as s}from"./index-a59f3bf3.js";import{bD as n,aP as t}from"./index-2860dd7c.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-2b8bcb5c.js";import{bD as n,aQ as t}from"./index-c3c57935.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};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -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-18c61513.js";import{d as Q,u as te,G as q,_ as S,a as R,h as f,x as ce,P as $e,r as F,a4 as Ee,bA as je,b as Te,c as ne,B as ae,A as Ve,al as U,ad as ke,aj as _e,ak as J,y as De,f as Ge,bB as Le,bC as He,ao as Re,ah as Ue,H as Ze,ag as ee,a8 as de,D as Ye,i as qe}from"./index-2860dd7c.js";import{i as Qe}from"./index-e69dee28.js";import{B as We}from"./button-e501ff87.js";const Xe=Q({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=Q({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,j=I.getPrefixCls,N=I.direction,w=I.size,s=q(function(){return j("input",e.inputPrefixCls)});return function(){var g,u,C,M,_,B=e.disabled,$=e.loading,L=e.addonAfter,V=L===void 0?(g=a.addonAfter)===null||g===void 0?void 0:g.call(a):L,W=e.suffix,X=W===void 0?(u=a.suffix)===null||u===void 0?void 0:u.call(a):W,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(je,null,null):null,x="".concat(E.value,"-button"),z=Array.isArray(t)?t[0]:t,T,H=z.type&&Qe(z.type)&&z.type.__ANT_BUTTON;if(H||z.tagName==="button")T=Te(z,f({onMousedown:b,onClick:A,key:"enterButton"},H?{class:x,size:w.value}:{}),!1);else{var D=v&&!t;T=R(We,{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]}})}V&&(T=[T,V]);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:X,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-3f813149.js";import{d as Q,u as te,G as q,_ as S,a as R,h as f,x as ce,P as $e,r as F,a4 as Ee,bA as je,b as Te,c as ne,B as ae,A as Ve,al as U,ad as ke,aj as _e,ak as J,y as De,f as Ge,bB as Le,bC as He,ao as Re,ah as Ue,H as Ze,ag as ee,a8 as de,D as Ye,i as qe}from"./index-c3c57935.js";import{i as Qe}from"./index-b1a530d3.js";import{B as We}from"./button-3c954d08.js";const Xe=Q({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=Q({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,j=I.getPrefixCls,N=I.direction,w=I.size,s=q(function(){return j("input",e.inputPrefixCls)});return function(){var g,u,C,M,_,B=e.disabled,$=e.loading,L=e.addonAfter,V=L===void 0?(g=a.addonAfter)===null||g===void 0?void 0:g.call(a):L,W=e.suffix,X=W===void 0?(u=a.suffix)===null||u===void 0?void 0:u.call(a):W,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(je,null,null):null,x="".concat(E.value,"-button"),z=Array.isArray(t)?t[0]:t,T,H=z.type&&Qe(z.type)&&z.type.__ANT_BUTTON;if(H||z.tagName==="button")T=Te(z,f({onMousedown:b,onClick:A,key:"enterButton"},H?{class:x,size:w.value}:{}),!1);else{var D=v&&!t;T=R(We,{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]}})}V&&(T=[T,V]);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:X,onChange:y,class:G,disabled:B}),a)}}});var nt=`
|
||||
min-height:0 !important;
|
||||
max-height:none !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
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
import{u as p}from"./useTaskListStore-19e73313.js";import{d as u,r as d,G as g,aj as f,ak as m,K as t,L as s,V as l,W as k,X as L,U as y,M as D,a2 as v}from"./index-2860dd7c.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,L(D(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-2e8a3a05.js";import{d as u,r as d,G as g,aj as f,ak as m,K as t,L as s,V as l,W as k,X as L,U as y,M as D,a2 as v}from"./index-c3c57935.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,L(D(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
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
import{cF as r,r as e,J as t,aR as i,cG as d}from"./index-2860dd7c.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{cF as r,r as e,J as t,aS as i,cG as d}from"./index-c3c57935.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};
|
||||
|
|
@ -7,8 +7,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-2860dd7c.js"></script>
|
||||
<link rel="stylesheet" href="/baidu_netdisk/fe-static/assets/index-a2045d1f.css">
|
||||
<script type="module" crossorigin src="/baidu_netdisk/fe-static/assets/index-c3c57935.js"></script>
|
||||
<link rel="stylesheet" href="/baidu_netdisk/fe-static/assets/index-85d7437d.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
|
|
|||
|
|
@ -24,15 +24,13 @@
|
|||
"splitpanes": "^3.1.5",
|
||||
"vue": "^3.2.47",
|
||||
"vue-virtual-scroller": "^2.0.0-beta.8",
|
||||
"vue3-ts-util": "^0.8.2",
|
||||
"vuedraggable": "^4.1.0"
|
||||
"vue3-ts-util": "^0.8.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
"@types/nprogress": "^0.2.0",
|
||||
"@types/path-browserify": "^1.0.0",
|
||||
"@rushstack/eslint-patch": "^1.2.0",
|
||||
"@types/node": "^18.14.2",
|
||||
"@types/nprogress": "^0.2.0",
|
||||
"@types/path-browserify": "^1.0.0",
|
||||
"@vitejs/plugin-vue": "^4.0.0",
|
||||
"@vue/eslint-config-prettier": "^7.1.0",
|
||||
"@vue/eslint-config-typescript": "^11.0.2",
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ export const deleteFiles = async (target: 'local' | 'netdisk' , file_paths: stri
|
|||
return resp.data as { files: FileNodeInfo[] }
|
||||
}
|
||||
|
||||
export const moveFiles = async (target: 'local' | 'netdisk' , file_paths: string[]) => {
|
||||
const resp = await axiosInst.post(`/move_files/${target}`, { file_paths })
|
||||
export const moveFiles = async (target: 'local' | 'netdisk' , file_paths: string[], dest: string) => {
|
||||
const resp = await axiosInst.post(`/move_files/${target}`, { file_paths, dest })
|
||||
return resp.data as { files: FileNodeInfo[] }
|
||||
}
|
||||
|
|
@ -5,7 +5,7 @@ import 'splitpanes/dist/splitpanes.css'
|
|||
import { useGlobalStore, type TabPane } from '@/store/useGlobalStore'
|
||||
import { defineAsyncComponent, watch, ref, nextTick } from 'vue'
|
||||
import { key } from '@/util'
|
||||
import { uniqueId } from 'lodash'
|
||||
import { uniqueId } from 'lodash-es'
|
||||
import edgeTrigger from './edgeTrigger.vue'
|
||||
import { message } from 'ant-design-vue'
|
||||
const global = useGlobalStore()
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<script lang="ts" setup>
|
||||
import { useGlobalStore, type TabPane } from '@/store/useGlobalStore'
|
||||
import { uniqueId } from 'lodash'
|
||||
import { uniqueId } from 'lodash-es'
|
||||
import { computed } from 'vue'
|
||||
import { ID } from 'vue3-ts-util'
|
||||
import { CloudDownloadOutlined, FileDoneOutlined } from '@/icon'
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import { downloadBaiduyun, genInfoCompleted, getImageGenerationInfo, setImgPath
|
|||
import { isAxiosError } from 'axios'
|
||||
import { useWatchDocument, type SearchSelectConv, ok, createTypedShareStateHook, copy2clipboard, Task, delay, FetchQueue, typedEventEmitter } from 'vue3-ts-util'
|
||||
import { gradioApp, isImageFile } from '@/util'
|
||||
import { getTargetFolderFiles, type FileNodeInfo, deleteFiles } from '@/api/files'
|
||||
import { getTargetFolderFiles, type FileNodeInfo, deleteFiles, moveFiles } from '@/api/files'
|
||||
import { sortFiles, sortMethodMap, SortMethod } from './fileSort'
|
||||
import { cloneDeep, debounce, last, range, uniqBy } from 'lodash-es'
|
||||
import path from 'path-browserify'
|
||||
|
|
@ -24,6 +24,8 @@ export const toRawFileUrl = (file: FileNodeInfo, download = false) => `/baidu_ne
|
|||
export const toImageThumbnailUrl = (file: FileNodeInfo, size: string) => `/baidu_netdisk/image-thumbnail?path=${encodeURIComponent(file.fullpath)}&size=${size}`
|
||||
|
||||
|
||||
const { eventEmitter: events, useEventListen } = typedEventEmitter<{ removeFiles: [paths: string[], loc: string], addFiles: [paths: string[], loc: string] }>()
|
||||
|
||||
export interface Scroller {
|
||||
$_startIndex: number
|
||||
$_endIndex: number
|
||||
|
|
@ -72,7 +74,7 @@ export const { useHookShareState } = createTypedShareStateHook(() => {
|
|||
stackViewEl: ref<HTMLDivElement>(),
|
||||
props,
|
||||
...useBaiduyun(),
|
||||
...typedEventEmitter<{ loadNextDir: undefined }>()
|
||||
...typedEventEmitter<{ loadNextDir: undefined, refresh: void }>()
|
||||
}
|
||||
})
|
||||
|
||||
|
|
@ -240,7 +242,7 @@ export function usePreview (props: Props) {
|
|||
|
||||
export function useLocation (props: Props) {
|
||||
const np = ref<Progress.NProgress>()
|
||||
const { installedBaiduyun, scroller, stackViewEl, stack, currPage, currLocation, basePath, sortMethod } = useHookShareState().toRefs()
|
||||
const { installedBaiduyun, scroller, stackViewEl, stack, currPage, currLocation, basePath, sortMethod, useEventListen } = useHookShareState().toRefs()
|
||||
|
||||
watch(() => stack.value.length, debounce((v, lv) => {
|
||||
if (v !== lv) {
|
||||
|
|
@ -370,20 +372,29 @@ export function useLocation (props: Props) {
|
|||
|
||||
|
||||
const refresh = async () => {
|
||||
if (stack.value.length === 1) {
|
||||
const resp = await getTargetFolderFiles(props.target, '/')
|
||||
stack.value = [
|
||||
{
|
||||
files: resp.files,
|
||||
curr: '/'
|
||||
}
|
||||
]
|
||||
} else {
|
||||
const last = currPage.value
|
||||
stack.value.pop()
|
||||
await openNext(currPage.value?.files.find((v) => v.name === last?.curr)!)
|
||||
try {
|
||||
np.value?.start()
|
||||
if (stack.value.length === 1) {
|
||||
const resp = await getTargetFolderFiles(props.target, '/')
|
||||
stack.value = [
|
||||
{
|
||||
files: resp.files,
|
||||
curr: '/'
|
||||
}
|
||||
]
|
||||
} else {
|
||||
const { files } = await getTargetFolderFiles(props.target, currLocation.value)
|
||||
last(stack.value)!.files = files
|
||||
}
|
||||
} finally {
|
||||
np.value?.done()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
useEventListen.value('refresh', refresh)
|
||||
|
||||
|
||||
return {
|
||||
refresh,
|
||||
copyLocation,
|
||||
|
|
@ -502,7 +513,7 @@ export function useFilesDisplay (props: Props) {
|
|||
|
||||
|
||||
export function useFileTransfer (props: Props) {
|
||||
const { currLocation, sortedFiles, currPage, multiSelectedIdxs } = useHookShareState().toRefs()
|
||||
const { currLocation, sortedFiles, currPage, multiSelectedIdxs, eventEmitter } = useHookShareState().toRefs()
|
||||
const recover = () => {
|
||||
multiSelectedIdxs.value = []
|
||||
}
|
||||
|
|
@ -526,6 +537,7 @@ export function useFileTransfer (props: Props) {
|
|||
JSON.stringify({
|
||||
from: props.target,
|
||||
includeDir,
|
||||
loc: currLocation.value,
|
||||
path: uniqBy(files, 'fullpath').map(f => f.fullpath)
|
||||
})
|
||||
)
|
||||
|
|
@ -535,32 +547,51 @@ export function useFileTransfer (props: Props) {
|
|||
type Data = {
|
||||
from: typeof props.target
|
||||
path: string[],
|
||||
loc: string
|
||||
includeDir: boolean
|
||||
}
|
||||
const data = JSON.parse(e.dataTransfer?.getData('text') || '{}') as Data
|
||||
console.log(data)
|
||||
if (data.from && data.path && typeof data.includeDir !== 'undefined') {
|
||||
if (data.from === props.target) {
|
||||
if (data.from && data.path && typeof data.includeDir !== 'undefined' && data.loc) {
|
||||
const toPath = currLocation.value
|
||||
if (data.from === props.target && data.loc === toPath) {
|
||||
return
|
||||
}
|
||||
const type = data.from === 'local' ? 'upload' : 'download'
|
||||
const typeZH = type === 'upload' ? '上传' : '下载'
|
||||
const toPath = currLocation.value
|
||||
const content = h('div', [
|
||||
h('div', `从 ${props.target !== 'local' ? '本地' : '云盘'} `),
|
||||
h('ol', data.path.map(v => v.split(/[/\\]/).pop()).map(v => h('li', v))),
|
||||
h('div', `${typeZH} ${props.target === 'local' ? '本地' : '云盘'} ${toPath}`)
|
||||
])
|
||||
Modal.confirm({
|
||||
title: `确定创建${typeZH}任务${data.includeDir ? ', 这是文件夹或者包含文件夹!' : ''}`,
|
||||
content,
|
||||
maskClosable: true,
|
||||
async onOk () {
|
||||
await global.createTaskRecordPaneIfNotExist(props.tabIdx)
|
||||
console.log('request createNewTask', { send_dirs: data.path, recv_dir: toPath, type })
|
||||
taskListStore.pendingBaiduyunTaskQueue.push({ send_dirs: data.path, recv_dir: toPath, type })
|
||||
}
|
||||
})
|
||||
if (props.target == data.from) {
|
||||
const content = h('div', [
|
||||
h('div', `下列文件移动至${toPath}`),
|
||||
h('ol', data.path.map(v => v.split(/[/\\]/).pop()).map(v => h('li', v))),
|
||||
])
|
||||
Modal.confirm({
|
||||
title: `确定?`,
|
||||
content,
|
||||
maskClosable: true,
|
||||
async onOk () {
|
||||
await moveFiles(props.target, data.path, toPath)
|
||||
events.emit('removeFiles', [data.path, data.loc])
|
||||
await eventEmitter.value.emit('refresh')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
const type = data.from === 'local' ? 'upload' : 'download'
|
||||
const typeZH = type === 'upload' ? '上传' : '下载'
|
||||
const content = h('div', [
|
||||
h('div', `从 ${props.target !== 'local' ? '本地' : '云盘'} `),
|
||||
h('ol', data.path.map(v => v.split(/[/\\]/).pop()).map(v => h('li', v))),
|
||||
h('div', `${typeZH} ${props.target === 'local' ? '本地' : '云盘'} ${toPath}`)
|
||||
])
|
||||
Modal.confirm({
|
||||
title: `确定创建${typeZH}任务${data.includeDir ? ', 这是文件夹或者包含文件夹!' : ''}`,
|
||||
content,
|
||||
maskClosable: true,
|
||||
async onOk () {
|
||||
await global.createTaskRecordPaneIfNotExist(props.tabIdx)
|
||||
console.log('request createNewTask', { send_dirs: data.path, recv_dir: toPath, type })
|
||||
taskListStore.pendingBaiduyunTaskQueue.push({ send_dirs: data.path, recv_dir: toPath, type })
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return {
|
||||
|
|
@ -575,7 +606,20 @@ export function useFileTransfer (props: Props) {
|
|||
export function useFileItemActions (props: Props, { openNext }: { openNext: (file: FileNodeInfo) => Promise<void> }) {
|
||||
const showGenInfo = ref(false)
|
||||
const imageGenInfo = ref('')
|
||||
const { sortedFiles, previewIdx, multiSelectedIdxs, stack } = useHookShareState().toRefs()
|
||||
const { sortedFiles, previewIdx, multiSelectedIdxs, stack, currLocation } = useHookShareState().toRefs()
|
||||
|
||||
useEventListen('removeFiles', ([paths, loc]: [paths: string[], loc: string]) => {
|
||||
if (loc !== currLocation.value) {
|
||||
return
|
||||
}
|
||||
const top = last(stack.value)!
|
||||
top.files = top.files.filter(v => !paths.includes(v.fullpath))
|
||||
if (top.walkFiles) {
|
||||
top.walkFiles = top.walkFiles.map(files => files.filter(file => !paths.includes(file.fullpath)))
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
const q = reactive(new FetchQueue())
|
||||
const onFileItemClick = async (e: MouseEvent, file: FileNodeInfo) => {
|
||||
const files = sortedFiles.value
|
||||
|
|
@ -641,11 +685,7 @@ export function useFileItemActions (props: Props, { openNext }: { openNext: (fil
|
|||
const paths = selectedFiles.map(v => v.fullpath)
|
||||
await deleteFiles(props.target, paths)
|
||||
message.success('删除成功')
|
||||
const top = last(stack.value)!
|
||||
top.files = top.files.filter(v => !paths.includes(v.fullpath))
|
||||
if (top.walkFiles) {
|
||||
top.walkFiles = top.walkFiles.map(files => files.filter(file => !paths.includes(file.fullpath)))
|
||||
}
|
||||
events.emit('removeFiles', [paths, currLocation.value])
|
||||
},
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -135,6 +135,7 @@ const { previewIdx, onPreviewVisibleChange, previewing, previewImgMove, canPrevi
|
|||
<RecycleScroller class="file-list" :items="sortedFiles" :prerender="10" ref="scroller" @scroll="onScroll"
|
||||
:item-size="itemSize.first" key-field="fullpath" :item-secondary-size="itemSize.second" :gridItems="gridItems">
|
||||
<template v-slot="{ item: file, index: idx }">
|
||||
<!-- idx 和file有可能丢失 -->
|
||||
<a-dropdown :trigger="['contextmenu']">
|
||||
<li class="file"
|
||||
:class="{ clickable: file.type === 'dir', selected: multiSelectedIdxs.includes(idx), grid: viewMode === 'grid' || viewMode === 'large-size-grid', 'large-grid': viewMode === 'large-size-grid' }"
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import type { GlobalConf, UploadTaskSummary } from '@/api'
|
|||
import type { UserInfo } from '@/api/user'
|
||||
import type { getAutoCompletedTagList } from '@/page/taskRecord/autoComplete'
|
||||
import type { ReturnTypeAsync } from '@/util'
|
||||
import { uniqueId } from 'lodash'
|
||||
import { uniqueId } from 'lodash-es'
|
||||
import { defineStore } from 'pinia'
|
||||
import { nextTick } from 'vue'
|
||||
import { ref } from 'vue'
|
||||
|
|
|
|||
|
|
@ -2491,11 +2491,6 @@ slash@^3.0.0:
|
|||
resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634"
|
||||
integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==
|
||||
|
||||
sortablejs@1.14.0:
|
||||
version "1.14.0"
|
||||
resolved "https://registry.yarnpkg.com/sortablejs/-/sortablejs-1.14.0.tgz#6d2e17ccbdb25f464734df621d4f35d4ab35b3d8"
|
||||
integrity sha512-pBXvQCs5/33fdN1/39pPL0NZF20LeRbLQ5jtnheIPN9JQAaufGjKdWduZn4U7wCtVuzKhmRkI0DFYHYRbB2H1w==
|
||||
|
||||
"source-map-js@>=0.6.2 <2.0.0", source-map-js@^1.0.2:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c"
|
||||
|
|
@ -2835,13 +2830,6 @@ vue@^3.2.47:
|
|||
"@vue/server-renderer" "3.2.47"
|
||||
"@vue/shared" "3.2.47"
|
||||
|
||||
vuedraggable@^4.1.0:
|
||||
version "4.1.0"
|
||||
resolved "https://registry.yarnpkg.com/vuedraggable/-/vuedraggable-4.1.0.tgz#edece68adb8a4d9e06accff9dfc9040e66852270"
|
||||
integrity sha512-FU5HCWBmsf20GpP3eudURW3WdWTKIbEIQxh9/8GE806hydR9qZqRRxRE3RjqX7PkuLuMQG/A7n3cfj9rCEchww==
|
||||
dependencies:
|
||||
sortablejs "1.14.0"
|
||||
|
||||
warning@^4.0.0:
|
||||
version "4.0.3"
|
||||
resolved "https://registry.yarnpkg.com/warning/-/warning-4.0.3.tgz#16e9e077eb8a86d6af7d64aa1e05fd85b4678ca3"
|
||||
|
|
|
|||
Loading…
Reference in New Issue