在警报消息中插入按钮,闪闪发亮

如果选择了“排除服务器场”选项,则下面代码中的好友会显示一条消息警报。但是,我想知道是否可以在此警报中插入两个按钮(是和否)?这些按钮的功能仍在开发中。可执行代码如下。

library(shinyWidgets)
library(shiny)


ui <- fluidPage(


  titlePanel("Old Faithful Geyser Data"),

  sidebarLayout(
    sidebarPanel(

      radioButtons(
        "filter1", 
        h3("Select properties"), 
        choiceValues = c(1, 2),
        choiceNames = list(
          tagList(
            tags$span("All properties"),
            tags$span(icon("info-circle"), id = "icon1", style = "color: blue;")
          ), 
          tagList(
            tags$span("Exclude properties"),
            tags$span(icon("info-circle"), id = "icon2", style = "color: blue;")
          )
        ),
        selected = 1
      ),


      selectInput("filter2", h3("Select farms"),
                  choices = list("All farms" = 1, 
                                 "Exclude farms" = 2),
                  selected = 1),
    ),

    mainPanel(

    )
  )
)

server <- function(input, output, session) {
  observe({
    if(input$filter2 == 2){
      sendSweetAlert(
        session = session,
        title = "Warning!",
        text = "Change filter options selected above",
        type = "warning"
      )
    }
  })
}

shinyApp(ui = ui, server = server)

非常感谢你!