mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-28 01:36:56 +08:00
parent
9cba19d4db
commit
79556affbd
2 changed files with 6 additions and 2 deletions
|
|
@ -623,7 +623,7 @@ const fileCreate = reactive({ path: '/', isDir: false, mode: 0o755 });
|
||||||
const fileCompress = reactive({ files: [''], name: '', dst: '', operate: 'compress' });
|
const fileCompress = reactive({ files: [''], name: '', dst: '', operate: 'compress' });
|
||||||
const fileDeCompress = reactive({ path: '', name: '', dst: '', mimeType: '' });
|
const fileDeCompress = reactive({ path: '', name: '', dst: '', mimeType: '' });
|
||||||
const fileEdit = reactive({ content: '', path: '', name: '', language: 'plaintext', extension: '' });
|
const fileEdit = reactive({ content: '', path: '', name: '', language: 'plaintext', extension: '' });
|
||||||
const filePreview = reactive({ path: '', name: '', extension: '', fileType: '', imageFiles: [] });
|
const filePreview = reactive({ path: '', name: '', extension: '', fileType: '', imageFiles: [], currentNode: '' });
|
||||||
const codeReq = reactive({ path: '', expand: false, page: 1, pageSize: 100, isDetail: false });
|
const codeReq = reactive({ path: '', expand: false, page: 1, pageSize: 100, isDetail: false });
|
||||||
const fileUpload = reactive({ path: '' });
|
const fileUpload = reactive({ path: '' });
|
||||||
const fileRename = reactive({ path: '', oldName: '' });
|
const fileRename = reactive({ path: '', oldName: '' });
|
||||||
|
|
@ -1081,6 +1081,7 @@ const openPreview = (item: File.File, fileType: string) => {
|
||||||
filePreview.extension = item.extension;
|
filePreview.extension = item.extension;
|
||||||
filePreview.fileType = fileType;
|
filePreview.fileType = fileType;
|
||||||
filePreview.imageFiles = imageFiles.value;
|
filePreview.imageFiles = imageFiles.value;
|
||||||
|
filePreview.currentNode = globalStore.currentNode;
|
||||||
|
|
||||||
previewRef.value.acceptParams(filePreview);
|
previewRef.value.acceptParams(filePreview);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -101,6 +101,7 @@ interface EditProps {
|
||||||
name: string;
|
name: string;
|
||||||
extension: string;
|
extension: string;
|
||||||
imageFiles: [];
|
imageFiles: [];
|
||||||
|
currentNode: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const open = ref(false);
|
const open = ref(false);
|
||||||
|
|
@ -109,6 +110,7 @@ const filePath = ref('');
|
||||||
const fileName = ref('');
|
const fileName = ref('');
|
||||||
const fileType = ref('');
|
const fileType = ref('');
|
||||||
const fileUrl = ref('');
|
const fileUrl = ref('');
|
||||||
|
const currentNode = ref('');
|
||||||
const imageFiles = ref([]);
|
const imageFiles = ref([]);
|
||||||
|
|
||||||
const fileExtension = ref('');
|
const fileExtension = ref('');
|
||||||
|
|
@ -140,7 +142,7 @@ const getDownloadUrl = (path: string) => {
|
||||||
const baseUrl = `${import.meta.env.VITE_API_URL as string}/files/download`;
|
const baseUrl = `${import.meta.env.VITE_API_URL as string}/files/download`;
|
||||||
const encodedPath = encodeURIComponent(path);
|
const encodedPath = encodeURIComponent(path);
|
||||||
const timestamp = new Date().getTime();
|
const timestamp = new Date().getTime();
|
||||||
return `${baseUrl}?path=${encodedPath}×tamp=${timestamp}`;
|
return `${baseUrl}?operateNode=${currentNode.value}&path=${encodedPath}×tamp=${timestamp}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
const acceptParams = (props: EditProps) => {
|
const acceptParams = (props: EditProps) => {
|
||||||
|
|
@ -149,6 +151,7 @@ const acceptParams = (props: EditProps) => {
|
||||||
fileName.value = props.name;
|
fileName.value = props.name;
|
||||||
filePath.value = props.path;
|
filePath.value = props.path;
|
||||||
fileType.value = props.fileType;
|
fileType.value = props.fileType;
|
||||||
|
currentNode.value = props.currentNode;
|
||||||
isFullscreen.value = fileType.value === 'excel';
|
isFullscreen.value = fileType.value === 'excel';
|
||||||
|
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue