Stop graying screen out when server is unreachable

1,025 views
Skip to first unread message

ad...@wealthfront.com

unread,
Feb 28, 2015, 9:48:28 PM2/28/15
to shiny-...@googlegroups.com
Hi Folks,

I have a Shiny app that I'm using on a big monitor at my company to display some key business metrics. Occasionally, the server becomes unreachable and the app grays out. This can happen for a variety of reasons, which we can usually root-cause and fix, but in the meantime, it looks awful to see the big gray screen. We have other monitoring in place to detect these situations, so we don't get any value in having the screen go gray. My question is this, is there an override to prevent the app from restyling itself during a connection failure?

Thanks!
Adam

Joe Cheng

unread,
Mar 1, 2015, 7:17:52 PM3/1/15
to ad...@wealthfront.com, shiny-...@googlegroups.com
This is the CSS in Shiny that causes the background to grey out:

body.disconnected {
  background-color: #999;
  opacity: 0.5;
}
You can override this by including your own CSS somewhere in your UI structure (doesn't particularly matter where):

tags$head(tags$style(type="text/css",
  "body.disconnected {
    background-color: inherit;
    opacity: 1;
  }"
))

--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/7adcef0d-971c-451d-8e55-215daa80e4ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ad...@wealthfront.com

unread,
Mar 3, 2015, 12:36:55 AM3/3/15
to shiny-...@googlegroups.com, ad...@wealthfront.com
Thanks Joe!

Duncan Ward

unread,
May 4, 2019, 5:47:56 AM5/4/19
to Shiny - Web Framework for R
Thanks for this Joe! 

It appears to work well for locally deployed apps, although I found that the bit of CSS causing grey out appears to have changed since 2015 to:

#shiny-disconnected-overlay {
   background-color: #999;
   opacity: 0.5;
}

With the following required addition to the UI structure:

tags$head(tags$style(type="text/css",
  "#shiny-disconnected-overlay {
    background-color: inherit;
    opacity: 0;
  }"
))

However, when I deploy the app on shinyapps.io, this does not prevent the grey out following internet drop-outs that cause the "Disconnected from the server. Reload" pop-up to trigger.

Ideally, I'd like to customise the reload background colour. The following CSS (in rstudio-connect.css) appears to control this behaviour:

.ss-gray-out {
   background-color: #999;
   opacity: 0.7;
   cursor: not-allowed !important;
}

Do you know if there's a way to control the greying out / cursor behaviours?


On Monday, 2 March 2015 10:17:52 UTC+10, Joe Cheng [RStudio] wrote:
This is the CSS in Shiny that causes the background to grey out:

body.disconnected {
  background-color: #999;
  opacity: 0.5;
}
You can override this by including your own CSS somewhere in your UI structure (doesn't particularly matter where):

tags$head(tags$style(type="text/css",
  "body.disconnected {
    background-color: inherit;
    opacity: 1;
  }"
))
On Sat, Feb 28, 2015 at 6:48 PM, <ad...@wealthfront.com> wrote:
Hi Folks,

I have a Shiny app that I'm using on a big monitor at my company to display some key business metrics. Occasionally, the server becomes unreachable and the app grays out. This can happen for a variety of reasons, which we can usually root-cause and fix, but in the meantime, it looks awful to see the big gray screen. We have other monitoring in place to detect these situations, so we don't get any value in having the screen go gray. My question is this, is there an override to prevent the app from restyling itself during a connection failure?

Thanks!
Adam

--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages