@@ -140,15 +140,16 @@ protected void prepareMap(ModelMap map, HttpServletRequest request) {
140140 } else {
141141 map .put ("showNavbar" , defaultShowNavbar );
142142 }
143-
144- map .put ("themeCss" , "/assets/css/themes/" + environment .getProperty ("proxy.theme" , "default" ) + ".css" );
143+
144+ map .put ("themeCss" , "/assets/css/themes/colors_ " + environment .getProperty ("proxy.theme" , "default" ) + ".css" );
145145 map .put ("bootstrapCss" , "/webjars/bootstrap/3.4.1/css/bootstrap.min.css" );
146146 map .put ("bootstrapJs" , "/webjars/bootstrap/3.4.1/js/bootstrap.min.js" );
147147 map .put ("jqueryJs" , "/webjars/jquery/3.7.1/jquery.min.js" );
148148 map .put ("handlebars" , "/webjars/handlebars/4.7.7/handlebars.runtime.min.js" );
149149
150150 Authentication authentication = SecurityContextHolder .getContext ().getAuthentication ();
151- boolean isLoggedIn = authentication != null && !(authentication instanceof AnonymousAuthenticationToken ) && authentication .isAuthenticated ();
151+ boolean isLoggedIn = authentication != null && !(authentication instanceof AnonymousAuthenticationToken )
152+ && authentication .isAuthenticated ();
152153 map .put ("isLoggedIn" , isLoggedIn );
153154 map .put ("isAdmin" , userService .isAdmin (authentication ));
154155 map .put ("isSupportEnabled" , isLoggedIn && defaultSupportAddress != null );
@@ -173,8 +174,8 @@ protected void prepareMap(ModelMap map, HttpServletRequest request) {
173174 }
174175 map .put ("appLogos" , appLogos );
175176
176-
177- ServletRequestAttributes servletRequestAttributes = ( ServletRequestAttributes ) RequestContextHolder .currentRequestAttributes ();
177+ ServletRequestAttributes servletRequestAttributes = ( ServletRequestAttributes ) RequestContextHolder
178+ .currentRequestAttributes ();
178179 HttpServletRequest httpServletRequest = servletRequestAttributes .getRequest ();
179180 HttpServletResponse httpServletResponse = servletRequestAttributes .getResponse ();
180181 map .put ("request" , httpServletRequest );
@@ -193,12 +194,12 @@ protected LogoInfo getAppLogoInfo(ProxySpec proxySpec) {
193194 }
194195
195196 return LogoInfo .builder ()
196- .src (src )
197- .width (coalesce (proxySpec .getLogoWidth (), defaultLogoWidth ))
198- .height (coalesce (proxySpec .getLogoHeight (), defaultLogoHeight ))
199- .style (coalesce (proxySpec .getLogoStyle (), defaultLogoStyle ))
200- .classes (coalesce (proxySpec .getLogoClasses (), defaultLogoClasses ))
201- .build ();
197+ .src (src )
198+ .width (coalesce (proxySpec .getLogoWidth (), defaultLogoWidth ))
199+ .height (coalesce (proxySpec .getLogoHeight (), defaultLogoHeight ))
200+ .style (coalesce (proxySpec .getLogoStyle (), defaultLogoStyle ))
201+ .classes (coalesce (proxySpec .getLogoClasses (), defaultLogoClasses ))
202+ .build ();
202203 });
203204 }
204205
@@ -226,7 +227,8 @@ protected String resolveImageURI(String resourceURI) {
226227 }
227228
228229 /**
229- * Checks whether starting a proxy violates the max instances of this spec and user.
230+ * Checks whether starting a proxy violates the max instances of this spec and
231+ * user.
230232 * This corresponds to the `max-instances` property of an app.
231233 */
232234 protected boolean validateMaxInstances (ProxySpec spec ) {
@@ -236,15 +238,20 @@ protected boolean validateMaxInstances(ProxySpec spec) {
236238 return true ;
237239 }
238240
239- // note: there is a very small change that the user is able to start more instances than allowed, if the user
241+ // note: there is a very small change that the user is able to start more
242+ // instances than allowed, if the user
240243 // starts many proxies at once. E.g. in the following scenario:
241244 // - max proxies = 2
242245 // - user starts a proxy
243- // - user sends a start proxy request -> this function is called and returns true
244- // - just before this new proxy is added to the list of active proxies, the user sends a new start proxy request
245- // - again this new proxy is allowed, because there is still only one proxy in the list of active proxies
246+ // - user sends a start proxy request -> this function is called and returns
247+ // true
248+ // - just before this new proxy is added to the list of active proxies, the user
249+ // sends a new start proxy request
250+ // - again this new proxy is allowed, because there is still only one proxy in
251+ // the list of active proxies
246252 // -> the user has three proxies running.
247- // Because of chance that this happens is small and that the consequences are low, we accept this risk.
253+ // Because of chance that this happens is small and that the consequences are
254+ // low, we accept this risk.
248255 long currentAmountOfInstances = proxyService .getUserProxiesBySpecId (spec .getId ()).count ();
249256
250257 return currentAmountOfInstances < maxInstances ;
0 commit comments