File tree Expand file tree Collapse file tree 4 files changed +14
-5
lines changed
spring-boot-admin-server-ui/src/main/frontend Expand file tree Collapse file tree 4 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 44 :href =" href"
55 :target =" target"
66 class =" sba-nav-item"
7- r
87 rel =" noopener noreferrer"
98 >
109 <slot />
Original file line number Diff line number Diff line change @@ -45,5 +45,8 @@ export function useViewRegistry() {
4545
4646 emitCustomRouteAddedEvent ( ) ;
4747 } ,
48+ getViewByName ( name : string ) {
49+ return viewRegistry . views . find ( ( view ) => view . name === name ) ;
50+ } ,
4851 } ;
4952}
Original file line number Diff line number Diff line change 6161 @locale-changed =" changeLocale"
6262 />
6363 <sba-nav-usermenu v-if =" sbaConfig.user" />
64- <sba-nav-item :to =" { name: 'about' }" >
65- <FontAwesomeIcon icon =" question-circle" />
64+ <sba-nav-item v-if =" isAboutEnabled" :to =" { name: 'about' }" >
65+ <FontAwesomeIcon
66+ :aria-label =" t('about.label')"
67+ icon =" question-circle"
68+ />
6669 </sba-nav-item >
6770 </sba-navbar-nav >
6871 </sba-navbar >
@@ -94,8 +97,9 @@ defineProps({
9497 },
9598});
9699
97- const { views } = useViewRegistry ();
100+ const { views, getViewByName } = useViewRegistry ();
98101const i18n = useI18n ();
102+ const t = i18n .t ;
99103
100104const brand = sbaConfig .uiSettings .brand ;
101105
@@ -106,7 +110,8 @@ const topLevelViews = computed(() => {
106110 ! view .parent &&
107111 ! view .name ?.includes (' instance' ) &&
108112 ! view .name ?.includes (' about' ) &&
109- ! view .path ?.includes (' /instance' )
113+ ! view .path ?.includes (' /instance' ) &&
114+ view .isEnabled ()
110115 );
111116 })
112117 .sort (compareBy ((v ) => v .order ));
@@ -121,6 +126,7 @@ const topLevelViews = computed(() => {
121126 });
122127});
123128
129+ const isAboutEnabled = getViewByName (' about' )?.isEnabled ();
124130const changeLocale = (locale ) => {
125131 i18n .locale .value = locale ;
126132 moment .locale (locale );
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ const createI18nTextVNode = (label: string) =>
3232// eslint-disable-next-line no-unused-vars
3333type ViewFilterFunction = ( view : SbaView ) => boolean ;
3434type ViewConfig = {
35+ isEnabled ?: ( obj ?) => boolean ;
3536 [ key : string ] : any ;
3637} ;
3738
You can’t perform that action at this time.
0 commit comments