mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-14 11:05:41 +00:00
[PUI] Add AdminCenter to cmd k (#7908)
* Add API bump
* [PUI] Add AdminCenter to cmd k
Closes https://github.com/invenhost/InvenTree/issues/96
* Revert "Add API bump"
This reverts commit 9135e443a9
.
This commit is contained in:
@ -4,11 +4,13 @@ import { IconHome, IconLink, IconPointer } from '@tabler/icons-react';
|
||||
import { NavigateFunction } from 'react-router-dom';
|
||||
|
||||
import { useLocalState } from '../states/LocalState';
|
||||
import { useUserState } from '../states/UserState';
|
||||
import { aboutInvenTree, docLinks, licenseInfo, serverInfo } from './links';
|
||||
import { menuItems } from './menuItems';
|
||||
|
||||
export function getActions(navigate: NavigateFunction) {
|
||||
const setNavigationOpen = useLocalState((state) => state.setNavigationOpen);
|
||||
const { user } = useUserState();
|
||||
|
||||
const actions: SpotlightActionData[] = [
|
||||
{
|
||||
@ -62,5 +64,15 @@ export function getActions(navigate: NavigateFunction) {
|
||||
}
|
||||
];
|
||||
|
||||
// Staff actions
|
||||
user?.is_staff &&
|
||||
actions.push({
|
||||
id: 'admin-center',
|
||||
label: t`Admin Center`,
|
||||
description: t`Go to the Admin Center`,
|
||||
onClick: () => navigate(menuItems['settings-admin'].link),
|
||||
leftSection: <IconLink size="1.2rem" />
|
||||
});
|
||||
|
||||
return actions;
|
||||
}
|
||||
|
Reference in New Issue
Block a user