inst/shiny-examples/medidor/ui.R

library(shiny)
library(shinydashboard)

#------------------------------------------------------------------------------
header <- dashboardHeader(
  title = tags$span('Medidor de Justiça')
)


#------------------------------------------------------------------------------
sidebar <- dashboardSidebar(
  disable = FALSE,
  radioButtons('origem', 'Origem do processo', 
               c('STF' = 'stf', 'STJ' = 'stj')),
  
  radioButtons('tipo_busca', 'Tipo de busca', 
               c('Busca de Processos' = 'busca', 
                 'Processos emblemáticos' = 'select')),
  conditionalPanel(
    condition = "input.tipo_busca == 'select'",
    selectInput('select', 'Selecione um processo', '')
  ),
  conditionalPanel(
    condition = "input.tipo_busca == 'busca'",
    radioButtons('tipo_numero', 'Tipo de número', 
                 c('Número CNJ' = 'cnj', 'Número do Recurso' = 'rec')),
    sidebarSearchForm('busca_side', 'busca_side_btn', 'Buscar processo')
  ),
  tags$hr(),
  sidebarMenu(
    id = "tabs",
    menuItem("Medidor", tabName = "medidor", icon = icon("plus-square")),
    menuItem("Configurações", tabName = "config", icon = icon("wrench"))
  ),
  tags$hr()
)

#------------------------------------------------------------------------------
medidor <- tabItem(
  'medidor',
  includeScript('www/js/cor.js'),
  
  ## Infos basicas e Alertas
  fluidRow(
    box(width = 6, title = 'Informações básicas', height = 800,
        tags$div(DT::dataTableOutput('infos'), 
                 style = 'max-width:100%;max-height:730px;overflow-y:scroll;overflow-x:scroll')
        ),
    column(
      6,
      box(width = 12, title = 'Alertas', height = 400,
          htmlOutput('alertas'))#,
      # box(width = 12, title = 'Legenda', height = 150,
      #     valueBox('Muito ruim', value = '', color = 'red'),
      #     valueBox('Perigoso', value = '', color = 'yellow'),
      #     valueBox('OK', value = '', color = 'green')
      # )
    )
  ),
  
  ## Legenda
  fluidRow(
    # box(width = 6, title = 'Linha do tempo'), height = 400,
  )
)

config <- tabItem(
  'config',
  box(width = 12)
)


bod <- dashboardBody(tabItems(medidor, config))

#------------------------------------------------------------------------------
dashboardPage(header, sidebar, bod, skin = 'red', title = 'Medidor de Justiça')
jtrecenti/medidor documentation built on May 20, 2019, 3:17 a.m.