mirror of
https://github.com/agdamsbo/REDCapCAST.git
synced 2024-11-24 22:11:55 +01:00
updated shiny app
This commit is contained in:
parent
9c61b5e646
commit
f787621f1b
@ -34,23 +34,32 @@ shiny_cast <- function() {
|
||||
)
|
||||
}
|
||||
|
||||
#' Deploy the Shiny app with rsconnect
|
||||
#' Deploy the Shiny app with rsconnect to shinyapps.io
|
||||
#'
|
||||
#' @description
|
||||
#' This is really just a simple wrapper
|
||||
#'
|
||||
#' @param path app folder path
|
||||
#' @param name.app name of deployed app
|
||||
#' @param name.token stored name of token
|
||||
#' @param name.secret stored name of secret
|
||||
#'
|
||||
#' @return deploy
|
||||
#' @export
|
||||
#'
|
||||
#' @examples
|
||||
#' # deploy_shiny
|
||||
#' # deploy_shiny()
|
||||
#'
|
||||
deploy_shiny <- function(path = here::here("app/"), name.app = "shiny_cast") {
|
||||
deploy_shiny <- function(path = here::here("app/"),
|
||||
account.name,
|
||||
name.app = "shiny_cast",
|
||||
name.token,
|
||||
name.secret) {
|
||||
# Connecting
|
||||
rsconnect::setAccountInfo(
|
||||
name = "cognitiveindex",
|
||||
token = keyring::key_get(service = "rsconnect_cognitiveindex_token"),
|
||||
secret = keyring::key_get(service = "rsconnect_cognitiveindex_secret")
|
||||
name = account.name,
|
||||
token = keyring::key_get(service = name.token),
|
||||
secret = keyring::key_get(service = name.secret)
|
||||
)
|
||||
|
||||
# Deploying
|
||||
|
10
app/rsconnect/shinyapps.io/agdamsbo/redcapcast.dcf
Normal file
10
app/rsconnect/shinyapps.io/agdamsbo/redcapcast.dcf
Normal file
@ -0,0 +1,10 @@
|
||||
name: redcapcast
|
||||
title:
|
||||
username: agdamsbo
|
||||
account: agdamsbo
|
||||
server: shinyapps.io
|
||||
hostUrl: https://api.shinyapps.io/v1
|
||||
appId: 11351429
|
||||
bundleId: 8311272
|
||||
url: https://agdamsbo.shinyapps.io/redcapcast/
|
||||
version: 1
|
10
app/rsconnect/shinyapps.io/cognitiveindex/shiny_cast.dcf
Normal file
10
app/rsconnect/shinyapps.io/cognitiveindex/shiny_cast.dcf
Normal file
@ -0,0 +1,10 @@
|
||||
name: shiny_cast
|
||||
title:
|
||||
username: cognitiveindex
|
||||
account: cognitiveindex
|
||||
server: shinyapps.io
|
||||
hostUrl: https://api.shinyapps.io/v1
|
||||
appId: 11351378
|
||||
bundleId: 8306502
|
||||
url: https://cognitiveindex.shinyapps.io/shiny_cast/
|
||||
version: 1
|
66
app/ui.R
66
app/ui.R
@ -1,21 +1,32 @@
|
||||
ui <- shiny::fluidPage(
|
||||
ui <- shiny::shinyUI(
|
||||
shiny::fluidPage(
|
||||
|
||||
## -----------------------------------------------------------------------------
|
||||
## Application title
|
||||
## -----------------------------------------------------------------------------
|
||||
shiny::titlePanel("Simple REDCap data base creation and data upload from data set file via API",
|
||||
windowTitle = "REDCap databse creator"
|
||||
|
||||
|
||||
# customHeaderPanel(title = "REDCapCAST: data base creation and data upload from data set file",
|
||||
# windowTitle = "REDCap database creator"
|
||||
# ),
|
||||
|
||||
shiny::titlePanel(title = shiny::div(shiny::a(shiny::img(src="logo.png"),href="https://agdamsbo.github.io/REDCapCAST"),
|
||||
"Easy REDCap database creation"),
|
||||
windowTitle = "REDCap database creator"
|
||||
),
|
||||
shiny::h5("Please note, that this tool serves as a demonstration of some of the functionality
|
||||
of the REDCapCAST package. No responsibility for data loss or any other
|
||||
problems will be taken."),
|
||||
shiny::h4("This tool includes to convenient functions:",
|
||||
shiny::br(),
|
||||
"1) creating a REDCap data dictionary based on a spreadsheet (.csv/.xls(x)/.dta) and",
|
||||
shiny::br(),
|
||||
"2) creating said database on a given REDCap server and uploading the dataset via API access."),
|
||||
|
||||
|
||||
## -----------------------------------------------------------------------------
|
||||
## Side panel
|
||||
## -----------------------------------------------------------------------------
|
||||
|
||||
shiny::sidebarPanel(
|
||||
shiny::h4("REDCap database and dataset"),
|
||||
shiny::h4("1) REDCap datadictionary and compatible dataset"),
|
||||
shiny::fileInput("ds", "Choose data file",
|
||||
multiple = FALSE,
|
||||
accept = c(
|
||||
@ -26,17 +37,18 @@ ui <- shiny::fluidPage(
|
||||
)
|
||||
),
|
||||
shiny::h6("Below you can download the dataset formatted for upload and the
|
||||
corresponding data dictionary for a new data base."),
|
||||
corresponding data dictionary for a new data base, if you want to upload manually."),
|
||||
# Button
|
||||
shiny::downloadButton("downloadData", "Download data"),
|
||||
|
||||
# Button
|
||||
shiny::downloadButton("downloadMeta", "Download dictionary"),
|
||||
shiny::downloadButton("downloadMeta", "Download datadictionary"),
|
||||
|
||||
|
||||
# Horizontal line ----
|
||||
shiny::tags$hr(),
|
||||
shiny::h4("REDCap upload"),
|
||||
shiny::h4("2) REDCap upload"),
|
||||
shiny::h6("This tool is usable for now. Detailed instructions are coming."),
|
||||
shiny::textInput(
|
||||
inputId = "uri",
|
||||
label = "URI",
|
||||
@ -47,9 +59,10 @@ ui <- shiny::fluidPage(
|
||||
label = "API key",
|
||||
value = ""
|
||||
),
|
||||
shiny::h6("An API key is an access key to the REDCap database. Please", shiny::a("see here for directions", href="https://www.iths.org/news/redcap-tip/redcap-api-101/"), " to obtain an API key for your project."),
|
||||
shiny::actionButton(
|
||||
inputId = "upload.meta",
|
||||
label = "Upload dictionary", icon = shiny::icon("book-bookmark")
|
||||
label = "Upload datadictionary", icon = shiny::icon("book-bookmark")
|
||||
),
|
||||
shiny::h6("Please note, that before uploading any real data, put your project
|
||||
into production mode."),
|
||||
@ -85,5 +98,36 @@ ui <- shiny::fluidPage(
|
||||
shiny::htmlOutput("upload.data.print", container = shiny::span)
|
||||
)
|
||||
)
|
||||
),
|
||||
|
||||
|
||||
# close sidebarLayout
|
||||
|
||||
br(),
|
||||
br(),
|
||||
br(),
|
||||
br(),
|
||||
hr(),
|
||||
shiny::tags$footer(shiny::strong("Disclaimer: "),
|
||||
"This tool is aimed at demonstrating use of REDCapCAST. No responsibility for data loss or any other problems will be taken. Please contact me for support.",
|
||||
shiny::br(),
|
||||
shiny::a("License: GPL-3+",href="https://agdamsbo.github.io/REDCapCAST/LICENSE.html"),
|
||||
"|",
|
||||
shiny::a("agdamsbo/REDCapCAST",href="https://agdamsbo.github.io/REDCapCAST"),
|
||||
"|",
|
||||
shiny::a("Source",href="https://github.com/agdamsbo/REDCapCAST"),
|
||||
"|",
|
||||
shiny::a("Contact",href="https://andreas.gdamsbo.dk"),
|
||||
align = "center",
|
||||
style = "
|
||||
position:fixed;
|
||||
bottom:40px;
|
||||
width:100%;
|
||||
height:20px;
|
||||
color: black;
|
||||
padding: 0px;
|
||||
background-color: White;
|
||||
z-index: 100;
|
||||
")
|
||||
)
|
||||
)
|
||||
|
BIN
app/www/logo.png
Normal file
BIN
app/www/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.1 KiB |
@ -2,22 +2,32 @@
|
||||
% Please edit documentation in R/shiny_cast.R
|
||||
\name{deploy_shiny}
|
||||
\alias{deploy_shiny}
|
||||
\title{Deploy the Shiny app with rsconnect}
|
||||
\title{Deploy the Shiny app with rsconnect to shinyapps.io}
|
||||
\usage{
|
||||
deploy_shiny(path = here::here("app/"), name.app = "shiny_cast")
|
||||
deploy_shiny(
|
||||
path = here::here("app/"),
|
||||
account.name,
|
||||
name.app = "shiny_cast",
|
||||
name.token,
|
||||
name.secret
|
||||
)
|
||||
}
|
||||
\arguments{
|
||||
\item{path}{app folder path}
|
||||
|
||||
\item{name.app}{name of deployed app}
|
||||
|
||||
\item{name.token}{stored name of token}
|
||||
|
||||
\item{name.secret}{stored name of secret}
|
||||
}
|
||||
\value{
|
||||
deploy
|
||||
}
|
||||
\description{
|
||||
Deploy the Shiny app with rsconnect
|
||||
This is really just a simple wrapper
|
||||
}
|
||||
\examples{
|
||||
# deploy_shiny
|
||||
# deploy_shiny()
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user