-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.py
88 lines (80 loc) · 3.01 KB
/
index.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
from dash.dependencies import Input, Output
from dash import dcc,html
from app import app
from apps import (ovdapp,electriceye,fastrsam,locali6,autovdas,hangar18,ovdash,
orcapp,sismodb,helicorderizador,nllvsh71,defcon,transparentar)
app.layout = html.Div([
dcc.Location(id='url', refresh=False),
html.Div(id='blank-output'),
html.Div(id='page-content')
])
@app.callback(Output('page-content', 'children'),
[Input('url', 'pathname')])
def display_page(pathname):
if pathname is None:
return 'Loading...'
elif pathname == '/apps/electriceye':
return electriceye.layout
elif pathname == '/apps/fastrsam':
return fastrsam.layout
elif pathname == '/apps/locali6':
return locali6.layout
elif pathname == '/apps/autovdas':
return autovdas.layout
elif pathname == '/apps/hangar18':
return hangar18.layout
elif pathname == '/apps/ovdash':
return ovdash.layout
elif pathname == '/apps/orcapp':
return orcapp.app.layout
elif pathname == '/apps/helicorderizador':
return helicorderizador.layout
elif pathname == '/apps/sismodb':
return sismodb.layout
elif pathname == '/apps/nllvsh71':
return nllvsh71.layout
elif pathname == '/apps/defcon':
return defcon.layout
elif pathname == '/apps/transparentar':
return transparentar.layout
elif pathname == '/':
return ovdapp.layout
else:
return '404'
app.clientside_callback(
"""
function(tab_value) {
if (tab_value === '/') {
document.title = 'Ovdapp'
} else if (tab_value === '/apps/electriceye') {
document.title = 'Ovdapp - Electric Eye'
} else if (tab_value === '/apps/fastrsam') {
document.title = 'Ovdapp - fastRSAM'
} else if (tab_value === '/apps/locali6') {
document.title = 'Ovdapp - Locali6'
} else if (tab_value === '/apps/autovdas') {
document.title = 'Ovdapp - Autovdas'
} else if (tab_value === '/apps/hangar18') {
document.title = 'Ovdapp - Hangar 18'
} else if (tab_value === '/apps/ovdash') {
document.title = 'Ovdapp - Ovdash'
} else if (tab_value === '/apps/orcapp') {
document.title = 'Ovdapp - Orcapp'
} else if (tab_value === '/apps/helicorderizador') {
document.title = 'Ovdapp - Helicorderizador'
} else if (tab_value === '/apps/sismodb') {
document.title = 'Ovdapp - SismoDB'
} else if (tab_value === '/apps/nllvsh71') {
document.title = 'Ovdapp - NonLinLoc vs Hypo71'
} else if (tab_value === '/apps/defcon') {
document.title = 'Ovdapp - DEFCON'
} else if (tab_value === '/apps/transparentar') {
document.title = 'Ovdapp - TRANSPARENTAR'
}
}
""",
Output('blank-output', 'children'),
[Input('url', 'pathname')]
)
if __name__ == '__main__':
app.run_server(debug=True,threaded=True)