diff --git a/pkg/middleware/middleware.go b/pkg/middleware/middleware.go index d1662cfa0fa..d6a86de5283 100644 --- a/pkg/middleware/middleware.go +++ b/pkg/middleware/middleware.go @@ -89,7 +89,6 @@ func (ctx *Context) Handle(status int, title string, err error) { } ctx.Data["Title"] = title - ctx.HTML(status, strconv.Itoa(status)) } diff --git a/pkg/services/sqlstore/dashboard.go b/pkg/services/sqlstore/dashboard.go index b3c0495a42f..89b7e254fea 100644 --- a/pkg/services/sqlstore/dashboard.go +++ b/pkg/services/sqlstore/dashboard.go @@ -117,6 +117,10 @@ func SearchDashboards(query *m.SearchDashboardsQuery) error { params = append(params, query.Tag) } + if query.Limit == 0 || query.Limit > 10000 { + query.Limit = 300 + } + sql.WriteString(fmt.Sprintf(" LIMIT %d", query.Limit)) var res []DashboardSearchProjection diff --git a/pkg/services/sqlstore/dashboard_test.go b/pkg/services/sqlstore/dashboard_test.go index 962fccb90a2..e4830693459 100644 --- a/pkg/services/sqlstore/dashboard_test.go +++ b/pkg/services/sqlstore/dashboard_test.go @@ -53,7 +53,7 @@ func TestDashboardDataAccess(t *testing.T) { Convey("Should be able to search for dashboard", func() { query := m.SearchDashboardsQuery{ - Title: "%test%", + Title: "test", AccountId: 1, } diff --git a/src/app/features/admin/adminUsersCtrl.js b/src/app/features/admin/adminUsersCtrl.js index d013465778f..ef7a88622de 100644 --- a/src/app/features/admin/adminUsersCtrl.js +++ b/src/app/features/admin/adminUsersCtrl.js @@ -19,6 +19,17 @@ function (angular) { }); }; + $scope.deleteUser = function(user) { + $scope.appEvent('confirm-modal', { + title: 'Delete user', + text: 'Are you sure you want to delete user: ' + user.login, + onConfirm: function() { + backendSrv.delete('/api/admin/users/delete/' + user.id); + } + }); + + }; + $scope.init(); }); diff --git a/src/app/features/admin/partials/users.html b/src/app/features/admin/partials/users.html index 57a4eca5159..17f4a20769a 100644 --- a/src/app/features/admin/partials/users.html +++ b/src/app/features/admin/partials/users.html @@ -31,7 +31,7 @@ Edit    - +