diff --git a/src/components/InputTimeInterval.vue b/src/components/InputTimeInterval.vue
index 7b72ac2c..3ae61cf9 100644
--- a/src/components/InputTimeInterval.vue
+++ b/src/components/InputTimeInterval.vue
@@ -1,55 +1,58 @@
div
div
- b-alert(v-if="mode == 'range' && invalidDaterange", variant="warning", show)
+ b-alert(v-if="invalidDaterange", variant="warning", show)
| The selected date range is invalid. The second date must be greater or equal to the first date.
- b-alert(v-if="mode == 'range' && daterangeTooLong", variant="warning", show)
+ b-alert(v-if="daterangeTooLong", variant="warning", show)
| The selected date range is too long. The maximum is {{ maxDuration/(24*60*60) }} days.
- div.d-flex.justify-content-between.align-items-end
+ div.d-flex.justify-content-between
table
tr
- th.pr-2
- label(for="mode") Interval mode:
- td
- select(id="mode", v-model="mode")
- option(value='last_duration') Last duration
- option(value='range') Date range
- tr(v-if="mode == 'last_duration'")
- th.pr-2
- label(for="duration") Show last:
- td
- select(id="duration", v-model="duration", @change="valueChanged")
- option(:value="15*60") 15min
- option(:value="30*60") 30min
- option(:value="60*60") 1h
- option(:value="2*60*60") 2h
- option(:value="4*60*60") 4h
- option(:value="6*60*60") 6h
- option(:value="12*60*60") 12h
- option(:value="24*60*60") 24h
- tr(v-if="mode == 'range'")
- th.pr-2 Range:
+ td.pr-2
+ label.col-form-label.col-form-label-sm Show last
+ td(colspan=2)
+ .btn-group(role="group")
+ template(v-for="(dur, idx) in durations")
+ input(
+ type="radio"
+ :id="'dur' + idx"
+ :value="dur.seconds"
+ v-model="duration"
+ @change="applyLastDuration"
+ ).d-none
+ label(:for="'dur' + idx" v-html="dur.label").btn.btn-light.btn-sm
+
+ tr
+ td.pr-2
+ label.col-form-label.col-form-label-sm Show from
td
- input(type="date", v-model="start")
- input(type="date", v-model="end")
- button(
- class="btn btn-outline-dark btn-sm",
+ input.form-control.form-control-sm.d-inline-block.p-1(type="date", v-model="start", style="height: auto; width: auto;")
+ label.col-form-label.col-form-label-sm.px-2 to
+ input.form-control.form-control-sm.d-inline.p-1(type="date", v-model="end", style="height: auto; width: auto")
+ td.text-right
+ button.ml-2.btn.btn-outline-dark.btn-sm(
type="button",
- :disabled="mode == 'range' && (invalidDaterange || emptyDaterange || daterangeTooLong)",
- @click="valueChanged"
- ) Update
+ :disabled="invalidDaterange || emptyDaterange || daterangeTooLong",
+ @click="applyRange"
+ ) Apply
- div(style="text-align:right" v-if="showUpdate && mode=='last_duration'")
- b-button.px-2(@click="update()", variant="outline-dark", size="sm")
+ div.text-muted.d-none.d-md-block(style="text-align:right" v-if="showUpdate")
+ b-button.mt-2.px-2(@click="refresh()", variant="outline-dark", size="sm", style="opacity: 0.7")
icon(name="sync")
span.d-none.d-md-inline
- | Update
- div.mt-1.small.text-muted(v-if="lastUpdate")
+ | Refresh
+ div.mt-2.small(v-if="lastUpdate")
| Last update: #[time(:datetime="lastUpdate.format()") {{lastUpdate | friendlytime}}]
-
+