mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 15:36:49 +08:00
fix aliyunpan ui
This commit is contained in:
@@ -112,6 +112,7 @@ async function load() {
|
|||||||
.replace(/{path}/g, encodeURIComponent(inProps.path || ''))
|
.replace(/{path}/g, encodeURIComponent(inProps.path || ''))
|
||||||
.replace(/{sort}/g, inProps.sort || 'name')
|
.replace(/{sort}/g, inProps.sort || 'name')
|
||||||
.replace(/{fileid}/g, inProps.fileid || '')
|
.replace(/{fileid}/g, inProps.fileid || '')
|
||||||
|
.replace(/{filetype}/g, isDir.value ? 'dir' : 'file')
|
||||||
const config = {
|
const config = {
|
||||||
url,
|
url,
|
||||||
method: inProps.endpoints?.list.method || 'get',
|
method: inProps.endpoints?.list.method || 'get',
|
||||||
@@ -134,7 +135,7 @@ async function deleteItem(item: FileItem) {
|
|||||||
const url = inProps.endpoints?.delete.url
|
const url = inProps.endpoints?.delete.url
|
||||||
.replace(/{storage}/g, inProps.storage)
|
.replace(/{storage}/g, inProps.storage)
|
||||||
.replace(/{path}/g, encodeURIComponent(item.path))
|
.replace(/{path}/g, encodeURIComponent(item.path))
|
||||||
.replace(/{fileid}/g, inProps.fileid || '')
|
.replace(/{fileid}/g, item.fileid || '')
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
url,
|
url,
|
||||||
@@ -151,6 +152,7 @@ async function deleteItem(item: FileItem) {
|
|||||||
|
|
||||||
// 切换路径
|
// 切换路径
|
||||||
function changePath(item: FileItem) {
|
function changePath(item: FileItem) {
|
||||||
|
item.path = inProps.path + item.name + (item.type === 'dir' ? '/' : '')
|
||||||
emit('pathchanged', item)
|
emit('pathchanged', item)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -191,8 +193,9 @@ async function rename() {
|
|||||||
const url = inProps.endpoints?.rename.url
|
const url = inProps.endpoints?.rename.url
|
||||||
.replace(/{storage}/g, inProps.storage)
|
.replace(/{storage}/g, inProps.storage)
|
||||||
.replace(/{path}/g, encodeURIComponent(currentItem.value?.path || ''))
|
.replace(/{path}/g, encodeURIComponent(currentItem.value?.path || ''))
|
||||||
.replace(/{fileid}/g, inProps.fileid || '')
|
.replace(/{fileid}/g, currentItem.value?.fileid || '')
|
||||||
.replace(/{newname}/g, encodeURIComponent(newName.value))
|
.replace(/{newname}/g, encodeURIComponent(newName.value))
|
||||||
|
.replace(/{filetype}/g, currentItem.value?.type || 'file')
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
url,
|
url,
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ const sortIcon = computed(() => {
|
|||||||
variant="text"
|
variant="text"
|
||||||
:input-value="index === pathSegments.length - 1"
|
:input-value="index === pathSegments.length - 1"
|
||||||
class="px-1 d-none d-md-block"
|
class="px-1 d-none d-md-block"
|
||||||
@click="changePath(segment.path, inProps.fileidstack[index])"
|
@click="changePath(segment.path, inProps.fileidstack[index + 1])"
|
||||||
>
|
>
|
||||||
<VIcon icon=" mdi-chevron-right" />
|
<VIcon icon=" mdi-chevron-right" />
|
||||||
{{ segment.name }}
|
{{ segment.name }}
|
||||||
|
|||||||
@@ -32,13 +32,15 @@ const treeItems = ref<FileItem[]>([
|
|||||||
extension: '',
|
extension: '',
|
||||||
size: 0,
|
size: 0,
|
||||||
modify_time: 0,
|
modify_time: 0,
|
||||||
|
fileid: '',
|
||||||
|
parent_fileid: '',
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
|
|
||||||
// 拉取子目录
|
// 拉取子目录
|
||||||
async function fetchDirs(item: any) {
|
async function fetchDirs(item: any) {
|
||||||
return api
|
return api
|
||||||
.get('/filebrowser/listdir?path=' + item.path)
|
.get('/filebrowser/local/listdir?path=' + item.path)
|
||||||
.then((data: any) => {
|
.then((data: any) => {
|
||||||
item.children.push(...data)
|
item.children.push(...data)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import FileBrowser from '@/components/FileBrowser.vue'
|
|||||||
|
|
||||||
const endpoints = {
|
const endpoints = {
|
||||||
list: {
|
list: {
|
||||||
url: '/filebrowser/{storage}/list?path={path}&sort={sort}&fileid={fileid}',
|
url: '/filebrowser/{storage}/list?path={path}&sort={sort}&fileid={fileid}&filetype={filetype}',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
},
|
},
|
||||||
mkdir: {
|
mkdir: {
|
||||||
@@ -25,7 +25,7 @@ const endpoints = {
|
|||||||
method: 'get',
|
method: 'get',
|
||||||
},
|
},
|
||||||
rename: {
|
rename: {
|
||||||
url: '/filebrowser/{storage}/rename?path={path}&new_name={newname}&fileid={fileid}',
|
url: '/filebrowser/{storage}/rename?path={path}&new_name={newname}&fileid={fileid}&filetype={filetype}',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -93,6 +93,7 @@ async function loadDownloadDirectories() {
|
|||||||
function pathChanged(item: FileItem) {
|
function pathChanged(item: FileItem) {
|
||||||
path.value = item.path
|
path.value = item.path
|
||||||
fileid.value = item.fileid
|
fileid.value = item.fileid
|
||||||
|
if (item.fileid == 'root') return
|
||||||
if (fileidstack.value.includes(item.fileid)) {
|
if (fileidstack.value.includes(item.fileid)) {
|
||||||
fileidstack.value = fileidstack.value.slice(0, fileidstack.value.indexOf(item.fileid) + 1)
|
fileidstack.value = fileidstack.value.slice(0, fileidstack.value.indexOf(item.fileid) + 1)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user