Spaces:
Sleeping
Sleeping
import gradio as gr | |
css = """ | |
.plugin-accordion button span:first-child { | |
font-size: 1.25rem !important; | |
} | |
""" | |
with gr.Blocks(css=css) as registry_submit: | |
gr.Markdown("# π Impact Framework Plugin Registry Submission") | |
gr.Markdown("Fill out the form below to submit your plugin to the Impact Framework Registry") | |
with gr.Accordion("Plugin Details",open=True,elem_classes=["plugin-accordion"]): | |
plugin_name = gr.Textbox(placeholder="What is the name of your plugin?", label="Plugin Name") | |
plugin_description = gr.Textbox(placeholder="What does your plugin do?", label="Plugin Description",lines=3) | |
plugin_url = gr.Textbox(placeholder="https://[your_website.com]", label="Plugin URL", info="Enter the URL where more info can be found about your plugin") | |
plugin_info = gr.Textbox(placeholder="Add any additional info we should know about your plugin", label="Plugin Info",lines=3) | |
with gr.Accordion("Plugin Inputs",open=True,elem_classes=["plugin-accordion"]): | |
gr.Markdown("This is where you put the data your plugin requires") | |
with gr.Row(elem_classes=["input-row"],variant="panel"): | |
plugin_input_1 = gr.Textbox(placeholder="Input name", label="Input Name", info="What is the name of the input?",scale=2) | |
plugin_input_1_type = gr.Dropdown(["Text", "Number", "Boolean"], label="Input Type",value="Text",interactive=True,info="What data type does your input expect",scale=2) | |
plugin_input_1_units = gr.Textbox(placeholder="Watts, Lbs CO2e, etc", label="Units", info="What units of measurement does the input expect?",scale=2) | |
plugin_input_1_required = gr.Checkbox(label="Required", value=False,scale=1) | |
with gr.Row(elem_classes=["input-row"]): | |
plugin_add_input = gr.Button("Add Input") | |
with gr.Accordion("Plugin Outputs",open=True,elem_classes=["plugin-accordion"]): | |
gr.Markdown("This is the data your plugin will return") | |
with gr.Row(elem_classes=["output-row"],variant="panel"): | |
plugin_output_1 = gr.Textbox(placeholder="Output name", label="Output Name", info="What is the name of the output?") | |
plugin_output_1_type = gr.Dropdown(["Text", "Number", "Boolean"], label="Output Type",value="Text",interactive=True,info="What data type does your output expect") | |
plugin_output_1_units = gr.Textbox(placeholder="Watts, Lbs CO2e, etc", label="Units", info="What units of measurement does the output expect?") | |
with gr.Row(elem_classes=["output-row"]): | |
plugin_add_output = gr.Button("Add Output") | |
with gr.Accordion("Plugin Data",open=True,elem_classes=["plugin-accordion"]): | |
gr.Markdown("This is where you put information about your plugin's data sources and assumptions") | |
with gr.Row(elem_classes=["data-row"],variant="panel"): | |
with gr.Column(): | |
with gr.Row(): | |
plugin_data_source_1 = gr.Textbox(placeholder="Data source name", label="Data Source Name", info="What is the name of the data source?") | |
plugin_data_source_1_url = gr.Textbox(placeholder="URL", label="Data Source URL", info="What is the URL of the data source?") | |
with gr.Row(): | |
plugin_data_source_1_description = gr.Textbox(placeholder="Description / Citation", label="Data Source Description", info="What does the data source contain, or what is the reference citation?") | |
with gr.Row(elem_classes=["data-row"]): | |
plugin_add_data_source = gr.Button("Add Data Source") | |
with gr.Accordion("Compatible Plugins",open=True,elem_classes=["plugin-accordion"]): | |
gr.Markdown("## Input Plugins") | |
gr.Markdown("List any known plugins that can provide input into your plugin") | |
with gr.Row(elem_classes=["input-row"],variant="panel"): | |
with gr.Column(): | |
# a url field for the registry page where the plugin can be found | |
plugin_input_plugin_1 = gr.Textbox(placeholder="https://greensoftware.foundation/if/[ID]", label="Plugin URL", info="Enter the impact framework registry URL where the plugin can be found") | |
with gr.Column(): | |
gr.Markdown("Alternatively, search for plugins that are compatible with your required inputs") | |
# a button to help users find compatible plugins | |
plugin_find_input_plugin = gr.Button("Find Compatible Plugins") | |
gr.Button("Add Input Plugin") | |
gr.Markdown("## Dependent Plugins") | |
gr.Markdown("List any plugins that can utilize the output of your plugin") | |
with gr.Row(elem_classes=["output-row"],variant="panel"): | |
with gr.Column(): | |
plugin_output_plugin_1 = gr.Textbox(placeholder="https://greensoftware.foundation/if/[ID]", label="Plugin URL", info="Enter the impact framework registry URL where the plugin can be found") | |
with gr.Column(): | |
gr.Markdown("Alternatively, search for plugins that are compatible with your output") | |
plugin_find_output_plugin = gr.Button("Find Compatible Plugins") | |
gr.Button("Add Output Plugin") | |
gr.Button("Submit Plugin",variant="primary") | |
#btn = gr.Button("Run") | |
#btn.click(fn=update, inputs=inp, outputs=out) | |
registry_submit.launch() |