Fix menu closing issue on file manager. #5615
Fix file path issue in import/export servers caused due to vulnerability fix.pull/5852/head
parent
e0b670f229
commit
53ae657cc9
|
|
@ -305,14 +305,18 @@ export class FileManagerUtils {
|
|||
}
|
||||
|
||||
async checkPermission(path) {
|
||||
let res = await this.api.post(this.fileConnectorUrl, {
|
||||
'path': path,
|
||||
'mode': 'permission',
|
||||
});
|
||||
if (res.data.data.result.Code === 1) {
|
||||
return null;
|
||||
} else {
|
||||
return res.data.data.result.Error;
|
||||
try {
|
||||
let res = await this.api.post(this.fileConnectorUrl, {
|
||||
'path': path,
|
||||
'mode': 'permission',
|
||||
});
|
||||
if (res.data.data.result.Code === 1) {
|
||||
return null;
|
||||
} else {
|
||||
return res.data.data.result.Error;
|
||||
}
|
||||
} catch (error) {
|
||||
return parseApiError(error);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -72,7 +72,6 @@ export function PgMenu({open, className='', label, menuButton=null, ...props}) {
|
|||
<ControlledMenu
|
||||
state={state}
|
||||
{...props}
|
||||
portal
|
||||
className={clsx(classes.menu, className)}
|
||||
aria-label={label || 'Menu'}
|
||||
data-state={state}
|
||||
|
|
|
|||
|
|
@ -147,6 +147,7 @@ function BrowserTree(props) {
|
|||
open={Boolean(contextPos) && contextMenuItems.length !=0}
|
||||
onClose={()=>setContextPos(null)}
|
||||
label="context"
|
||||
portal
|
||||
>
|
||||
{contextMenuItems.length !=0 && contextMenuItems.map((menuItem, i)=>{
|
||||
const submenus = menuItem.getMenuItems();
|
||||
|
|
|
|||
|
|
@ -127,13 +127,6 @@ def load_servers():
|
|||
except Exception as e:
|
||||
return bad_request(errormsg=str(e))
|
||||
|
||||
if storage_manager_path:
|
||||
# generate full path of file
|
||||
file_path = os.path.join(
|
||||
storage_manager_path,
|
||||
file_path.lstrip('/').lstrip('\\')
|
||||
)
|
||||
|
||||
if file_path and os.path.exists(file_path):
|
||||
try:
|
||||
with open(file_path, 'r') as j:
|
||||
|
|
|
|||
Loading…
Reference in New Issue