-
Notifications
You must be signed in to change notification settings - Fork 8
/
ui.R
73 lines (67 loc) · 1.77 KB
/
ui.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
jscode <- "
shinyjs.disableTab = function(name) {
var tab = $('.nav li a[data-value=' + name + ']');
tab.bind('click.tab', function(e) {
e.preventDefault();
return false;
});
tab.addClass('disabled');
}
shinyjs.enableTab = function(name) {
var tab = $('.nav li a[data-value=' + name + ']');
tab.unbind('click.tab');
tab.removeClass('disabled');
}
/* Initialise the app with the multiPlotsTab hidden */
shinyjs.init = function(){
$('#appNavbarPage li a[data-value=\"multiPlotsTab\"]').hide();
}
"
appCSS <- "
.nav li a.disabled {
background-color: #aaa !important;
color: #333 !important;
cursor: not-allowed !important;
border-color: #aaa !important;
}
#loading-content {
position: absolute;
background: #000000;
opacity: 0.9;
z-index: 100;
left: 0;
right: 0;
height: 100%;
text-align: center;
color: #FFFFFF;
}
.leaflet .legend {
text-align: left;
}
"
shinyUI(ui=tagList(
# Some definitions that apply to all tabs
useShinyjs(),
extendShinyjs(text=jscode, functions=c("disableTab", "enableTab", "init")),
tags$script(inactivity), # Enable session timeout
inlineCSS(appCSS),
div(id="loading-content",h2(sprintf("Loading Obsmon v%s...",obsmonVersion))),
# The page
hidden(div(id="app-content",
navbarPage(
title=uiOutput("pageTitle"),
windowTitle=ifelse(length(obsmonConfig$general$configName)>0,
sprintf("Obsmon v%s %s", obsmonVersion, obsmonConfig$general$configName),
paste0("Obsmon v", obsmonVersion)
),
id="appNavbarPage",
tabPanel("Main", value="mainTab", mainTab()),
tabPanel(
title="User-configured multiPlots",
value="multiPlotsTab",
multiPlotsTab()
),
tabPanel("Domain Geometry & Grid", value="modelDomainTab", modelDomainTab())
)
))
))