[spack.ui.sections]
order = ["spack_input_box", "spack_output_box_table", "spack_output_box_text"]
[spack.ui.sections.ui_basic]
spack_input_box = "title = 'Input', status = 'primary', width = 12, collapsed = FALSE, collapsible = TRUE"
spack_output_box_text = "title = 'Output of spack (Text)', status = 'primary', width = 12, collapsed = FALSE, collapsible = TRUE"
spack_output_box_table = "title = 'Output of spack (Table)', status = 'primary', width = 12, collapsed = FALSE, collapsible = TRUE"

[spack.paramters.spack_input_box]
# For reading annovarR shiny APP spack tool input files  
section_type = "input"
rcmd_last = ""
progressbar_message = "Running spack functions."
render_id = "spack_input_box"

#!!!!! input_ui_order required related section
input_ui_order = ["single_input", "start_analysis"]

[spack.paramters.spack_input_box.input.single_input]
title = "Parameters:"
title_control = "class = 'input-section-p'"
varname = ["spack_sub_cmd", "spack_params"]
input_id = ["input_spack_1", "input_spack_2"]
type = ["shiny::selectInput", "shiny::textInput"]
label = ["spack subcommands", "spack parameters"]

[spack.paramters.spack_input_box.input.single_input.choices]
spack_sub_cmd = ["list", "info", "find", "install", "uninstall",
                 "spec", "load",
                 "module", "unload",
                 "view", "create", "edit",
                 "arch", "compilers"]
[spack.paramters.spack_input_box.input.single_input.selected]
spack_sub_cmd = "list"

[spack.paramters.spack_input_box.input.start_analysis]
input_id = "start_spack_analysis"
type = "shiny::actionButton"
label = "Run"

[spack.paramters.spack_output_box_text]
section_type = "output"
rcmd_last = "cat(BioInstaller::spack(sprintf('%s %s', spack_sub_cmd, spack_params)))"
render_type = "shiny::renderPrint"
render_id = "spack_output"
output_type = "shiny::verbatimTextOutput"
progressbar_message = "spack ouput"

[spack.paramters.spack_output_box_table]
section_type = "output"
rcmd_last = """
if (spack_sub_cmd == 'list') obj <- as.data.frame(spack.list())
colnames(obj) <- "item"
obj
"""
render_type = "DT::renderDataTable"
render_id = "spack_output_table"
output_type = "DT::dataTableOutput"
progressbar_message = "spack ouput_box_table"
