-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathui.R
136 lines (121 loc) · 2.82 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
config_panel <- shinyjs::hidden(
fluidRow(
id='config_panel',
box(
width=12,
status = 'primary',
title = 'Set application Configuration',
solidHeader = T,
div(
fluidRow(
column(3,
textInput(
'input_strava_app_client_id',
"Client ID",
value = Sys.getenv('strava_app_client_id')
)
),
column(
3,
textInput(
'input_strava_app_secret',
"Client Secret",
value = Sys.getenv('strava_app_secret')
)
),
column(
3,
textInput(
'input_strava_app_url',
"Application URL",
value = Sys.getenv('strava_app_url')
)
),
column(
3,
actionButton('input_save_config','Save')
#uiOutput('auth_submit_button')
),
br()
)
)
)
)
)
loggin_panel <- shinyjs::hidden(
fluidRow(
id='loggin_panel',
box(
width=12,
status = 'primary',
title = 'Click to login with Strava',
solidHeader = T,
div(
uiOutput('auth_submit_button')
)
)
)
)
ui_activity_filters <- div(
shiny::selectInput('selected_period',
label='Period',
choices = names(periods),
selected = 'Last 30 days',
multiple = F
),
conditionalPanel(
condition="input.selected_period == 'Custom'",
dateRangeInput(inputId = 'selected_dates',
label = 'Select date range'
)
),
shiny::selectInput(
inputId = 'selected_types',
label='Select types',
choices='',
multiple = T
),
div(
img(src='1.2 strava api logos/powered by Strava/pwrdBy_strava_light/api_logo_pwrdBy_strava_stack_light.png',width=199*.6,height=86*.6),
style='display: block;margin-left: auto;margin-right: auto;width: 50%;'
)
)
ui_footer <- fluidRow(
box(
width=12,
column(4,img(src='api_logo_pwrdBy_strava_stack_light.png',width=199*.6,height=86*.6)),
column(8,textOutput('welcome_line'))
)
)
#ui_summary_chart <- plotOutput('summary_chart')
shinyUI(
dashboardPage(
title = 'shiny-strava',
# HEADER ----
dashboardHeader(
title = 'shiny-strava'
#titleWidth = 350
),
# SIDEBAR ----
dashboardSidebar(
ui_activity_filters
#width = 350
),
dashboardBody(
useShinyjs(),
config_panel,
loggin_panel,
tabBox(
width = 12,
tabPanel(
'Chart',
summaryDataUI('summary_data')
),
tabPanel(
'Map',
activityMapUI('map')
)
)
)
)
)