|
3 | 3 | import dash_bootstrap_components as dbc |
4 | 4 | import dash_mantine_components as dmc |
5 | 5 | from logging import Logger |
6 | | - |
| 6 | +import flask |
| 7 | +import urllib |
7 | 8 |
|
8 | 9 | # create app |
9 | 10 | app = Dash( |
10 | 11 | __name__, |
11 | 12 | # suppress_callback_exceptions=True, |
12 | 13 | use_pages=True, |
13 | 14 | external_stylesheets=[dbc.themes.SIMPLEX, dbc.icons.BOOTSTRAP], |
14 | | - title="CEOS Calibration Dashboard", |
| 15 | + title="CEOS-PVP RadVAL Dashboard", |
| 16 | + serve_locally=True, |
15 | 17 | ) |
16 | 18 |
|
17 | 19 | application = app.server |
|
20 | 22 |
|
21 | 23 | log = Logger(__name__) |
22 | 24 |
|
23 | | -# add upper buttons based on pages |
24 | 25 | page_buttons = dbc.Container( |
25 | | - fluid="xs", |
| 26 | + fluid=True, # "xs", |
26 | 27 | style={ |
27 | 28 | "width": "110vh", |
28 | | - # 'margin-left': '1px', |
29 | | - "margin-right": "3vh", |
| 29 | + # 'margin-left': '15vh', |
| 30 | + "margin-right": "5vh", |
30 | 31 | }, |
31 | 32 | children=[ |
32 | 33 | html.Div( |
|
67 | 68 | ], |
68 | 69 | ) |
69 | 70 |
|
70 | | -# create header of logos and buttons |
71 | 71 | header = dmc.Card( |
72 | 72 | children=[ |
73 | 73 | dbc.Container( |
|
84 | 84 | children=[ |
85 | 85 | html.A( |
86 | 86 | href="https://ceos.org/", |
87 | | - target="newPage", # https://calvalportal.ceos.org/web/guest |
| 87 | + target="newPage", |
88 | 88 | children=[ |
89 | 89 | html.Img( |
90 | 90 | alt="Link to CEOS portal", |
|
100 | 100 | dbc.Col( |
101 | 101 | dbc.Container( |
102 | 102 | fluid="xs", |
| 103 | + style={"margin-left": "-5vh", "margin-top": "-1.5vh"}, |
| 104 | + children=[ |
| 105 | + html.A( |
| 106 | + href="https://ceos.org/", |
| 107 | + target="newPage", |
| 108 | + children=[ |
| 109 | + html.Img( |
| 110 | + alt="Link to CEOS portal", |
| 111 | + src="assets/RadVAL_logo.png", |
| 112 | + height=100, |
| 113 | + ) |
| 114 | + ], |
| 115 | + ) |
| 116 | + # width=100), |
| 117 | + ], |
| 118 | + ) |
| 119 | + ), |
| 120 | + dbc.Col( |
| 121 | + dbc.Container( |
| 122 | + fluid="xs", |
| 123 | + children=[page_buttons], |
103 | 124 | style={ |
104 | | - "width": "20vh", |
105 | | - "margin-top": "0vh", |
| 125 | + "margin-top": "1vh", |
| 126 | + "margin-right": "-5vh", |
106 | 127 | "margin-left": "-5vh", |
107 | 128 | }, |
| 129 | + ) # update button margins here |
| 130 | + ), |
| 131 | + ] |
| 132 | + ), |
| 133 | + dbc.Row( |
| 134 | + children=[ |
| 135 | + dbc.Col( |
| 136 | + dbc.Container( |
| 137 | + fluid="xs", |
| 138 | + style={"margin-left": "0vh", "margin-top": "0vh"}, |
108 | 139 | children=[ |
109 | | - dmc.Text( |
110 | | - "Calibration Dashboard", |
111 | | - weight=500, |
112 | | - align="left", |
113 | | - inline=True, |
| 140 | + html.Div( |
| 141 | + "Operational Beta version welcoming inputs and users", |
114 | 142 | style={ |
115 | | - "font-size": "2rem", |
116 | | - "font-family": "Segoe UI", |
117 | | - # 'position': 'absolute', |
118 | | - "top": "12", |
| 143 | + "color": "red", |
| 144 | + "fontSize": 30, |
| 145 | + "font-weight": "bold", |
| 146 | + "align": "centre", |
119 | 147 | }, |
120 | 148 | ) |
121 | 149 | ], |
122 | 150 | ) |
123 | 151 | ), |
| 152 | + ] |
| 153 | + ), |
| 154 | + dbc.Row( |
| 155 | + children=[ |
124 | 156 | dbc.Col( |
125 | | - page_buttons, |
126 | | - style={"margin-top": "1vh", "margin-right": "1vh"}, |
| 157 | + dbc.Container( |
| 158 | + fluid="xs", |
| 159 | + style={"margin-left": "0vh", "margin-top": "0vh"}, |
| 160 | + children=[ |
| 161 | + html.Div( |
| 162 | + "- Enhancements on-going", |
| 163 | + style={ |
| 164 | + "color": "red", |
| 165 | + "fontSize": 30, |
| 166 | + "font-weight": "bold", |
| 167 | + "align": "centre", |
| 168 | + }, |
| 169 | + ) |
| 170 | + ], |
| 171 | + ) |
127 | 172 | ), |
128 | 173 | ] |
129 | | - ) |
| 174 | + ), |
130 | 175 | ], |
131 | 176 | ) |
132 | 177 | ] |
133 | 178 | ) |
134 | 179 |
|
135 | | -# create footer of logos & links |
136 | 180 | footer = dmc.Card( |
137 | 181 | children=[ |
138 | 182 | dbc.Container( |
|
143 | 187 | dbc.Col( |
144 | 188 | html.A( |
145 | 189 | href="https://ceos.org/", |
146 | | - target="newPage", # https://calvalportal.ceos.org/web/guest |
| 190 | + target="newPage", |
147 | 191 | children=[ |
148 | 192 | html.Img( |
149 | 193 | alt="Link to CEOS portal", |
|
196 | 240 | ), |
197 | 241 | dbc.Col( |
198 | 242 | html.A( |
199 | | - href="https://staging.eodatahub.org.uk/", |
| 243 | + href="https://eodatahub.org.uk/", |
200 | 244 | target="newPage", |
201 | 245 | children=[ |
202 | 246 | html.Img( |
|
222 | 266 | ), |
223 | 267 | align="center", |
224 | 268 | ), |
225 | | - dbc.Row( |
226 | | - [html.Div([html.Br()])] |
227 | | - ), # add in empty row for spacing |
| 269 | + dbc.Row([html.Div([html.Br()])]), # empty row for spacing |
228 | 270 | dbc.Row( |
229 | 271 | [ |
230 | 272 | dbc.Col( |
|
242 | 284 | ) |
243 | 285 |
|
244 | 286 |
|
245 | | -app.layout = html.Div( |
246 | | - [ |
247 | | - dbc.Row( |
248 | | - children=[ |
249 | | - dbc.Container( |
250 | | - fluid=True, |
251 | | - children=[ |
252 | | - dbc.Col( |
253 | | - header, |
254 | | - style={ |
255 | | - "margin-bottom": "5vh", |
256 | | - "margin-left": "5vh", |
257 | | - "margin-right": "5vh", |
258 | | - }, |
259 | | - ), # , xs=12, sm=12, md=12, lg=12)), |
260 | | - ], |
261 | | - ) |
262 | | - ] |
263 | | - ), |
264 | | - dash.page_container, |
265 | | - dbc.Row( |
266 | | - dbc.Col( |
267 | | - footer, style={"margin-bottom": "5vh", "margin-left": "5vh"} |
268 | | - ) # xs=12, sm=12, md=12, lg=12)) |
269 | | - ), |
270 | | - ] |
| 287 | +app.layout = dmc.MantineProvider( |
| 288 | + html.Div( |
| 289 | + [ |
| 290 | + dbc.Row( |
| 291 | + children=[ |
| 292 | + dbc.Container( |
| 293 | + fluid=True, |
| 294 | + children=[ |
| 295 | + dbc.Col( |
| 296 | + header, |
| 297 | + style={ |
| 298 | + "margin-bottom": "5vh", |
| 299 | + "margin-left": "5vh", |
| 300 | + "margin-right": "5vh", |
| 301 | + }, |
| 302 | + ), # , xs=12, sm=12, md=12, lg=12)), |
| 303 | + ], |
| 304 | + ) |
| 305 | + ] |
| 306 | + ), |
| 307 | + dash.page_container, |
| 308 | + dbc.Row( |
| 309 | + dbc.Col( |
| 310 | + footer, style={"margin-bottom": "5vh", "margin-left": "5vh"} |
| 311 | + ) # xs=12, sm=12, md=12, lg=12)) |
| 312 | + ), |
| 313 | + ] |
| 314 | + ) |
271 | 315 | ) |
272 | 316 |
|
273 | 317 | if __name__ == "__main__": |
274 | 318 | app.run( |
275 | | - debug=True, # for testing locally |
276 | | - # dev_tools_ui=False, dev_tools_props_check=False # disables the blue marker that shows errors |
| 319 | + dev_tools_props_check=False, |
| 320 | + # debug=True, |
| 321 | + # dev_tools_ui=False, # disables the blue marker that shows errors |
| 322 | + host="0.0.0.0", |
| 323 | + port=80, |
277 | 324 | ) |
278 | | - # app.run(debug=False, host='0.0.0.0', port=5000) # for running in Docker container |
|
0 commit comments