@@ -66,6 +66,9 @@ export class Router {
6666 const logo = document . getElementById ( "logo" ) ;
6767 Utils . addToolTip ( logo , "ctrl-click to see\nOptions and Stats" , "logo" ) ;
6868
69+ const fab = document . querySelector ( ".fab" ) ;
70+ Utils . addToolTip ( fab , "Type 'c' to show\nmanual run" , "fab" ) ;
71+
6972 Router . updateMainMenu ( ) ;
7073
7174 const hash = window . location . hash . replace ( / ^ # / , "" ) ;
@@ -77,7 +80,13 @@ export class Router {
7780 /* eslint-enable compat/compat */
7881 }
7982
80- _registerMenuItem ( pParentId , pButtonId , pUrl ) {
83+ _registerMenuItem ( pParentId , pButtonId , pUrl , pKey ) {
84+
85+ // shortcut
86+
87+ if ( pKey ) {
88+ Utils . setStorageItem ( "session" , "menu_" + pKey , pUrl ) ;
89+ }
8190
8291 // full menu
8392
@@ -97,17 +106,30 @@ export class Router {
97106 dropDownDiv . append ( dropdownContent ) ;
98107 }
99108 const itemDiv = Utils . createDiv ( "run-command-button menu-item" , pButtonId , "button-" + pButtonId + "1" ) ;
109+ if ( pKey ) {
110+ // currently applies to all, but just in case
111+ itemDiv . classList . add ( "menu-item-first-letter" ) ;
112+ }
100113 dropdownContent . append ( itemDiv ) ;
101114 } else {
102115 const topItemDiv = Utils . createDiv ( "menu-item" , pButtonId , "button-" + pButtonId + "1" ) ;
103116 dropDownDiv . append ( topItemDiv ) ;
117+ if ( pKey ) {
118+ topItemDiv . classList . add ( "menu-item-first-letter" ) ;
119+ }
104120 }
105121
106122 // mini menu
107123
108124 const miniMenuDiv = document . querySelector ( ".minimenu" ) ;
109125 const dropdownContent2 = miniMenuDiv . querySelector ( ".dropdown-content" ) ;
110- const menuItemDiv = Utils . createDiv ( "run-command-button menu-item" , ( pParentId ? "-" + Character . NO_BREAK_SPACE : "" ) + pButtonId , "button-" + pButtonId + "2" ) ;
126+ const menuItemDiv = Utils . createDiv ( "run-command-button menu-item" , pButtonId , "button-" + pButtonId + "2" ) ;
127+ if ( pParentId ) {
128+ menuItemDiv . style . paddingLeft = "50px" ;
129+ }
130+ if ( pKey ) {
131+ menuItemDiv . classList . add ( "menu-item-first-letter" ) ;
132+ }
111133 dropdownContent2 . append ( menuItemDiv ) ;
112134
113135 // activate the menu items as needed
@@ -177,19 +199,20 @@ export class Router {
177199 /* eslint-enable compat/compat */
178200 } ) ;
179201
180- this . _registerMenuItem ( null , "minions" , "minions" ) ;
181- this . _registerMenuItem ( "minions" , "grains" , "grains" ) ;
182- this . _registerMenuItem ( "minions" , "schedules" , "schedules" ) ;
183- this . _registerMenuItem ( "minions" , "pillars" , "pillars" ) ;
184- this . _registerMenuItem ( "minions" , "beacons" , "beacons" ) ;
185- this . _registerMenuItem ( "minions" , "nodegroups" , "nodegroups" ) ;
186- this . _registerMenuItem ( null , "keys" , "keys" ) ;
187- this . _registerMenuItem ( null , "jobs" , "jobs" ) ;
188- this . _registerMenuItem ( "jobs" , "highstate" , "highstate" ) ;
189- this . _registerMenuItem ( "jobs" , "templates" , "templates" ) ;
190- this . _registerMenuItem ( null , "events" , "events" ) ;
191- this . _registerMenuItem ( "events" , "reactors" , "reactors" ) ;
192- this . _registerMenuItem ( null , "issues" , "issues" ) ;
202+ this . _registerMenuItem ( null , "minions" , "minions" , "m" ) ;
203+ this . _registerMenuItem ( "minions" , "grains" , "grains" , "g" ) ;
204+ this . _registerMenuItem ( "minions" , "schedules" , "schedules" , "s" ) ;
205+ this . _registerMenuItem ( "minions" , "pillars" , "pillars" , "p" ) ;
206+ this . _registerMenuItem ( "minions" , "beacons" , "beacons" , "b" ) ;
207+ this . _registerMenuItem ( "minions" , "nodegroups" , "nodegroups" , "n" ) ;
208+ this . _registerMenuItem ( null , "keys" , "keys" , "k" ) ;
209+ this . _registerMenuItem ( null , "jobs" , "jobs" , "j" ) ;
210+ this . _registerMenuItem ( "jobs" , "highstate" , "highstate" , "h" ) ;
211+ this . _registerMenuItem ( "jobs" , "templates" , "templates" , "t" ) ;
212+ this . _registerMenuItem ( null , "events" , "events" , "e" ) ;
213+ this . _registerMenuItem ( "events" , "reactors" , "reactors" , "r" ) ;
214+ this . _registerMenuItem ( null , "issues" , "issues" , "i" ) ;
215+ // no shortcut for logout
193216 this . _registerMenuItem ( null , "logout" , "logout" ) ;
194217 }
195218
0 commit comments