Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgergo committed Dec 19, 2024
1 parent df37653 commit 8b634ac
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions resources/views/widgets/trend.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@
@endif
</div>
<div class="app-widget__chart">
<form method="GET" action="{{ $url }}" onchange="this.requestSubmit();">
<div class="form-group">
<label class="form-label sr-only" for="widget-{{ $key }}}-interval">{{ __('Interval') }}</label>
<select class="form-control form-control--sm" name="range" id="widget-{{ $key }}}-interval">
@foreach($ranges as $range => $rangeLabel)
<option value="{{ $range }}" @selected($range === $currentRange)>{{ $rangeLabel }}</option>
@endforeach
</select>
</div>
</form>
<x-root::chart :config="$data['chart']" />
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/Widgets/Metric.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ public function data(Request $request): array
{
return array_merge(parent::data($request), [
'ranges' => $this->ranges(),
'currentRange' => $this->getCurrentRange($request),
'data' => (! $this->async || $request->isTurboFrameRequest()) ? $this->calculate($request) : [],
]);
}
Expand Down

0 comments on commit 8b634ac

Please sign in to comment.