fix pack 2

This commit is contained in:
Rafał Piskorski 2021-01-22 13:42:15 +01:00
parent b2ba30db92
commit 96c515b662
5 changed files with 73 additions and 65 deletions

View File

@ -6,6 +6,7 @@ library(plotly)
library(DT)
library(shinyjs)
library(leaflet)
library(tidyverse)
#source(".R/home_module.R",encoding="utf-8")
#source(".R/about_module.R",encoding="utf-8")
@ -161,7 +162,7 @@ server <- shinyServer(function(input, output, session){
inlineCSS(list(.clicked = "background-color: #008375 !important")),
column(12,
navbarPage("",
tabPanel(a("TakeCareApp",id='takeCareApp',class = "tab-link", href = route_link("home"))),
tabPanel(a("TakeCareApp",id='takeCareApp',class = "tab-link", href = route_link("/home"))),
tabPanel(a("Firmy",id="tab1",class = "tab-link", href = route_link("firms"))),
tabPanel(a("O nas",id="tab2",class = "tab-link", href = route_link("about"))),
tabPanel(a("Zaloguj",id="tab3",class="tab-link", href = route_link("login"))),

View File

@ -6,6 +6,18 @@ library(DT)
calculatorUI <- function(id){
ns <- NS(id)
uiOutput("calculatorPage")
}
calculatorServer <- function(input, output, session) {
calculatorRV <-reactiveValues(value=NULL)
calculatorTV <-reactiveValues(value=NULL)
output$calculatorPage<-renderUI({
if(get_page()=="calculator"){
fluidPage(
@ -48,12 +60,11 @@ calculatorUI <- function(id){
)
}
)
}
calculatorServer <- function(input, output, session) {
calculatorRV <-reactiveValues(value=NULL)
calculatorTV <-reactiveValues(value=NULL)
})
output$report <- downloadHandler(

View File

@ -85,7 +85,7 @@ loginServer <- function(input, output,session) {
output$loginErr<-renderUI({
if (isCorrect()==TRUE){
p("OK",style="color:white;text-align:center;")
}else{
p("Uzytkownik nie istnieje lub wprowadzono bledne dane",style="color:yellow;text-align:center;")
}

View File

@ -121,10 +121,13 @@ profilServer <- function(input, output,session) {
personalDataVector <- reactiveVal()
historyDataVector <- reactiveVal()
activeTab<-reactiveVal()
downloadPersonalData<-reactive({
r<-httr::GET("http://localhost:8080/api/profile",add_headers(Authorization=paste("Bearer",input$token,sep=" ")))
print("Reactive data")
r
@ -133,6 +136,7 @@ profilServer <- function(input, output,session) {
downloadHistoryData<-reactive({
r<-httr::GET("http://localhost:8080/api/prediction/usersPredictions/ind",add_headers(Authorization=paste("Bearer",input$token,sep=" ")),encode = 'json')
print("Reactive hist")
r
@ -140,29 +144,25 @@ profilServer <- function(input, output,session) {
observe({
currPage = get_page()
if(currPage=="profile" | currPage=="calculator" | currPage=="iota"){
if(currPage=="profil" | currPage=="calculator" | currPage=="iota"){
if(currPage=="profile"){
run = paste('Shiny.onInputChange("pagePROFILE","',timestamp(),'");',sep="")
shinyjs::runjs(run)
}
else{
shinyjs::runjs('Shiny.onInputChange("profileTabs", "");')
}
session$sendCustomMessage(type='tokenHandlerAccess',(session$clientData)$url_hash)
}
})
observeEvent(input$profileTabs,{
if(input$profileTabs=="data"){
personalDataVector(downloadPersonalData())
}else if(input$profileTabs=="history"){
historyDataVector(downloadHistoryData())
}
@ -246,6 +246,7 @@ profilServer <- function(input, output,session) {
output$afterLogin<-renderUI({
if(get_page()=="profil"){
if(!is.null(input$auth) & length(input$auth)>0 ){
fluidRow(
@ -262,6 +263,7 @@ profilServer <- function(input, output,session) {
}else{
}
}
})
@ -308,16 +310,16 @@ profilServer <- function(input, output,session) {
df_historyTable<-df_historyTable %>%
mutate(Akcja=historyTableButtons)%>%
select(name,resultValue,localDateTime,Akcja) %>%
mutate(localDateTime = (str_replace(strptime(str_replace(localDateTime,"T"," "),"%Y-%m-%d %H:%M:%S")," CET","")))%>%
rename(
Nazwa = name,
Wynik = resultValue,
Data = localDateTime
)
df_historyTable$Nazwa<-do.call(c, df_historyTable$Nazwa)
df_historyTable$Wynik<-do.call(c, df_historyTable$Wynik)
df_historyTable$Data<-do.call(c, df_historyTable$Data)
DT::datatable(df_historyTable,selection="none",options = list(scrollX = TRUE,language=pl))}
# }

View File

@ -60,13 +60,7 @@ public class UserController {
HttpServletResponse httpServletResponse){
ObjectMapper mapper = new ObjectMapper();
try {
String jsonString = mapper.writeValueAsString(personalProfileDTO);
System.out.println(jsonString);
}catch(Exception e){
e.printStackTrace();
}
Map<String,Object> map = new HashMap<>();