-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathlayout_sync.py
120 lines (116 loc) · 4.92 KB
/
layout_sync.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
import dash
from dash import dcc
import dash_bootstrap_components as dbc
from dash import html
import dash_table
from dash.dependencies import Input, Output, State
import dash_daq as daq
# Plotly Imports
import plotly.express as px
import plotly.graph_objects as go
SYCHRONIZATION_MODAL = [
dbc.Modal(
[
dbc.ModalHeader("Sychronization Options"),
dbc.ModalBody([
dbc.Row([
dbc.Col(
dbc.InputGroup(
[
dbc.InputGroupText("Session ID"),
dbc.Input(id='sychronization_session_id', placeholder="Enter Session ID", value=""),
],
className="mb-3",
),
),
]
),
dbc.Row([
dbc.Col(
html.Div([dbc.Button("Save Session", color="secondary", id="sychronization_save_session_button")], className="d-grid gap-2"),
),
dbc.Col(
html.Div([dbc.Button("Load Session", color="secondary", id="sychronization_load_session_button")], className="d-grid gap-2"),
),
]
),
html.Hr(),
html.H5("Dashboard Sychronization Type"),
dbc.Row([
dbc.Col(
dcc.Dropdown(
id='synchronization_type',
options=[
{'label': 'MANUAL (Default)', 'value': 'MANUAL'},
{'label': 'COLLAB (Bidirectional sync)', 'value': 'COLLAB'},
{'label': 'LEADER', 'value': 'LEADER'},
{'label': 'FOLLOWER', 'value': 'FOLLOWER'},
],
searchable=False,
clearable=False,
value="MANUAL",
style={
"width":"100%"
}
),
),
dbc.Col(
html.Div([dbc.Button("Set Synchronization", id="sychronization_set_type_button")], className="d-grid gap-2"),
)
]),
html.Hr(),
dbc.InputGroup(
[
dbc.InputGroupText("Leader Session Token"),
dbc.Input(id='synchronization_leader_token', placeholder="Enter Token", value=""),
],
className="mb-3",
),
dbc.Row([
dbc.Col(
html.Div([dbc.Button("Get New Token", color="secondary", id="synchronization_leader_newtoken_button")], className="d-grid gap-2"),
),
dbc.Col(
html.Div([dbc.Button("Check Token", color="secondary", id="synchronization_leader_checktoken_button")], className="d-grid gap-2"),
),
]
),
html.Br(),
html.Div(id="sychronization_output1"),
html.Div(id="sychronization_output2"),
html.Br(),
dbc.Row([
dbc.Col(
html.Div([dbc.Button("Copy Follower URL", color="primary", id="copy_follower_link_button")], className="d-grid gap-2"),
),
dbc.Col(
html.Div([dbc.Button("Copy Leader URL", color="primary", id="copy_leader_link_button")], className="d-grid gap-2"),
),
dbc.Col(
html.Div([dbc.Button("Copy Collab URL", color="primary", id="copy_collab_link_button")], className="d-grid gap-2"),
),
]),
# Links to be generated
html.Div(
[
dcc.Link(id="follower_query_link", href="#", target="_blank"),
dcc.Link(id="leader_query_link", href="#", target="_blank"),
dcc.Link(id="collab_query_link", href="#", target="_blank"),
],
style={
"display":"none"
}
),
dbc.Row([
dbc.Col(id="follower_qr_code"),
dbc.Col()
])
]),
dbc.ModalFooter(
dbc.Button("Close", id="sychronization_options_modal_close", className="ml-auto")
),
],
id="sychronization_options_modal",
size="xl",
)
]