Skip to content

Commit

Permalink
Merge branch 'bfabric12' of github.com:fgcz/bfabricShiny into bfabric12
Browse files Browse the repository at this point in the history
  • Loading branch information
cpanse committed Nov 29, 2023
2 parents cb24456 + 3ba5a7a commit 3b9cf3f
Show file tree
Hide file tree
Showing 6 changed files with 492 additions and 5 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ Authors@R: c(person("Christian", "Trachsel",
role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-1975-3064")))
Maintainer: Christian Panse <[email protected]>
Version: 0.12.21
Version: 0.12.23
Description: provides a shiny module and read, save, and delete functions to
interact with the FGCZ's B-Fabric <https://fgcz-bfabric.uzh.ch> system
using WSDL and REST. Also, the package contains shiny
applications, e.g., to allow the FGCZ user to automatically generate a
configuration of queues for Thermo Fisher Scientific and Bruker instruments.
Depends:
R (>= 4.1)
R (>= 4.2)
Imports:
PKI,
base64enc,
Expand Down
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[![JIB](https://img.shields.io/badge/JIB-10.1515%2Fjib.2022.0031-brightgreen)](https://doi.org/10.1515/jib-2022-0031)
[![codecov](https://codecov.io/gh/fgcz/bfabricShiny/branch/bfabric11/graph/badge.svg?token=Q9G0WFEH6K)](https://codecov.io/gh/fgcz/bfabricShiny)
![Downloads](https://img.shields.io/github/downloads/fgcz/bfabricShiny/total)


# bfabricShiny R package
Expand Down Expand Up @@ -111,12 +112,27 @@ system.file("shiny", "queue_generator10", package = "bfabricShiny") |>
```{bash}
python3 bfabric_flask.py
```
If a certified key is available, Flask will use SSL certificate and run on port 5001. Otherwise it will run using http and port 5000.
Note that the port configuration can be changed in the bfabric\_flask.py script.
```{python}
# code snippet from bfabric_flask.py:
if exists('/etc/ssl/fgcz-host.pem') and exists('/etc/ssl/private/fgcz-host_key.pem'):
app.run(debug=False, host="0.0.0.0", port=5001, ssl_context=('/etc/ssl/fgcz-host.pem', '/etc/ssl/private/fgcz-host_key.pem'))
else:
app.run(debug=False, host="127.0.0.1", port=5000)
```
See [bfabric\_flask.py on GitHub](https://github.com/fgcz/bfabricPy/blob/bfabric12/bfabric/scripts/bfabric_flask.py) for more details.

- simple json test
- simple tests

```{bash}
curl http://127.0.0.1:5000/sample/1
```
```{r}
# R
rv <- httr::POST("https://host:5001/read", body = jsonlite::toJSON(list(login = "login", webservicepassword = "webservicepassword", endpoint = "user", query = list("login" = "cpanse"))), encode = "json")
httr::content(rv)
```

## Sample Query

Expand Down
6 changes: 4 additions & 2 deletions inst/shiny/bfabric_rawDiag/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -925,8 +925,10 @@ output$qc <- renderPlot({
msg <- paste0("bfabricShiny::uploadResource ...")
message(msg)
progress$set(message = msg)



resources <- bf$resources()

rvupload <- bfabricShiny::uploadResource(
login = bf$login(),
webservicepassword = bf$webservicepassword(),
Expand All @@ -940,7 +942,7 @@ output$qc <- renderPlot({
resourcename = sprintf("%s.pdf", "rawDiag"),
file = pdfFilename
)
print(rvupload)
message(rvupload)
values$wuid <- rvupload$workunit[[1]]$`_id`
msg <- paste0("The current plot is available as workunit ", values$wuid)
message(msg)
Expand Down
Loading

0 comments on commit 3b9cf3f

Please sign in to comment.