-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.R
136 lines (129 loc) · 5.34 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# User interface code for the TEMPEST data dashboard
# June 2023
library(shiny)
library(shinydashboard)
library(shinydashboardPlus)
library(dplyr)
library(shinyWidgets)
library(shinybusy)
library(shinyalert)
library(gmailr)
ui <- dashboardPage(
skin = if_else(TESTING, "red-light", "black-light"),
dashboardHeader(
title = "TEMPEST Dashboard"
),
dashboardSidebar(
sidebarMenu(
menuItem("Dashboard", tabName = "dashboard", icon = icon("compass")),
menuItem("Sapflow", tabName = "sapflow", icon = icon("tree")),
menuItem("TEROS", tabName = "teros", icon = icon("temperature-high")),
menuItem("AquaTroll", tabName = "troll", icon = icon("water")),
menuItem("Redox", tabName = "redox", icon = icon("face-smile")),
menuItem("Battery", tabName = "battery", icon = icon("car-battery")),
menuItem("Maps", tabName = "maps", icon = icon("map-location-dot")),
menuItem("Alerts", tabName = "alerts", icon = icon("comment-dots"))
)
),
dashboardBody(
tags$head(tags$style(".shiny-notification {position: fixed; top: 30% ;left: 50%; width: 300px")),
tabItems(
tabItem(
tabName = "dashboard",
fluidRow(
# Clearly display the time of the dashboard
# If in testing mode, this will be set to the latest timestamp
# of the offline data
textOutput("DDT"),
# Front page badges; their attributes are computed by the server
valueBoxOutput("sapflow_bdg", width = 3),
valueBoxOutput("teros_bdg", width = 3),
valueBoxOutput("aquatroll_bdg", width = 3),
valueBoxOutput("battery_bdg", width = 3)
),
fluidRow(
# Gear UI is defined in R/gear_module.R
column(1, gearUI("gear")),
column(5,
progress_circle(value = 0, shiny_id = "circle",
color = "#00B0CA", stroke_width = 15,
trail_color = "#BBE7E6"),
tags$h3("Flood Progress", align = "center")
),
column(width = 6,
tabBox(width = 12,
tabPanel(
title = "Sapflow",
dataTableOutput("sapflow_bad_sensors")
),
tabPanel(
title = "TEROS",
dataTableOutput("teros_bad_sensors")
),
tabPanel(
title = "AquaTroll",
dataTableOutput("troll_bad_sensors")
),
tabPanel(
title = "Battery",
dataTableOutput("batt_bad_sensors")
)
)
)
),
fluidRow(
tabBox(width = 12,
tabPanel(
title = "Sapflow",
plotlyOutput("sapflow_plot", height = "400px")
),
tabPanel(
title = "TEROS",
plotlyOutput("teros_plot", height = "400px")
),
tabPanel(
title = "AquaTroll",
plotlyOutput("aquatroll_plot", height = "400px")
),
tabPanel(
title = "Redox",
plotlyOutput("redox_plot", height = "400px")
),
tabPanel(
title = "Battery",
plotlyOutput("battery_plot", height = "400px")
)
)
)
),
tabItem(
tabName = "sapflow",
DT::dataTableOutput("sapflow_table"),
plotlyOutput("sapflow_detail_graph")
),
tabItem(
tabName = "teros",
DT::dataTableOutput("teros_table"),
plotlyOutput("teros_detail_graph")
),
tabItem(
tabName = "troll",
DT::dataTableOutput("troll_table"),
plotlyOutput("troll_detail_graph")
),
tabItem(
tabName = "redox",
DT::dataTableOutput("redox_table"),
plotlyOutput("redox_detail_graph")
),
tabItem(
tabName = "battery",
dataTableOutput("btable")
),
# Maps tab UI is defined in R/maps_module.R
mapsUI("mapsTab"),
# Alerts tab UI is defined in R/alerts_module.R
alertsUI("alertsTab")
)
)
)