mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-27 12:39:01 +08:00
parent
5b00286e65
commit
cf8aa86a67
@ -550,6 +550,11 @@ const top = () => {
|
||||
};
|
||||
|
||||
const jump = async (url: string) => {
|
||||
const fileName = url.substring(url.lastIndexOf('/') + 1);
|
||||
let filePath = url.substring(0, url.lastIndexOf('/') + 1);
|
||||
if (!url.includes('.')) {
|
||||
filePath = url;
|
||||
}
|
||||
history.splice(pointer + 1);
|
||||
history.push(url);
|
||||
pointer = history.length - 1;
|
||||
@ -558,7 +563,7 @@ const jump = async (url: string) => {
|
||||
const oldPageSize = req.pageSize;
|
||||
// reset search params before exec jump
|
||||
Object.assign(req, initData());
|
||||
req.path = url;
|
||||
req.path = filePath;
|
||||
req.containSub = false;
|
||||
req.search = '';
|
||||
req.pageSize = oldPageSize;
|
||||
@ -571,6 +576,14 @@ const jump = async (url: string) => {
|
||||
MsgWarning(i18n.global.t('commons.res.notFound'));
|
||||
return;
|
||||
}
|
||||
if (fileName && fileName.length > 1 && fileName.includes('.')) {
|
||||
const fileData = searchResult.data.items.filter((item) => item.name === fileName);
|
||||
if (fileData && fileData.length === 1) {
|
||||
openView(fileData[0]);
|
||||
} else {
|
||||
MsgWarning(i18n.global.t('commons.res.notFound'));
|
||||
}
|
||||
}
|
||||
handleSearchResult(searchResult);
|
||||
getPaths(req.path);
|
||||
nextTick(function () {
|
||||
|
Loading…
Reference in New Issue
Block a user