|
|
@@ -1,11 +1,18 @@ |
|
|
|
import dash
|
|
|
|
import dash_bootstrap_components as dbc
|
|
|
|
import dash_html_components as html
|
|
|
|
import dash_core_components as dcc
|
|
|
|
import socket
|
|
|
|
import arvados
|
|
|
|
import functools
|
|
|
|
from .projects import list_projects_html
|
|
|
|
from .collections import list_collections_html
|
|
|
|
from .processes import list_processes_html
|
|
|
|
|
|
|
|
|
|
|
|
# list_projects_html = functools.lru_cache(maxsize=128)(list_projects_html)
|
|
|
|
# list_collections_html = functools.lru_cache(maxsize=128)(list_collections_html)
|
|
|
|
# list_processes_html = functools.lru_cache(maxsize=128)(list_processes_html)
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
@@ -13,19 +20,36 @@ def main(): |
|
|
|
arv = arvados.api('v1')
|
|
|
|
|
|
|
|
user = arv.users().current().execute()
|
|
|
|
|
|
|
|
# nav_btns = [ dbc.Button(a['name']) for a in projects ]
|
|
|
|
projects_table = list_projects_html(arv, user['uuid'])
|
|
|
|
collections_table = list_collections_html(arv, user['uuid'])
|
|
|
|
|
|
|
|
app.layout = html.Div([
|
|
|
|
html.H5('Projects'),
|
|
|
|
projects_table,
|
|
|
|
html.H5('Collections'),
|
|
|
|
collections_table
|
|
|
|
dcc.Location(id='url', refresh=False),
|
|
|
|
html.Div(id='page-content')
|
|
|
|
], style={ 'margin': '10px' })
|
|
|
|
|
|
|
|
app.run_server(host=socket.getfqdn(), debug=True)
|
|
|
|
projects_table = list_projects_html(arv, user['uuid'])
|
|
|
|
collections_table = list_collections_html(arv, user['uuid'])
|
|
|
|
processes_table = list_processes_html(arv, user['uuid'])
|
|
|
|
|
|
|
|
|
|
|
|
@app.callback(dash.dependencies.Output('page-content', 'children'),
|
|
|
|
[ dash.dependencies.Input('url', 'pathname') ])
|
|
|
|
def display_page(pathname):
|
|
|
|
print('display_page(), pathname:', pathname)
|
|
|
|
return html.Div([
|
|
|
|
dbc.Tabs([
|
|
|
|
dbc.Tab(projects_table, label="Projects",
|
|
|
|
label_style={ 'cursor': 'pointer' })
|
|
|
|
], style={ 'borderBottom': 'none' }),
|
|
|
|
dbc.Tabs([
|
|
|
|
dbc.Tab(collections_table, label="Collections",
|
|
|
|
label_style={ 'cursor': 'pointer' }),
|
|
|
|
dbc.Tab(processes_table, label="Processes",
|
|
|
|
label_style={ 'cursor': 'pointer' })
|
|
|
|
], style={ 'borderBottom': 'none' })
|
|
|
|
])
|
|
|
|
|
|
|
|
app.run_server(host=socket.getfqdn(), debug=False)
|
|
|
|
|
|
|
|
|
|
|
|
main()
|