summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Metzger2020-06-10 15:35:24 +0200
committerLukas Metzger2020-06-10 15:35:24 +0200
commit5af4a1983b872c2c471eb9ca35765044a3a20070 (patch)
tree4ea3834de53df5f3e3146d9e081e96edf6207e2f
parentRetain state after graphics update (diff)
downloadbwlp-statistics-5af4a1983b872c2c471eb9ca35765044a3a20070.tar.gz
bwlp-statistics-5af4a1983b872c2c471eb9ca35765044a3a20070.tar.xz
bwlp-statistics-5af4a1983b872c2c471eb9ca35765044a3a20070.zip
Added persistence for inputs
-rw-r--r--pages/dozmod.py16
-rw-r--r--pages/locations.py8
-rw-r--r--pages/machines.py12
-rw-r--r--pages/total.py16
-rw-r--r--pages/vms.py12
5 files changed, 46 insertions, 18 deletions
diff --git a/pages/dozmod.py b/pages/dozmod.py
index 37c108d..61a99ee 100644
--- a/pages/dozmod.py
+++ b/pages/dozmod.py
@@ -20,17 +20,21 @@ def layout():
id='dozmod-days',
options=[{'label': '{} days'.format(d), 'value': d} for d in [7, 30, 90]],
value=7,
- clearable=False
+ clearable=False,
+ persistence=True,
+ persistence_type='memory'
)
]),
dbc.Col(width=12, lg=3, children=[
dcc.DatePickerRange(
id='dozmod-range',
- start_date=dt.datetime.now() - dt.timedelta(days=12*30),
- end_date=dt.datetime.now(),
+ start_date=(dt.datetime.now() - dt.timedelta(days=12*30)).date(),
+ end_date=dt.datetime.now().date(),
display_format='DD-MM-YYYY',
initial_visible_month=dt.datetime.now(),
- first_day_of_week=1
+ first_day_of_week=1,
+ persistence=True,
+ persistence_type='memory'
),
]),
dbc.Col(width=12, lg=6, children=[
@@ -39,7 +43,9 @@ def layout():
options=[{'label': s, 'value': s} for s in get_satellites()],
multi=True,
value=[],
- placeholder='All Satellites'
+ placeholder='All Satellites',
+ persistence=True,
+ persistence_type='memory'
)
])
]),
diff --git a/pages/locations.py b/pages/locations.py
index 470fc19..9cb36bc 100644
--- a/pages/locations.py
+++ b/pages/locations.py
@@ -22,7 +22,9 @@ def layout():
id='locations-days',
options=[{'label': '{} days'.format(d), 'value': d} for d in [7, 30, 90]],
value=7,
- clearable=False
+ clearable=False,
+ persistence=True,
+ persistence_type='memory'
)
]),
dbc.Col(width=12, lg=3, children=[
@@ -32,7 +34,9 @@ def layout():
display_format='DD-MM-YYYY',
max_date_allowed=get_newest_date(),
initial_visible_month=get_newest_date(),
- first_day_of_week=1
+ first_day_of_week=1,
+ persistence=True,
+ persistence_type='memory'
),
]),
dbc.Col(width=12, lg=6, children=[
diff --git a/pages/machines.py b/pages/machines.py
index 3f38ef1..f314777 100644
--- a/pages/machines.py
+++ b/pages/machines.py
@@ -22,7 +22,9 @@ def layout():
id='machines-days',
options=[{'label': '{} days'.format(d), 'value': d} for d in [7, 30, 90]],
value=7,
- clearable=False
+ clearable=False,
+ persistence=True,
+ persistence_type='memory'
)
]),
dbc.Col(width=12, lg=3, children=[
@@ -32,7 +34,9 @@ def layout():
display_format='DD-MM-YYYY',
max_date_allowed=get_newest_date(),
initial_visible_month=get_newest_date(),
- first_day_of_week=1
+ first_day_of_week=1,
+ persistence=True,
+ persistence_type='memory'
),
]),
dbc.Col(width=12, lg=6, children=[
@@ -41,7 +45,9 @@ def layout():
options=[{'label': s, 'value': s} for s in get_satellites()],
multi=True,
value=[],
- placeholder='All Satellites'
+ placeholder='All Satellites',
+ persistence=True,
+ persistence_type='memory'
)
])
]),
diff --git a/pages/total.py b/pages/total.py
index bceb49b..4fb6b83 100644
--- a/pages/total.py
+++ b/pages/total.py
@@ -20,17 +20,21 @@ def layout():
id='total-days',
options=[{'label': '{} days'.format(d), 'value': d} for d in [7, 30, 90]],
value=7,
- clearable=False
+ clearable=False,
+ persistence=True,
+ persistence_type='memory'
)
]),
dbc.Col(width=12, lg=3, children=[
dcc.DatePickerRange(
id='total-range',
- start_date=dt.datetime.now() - dt.timedelta(days=12*30),
- end_date=dt.datetime.now(),
+ start_date=(dt.datetime.now() - dt.timedelta(days=12*30)).date(),
+ end_date=dt.datetime.now().date(),
display_format='DD-MM-YYYY',
initial_visible_month=dt.datetime.now(),
- first_day_of_week=1
+ first_day_of_week=1,
+ persistence=True,
+ persistence_type='memory'
),
]),
dbc.Col(width=12, lg=6, children=[
@@ -39,7 +43,9 @@ def layout():
options=[{'label': s, 'value': s} for s in get_satellites()],
multi=True,
value=[],
- placeholder='All Satellites'
+ placeholder='All Satellites',
+ persistence=True,
+ persistence_type='memory'
)
])
]),
diff --git a/pages/vms.py b/pages/vms.py
index 1c75545..f0b9a05 100644
--- a/pages/vms.py
+++ b/pages/vms.py
@@ -22,7 +22,9 @@ def layout():
id='vms-days',
options=[{'label': '{} days'.format(d), 'value': d} for d in [7, 30, 90]],
value=7,
- clearable=False
+ clearable=False,
+ persistence=True,
+ persistence_type='memory'
)
]),
dbc.Col(width=12, lg=3, children=[
@@ -32,7 +34,9 @@ def layout():
display_format='DD-MM-YYYY',
max_date_allowed=get_newest_date(),
initial_visible_month=get_newest_date(),
- first_day_of_week=1
+ first_day_of_week=1,
+ persistence=True,
+ persistence_type='memory'
),
]),
dbc.Col(width=12, lg=6, children=[
@@ -40,7 +44,9 @@ def layout():
id='vms-satellite',
options=[{'label': s, 'value': s} for s in get_satellites()],
value=None,
- placeholder='All Satellites'
+ placeholder='All Satellites',
+ persistence=True,
+ persistence_type='memory'
)
])
]),