Skip to content

Commit 8a59dcf

Browse files
committed
#11 admin mode : add possibility to export encrypt SQL
1 parent 3b5d183 commit 8a59dcf

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
* Fix bug on timeout.
44
* `secure_app()` now accept a `function` to define the UI.
5+
* Disable `admin mode` if no SQL database
6+
* `admin mode` : add possibility to export encrypt SQL
57

68
# shinymanager 1.0
79

R/language.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ language <- R6::R6Class(
9292
"Users" = "Users",
9393
"Passwords" = "Passwords",
9494
"Download logs database" = "Download logs database",
95+
"Download SQL database" = "Download SQL database",
9596
"Reset password for %s?" = "Reset password for %s?",
9697
"Temporary password:" = "Temporary password:",
9798
"Password succesfully reset!" = "Password succesfully reset!",
@@ -150,6 +151,7 @@ language <- R6::R6Class(
150151
"Users" = "Utilisateurs",
151152
"Passwords" = "Mots de passe",
152153
"Download logs database" = "T\u00e9l\u00e9charger les logs",
154+
"Download SQL database" = "T\u00e9l\u00e9charger la base SQL",
153155
"Reset password for %s?" = "R\u00e9initialiser le mot de passe de %s ?",
154156
"Temporary password:" = "Mot de passe temporaire",
155157
"Password succesfully reset!" = "Mot de passe r\u00e9initialis\u00e9",

R/module-admin.R

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,16 @@ admin_ui <- function(id) {
7777
icon = icon("key")
7878
),
7979

80-
tags$br(),tags$br(), tags$br()
80+
tags$br(),tags$br(), tags$br(), tags$hr(),
81+
82+
downloadButton(
83+
outputId = ns("download_sql_database"),
84+
label = lan$get("Download SQL database"),
85+
class = "btn-primary center-block",
86+
icon = icon("download")
87+
),
88+
89+
tags$br(),tags$br()
8190

8291
)
8392
)
@@ -498,6 +507,15 @@ admin <- function(input, output, session, sqlite_path, passphrase) {
498507
update_read_db$x <- Sys.time()
499508
})
500509

510+
# download SQL Database
511+
output$download_sql_database <- downloadHandler(
512+
filename = function() {
513+
paste('shinymanager-sql-', Sys.Date(), '.sqlite', sep = '')
514+
},
515+
content = function(con) {
516+
file.copy(sqlite_path, con)
517+
}
518+
)
501519
}
502520

503521

0 commit comments

Comments
 (0)