不再强制要求安装百度云依赖,只有等需要时才提示
parent
7033d1f57f
commit
5ca4fada9d
|
|
@ -6,8 +6,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-cba93bef.js"></script>
|
||||
<link rel="stylesheet" href="/baidu_netdisk/fe-static/assets/index-bca67b7d.css">
|
||||
<script type="module" crossorigin src="/baidu_netdisk/fe-static/assets/index-b129b19c.js"></script>
|
||||
<link rel="stylesheet" href="/baidu_netdisk/fe-static/assets/index-f3d71b55.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="zanllp_dev_gradio_fe"></div>
|
||||
|
|
|
|||
|
|
@ -15,6 +15,13 @@ from PIL import Image
|
|||
from io import BytesIO
|
||||
import hashlib
|
||||
|
||||
from scripts.bin import (
|
||||
bin_file_name,
|
||||
get_matched_summary,
|
||||
check_bin_exists,
|
||||
download_bin_file,
|
||||
)
|
||||
|
||||
from scripts.bin import (
|
||||
check_bin_exists,
|
||||
cwd,
|
||||
|
|
@ -368,4 +375,17 @@ def baidu_netdisk_api(_: Any, app: FastAPI):
|
|||
for path in req.paths:
|
||||
res[path] = os.path.exists(path)
|
||||
return res
|
||||
|
||||
|
||||
not_exists_msg = ()
|
||||
|
||||
@app.get(pre + '/baiduyun_exists')
|
||||
async def baiduyun_exists():
|
||||
return check_bin_exists()
|
||||
|
||||
@app.post(pre + '/download_baiduyun')
|
||||
async def download_baiduyun():
|
||||
if not check_bin_exists():
|
||||
try:
|
||||
download_bin_file()
|
||||
except:
|
||||
raise HTTPException(500, detail=f"安装失败,找不到{bin_file_name},尝试手动从 {get_matched_summary()[1]} 或者 {get_matched_summary()[2]} 下载,下载后放到 {cwd} 文件夹下,重启界面")
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +0,0 @@
|
|||
import{d as f,j as x,k as C,n as o,p as n,q as l,az as t,aU as i,cs as S,aJ as g,ad as v,aK as y,x as _,aR as I,aA as w,aB as B,A as D}from"./index-cba93bef.js";const k=c=>(w("data-v-cafd544a"),c=c(),B(),c),L={class:"container"},q=k(()=>t("h1",null," 欢迎 ",-1)),N={key:0,class:"record-restore"},R=k(()=>t("h2",null,"启动",-1)),$=["onClick"],j=k(()=>t("h2",null,"最近",-1)),A=["onClick"],E=f({__name:"emptyStartup",props:{tabIdx:null,paneIdx:null},setup(c){const h=c,r=x(),d={"auto-upload":"自动上传",local:"本地文件",netdisk:"百度云","task-record":"任务记录"},b=(a,p)=>{let s;switch(a){case"auto-upload":case"task-record":case"empty":s={type:a,name:d[a],key:Date.now()+I.uniqueId()};break;case"local":case"netdisk":s={type:a,name:d[a],key:Date.now()+I.uniqueId(),target:a,path:p}}const e=r.tabList[h.tabIdx];e.panes.splice(h.paneIdx,1,s),e.key=s.key},m=C(()=>{var a;return(a=r.lastTabListRecord)==null?void 0:a[1]});return(a,p)=>{var s;return o(),n("div",L,[q,(s=l(m))!=null&&s.tabs?(o(),n("div",N,[t("a",{onClick:p[0]||(p[0]=i(e=>l(r).tabList=l(m).tabs.map(u=>l(S)(u,!0)),["prevent"]))},"还原上次记录")])):g("",!0),t("ul",null,[R,(o(!0),n(v,null,y(Object.keys(d),e=>(o(),n("li",{key:e},[t("a",{onClick:i(u=>b(e),["prevent"])},_(d[e]),9,$)]))),128))]),t("ul",null,[j,(o(!0),n(v,null,y(l(r).recent,e=>(o(),n("li",{key:e.key},[t("a",{onClick:i(u=>b(e.target,e.path),["prevent"])},_(e.target==="local"?"本地":"云盘")+" : "+_(e.path),9,A)]))),128))])])}}});const T=D(E,[["__scopeId","data-v-cafd544a"]]);export{T as default};
|
||||
|
|
@ -0,0 +1 @@
|
|||
.container[data-v-99f24d22]{margin:32px}.quick-start[data-v-99f24d22]{display:flex;flex-wrap:wrap;margin-top:64px}.quick-start ul[data-v-99f24d22]{flex-shrink:0;padding:16px 0;list-style:none;margin-right:20%;width:512px}.quick-start ul li[data-v-99f24d22]{padding:4px 0}
|
||||
|
|
@ -1 +0,0 @@
|
|||
.container[data-v-cafd544a]{margin:32px}ul[data-v-cafd544a]{padding:16px 0;list-style:none}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
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,g as Be,B as Oe,I as P,h as Ie,j as Fe,k as Ne,l as $e,r as ie,E as Ve}from"./index-633d24a9.js";import{d as X,u as te,k as q,a as S,c as R,_ as f,e as ce,P as je,r as F,B as Ee,bp as ke,F as Te,C as ne,h as ae,g as De,Z,O as Ge,X as _e,Y as J,o as Le,a3 as Ue,bq as Ze,br as He,a1 as Re,V as Ye,l as qe,U as ee,I as de,ah as Xe,K as Ke}from"./index-cba93bef.js";const Qe=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,H=/\bAndroid(?:.+)SD4930UR\b/i,W=/\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(H,e),tablet:!r(H,e)&&r(W,e),device:r(H,e)||r(W,e)},android:{phone:!r(k,e)&&r(H,e)||!r(k,e)&&r(le,e),tablet:!r(k,e)&&!r(H,e)&&!r(le,e)&&(r(W,e)||r(me,e)),device:!r(k,e)&&(r(H,e)||r(W,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 We=f(f({},ze()),{},{isMobile:ze});const Je=We;var et=["disabled","loading","addonAfter","suffix"];const tt=X({compatConfig:{MODE:3},name:"AInputSearch",inheritAttrs:!1,props:f(f({},Pe()),{},{inputPrefixCls:String,enterButton:je.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,K=e.suffix,Q=K===void 0?(u=a.suffix)===null||u===void 0?void 0:u.call(a):K,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(ke,null,null):null,x="".concat(E.value,"-button"),z=Array.isArray(t)?t[0]:t,T,U=z.type&&Be(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(Oe,{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:Q,onChange:y,class:G,disabled:B}),a)}}});var nt=`
|
||||
import{i as Pe,g as Be,B as Oe,I as P,h as Ie,j as Fe,k as Ne,l as $e,r as ie,E as Ve}from"./index-baae1092.js";import{d as X,u as te,k as q,a as S,c as R,_ as f,e as ce,P as je,r as F,B as Ee,bs as ke,F as Te,C as ne,h as ae,g as De,Z,O as Ge,X as _e,Y as J,o as Le,a3 as Ue,bt as Ze,bu as He,a1 as Re,V as Ye,l as qe,U as ee,I as de,ah as Xe,K as Ke}from"./index-b129b19c.js";const Qe=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,H=/\bAndroid(?:.+)SD4930UR\b/i,W=/\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(H,e),tablet:!r(H,e)&&r(W,e),device:r(H,e)||r(W,e)},android:{phone:!r(k,e)&&r(H,e)||!r(k,e)&&r(le,e),tablet:!r(k,e)&&!r(H,e)&&!r(le,e)&&(r(W,e)||r(me,e)),device:!r(k,e)&&(r(H,e)||r(W,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 We=f(f({},ze()),{},{isMobile:ze});const Je=We;var et=["disabled","loading","addonAfter","suffix"];const tt=X({compatConfig:{MODE:3},name:"AInputSearch",inheritAttrs:!1,props:f(f({},Pe()),{},{inputPrefixCls:String,enterButton:je.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,K=e.suffix,Q=K===void 0?(u=a.suffix)===null||u===void 0?void 0:u.call(a):K,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(ke,null,null):null,x="".concat(E.value,"-button"),z=Array.isArray(t)?t[0]:t,T,U=z.type&&Be(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(Oe,{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:Q,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
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -5,8 +5,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-cba93bef.js"></script>
|
||||
<link rel="stylesheet" href="/baidu_netdisk/fe-static/assets/index-bca67b7d.css">
|
||||
<script type="module" crossorigin src="/baidu_netdisk/fe-static/assets/index-b129b19c.js"></script>
|
||||
<link rel="stylesheet" href="/baidu_netdisk/fe-static/assets/index-f3d71b55.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="zanllp_dev_gradio_fe"></div>
|
||||
|
|
|
|||
|
|
@ -183,4 +183,7 @@ export const autoUploadOutput = async (recv_dir: string) => {
|
|||
task_summary: UploadTaskSummary
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const checkBaiduyunExists = () => axiosInst.get('/baiduyun_exists').then(v => v.data as boolean)
|
||||
export const downloadBaiduyun = () => axiosInst.post('/download_baiduyun')
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
import { useGlobalStore } from '@/store/useGlobalStore'
|
||||
import { useTaskListStore } from '@/store/useTaskListStore'
|
||||
import { computedAsync } from '@vueuse/core'
|
||||
import { ref } from 'vue'
|
||||
|
||||
import { downloadBaiduyun } from '@/api'
|
||||
import { isAxiosError } from 'axios'
|
||||
export const useBaiduyun = () => {
|
||||
|
||||
const taskListStore = useTaskListStore()
|
||||
const installedBaiduyun = computedAsync(taskListStore.checkBaiduyunInstalled, false)
|
||||
const baiduyunLoading = ref(false)
|
||||
const failedHint = ref('')
|
||||
const installBaiduyunBin = async () => {
|
||||
try {
|
||||
failedHint.value = ''
|
||||
baiduyunLoading.value = true
|
||||
await downloadBaiduyun()
|
||||
taskListStore.baiduyunInstalled = null
|
||||
await taskListStore.checkBaiduyunInstalled()
|
||||
} catch (e) {
|
||||
if (isAxiosError(e)) {
|
||||
failedHint.value = e.response?.data.detail ?? 'error'
|
||||
}
|
||||
} finally {
|
||||
baiduyunLoading.value = false
|
||||
}
|
||||
}
|
||||
return {
|
||||
installBaiduyunBin,
|
||||
installedBaiduyun,
|
||||
failedHint,
|
||||
baiduyunLoading
|
||||
}
|
||||
}
|
||||
|
|
@ -7,6 +7,7 @@ import { FileOutlined, FolderOpenOutlined, DownOutlined, LeftCircleOutlined, Rig
|
|||
import { sortMethodMap, sortFiles, SortMethod } from './fileSort'
|
||||
import path from 'path-browserify'
|
||||
import { useGlobalStore, type FileTransferTabPane } from '@/store/useGlobalStore'
|
||||
import { useBaiduyun } from './hook'
|
||||
import { copy2clipboard, ok, type SearchSelectConv, SearchSelect, useWatchDocument, fallbackImage, delay, Task, FetchQueue } from 'vue3-ts-util'
|
||||
// @ts-ignore
|
||||
import NProgress from 'multi-nprogress'
|
||||
|
|
@ -21,6 +22,8 @@ import { RecycleScroller } from 'vue-virtual-scroller'
|
|||
import 'vue-virtual-scroller/dist/vue-virtual-scroller.css'
|
||||
import type { MenuInfo } from 'ant-design-vue/lib/menu/src/interface'
|
||||
|
||||
|
||||
const global = useGlobalStore()
|
||||
const el = ref<HTMLDivElement>()
|
||||
const props = defineProps<{
|
||||
target: 'local' | 'netdisk',
|
||||
|
|
@ -36,7 +39,7 @@ interface FileNodeInfoR extends FileNodeInfo {
|
|||
fullpath: string
|
||||
}
|
||||
type ViewMode = 'line' | 'grid' | 'large-size-grid'
|
||||
const global = useGlobalStore()
|
||||
const { installBaiduyunBin, installedBaiduyun, failedHint, baiduyunLoading } = useBaiduyun()
|
||||
const { currLocation, currPage, refresh, copyLocation, back, openNext, stack, to, scroller } = useLocation()
|
||||
const { gridItems, sortMethodConv, moreActionsDropdownShow, sortedFiles, sortMethod, viewMode, gridSize, viewModeMap, largeGridSize } = useFilesDisplay()
|
||||
const { onDrop, onFileDragStart, multiSelectedIdxs } = useFileTransfer()
|
||||
|
|
@ -46,6 +49,7 @@ const { previewIdx, onPreviewVisibleChange, previewing, previewImgMove, canPrevi
|
|||
const toRawFileUrl = (file: FileNodeInfoR, download = false) => `/baidu_netdisk/file?filename=${encodeURIComponent(file.fullpath)}${download ? `&disposition=${encodeURIComponent(file.name)}` : ''}`
|
||||
const toImageThumbnailUrl = (file: FileNodeInfoR, size = '256,256') => `/baidu_netdisk/image-thumbnail?path=${encodeURIComponent(file.fullpath)}&size=${size}`
|
||||
|
||||
|
||||
function usePreview () {
|
||||
const previewIdx = ref(-1)
|
||||
const previewing = ref(false)
|
||||
|
|
@ -172,6 +176,9 @@ function useLocation () {
|
|||
}, 300))
|
||||
|
||||
onMounted(async () => {
|
||||
if (props.target === 'netdisk' && installedBaiduyun.value) {
|
||||
return
|
||||
}
|
||||
const resp = await getTargetFolderFiles(props.target, '/')
|
||||
stack.value.push({
|
||||
files: resp.files,
|
||||
|
|
@ -186,6 +193,16 @@ function useLocation () {
|
|||
}
|
||||
})
|
||||
|
||||
watch(() => props.target === 'netdisk' && installedBaiduyun.value, async v => {
|
||||
if (v) {
|
||||
const resp = await getTargetFolderFiles(props.target, '/')
|
||||
stack.value = [{
|
||||
files: resp.files,
|
||||
curr: '/'
|
||||
}]
|
||||
}
|
||||
})
|
||||
|
||||
const getBasePath = () =>
|
||||
stack.value.map((v) => v.curr).slice(global.conf?.is_win && props.target === 'local' ? 1 : 0)
|
||||
|
||||
|
|
@ -432,13 +449,18 @@ function useFileItemActions () {
|
|||
</script>
|
||||
<template>
|
||||
<ASelect style="display: none;"></ASelect>
|
||||
<div ref="el" @dragover.prevent @drop.prevent="onDrop($event)" class="container">
|
||||
<div v-if="props.target === 'netdisk' && !installedBaiduyun" class="uninstalled-hint">
|
||||
<div>尚未安装依赖,当前不可用</div>
|
||||
<AButton type="primary" :loading="baiduyunLoading" @click="installBaiduyunBin">点此安装</AButton>
|
||||
<p v-if="failedHint">{{ failedHint }}</p>
|
||||
</div>
|
||||
<div ref="el" @dragover.prevent @drop.prevent="onDrop($event)" class="container" v-else>
|
||||
<AModal v-model:visible="showGenInfo" width="50vw">
|
||||
<ASkeleton active :loading="!q.isIdle">
|
||||
<pre style="width: 100%; word-break: break-all;white-space: pre-line;" @dblclick="copy2clipboard(imageGenInfo)">
|
||||
双击复制
|
||||
{{ imageGenInfo }}
|
||||
</pre>
|
||||
双击复制
|
||||
{{ imageGenInfo }}
|
||||
</pre>
|
||||
</ASkeleton>
|
||||
</AModal>
|
||||
<div class="location-bar">
|
||||
|
|
@ -466,19 +488,21 @@ function useFileItemActions () {
|
|||
</template>
|
||||
</a-dropdown>
|
||||
|
||||
<a-dropdown :trigger="['click']" v-model:visible="moreActionsDropdownShow" placement="bottomLeft" :getPopupContainer="trigger => trigger.parentNode as HTMLDivElement">
|
||||
<a-dropdown :trigger="['click']" v-model:visible="moreActionsDropdownShow" placement="bottomLeft"
|
||||
:getPopupContainer="trigger => trigger.parentNode as HTMLDivElement">
|
||||
<a class="opt" @click.prevent>
|
||||
更多
|
||||
</a>
|
||||
<template #overlay>
|
||||
<div
|
||||
<div
|
||||
style=" width: 384px; background: white; padding: 16px; border-radius: 4px; box-shadow: 0 0 4px #aaa; border: 1px solid #aaa;">
|
||||
<a-form v-bind="{
|
||||
labelCol: { span: 6 },
|
||||
wrapperCol: { span: 18 }
|
||||
}">
|
||||
<a-form-item label="查看模式" >
|
||||
<search-select v-model:value="viewMode" @click.stop :conv="{ value: v => v, text: v => viewModeMap[v as ViewMode] }"
|
||||
<a-form-item label="查看模式">
|
||||
<search-select v-model:value="viewMode" @click.stop
|
||||
:conv="{ value: v => v, text: v => viewModeMap[v as ViewMode] }"
|
||||
:options="Object.keys(viewModeMap)" />
|
||||
</a-form-item>
|
||||
<a-form-item label="排序方法">
|
||||
|
|
@ -553,6 +577,19 @@ function useFileItemActions () {
|
|||
</div>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
.uninstalled-hint {
|
||||
margin: 256px auto;
|
||||
display: flex;
|
||||
flex-flow: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
&>* {
|
||||
margin: 16px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.preview-switch {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type { UploadTaskSummary, UploadTaskTickStatus } from '@/api'
|
||||
import { checkBaiduyunExists, type UploadTaskSummary, type UploadTaskTickStatus } from '@/api'
|
||||
import { defineStore } from 'pinia'
|
||||
import { reactive, ref } from 'vue'
|
||||
import { FetchQueue } from 'vue3-ts-util'
|
||||
|
|
@ -13,7 +13,16 @@ export const useTaskListStore = defineStore('useTaskListStore', () => {
|
|||
const tasks = ref<WithId<UploadTaskSummary>[]>([])
|
||||
|
||||
const showDirAutoCompletedIdx = ref(-1)
|
||||
const baiduyunInstalled = ref(null as null | Promise<boolean>)
|
||||
const checkBaiduyunInstalled = async () => {
|
||||
if (baiduyunInstalled.value === null) {
|
||||
baiduyunInstalled.value = checkBaiduyunExists()
|
||||
}
|
||||
return baiduyunInstalled.value
|
||||
}
|
||||
return {
|
||||
checkBaiduyunInstalled,
|
||||
baiduyunInstalled,
|
||||
pollInterval,
|
||||
taskLogMap,
|
||||
splitView,
|
||||
|
|
|
|||
Loading…
Reference in New Issue