mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Add headings and links to plugin pages
This commit is contained in:
parent
f071ea2a1f
commit
f0626465b0
5 changed files with 30 additions and 6 deletions
|
@ -77,12 +77,13 @@ const AdvancedDrawerSection = () => {
|
||||||
<ListItemLink to='/dashboard/plugins' sx={{ pl: 4 }}>
|
<ListItemLink to='/dashboard/plugins' sx={{ pl: 4 }}>
|
||||||
<ListItemText inset primary={globalize.translate('TabMyPlugins')} />
|
<ListItemText inset primary={globalize.translate('TabMyPlugins')} />
|
||||||
</ListItemLink>
|
</ListItemLink>
|
||||||
<ListItemLink to='/dashboard/plugins/catalog' sx={{ pl: 4 }}>
|
<ListItemLink
|
||||||
|
to='/dashboard/plugins/catalog'
|
||||||
|
includePaths={[ '/dashboard/plugins/repositories' ]}
|
||||||
|
sx={{ pl: 4 }}
|
||||||
|
>
|
||||||
<ListItemText inset primary={globalize.translate('TabCatalog')} />
|
<ListItemText inset primary={globalize.translate('TabCatalog')} />
|
||||||
</ListItemLink>
|
</ListItemLink>
|
||||||
<ListItemLink to='/dashboard/plugins/repositories' sx={{ pl: 4 }}>
|
|
||||||
<ListItemText inset primary={globalize.translate('TabRepositories')} />
|
|
||||||
</ListItemLink>
|
|
||||||
</List>
|
</List>
|
||||||
</Collapse>
|
</Collapse>
|
||||||
<ListItem disablePadding>
|
<ListItem disablePadding>
|
||||||
|
|
|
@ -4,6 +4,8 @@ import { Link, useLocation, useSearchParams } from 'react-router-dom';
|
||||||
|
|
||||||
interface ListItemLinkProps extends ListItemButtonBaseProps {
|
interface ListItemLinkProps extends ListItemButtonBaseProps {
|
||||||
to: string
|
to: string
|
||||||
|
includePaths?: string[]
|
||||||
|
excludePaths?: string[]
|
||||||
}
|
}
|
||||||
|
|
||||||
const isMatchingParams = (routeParams: URLSearchParams, currentParams: URLSearchParams) => {
|
const isMatchingParams = (routeParams: URLSearchParams, currentParams: URLSearchParams) => {
|
||||||
|
@ -19,6 +21,8 @@ const isMatchingParams = (routeParams: URLSearchParams, currentParams: URLSearch
|
||||||
const ListItemLink: FC<ListItemLinkProps> = ({
|
const ListItemLink: FC<ListItemLinkProps> = ({
|
||||||
children,
|
children,
|
||||||
to,
|
to,
|
||||||
|
includePaths = [],
|
||||||
|
excludePaths = [],
|
||||||
...params
|
...params
|
||||||
}) => {
|
}) => {
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
|
@ -27,8 +31,11 @@ const ListItemLink: FC<ListItemLinkProps> = ({
|
||||||
const [ toPath, toParams ] = to.split('?');
|
const [ toPath, toParams ] = to.split('?');
|
||||||
// eslint-disable-next-line compat/compat
|
// eslint-disable-next-line compat/compat
|
||||||
const toSearchParams = new URLSearchParams(`?${toParams}`);
|
const toSearchParams = new URLSearchParams(`?${toParams}`);
|
||||||
|
const selectedPaths = [ toPath, ...includePaths ];
|
||||||
|
|
||||||
const selected = location.pathname === toPath && (!toParams || isMatchingParams(toSearchParams, searchParams));
|
const selected = selectedPaths.includes(location.pathname)
|
||||||
|
&& !excludePaths.includes(location.pathname + location.search)
|
||||||
|
&& (!toParams || isMatchingParams(toSearchParams, searchParams));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ListItemButton
|
<ListItemButton
|
||||||
|
|
|
@ -1,6 +1,15 @@
|
||||||
<div id="pluginCatalogPage" data-role="page" class="page type-interior pluginConfigurationPage fullWidthContent">
|
<div id="pluginCatalogPage" data-role="page" class="page type-interior pluginConfigurationPage fullWidthContent">
|
||||||
<div>
|
<div>
|
||||||
<div class="content-primary">
|
<div class="content-primary">
|
||||||
|
<div class="sectionTitleContainer flex align-items-center">
|
||||||
|
<h2 class="sectionTitle">${TabCatalog}</h2>
|
||||||
|
<a is="emby-linkbutton" class="fab" href="#/dashboard/plugins/repositories" style="margin-left:1em;" title="${Settings}">
|
||||||
|
<span class="material-icons settings" aria-hidden="true"></span>
|
||||||
|
</a>
|
||||||
|
<a is="emby-linkbutton" rel="noopener noreferrer" class="raised button-alt headerHelpButton" target="_blank" href="https://jellyfin.org/docs/general/server/plugins/">
|
||||||
|
${Help}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
<div class="inputContainer">
|
<div class="inputContainer">
|
||||||
<input id="txtSearchPlugins" name="txtSearchPlugins" type="text" is="emby-input" label="${Search}" />
|
<input id="txtSearchPlugins" name="txtSearchPlugins" type="text" is="emby-input" label="${Search}" />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,6 +1,12 @@
|
||||||
<div id="pluginsPage" data-role="page" class="page type-interior pluginConfigurationPage fullWidthContent">
|
<div id="pluginsPage" data-role="page" class="page type-interior pluginConfigurationPage fullWidthContent">
|
||||||
<div>
|
<div>
|
||||||
<div class="content-primary">
|
<div class="content-primary">
|
||||||
|
<div class="sectionTitleContainer flex align-items-center">
|
||||||
|
<h2 class="sectionTitle">${TabMyPlugins}</h2>
|
||||||
|
<a is="emby-linkbutton" rel="noopener noreferrer" class="raised button-alt headerHelpButton" target="_blank" href="https://jellyfin.org/docs/general/server/plugins/">
|
||||||
|
${Help}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
<div class="inputContainer">
|
<div class="inputContainer">
|
||||||
<input id="txtSearchPlugins" name="txtSearchPlugins" type="text" is="emby-input" label="${Search}" />
|
<input id="txtSearchPlugins" name="txtSearchPlugins" type="text" is="emby-input" label="${Search}" />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -156,7 +156,8 @@ div[data-role=controlgroup] a.ui-btn-active {
|
||||||
padding-left: 1em;
|
padding-left: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.content-primary ul:first-child {
|
.content-primary ul:first-child,
|
||||||
|
.type-interior .content-primary > .sectionTitleContainer {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue