diff --git a/pkg/models/account.go b/pkg/models/account.go index 8a1b80e534a..ad4cdc47e53 100644 --- a/pkg/models/account.go +++ b/pkg/models/account.go @@ -12,6 +12,7 @@ var ( type Account struct { Id int64 + Version int Name string Created time.Time Updated time.Time diff --git a/pkg/models/dashboards.go b/pkg/models/dashboards.go index aec0b6f9fc5..0ebde7aa163 100644 --- a/pkg/models/dashboards.go +++ b/pkg/models/dashboards.go @@ -17,6 +17,7 @@ type Dashboard struct { Id int64 Slug string AccountId int64 + Version int Created time.Time Updated time.Time diff --git a/pkg/models/datasource.go b/pkg/models/datasource.go index 280d2a4c79d..77e14c04c3b 100644 --- a/pkg/models/datasource.go +++ b/pkg/models/datasource.go @@ -23,6 +23,7 @@ type DsAccess string type DataSource struct { Id int64 + Version int AccountId int64 Name string diff --git a/pkg/models/user.go b/pkg/models/user.go index 822d79187cd..0a3de0c9a4d 100644 --- a/pkg/models/user.go +++ b/pkg/models/user.go @@ -12,6 +12,7 @@ var ( type User struct { Id int64 + Version int Email string Name string Login string diff --git a/pkg/services/sqlstore/migrations.go b/pkg/services/sqlstore/migrations.go index 1bc4ebccfa2..720aa3bd28f 100644 --- a/pkg/services/sqlstore/migrations.go +++ b/pkg/services/sqlstore/migrations.go @@ -33,11 +33,13 @@ func addUserMigrations(mg *Migrator) { mg.AddMigration("create user table", new(AddTableMigration). Name("user").WithColumns( &Column{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true}, + &Column{Name: "version", Type: DB_Int, Nullable: false}, &Column{Name: "login", Type: DB_NVarchar, Length: 255, Nullable: false}, &Column{Name: "email", Type: DB_NVarchar, Length: 255, Nullable: false}, &Column{Name: "name", Type: DB_NVarchar, Length: 255, Nullable: true}, &Column{Name: "password", Type: DB_NVarchar, Length: 255, Nullable: true}, &Column{Name: "salt", Type: DB_NVarchar, Length: 50, Nullable: true}, + &Column{Name: "rands", Type: DB_NVarchar, Length: 50, Nullable: true}, &Column{Name: "company", Type: DB_NVarchar, Length: 255, Nullable: true}, &Column{Name: "account_id", Type: DB_BigInt, Nullable: false}, &Column{Name: "is_admin", Type: DB_Bool, Nullable: false}, @@ -50,9 +52,6 @@ func addUserMigrations(mg *Migrator) { Table("user").Columns("login").Unique()) mg.AddMigration("add unique index user.email", new(AddIndexMigration). Table("user").Columns("email").Unique()) - - mg.AddMigration("add column user.rands", new(AddColumnMigration). - Table("user").Column(&Column{Name: "rands", Type: DB_NVarchar, Length: 255, Nullable: true})) } func addStarMigrations(mg *Migrator) { @@ -71,6 +70,7 @@ func addAccountMigrations(mg *Migrator) { mg.AddMigration("create account table", new(AddTableMigration). Name("account").WithColumns( &Column{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true}, + &Column{Name: "version", Type: DB_Int, Nullable: false}, &Column{Name: "name", Type: DB_NVarchar, Length: 255, Nullable: false}, &Column{Name: "created", Type: DB_DateTime, Nullable: false}, &Column{Name: "updated", Type: DB_DateTime, Nullable: false}, @@ -98,6 +98,7 @@ func addDashboardMigration(mg *Migrator) { mg.AddMigration("create dashboard table", new(AddTableMigration). Name("dashboard").WithColumns( &Column{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true}, + &Column{Name: "version", Type: DB_Int, Nullable: false}, &Column{Name: "slug", Type: DB_NVarchar, Length: 255, Nullable: false}, &Column{Name: "title", Type: DB_NVarchar, Length: 255, Nullable: false}, &Column{Name: "data", Type: DB_Text, Nullable: false}, @@ -129,6 +130,7 @@ func addDataSourceMigration(mg *Migrator) { Name("data_source").WithColumns( &Column{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true}, &Column{Name: "account_id", Type: DB_BigInt, Nullable: false}, + &Column{Name: "version", Type: DB_Int, Nullable: false}, &Column{Name: "type", Type: DB_NVarchar, Length: 255, Nullable: false}, &Column{Name: "name", Type: DB_NVarchar, Length: 255, Nullable: false}, &Column{Name: "access", Type: DB_NVarchar, Length: 255, Nullable: false}, diff --git a/src/app/controllers/sidemenuCtrl.js b/src/app/controllers/sidemenuCtrl.js index d503cecab42..c267131ba27 100644 --- a/src/app/controllers/sidemenuCtrl.js +++ b/src/app/controllers/sidemenuCtrl.js @@ -17,10 +17,9 @@ function (angular, _, $, config) { $scope.menu = []; $scope.menu.push({ - text: "Dashbords", + text: "Dashboards", icon: "fa fa-th-large", href: $scope.getUrl("/"), - //startsWith: config.appSubUrl + '/dashboard/', }); if ($scope.grafana.user.accountRole === 'Admin') { @@ -34,16 +33,6 @@ function (angular, _, $, config) { requireRole: "Admin", icon: "fa fa-shield", }); - $scope.menu.push({ - text: "Users", href: $scope.getUrl("/account/users"), - requireRole: "Admin", - icon: "fa fa-users", - }); - $scope.menu.push({ - text: "API Keys", href: $scope.getUrl("/account/apikeys"), - requireRole: "Admin", - icon: "fa fa-key", - }); } if ($scope.grafana.user.isGrafanaAdmin) { diff --git a/src/app/directives/topnav.js b/src/app/directives/topnav.js index 0dd497de047..b27a6be6241 100644 --- a/src/app/directives/topnav.js +++ b/src/app/directives/topnav.js @@ -13,7 +13,6 @@ function (angular) { transclude: true, scope: { title: "@", - section: "@", titleAction: "&", toggle: "&", showMenuBtn: "=", @@ -23,18 +22,13 @@ function (angular) { '