@@ -84,7 +144,7 @@
-
${probe.location}
+
${probe.location or ""}
@@ -97,3 +157,70 @@
+ % endif
+%def>
+
+<%def name="modify_tailbone_form()">
+
+%def>
+
+
+${parent.body()}
diff --git a/tailbone/views/tempmon/probes.py b/tailbone/views/tempmon/probes.py
index 205d4c52..de0ca42d 100644
--- a/tailbone/views/tempmon/probes.py
+++ b/tailbone/views/tempmon/probes.py
@@ -2,7 +2,7 @@
################################################################################
#
# Rattail -- Retail Software Framework
-# Copyright © 2010-2018 Lance Edgar
+# Copyright © 2010-2019 Lance Edgar
#
# This file is part of Rattail.
#
@@ -35,7 +35,7 @@ from rattail_tempmon.db import model as tempmon
import colander
from deform import widget as dfwidget
-from webhelpers2.html import tags
+from webhelpers2.html import tags, HTML
from tailbone import forms, grids
from tailbone.views.tempmon import MasterView
@@ -255,6 +255,7 @@ class TempmonProbeView(MasterView):
def graph(self):
probe = self.get_instance()
+ use_buefy = self.get_use_buefy()
key = 'tempmon.probe.{}.graph_time_range'.format(probe.uuid)
selected = self.request.params.get('time-range')
@@ -262,18 +263,26 @@ class TempmonProbeView(MasterView):
selected = self.request.session.get(key, 'last hour')
self.request.session[key] = selected
- time_range = tags.select('time-range', selected, tags.Options([
+ range_options = tags.Options([
tags.Option("Last Hour", 'last hour'),
tags.Option("Last 6 Hours", 'last 6 hours'),
tags.Option("Last Day", 'last day'),
tags.Option("Last Week", 'last week'),
- ]))
+ ])
+
+ if use_buefy:
+ time_range = HTML.tag('b-select', c=[range_options.render()],
+ **{'v-model': 'currentTimeRange',
+ '@input': 'timeRangeChanged'})
+ else:
+ time_range = tags.select('time-range', selected, range_options)
context = {
'probe': probe,
'parent_title': six.text_type(probe),
'parent_url': self.get_action_url('view', probe),
'time_range': time_range,
+ 'current_time_range': selected,
}
return self.render_to_response('graph', context)