Example #1
0
def login():
    return dbc.Col(
        html.Form(
            [
                dbc.FormGroup(
                    [
                        dbc.Label('Username', html_for=__package__ + 'username', width=2),
                        dbc.Col(
                            dbc.Input(id=__package__ + '-username', placeholder='Enter username', name='username'),
                            width=10
                        ),
                    ],
                    row=True,
                ),
                dbc.FormGroup(
                    [
                        dbc.Label('Password', html_for=__package__ + 'password', width=2),
                        dbc.Col(
                            dbc.Input(id=__package__ + '-password', placeholder='Enter password', name='password', type='password'),
                            width=10
                        ),
                    ],
                    row=True,
                ),
                html.Button('Submit', id=__package__ + '-submit', className='button btn-primary', type='submit'),
            ],
            action='/custom-auth/login', method='post',
        ),
        width={'size': 4, 'offset': 4},
        className='mt-4 mx-auto'
    )
Example #2
0
def _iframe(element_id, download=False):
    optional_download_form = html.Form([
        dcc.Input(id=element_id + '-input-genes-json',
                  type='hidden',
                  name='genes-json'),
        dcc.Input(id=element_id + '-input-conditions-json',
                  type='hidden',
                  name='conditions-json'),
        dcc.Input(type='submit', value='Download')
    ],
                                       method='POST',
                                       action='download') if download else ''
    return html.Div(
        [
            html.Br(), optional_download_form,
            html.Iframe(id=element_id + '-iframe',
                        srcDoc='First select a subset')
            # or
            #   dcc.Graph(id='gene-table',
            #   figure=ff.create_table(self._union_dataframe.to_html()))
            #   (but that's slow)
            # or
            #   https://community.plot.ly/t/display-tables-in-dash/4707/13
        ],
        className='tab-pane',
        id=element_id)
Example #3
0
def createTaskInCompletedReport(taskId):
    location = f'download/result-{taskId}.jpg'

    return html.Div(
        id=f"task-{taskId}",
        children=[
            html.P(f'Task {taskId}', style={'padding': '10px'}),
            # html.A('Link to donload', className='stretched-link',href=location, style={'margin': '5px 20px'}),
            html.Form(action=location,
                      method="get",
                      target='_blank',
                      children=[
                          html.Img(src=location,
                                   className='img-thumbnail',
                                   style={
                                       'box-sizing': 'border-box',
                                   }),
                          html.Button(className="btn btn-success",
                                      type="submit",
                                      children=["Download"],
                                      style={
                                          'margin': '10px auto',
                                          'display': 'block'
                                      })
                      ])
        ],
        className='shadow bg-light',
        style={
            'padding': '5px',
            'margin': '10px 0',
            'border-radius': '5px',
        })
Example #4
0
def layout_login():
    """The Dash app login oage layout"""
    header = html.Div(
        [
            html.H2("HIIT PI"),
            dcc.Markdown(
                id="welcome-intro-md",
                children="""
            A workout trainer [Dash](https://dash.plot.ly/) app 
            that helps track your [HIIT](https://en.wikipedia.org/wiki/High-intensity_interval_training) workouts 
            by analyzing real-time video streaming from your sweet [Pi](https://www.raspberrypi.org/).  
            """,
            ),
            dcc.Markdown(
                id="welcome-intro-sub-md",
                children=
                "Powered by [TensorFlow Lite](https://www.tensorflow.org/lite) and [Edge TPU](https://cloud.google.com/edge-tpu) with ❤️.",
            ),
        ],
        className="app__header",
    )

    login_form = html.Div(
        [
            html.Form(
                [
                    dcc.Input(
                        id="user_name_input",
                        name="user_name_form",
                        type="text",
                        placeholder="PLAYER NAME",
                        maxLength=20,
                        minLength=1,
                        required=True,
                    ),
                    html.Button(
                        id="user-login-btn",
                        children="ENTER",
                        type="submit",
                        n_clicks=0,
                        className="button",
                    ),
                ],
                action="/user_login",
                method="POST",
                autoComplete="off",
                className="form-inline",
                title="Enter your player name.",
            )
        ],
        className="flex-display",
        style={"margin-top": "4rem"},
    )

    welcome_jumbotron = html.Div([header, login_form],
                                 className="header_container")
    return html.Div(
        [welcome_jumbotron],
        className="welcome_login_form page-background-image flex-display",
    )
Example #5
0
def result_download_button(app, df):
    """Download button for processed data or results

    Args:
        app (app): get app properties
        df (pandas DataFrame): input DataFrame, to be downloaded by user

    Returns:
        (html.Form)
    """
    df_ser = encode_df(df)
    return html.Form([
        dcc.Input(value=df_ser,
                  name='result',
                  type='text',
                  style={'display': 'none'}),
        html.Button([
            html.Img(src=app.get_asset_url('download.svg')),
            html.Span('Download results')
        ],
                    type='submit',
                    className='div-with-image small-image')
    ],
                     method='POST',
                     action='/download_df/')
Example #6
0
def user_coments(portfolio: RandomPortfolio):

    with sqlite3.connect('data/comments.db') as conn:
        c = conn.cursor()

        c.execute("""
                CREATE TABLE IF NOT EXISTS comment_table(
                  id varchar(12),
                  user TEXT,
                  date DATE,
                  text TEXT,
                  tag TEXT)
                  """)

        existing_comments = pd.read_sql("""
            SELECT * FROM comment_table 
            WHERE id = {};""".format(portfolio.id), con=conn)

        if existing_comments.empty:
            comments_table = html.P("No existing comments for this portfolio.")
        else:
            comments_table = dtex.DataTable(
                rows=existing_comments.to_dict('records'),
                filterable=True,
                sortable=True,
                id='existing-comments')

    return html.Form(

        html.Div([

            html.H2('Account n° {} - Comments'.format(portfolio.id), className='panel-heading'),

            html.Div([
                html.Div([

                    comments_table,
                    html.Label('Comments', htmlFor='comment-input'),
                    dcc.Textarea(
                        id='comment-input',
                        value='',
                        placeholder='Enter a comments...',
                        rows=4,
                        className='form-control'),
                        ],
                    className='form-group'),

                html.Div([
                    html.Button('Submit', id='comment-button', n_clicks=None, className='btn btn-default'),
                    html.Div(id='comment-output')],

                    className='form-group')

                ],
                className='panel-body')

        ], className='panel panel-default'),
    )
Example #7
0
def build_download_button(uri):
    """Generates a download button for the resource"""
    button = html.Form(action=uri,
                       method="get",
                       children=[
                           html.Button(className="button",
                                       type="submit",
                                       children=["download"])
                       ])
    return button
Example #8
0
def get_layout():
    username = ''
    password = ''

    message = current_user.get_message()

    layout = dbc.Container(dbc.Row(dbc.Col(
        [
            html.H1('Log In', className='text-center'),
            html.P(message['form'], className='error-message text-center')
            if message['form'] is not None else None,
            html.Form([
                dbc.FormGroup([
                    dbc.Label('Username', html_for='username'),
                    dbc.Input(type='text',
                              id='username',
                              name='username',
                              placeholder='Enter username',
                              value=username,
                              invalid=True if message['form']
                              or message['username'] else False),
                    dbc.FormFeedback(
                        message['username'],
                        valid=False,
                    ),
                ]),
                dbc.FormGroup([
                    dbc.Label('Password', html_for='password'),
                    dbc.Input(type='password',
                              id='password',
                              name='password',
                              placeholder='Enter password',
                              value=password,
                              invalid=True if message['form']
                              or message['password'] else False),
                    dbc.FormFeedback(
                        message['password'],
                        valid=False,
                    ),
                ]),
                html.Button(
                    'Login',
                    type='submit',
                    id='login_button',
                    className='col-12 col-lg-4 float-lg-right btn btn-primary')
            ],
                      action='/login',
                      method='post')
        ],
        className='col-12 col-md-6 col-lg-4 m-auto'),
                                   align='center',
                                   className='height-100vh'),
                           fluid=True)

    return layout
Example #9
0
def build_download_button(uri=None):
    """Generates a download button for the resource"""
    if uri:
        button = html.Form(
            action='/download/'+uri,
            method="get",
            children=[
               html.Button('Загрузить', type='submit'),
            ]
        )
        return button
Example #10
0
def get_layout():
    layout = dbc.Row(dbc.Col(dbc.Row(children=[
        dbc.Button(html.Span(
            html.I(className='fa fa-bars', **{'aria-hidden': True})),
                   id='sidebarCollapse',
                   className='m-2 bg-transparent px-3'),
        html.A(children=[
            html.Img(src='/assets/images/logo_1.png',
                     height=50,
                     className='d-block d-md-none'),
            html.Img(src='/assets/images/logo.png',
                     height=50,
                     className='d-none d-md-block'),
            html.Div(html.Big(children=['IntelliFlux ',
                                        html.B('Dashboard')],
                              className='m-auto'),
                     className='ml-2 d-none d-md-flex flex-column')
        ],
               href='/',
               className='col-white d-flex m-2'),
        html.Form(children=[
            html.Button(children=[
                dbc.Row(children=[
                    dbc.Col(children=[
                        html.B(current_user.get_username()),
                        html.Span('Logout')
                    ],
                            className='d-flex flex-column p-0'),
                    dbc.Col(children=[
                        html.Span(html.I(className='fa fa-user-circle',
                                         **{'aria-hidden': True}),
                                  className='m-auto')
                    ],
                            className='d-flex flex-column pr-0')
                ],
                        className='m-auto')
            ],
                        type='submit',
                        className=
                        'bg-black col-white border-0 logout-button px-0')
        ],
                  action='/logout',
                  method='post',
                  className='ml-auto m-2 d-none d-md-block')
    ]),
                             className='bg-black'),
                     className='header-container')

    return layout
Example #11
0
def new_login(topnav):
    return html.Div(
        id="login-page",
        children=[
            topnav,
            html.Div(
                html.Img(src=APP_LOGO, height="80px"),
            ),
            html.Div(
                Header("Sign in to Budget App"),
            ),
            dbc.Card(
                id="login-card",
                children=dbc.CardBody(
                    html.Form(
                        id="login-form",
                        action="/login",
                        method="POST",
                        children=[
                            dbc.Label("Username", html_for="login-username"),
                            dbc.Input(
                                id="username-input",
                                name="login-username",
                                type="text",
                                value="bob",
                            ),
                            html.Br(),
                            dbc.Label("Password", html_for="login-password"),
                            dbc.Input(
                                id="password-input",
                                name="login-password",
                                value="bob@123",
                                type="password",
                            ),
                            html.Br(),
                            dbc.Button(
                                "Login",
                                id="submit-button",
                                color="primary",
                                block=True,
                            ),
                        ]
                    )
                ),
                color="light",
            ),
        ],
    )
Example #12
0
 def buildPage(self):
     """
     Builds page with the basic layout from *basicApp.py* and adds the login form.
     """
     self.add_basic_layout()
     login_form = html.Div([
         html.Form([
             dcc.Input(placeholder='username', name='username',
                       type='text'),
             dcc.Input(
                 placeholder='password', name='password', type='password'),
             html.Button('Login', type='submit')
         ],
                   action='/apps/login',
                   method='post')
     ])
     self.add_to_layout(login_form)
Example #13
0
 def add_basic_layout(self):
     """
     Calls class functions to setup the layout: title, subtitle, description, \
     logo and footer.
     """
     self.layout.append(html.Div([html.Form([html.Button('Logout', type='submit')], action='/apps/logout', method='post',
                                            style={'display': 'none', 'position': 'absolute', 'right': '0px'}, id='logout_form')]))
     self.layout.append(html.Div(html.H2('Invalid user name or password', className='error_msg'), id='error_msg', style={'display': 'none'}))
     if self.title is not None:
         self.layout.append(self.get_HTML_title())
     if self.subtitle is not None:
         self.layout.append(self.get_HTML_subtitle())
     if self.description is not None:
         self.layout.append(self.get_HTML_description())
     if self.logo is not None:
         self.layout.append(self.logo)
     if self.footer is not None:
         self.layout.append(self.footer)
Example #14
0
def build_download_button(uri):
    """Generates a download button for the resource"""
    button = html.Form(
        action=uri,
        method="get",
        children=[
            html.Button(
                type="submit",
                style={
                    'margin': 'auto'
                },
                children=[
                    "download model"
                ]
            )
        ]
    )
    return button
Example #15
0
def make_objectives_form(id='objectives-form', style={}):
    objective_labels = ['Safety', 'Cost', 'Stability', 'Reliability']

    objective_input_labels = [
        html.Label(children=l,
                   id=l.lower() + '-label',
                   htmlFor=l.lower() + '-slider',
                   style={'flex': '1 1 auto'}) for l in objective_labels
    ]

    objective_input_sliders = [
        html.Div(id=l.lower() + '-slider-div',
                 style={
                     'flex': '1 1 auto',
                     'padding': '10px'
                 },
                 children=[
                     dcc.Slider(id=l.lower() + '-slider',
                                min=1,
                                max=4,
                                marks={j: str(j)
                                       for j in range(1, 5)} if i == 3 else {},
                                value=1 if i else 4,
                                vertical=True)
                 ]) for i, l in enumerate(objective_labels)
    ]

    return html.Form(children=html.Fieldset(children=[
        html.Div(children=objective_input_sliders,
                 style={
                     'display': 'flex',
                     'flex': '5 5 auto',
                     'columnCount': 4,
                     'height': '100px'
                 }),
        html.Div(children=objective_input_labels,
                 style={
                     'display': 'flex',
                     'flex': '1 1 auto',
                     'columnCount': 4
                 })
    ]),
                     id=id,
                     style=style)
Example #16
0
def display_page(pathname):

    if pathname == "/":

        #STOCKS APP
        return html.Div([
            html.Div(
                className='container',
                children=[
                    html.Hr(className="seperator"),
                    html.Div(
                        className='row',

                        #TICKER COLUMN
                        children=[
                            html.Div(
                                className='col-lg-12',
                                children=[
                                    html.Form(children=[
                                        html.Fieldset(children=[
                                            html.Div(
                                                className='form-group',
                                                children=[
                                                    html.Label(
                                                        children="""Ticker"""),
                                                    dcc.Input(id='input',
                                                              className=
                                                              'form-control',
                                                              value='',
                                                              type='text')
                                                ])
                                        ])
                                    ])
                                ])
                        ]),

                    #GRAPH COLUMN
                    html.Div(className="row",
                             children=html.Div(
                                 className='col-lg-12',
                                 children=[html.Div(id='output_graph')]))
                ])
        ])
def form(action, location):

    return html.Form(action=location,
                     method="get",
                     target='_blank',
                     children=[
                         html.Img(src=location,
                                  className='img-thumbnail',
                                  style={
                                      'box-sizing': 'border-box',
                                  }),
                         html.Button(className="btn btn-success",
                                     type="submit",
                                     children=["Download"],
                                     style={
                                         'margin': '10px auto',
                                         'display': 'block'
                                     })
                     ])
Example #18
0
def get_layout(nav_items=[]):
    # create navigation layout
    return html.Nav(children=[
        html.Button('×',
                    className='close-nav bg-transparent border-0 col-white'),
        html.A(html.Img(
            src='/assets/images/logo_1.png',
            height=50,
        ),
               href='/',
               className='d-block text-center my-2'),
        html.Ul(children=[
            html.Li(html.A(children=nav_item['label'],
                           href=nav_item['target'])) for nav_item in nav_items
        ]),
        html.Form(
            children=[
                html.Button(
                    children=[
                        dbc.Row(children=[
                            dbc.Col(children=[
                                html.B(current_user.get_username()),
                                html.Span('Logout')
                            ],
                                    className='d-flex flex-column p-0'),
                            dbc.Col(children=[
                                html.Span(html.I(className='fa fa-user-circle',
                                                 **{'aria-hidden': True}),
                                          className='m-auto')
                            ],
                                    className='d-flex flex-column pr-0')
                        ],
                                className='m-auto')
                    ],
                    type='submit',
                    className='bg-black col-white border-0 logout-button px-0')
            ],
            action='/logout',
            method='post',
        )
    ],
                    id='sidebar')
Example #19
0
def header():
    search_options = []
    data_lists = read_yaml(search_services_file)
    for data in data_lists:
        search_options.append({'label':data['name'],'value':data['id']})
    
    
    return html.Div(className='ui vertical masthead center aligned segment', children=[
            html.Div(className='ui container', children=[
                html.Div(className='ui secondary  menu', children=[
                        html.A('首页', className="item active", href="/"),     
                        html.A('行业分类', className="item", href="/industry"), 
                        html.A('股东关联', className="item", href="/shareholders"),                                                                                                                                                                                                                                      
                        html.A('财务报表', className="item", href="/indicators"),
                        html.A('投资组合', className="item", href="/portfolio"),
                        html.A('风险价值', className="item", href="/var"),                      
                        html.A('技术分析', className="item", href="/tick"),            
                        html.Div(className='right menu',children=[
                                html.A('GitHub', className="ui item", href="https://github.com/fundviz",target="_blank" ),
                                        ])
                                ]),                               
                    ]),
                                                  
                                                                                                  
             html.Div(className='ui text container', children=[
                    html.H1('查企.Net',className='ui header'),
                    html.H2('Do whatever you want when you want to.'),
                    html.Form(id='submit-form',target='_blank',method='post',className='ui input focus',children=[
                                dcc.Input(id='searchInput',
                                          list='autoSuggestion',
                                          type='text',
                                          style={'padding': '0px'}
                                            ),
                                html.Div(children=[dcc.Dropdown(id='search-engine',
                                             options = search_options,
                                             value='wechat',
                                             searchable=False,
                                             clearable=False,
                                             )],style={'width': '20%',}),
                    html.Datalist(id="autoSuggestion")
                                                                                                                                                                          
            ],style={'width': '90%',})]       )])
Example #20
0
def display_page(pathname):
    df = load(pathname)
    return html.Div([
        html.H3('You are on page {}'.format(pathname)),
        dbc.Row([
            html.Form(
                children=[
                    html.Table(children=[
                        series_to_tr(i, row) for i, row in df.iterrows()
                    ]),
                    html.Button(
                        children='Submit',
                        type='submit',
                    ),
                ],
                id='form',
                method='POST',
                action='/submit',
            ),
        ])
    ])
Example #21
0
    def download_library(n, lib_text):
        if n is None:
            raise PreventUpdate

        relative_filename = os.path.join("workspace", "AI.lib")
        absolute_filename = os.path.join(os.getcwd(), relative_filename)

        with open(relative_filename, "w") as f:
            f.write(lib_text)
        uri = relative_filename
        return html.Form(
            action=uri,
            method="get",
            children=[
                html.Button(children=[
                    dbc.Button("Success", color="success", className="mr-1")
                ],
                            type="submit",
                            style={"borderStyle": "none"})
            ],
        )
def get_similar_articles(n_clicks, _):
    if n_clicks == []:
        return []

    elif n_clicks > 0:
        article_index = int(
            dash.callback_context.states['article_index.children'])
        article_title = topic_df.loc[article_index, 'title']
        recs, title_list, url_list = get_recs(article_index,
                                              n=5,
                                              topic_df=topic_df)
        element_list = []
        element_list.append(html.Br())
        element_list.append(
            html.H6(
                dcc.Markdown(children='Articles similar to your selection:',
                             style={'color': '#fff'})))
        element_list.append(html.Br())
        for i, rec in enumerate(recs):
            element = html.Form(children=[
                html.Button(children=f'{title_list[i]}',
                            id=f'rec{i}',
                            type='submit',
                            formAction=f'https://www.nature.com{url_list[i]}',
                            formTarget='_blank',
                            n_clicks=0,
                            style={
                                'backgroundColor': '#fff',
                                'border': 'none',
                                'color': 'black',
                                'fontSize': '14px'
                            })
            ])
            element_list.append(element)
            element_list.append(html.Br())
        return element_list
    else:
        return []
Example #23
0
def create_download_button(key):
    """
    Creates a button that submits a POST request to the /download/ route.

    Args:
        key (str): S3 key

    Returns:
        html.Form
    """
    return html.Form(
        [
            dbc.Input(type='hidden', name='key', value=serialize(key)),
            dbc.Button(
                file_name(key),
                type='submit',
                color='link',
            )
        ],
        action=url_for('fif_archive.download'),
        method='POST',
        className='download-form',
    )
Example #24
0
def render():
    return page.get_layout(
        html.Div([
            dcc.Interval(
                id='main-tick',
                interval=2 * 1000,  # in milliseconds
                n_intervals=0),
            html.H1('Просмотр показаний счетчиков'),
            html.Div(
                className='row',
                children=[
                    html.Form(
                        className='col-xs-12 form',
                        children=[
                            html.H3('Счетчик'),
                            dcc.RadioItems(
                                options=[{
                                    'label': hard.name,
                                    'value': hard.id
                                } for hard in db.session.query(
                                    models.Hardware).all()],
                                value=1,
                                id='select-hardware',
                                className='radio',
                                # labelClassName='row',
                                # inputClassName='col-xs-6',
                                labelStyle={'margin': '5px'})
                        ]),
                    html.Div(
                        [html.H3('Показания'),
                         dcc.Graph(id='history-graph')])
                ]),
            html.Div([
                'History',
                html.Div(id='history', children=[dcc.Graph(id='chart')])
            ])
        ]))
 def render_controls():
     return html.Div(
         [
             html.H3("Controls", className="Subhead"),
             html.Form(
                 html.Div(
                     className="form",
                     children=[
                         html.Div(
                             id="page-controls",
                             children=[],
                         ),
                         html.Div(
                             className="form-group-header",
                             children=html.Label("Patch Location:",
                                                 className="m-2"),
                         ),
                         html.Div(
                             className="form-group-body",
                             children=html.Pre(
                                 id="patch-config",
                                 className="m-2 similarity-code-view",
                             ),
                         ),
                         html.Div(
                             className="form-group-body",
                             children=html.Div(
                                 id="extractor-constructor",
                                 className="m-2 codelike-content",
                             ),
                         ),
                     ],
                 ), ),
         ],
         className="col-4 float-left",
         id="left-column-div",
     )
def get_recent_articles(input_topic):
    if input_topic:
        subset = topic_df[topic_df.subtopic == input_topic].head(5)
        titles = list(subset.title)
        urls = list(subset.url)
        indices = list(subset.index)

        element_list = []
        element_list.append(html.Br())
        element_list.append(
            html.H6(
                dcc.Markdown(
                    children=f'Recent articles related to **{input_topic}**',
                    style={'color': '#fff'})))
        element_list.append(html.Br())
        for i in range(len(titles)):
            element = html.Form(children=[
                html.Button(children=f'{titles[i]}',
                            id=f'btn{i}',
                            type='submit',
                            formAction=f'https://www.nature.com{urls[i]}',
                            formTarget='_blank',
                            n_clicks=0,
                            style={
                                'backgroundColor': '#fff',
                                'border': 'none',
                                'color': 'black',
                                'fontSize': '14px'
                            })
            ])
            element_list.append(element)
            element_list.append(html.Br())

        return element_list
    else:
        return []
Example #27
0
encoded_image = base64.b64encode(open(image_filename, 'rb').read())


app.layout = html.Div(className="row justify-content-center", children= [
                html.H3(className="text-dark col-11 offset-1 mt-1", children="Bienvenue"),
    html.Div(className="row justify-content-center", children=[
       


        html.Div(className="col-6",children=[
                html.Hr(className="col-11 offset-1"),
                html.Div(className="p-5 ml-5 shadow",children=[
                html.Form([
                    
                           html.Img(src='data:image/png;base64,{}'.format(encoded_image))

                 
                  
                         ], className="row"),
                html.Hr(),
                dcc.Link( html.Button('Rediriger vers la banque de  "Allemagne" '), href='https://github.com/czbiohub/singlecell-dash/issues/new'),
                                html.Hr(),
html.A(html.Button('Submit feedback!', className='three columns'),
    href='/german/'),
                html.Button("valider", className="btn btn-success", id="action"),
                
                 ])
        
        ])
                 
    ])
Example #28
0
def login_layout(app):
    return html.Div(
        [
            html.Div(
                [
                    html.Div(html.Img(src=app.get_asset_url("coeus.png"),
                                      style={"height": "4rem"}),
                             style={
                                 "text-align": "center",
                                 "padding": "4rem"
                             }),
                    html.Div(html.H2("Patient",
                                     style={
                                         "font-size": "1.6rem",
                                         "padding-left": "20px"
                                     }),
                             style={"text-align": "start"}),
                    html.Div(id='store-location'),
                    dbc.Card(
                        dbc.CardBody(
                            [
                                html.Div(style={"padding-top": "20px"}),
                                dbc.Collapse(children=[
                                    "\u2757",
                                    "Please check your username and password."
                                ],
                                             id='login-collapse-check',
                                             is_open=False,
                                             style={"text-align": "center"}),
                                html.Div([
                                    html.Form(
                                        [
                                            html.Div(dbc.Input(
                                                placeholder="Username",
                                                type="text",
                                                style={
                                                    "border-radius": "10rem"
                                                },
                                                id="login-input-username"),
                                                     style={
                                                         "padding": "0.5rem"
                                                     }),
                                            html.Div(dbc.Input(
                                                placeholder="Password",
                                                style={
                                                    "border-radius": "10rem"
                                                },
                                                type='password',
                                                id="login-input-password"),
                                                     style={
                                                         "padding": "0.5rem"
                                                     }),
                                            dbc.Row(
                                                [
                                                    dbc.Col(html.Div(), ),
                                                    dbc.Col(
                                                        [
                                                            dbc.Button(
                                                                "Log In",
                                                                # id = 'manager-button-openmodal-pmpm',
                                                                className=
                                                                "mb-3",
                                                                style={
                                                                    "background-color":
                                                                    "#38160f",
                                                                    "border":
                                                                    "none",
                                                                    "border-radius":
                                                                    "10rem",
                                                                    "font-family":
                                                                    "NotoSans-Regular",
                                                                    "font-size":
                                                                    "1rem",
                                                                    "width":
                                                                    "6rem"
                                                                },
                                                                id=
                                                                "login-button-submit"
                                                            ),
                                                        ],
                                                        width=3),
                                                    dbc.Col(html.Div(), ),
                                                ],
                                                style={
                                                    "padding-top": "2rem",
                                                    "padding-right": "1rem"
                                                })
                                        ],
                                        action='/login',
                                        method='post')
                                ])
                            ],
                            style={
                                "padding-left": "2rem",
                                "padding-right": "2rem"
                            }),
                        className="mb-3",
                        style={
                            "box-shadow":
                            "0 4px 8px 0 rgba(0, 0, 0, 0.1), 0 6px 20px 0 rgba(0, 0, 0, 0.1)",
                            "border": "none",
                            "border-radius": "1rem"
                        })
                ],
                style={
                    "background-color": "transparent",
                    "border": "none",
                    "width": "500px",
                    "margin": "auto",
                    "padding-top": "5vh"
                }),
        ],
        style={
            "background": "url(./assets/patient-login.png)",
            "height": "100vh"
        },
        id="login-layout")
Example #29
0
def create_image_group(id_box,
                       path_default_img,
                       button1_txt='Select an Image',
                       elmt2_type='upload',
                       elmt2_msg=html.Div(
                           ['Drag and Drop or ',
                            html.A('Select Files')])):

    elmt_list = list()
    ## add image
    id_img = f'{id_box}-img'
    elmt_img = html.Div(id=f'container-{id_img}',
                        children=[
                            html.Img(id=id_img,
                                     src=str(path_default_img),
                                     style={
                                         'display': 'block',
                                         'width': IMG_BOX_WIDTH,
                                         'height': IMG_BOX_HEIGHT,
                                         'margin': IMG_BOX_MARGIN
                                     })
                        ])
    elmt_list.append(elmt_img)

    ## add button 1
    id_button1 = f'{id_box}-button-1'
    elmt_button = html.Div(id=f'container-{id_button1}',
                           children=[
                               html.Button(button1_txt,
                                           id=id_button1,
                                           n_clicks=0,
                                           style={
                                               'display': 'block',
                                               'width': IMG_BOX_WIDTH,
                                               'margin': IMG_BOX_MARGIN
                                           })
                           ])
    elmt_list.append(elmt_button)

    ## add button 2 or upload
    id_button2 = f'{id_box}-upload'
    if elmt2_type == "upload":
        elmt_upload = dcc.Upload(
            id=id_button2,
            children=elmt2_msg,
            style={
                'display': 'block',
                'borderWidth': '1px',
                'width': IMG_BOX_WIDTH,
                'height': '30px',
                'borderStyle': 'dashed',
                'borderWidth': '1px',
                'textAlign': 'center',
                'margin': IMG_BOX_MARGIN
            },
            multiple=False  #Allow multiple files to be uploaded
        )
        elmt_list.append(elmt_upload)
    elif elmt2_type == 'download-button':
        elmt_download_button = html.Div(
            id=id_box + '-download-button-container',
            children=[
                html.Form(id=f'{id_box}-download-form',
                          children=[
                              html.Button(elmt2_msg,
                                          id=f'{id_box}-download-button',
                                          style={
                                              'display': 'block',
                                              'width': IMG_BOX_WIDTH,
                                              'margin': IMG_BOX_MARGIN
                                          })
                          ],
                          action='')
            ],
            style={
                'margin': '0px',
                'padding': '0px'
            })
        elmt_list.append(elmt_download_button)

    img_box = html.Div(children=elmt_list, style={'margin': '20px'})
    return img_box
Example #30
0
serverCpp.connect((HOST, PORT))

app = dash.Dash(
    __name__,
    external_stylesheets=['https://codepen.io/chriddyp/pen/bWLwgP.css'],
    meta_tags=[{
        "name": "viewport",
        "content": "width=device-width, initial-scale=1"
    }],
)
fontSize = 20
login_form = html.Div([
    html.Form([
        dcc.Input(placeholder='username', name='username', type='text'),
        dcc.Input(placeholder='password', name='password', type='password'),
        html.Button('Login', type='submit')
    ],
              action='/login',
              method='post')
])

url_bar_and_content_div = html.Div(
    [dcc.Location(id='url', refresh=False),
     html.Div(id='page-content')])

avalon_form = html.Div([
    html.Div([
        dcc.Dropdown(
            id='input_option',
            options=[
                {