Set an order on metrics via the API. Closes #1874

This commit is contained in:
James Brooks
2016-06-02 09:06:40 +01:00
parent 439ac9fe44
commit cab030237b
12 changed files with 106 additions and 17 deletions

View File

@@ -85,7 +85,8 @@ class MetricController extends AbstractApiController
Binput::get('display_chart', true),
Binput::get('places', 2),
Binput::get('view', 1),
Binput::get('threshold', 5)
Binput::get('threshold', 5),
Binput::get('order', 0)
));
} catch (QueryException $e) {
throw new BadRequestHttpException();
@@ -114,7 +115,8 @@ class MetricController extends AbstractApiController
Binput::get('display_chart'),
Binput::get('places'),
Binput::get('view'),
Binput::get('threshold')
Binput::get('threshold'),
Binput::get('order')
));
} catch (QueryException $e) {
throw new BadRequestHttpException();

View File

@@ -31,7 +31,7 @@ class MetricController extends Controller
*/
public function showMetrics()
{
$metrics = Metric::orderBy('created_at', 'desc')->get();
$metrics = Metric::orderBy('order')->get();
return View::make('dashboard.metrics.index')
->withPageTitle(trans('dashboard.metrics.metrics').' - '.trans('dashboard.dashboard'))