mirror of
https://github.com/grafana/grafana.git
synced 2025-08-06 20:59:35 +08:00
Frontend: Fix broken links in /plugins when pathname has a trailing slash (#64348)
Fix broken links in /plugins when pathname has a trailing slash
This commit is contained in:
@ -18,8 +18,8 @@ interface Props {
|
|||||||
export const PluginList = ({ plugins, displayMode }: Props) => {
|
export const PluginList = ({ plugins, displayMode }: Props) => {
|
||||||
const isList = displayMode === PluginListDisplayMode.List;
|
const isList = displayMode === PluginListDisplayMode.List;
|
||||||
const styles = useStyles2(getStyles);
|
const styles = useStyles2(getStyles);
|
||||||
const location = useLocation();
|
const { pathname } = useLocation();
|
||||||
const pathName = config.appSubUrl + location.pathname;
|
const pathName = config.appSubUrl + (pathname.endsWith('/') ? pathname.slice(0, -1) : pathname);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={cx(styles.container, { [styles.list]: isList })} data-testid="plugin-list">
|
<div className={cx(styles.container, { [styles.list]: isList })} data-testid="plugin-list">
|
||||||
|
Reference in New Issue
Block a user