2017-09-05 11:28:28 +03:00
|
|
|
#' This is a template to view a DT object
|
|
|
|
#'
|
2017-09-27 12:04:48 +03:00
|
|
|
#' @param x data.frame
|
2017-09-05 11:28:28 +03:00
|
|
|
#' @param title Text to display in pane title
|
2017-06-06 23:58:16 +03:00
|
|
|
|
|
|
|
#' @importFrom miniUI miniPage gadgetTitleBar miniContentPanel
|
|
|
|
#' @importFrom DT dataTableOutput renderDataTable
|
2017-09-27 12:04:48 +03:00
|
|
|
#' @importFrom shiny observeEvent paneViewer runGadget stopApp
|
2017-06-06 23:58:16 +03:00
|
|
|
dataTableViewer <- function(x, title = "") {
|
|
|
|
ui <- miniPage(
|
|
|
|
gadgetTitleBar(title),
|
|
|
|
miniContentPanel(
|
|
|
|
DT::dataTableOutput("dt", height = "100%")
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
server <- function(input, output, session) {
|
|
|
|
output$dt <- DT::renderDataTable(x)
|
|
|
|
observeEvent(input$done, stopApp())
|
|
|
|
}
|
|
|
|
|
|
|
|
viewer <- paneViewer()
|
|
|
|
runGadget(ui, server, viewer = viewer)
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
addinListAllResources <- function() {
|
|
|
|
settingsfile <- getOption("AzureSMR.config")
|
|
|
|
assert_that(file.exists(settingsfile))
|
|
|
|
az <- createAzureContext(configFile = settingsfile)
|
|
|
|
z <- azureListAllResources(az)
|
|
|
|
z$id <- NULL
|
|
|
|
dataTableViewer(z, title = "All resources")
|
|
|
|
}
|
|
|
|
|
|
|
|
addinGetAllVMstatus <- function() {
|
|
|
|
settingsfile <- getOption("AzureSMR.config")
|
|
|
|
assert_that(file.exists(settingsfile))
|
|
|
|
az <- createAzureContext(configFile = settingsfile)
|
|
|
|
z <- azureGetAllVMstatus(az)
|
|
|
|
z$id <- NULL
|
|
|
|
dataTableViewer(z, title = "All virtual machines")
|
|
|
|
}
|