-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathapp.R
77 lines (67 loc) · 1.86 KB
/
app.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
# devtools::document()
# devtools::install()
library(dplyr)
library(stringr)
library(purrr)
library(jsonlite)
library(R6)
library(shiny.semantic)
library(shiny)
library(shinyjs)
library(semantic.dashboard)
library(googlesheets4)
library(gargle)
library(bcrypt)
# remotes::install_github("rstudio/reactlog")
# library(reactlog)
# reactlog_enable()
# # designate project-specific cache
# options(gargle_oauth_cache = ".secrets")
# # check the value of the option, if you like
# gargle::gargle_oauth_cache()
# # trigger auth on purpose to store a token in the specified cache
# # a broswer will be opened
# googlesheets4::sheets_auth()
# sheets_auth(
# cache = ".secrets",
# email = "[email protected]"
# )
dir("R", full.names = T) %>% purrr::walk(source)
ui <- function(){
dashboardPage(
dashboardHeader(
inverted = T,
login_ui("user", test = T),
#tail = a(href="https://www.google.de", target="_blank", "Forgot your password?")),
div(class = "ui circular icon button action-button", id = "user-logout",
icon("power off")
)
),
dashboardSidebar(
side = "left", size = "", inverted = T,
sidebarMenu(
div(class = "item",
h4(class = "ui inverted header", "Something")
)
)
),
dashboardBody(
div(class = "sixteen wide column",
"Something great content"
)
)
)
}
server <- function(input, output) {
users <- reactive({
# user_sheet <- "https://docs.google.com/spreadsheets/d/1l-lHBPO9_JaI5aAUyTQ0Dt6YYY7O2SzTYFLbAHjCxlg/edit?usp=sharing"
# googlesheets4::read_sheet(user_sheet) %>%
dplyr::tibble(name = c("admin", "admin2"), email = name, pw = bcrypt::hashpw("test")) %>% glimpse
})
user <- callModule(login_server, "user", users)
observeEvent(user(), {
observe(print(user()))
})
}
shinyApp(ui, server)
# reactlog::reactlog_show()