Skip to content

Commit

Permalink
feat(metric): Use MetricViewEnum for period selection
Browse files Browse the repository at this point in the history
  • Loading branch information
Ionys320 committed May 20, 2024
1 parent a61b7a5 commit f70ee35
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions resources/views/components/metric.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
'metric',
])

@use('\Cachet\Enums\MetricViewEnum')

<div x-data="chart">
<div class="flex flex-col gap-2">
<div class="flex items-center gap-1.5">
Expand All @@ -19,10 +21,9 @@

<!-- Period Selector -->
<select x-model="period" class="ml-auto rounded-md border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 text-sm font-medium">
<option value="0">Last Hour</option>
<option value="1">Today</option>
<option value="2">Week</option>
<option value="3">Month</option>
@foreach([MetricViewEnum::last_hour, MetricViewEnum::today, MetricViewEnum::week, MetricViewEnum::month] as $value)
<option value="{{ $value }}">{{ $value->getLabel() }}</option>
@endforeach
</select>
</div>
<canvas x-ref="canvas" height="300" class="ring-1 ring-gray-900/5 dark:ring-gray-100/10 bg-gray-50 dark:bg-gray-800 rounded-md shadow-sm text-white"></canvas>
Expand Down

0 comments on commit f70ee35

Please sign in to comment.