Commit c71ce0af authored by Martin Schorb's avatar Martin Schorb
Browse files

filebrowse convert

parent 249ab8d4
Pipeline #23825 passed with stage
in 17 seconds
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 4 08:42:12 2020
@author: schorb
"""
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input,Output,State
from dash.exceptions import PreventUpdate
import os
from app import app
import params
from utils import launch_jobs, pages
from utils import helper_functions as hf
from callbacks import filebrowse
# element prefix
label = "browse"
parent = "convert"
# SELECT input directory
# get user name and main group to pre-polulate input directory
group = params.group
# ============================
# set up render parameters
owner = "SBEM"
# =============================================
# # Page content
# Pick source directory
directory_sel = html.Div(children=[html.H4("Select dataset root directory:"),
html.Script(type="text/javascript",children="alert('test')"),
dcc.Input(id={'component': 'path_input', 'module': label}, type="text", debounce=True,value="/g/"+group,persistence=True,className='dir_textinput')
])
filebrowse = pages.filebrowse(label)
page = [filebrowse,directory_sel]
\ No newline at end of file
......@@ -14,7 +14,7 @@ from app import app
from utils import pages
from callbacks import runstate
import browse
from sbem import sbem_conv
module='convert'
......@@ -55,7 +55,7 @@ page1 = html.Div(id={'component': 'page1', 'module': module})
Input({'component': 'import_type_dd', 'module': module}, 'value'))
def convert_output(dd_value):
if dd_value=='SBEMImage':
return [html.Div(browse.page)]
return [html.Div(sbem_conv.page)]
else:
return [html.Div([html.Br(),'No data type selected.'])]
......
......@@ -21,7 +21,9 @@ import importlib
from app import app
import params
from utils import launch_jobs
from utils import launch_jobs, pages
from callbacks import filebrowse
# element prefix
......@@ -45,18 +47,19 @@ owner = "SBEM"
# # Page content
# Pick source directory
directory_sel = html.Div(children=[html.H4("Select dataset root directory:"),
html.Script(type="text/javascript",children="alert('test')"),
dcc.Input(id=label+"input1", type="text", debounce=True,placeholder="/g/"+group,persistence=True,className='dir_textinput'),
html.Button('Browse',id=label+"browse1"),' graphical browsing works on cluster login node ONLY!',
html.Div(id=label+'warning-popup')
dcc.Input(id={'component': 'path_input', 'module': label}, type="text", debounce=True,value="/g/"+group,persistence=True,className='dir_textinput')
])
pathbrowse = pages.path_browse(label)
page = [directory_sel]
page = [directory_sel,pathbrowse]
@app.callback([Output(label+'input1', 'value'),
Output(label+'warning-popup','children')],
......
......@@ -273,14 +273,14 @@ def section_view(module,numpanel=1):
return html.Div(out)
def filebrowse(module,tf_in = None):
def path_browse(module,tf_in = None):
if tf_in is None:
tf_in = {'component': 'path_input', 'module': module}
tf_in = checks.makeinput(tf_in)
fbdd = dcc.Dropdown(id={'component': 'browse_dd', 'module': module} ,searchable=True)
fbdd = dcc.Dropdown(id={'component': 'browse_dd', 'module': module} ,searchable=True,className='dropdown_inline')
fbrowse = html.Details([html.Summary('Browse'),fbdd])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment