mirror of
https://github.com/grafana/grafana.git
synced 2025-08-01 21:02:16 +08:00
CommandPalette: Minor usability improvements (#61567)
This commit is contained in:
@ -56,7 +56,10 @@ export const CommandPalette = () => {
|
||||
<KBarAnimator className={styles.animator}>
|
||||
<FocusScope contain autoFocus restoreFocus>
|
||||
<div {...overlayProps} {...dialogProps}>
|
||||
<KBarSearch className={styles.search} />
|
||||
<KBarSearch
|
||||
defaultPlaceholder={t('command-palette.search-box.placeholder', 'Search Grafana')}
|
||||
className={styles.search}
|
||||
/>
|
||||
<RenderResults dashboardResults={dashboardResults} />
|
||||
</div>
|
||||
</FocusScope>
|
||||
|
@ -59,15 +59,6 @@ export const ResultItem = React.forwardRef(
|
||||
</div>
|
||||
{action.subtitle && <span className={styles.subtitleText}>{action.subtitle}</span>}
|
||||
</div>
|
||||
{action.shortcut?.length ? (
|
||||
<div aria-hidden className={styles.shortcutContainer}>
|
||||
{action.shortcut.map((sc) => (
|
||||
<kbd key={sc} className={styles.shortcut}>
|
||||
{sc}
|
||||
</kbd>
|
||||
))}
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ export async function getRecentDashboardActions(): Promise<CommandPaletteAction[
|
||||
return {
|
||||
id: `recent-dashboards/${url}`,
|
||||
name: `${name}`,
|
||||
section: t('command-palette.section.recent-dashboards', 'Recently viewed dashboards'),
|
||||
section: t('command-palette.section.recent-dashboards', 'Recent dashboards'),
|
||||
priority: RECENT_DASHBOARDS_PRORITY,
|
||||
perform: () => {
|
||||
locationService.push(locationUtil.stripBaseFromUrl(url));
|
||||
|
@ -55,7 +55,6 @@ export default (navBarTree: NavModelItem[]): CommandPaletteAction[] => {
|
||||
keywords: 'navigate',
|
||||
perform: () => locationService.push('?search=open'),
|
||||
section: t('command-palette.section.pages', 'Pages'),
|
||||
shortcut: ['s', 'o'],
|
||||
priority: DEFAULT_PRIORITY,
|
||||
},
|
||||
{
|
||||
@ -63,7 +62,6 @@ export default (navBarTree: NavModelItem[]): CommandPaletteAction[] => {
|
||||
name: t('command-palette.action.change-theme', 'Change theme...'),
|
||||
keywords: 'interface color dark light',
|
||||
section: t('command-palette.section.preferences', 'Preferences'),
|
||||
shortcut: ['c', 't'],
|
||||
priority: PREFERENCES_PRIORITY,
|
||||
},
|
||||
{
|
||||
|
@ -12,6 +12,9 @@
|
||||
"light-theme": "",
|
||||
"search": ""
|
||||
},
|
||||
"search-box": {
|
||||
"placeholder": ""
|
||||
},
|
||||
"section": {
|
||||
"actions": "",
|
||||
"dashboard-search-results": "",
|
||||
|
@ -12,12 +12,15 @@
|
||||
"light-theme": "Light",
|
||||
"search": "Search"
|
||||
},
|
||||
"search-box": {
|
||||
"placeholder": "Search Grafana"
|
||||
},
|
||||
"section": {
|
||||
"actions": "Actions",
|
||||
"dashboard-search-results": "Dashboards",
|
||||
"pages": "Pages",
|
||||
"preferences": "Preferences",
|
||||
"recent-dashboards": "Recently viewed dashboards"
|
||||
"recent-dashboards": "Recent dashboards"
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
|
@ -12,6 +12,9 @@
|
||||
"light-theme": "",
|
||||
"search": ""
|
||||
},
|
||||
"search-box": {
|
||||
"placeholder": ""
|
||||
},
|
||||
"section": {
|
||||
"actions": "",
|
||||
"dashboard-search-results": "",
|
||||
|
@ -12,6 +12,9 @@
|
||||
"light-theme": "",
|
||||
"search": ""
|
||||
},
|
||||
"search-box": {
|
||||
"placeholder": ""
|
||||
},
|
||||
"section": {
|
||||
"actions": "",
|
||||
"dashboard-search-results": "",
|
||||
|
@ -12,12 +12,15 @@
|
||||
"light-theme": "Ŀįģĥŧ",
|
||||
"search": "Ŝęäřčĥ"
|
||||
},
|
||||
"search-box": {
|
||||
"placeholder": "Ŝęäřčĥ Ğřäƒäʼnä"
|
||||
},
|
||||
"section": {
|
||||
"actions": "Åčŧįőʼnş",
|
||||
"dashboard-search-results": "Đäşĥþőäřđş",
|
||||
"pages": "Päģęş",
|
||||
"preferences": "Přęƒęřęʼnčęş",
|
||||
"recent-dashboards": "Ŗęčęʼnŧľy vįęŵęđ đäşĥþőäřđş"
|
||||
"recent-dashboards": "Ŗęčęʼnŧ đäşĥþőäřđş"
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
|
@ -12,6 +12,9 @@
|
||||
"light-theme": "",
|
||||
"search": ""
|
||||
},
|
||||
"search-box": {
|
||||
"placeholder": ""
|
||||
},
|
||||
"section": {
|
||||
"actions": "",
|
||||
"dashboard-search-results": "",
|
||||
|
Reference in New Issue
Block a user