Some checks failed
Security Scan / security (pull_request) Successful in 40s
Test Suite / test (3.11) (pull_request) Successful in 1m25s
Test Suite / build (pull_request) Has been skipped
Security Scan / dependency-check (pull_request) Successful in 35s
Test Suite / lint (pull_request) Failing after 26s
66 lines
1.8 KiB
Python
66 lines
1.8 KiB
Python
from dash import dcc, html
|
|
import dash_bootstrap_components as dbc
|
|
|
|
|
|
class UploadComponent:
|
|
@staticmethod
|
|
def create_data_upload():
|
|
return dcc.Upload(
|
|
id="upload-data",
|
|
children=html.Div(["Drag and Drop or ", html.A("Select Files")]),
|
|
style={
|
|
"width": "100%",
|
|
"height": "60px",
|
|
"lineHeight": "60px",
|
|
"borderWidth": "1px",
|
|
"borderStyle": "dashed",
|
|
"borderRadius": "5px",
|
|
"textAlign": "center",
|
|
"margin-bottom": "20px",
|
|
},
|
|
multiple=False,
|
|
)
|
|
|
|
@staticmethod
|
|
def create_prompts_upload():
|
|
return dcc.Upload(
|
|
id="upload-prompts",
|
|
children=html.Div(["Drag and Drop Prompts or ", html.A("Select Files")]),
|
|
style={
|
|
"width": "100%",
|
|
"height": "60px",
|
|
"lineHeight": "60px",
|
|
"borderWidth": "1px",
|
|
"borderStyle": "dashed",
|
|
"borderRadius": "5px",
|
|
"textAlign": "center",
|
|
"margin-bottom": "20px",
|
|
"borderColor": "#28a745",
|
|
},
|
|
multiple=False,
|
|
)
|
|
|
|
@staticmethod
|
|
def create_reset_button():
|
|
return dbc.Button(
|
|
"Reset All Data",
|
|
id="reset-button",
|
|
color="danger",
|
|
outline=True,
|
|
size="sm",
|
|
className="mb-3",
|
|
style={"width": "100%"},
|
|
)
|
|
|
|
@staticmethod
|
|
def create_error_alert():
|
|
"""Create error alert component for data upload issues."""
|
|
return dbc.Alert(
|
|
id="upload-error-alert",
|
|
dismissable=True,
|
|
is_open=False,
|
|
color="danger",
|
|
className="mb-3",
|
|
)
|
|
|