diff --git a/pkg/api/playlist.go b/pkg/api/playlist.go index d02f9585429..a0ceea19a4c 100644 --- a/pkg/api/playlist.go +++ b/pkg/api/playlist.go @@ -60,7 +60,7 @@ func GetPlaylist(c *middleware.Context) Response { dto := &m.PlaylistDTO{ Id: cmd.Result.Id, Title: cmd.Result.Title, - Timespan: cmd.Result.Timespan, + Interval: cmd.Result.Interval, OrgId: cmd.Result.OrgId, Items: playlistDTOs, } diff --git a/pkg/models/playlist.go b/pkg/models/playlist.go index 802a9262c9f..5d861dc11b0 100644 --- a/pkg/models/playlist.go +++ b/pkg/models/playlist.go @@ -14,14 +14,14 @@ var ( type Playlist struct { Id int64 `json:"id"` Title string `json:"title"` - Timespan string `json:"timespan"` + Interval string `json:"interval"` OrgId int64 `json:"-"` } type PlaylistDTO struct { Id int64 `json:"id"` Title string `json:"title"` - Timespan string `json:"timespan"` + Interval string `json:"interval"` OrgId int64 `json:"-"` Items []PlaylistItemDTO `json:"items"` } @@ -83,7 +83,7 @@ type UpdatePlaylistQuery struct { Id int64 Title string Type string - Timespan string + Interval string Items []PlaylistItemDTO Result *PlaylistDTO @@ -92,7 +92,7 @@ type UpdatePlaylistQuery struct { type CreatePlaylistQuery struct { Title string Type string - Timespan string + Interval string Data []int64 OrgId int64 Items []PlaylistItemDTO diff --git a/pkg/services/sqlstore/migrations/playlist_mig.go b/pkg/services/sqlstore/migrations/playlist_mig.go index c97fc1adb3d..b972994e45b 100644 --- a/pkg/services/sqlstore/migrations/playlist_mig.go +++ b/pkg/services/sqlstore/migrations/playlist_mig.go @@ -8,7 +8,7 @@ func addPlaylistMigrations(mg *Migrator) { Columns: []*Column{ {Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true}, {Name: "title", Type: DB_NVarchar, Length: 255, Nullable: false}, - {Name: "timespan", Type: DB_NVarchar, Length: 255, Nullable: false}, + {Name: "interval", Type: DB_NVarchar, Length: 255, Nullable: false}, {Name: "org_id", Type: DB_BigInt, Nullable: false}, }, } diff --git a/pkg/services/sqlstore/playlist.go b/pkg/services/sqlstore/playlist.go index ff3f1753a3c..fd3a49b2b2a 100644 --- a/pkg/services/sqlstore/playlist.go +++ b/pkg/services/sqlstore/playlist.go @@ -23,7 +23,7 @@ func CreatePlaylist(query *m.CreatePlaylistQuery) error { playlist := m.Playlist{ Title: query.Title, - Timespan: query.Timespan, + Interval: query.Interval, OrgId: query.OrgId, } @@ -54,7 +54,7 @@ func UpdatePlaylist(query *m.UpdatePlaylistQuery) error { playlist := m.Playlist{ Id: query.Id, Title: query.Title, - Timespan: query.Timespan, + Interval: query.Interval, } existingPlaylist := x.Where("id = ?", query.Id).Find(m.Playlist{}) @@ -67,7 +67,7 @@ func UpdatePlaylist(query *m.UpdatePlaylistQuery) error { Id: playlist.Id, OrgId: playlist.OrgId, Title: playlist.Title, - Timespan: playlist.Timespan, + Interval: playlist.Interval, } _, err = x.Id(query.Id).Cols("id", "title", "timespan").Update(&playlist) diff --git a/public/app/features/dashboard/all.js b/public/app/features/dashboard/all.js index 524441b7a99..4bddbf8dd95 100644 --- a/public/app/features/dashboard/all.js +++ b/public/app/features/dashboard/all.js @@ -11,7 +11,6 @@ define([ './dashboardSrv', './keybindings', './viewStateSrv', - './playlistSrv', './timeSrv', './unsavedChangesSrv', './directives/dashSearchView', diff --git a/public/app/features/playlist/all.js b/public/app/features/playlist/all.js index 3390bc55003..df0d6983c06 100644 --- a/public/app/features/playlist/all.js +++ b/public/app/features/playlist/all.js @@ -1,5 +1,6 @@ define([ './playlists_ctrl', + './playlistSrv', './playlist_edit_ctrl', './playlist_routes' ], function () {}); diff --git a/public/app/features/playlist/partials/playlist.html b/public/app/features/playlist/partials/playlist.html index 925b3699505..077ef5cbdd0 100644 --- a/public/app/features/playlist/partials/playlist.html +++ b/public/app/features/playlist/partials/playlist.html @@ -26,7 +26,7 @@ Interval
  • - +
  • diff --git a/public/app/features/playlist/playlistSrv.js b/public/app/features/playlist/playlistSrv.js index bf4587f6c48..f7ea59b6c98 100644 --- a/public/app/features/playlist/playlistSrv.js +++ b/public/app/features/playlist/playlistSrv.js @@ -28,11 +28,11 @@ function (angular, _, kbn) { self.next(); }; - this.start = function(dashboards, timespan) { + this.start = function(dashboards, interval) { self.stop(); self.index = 0; - self.interval = kbn.interval_to_ms(timespan); + self.interval = kbn.interval_to_ms(interval); self.dashboards = dashboards; $rootScope.playlistSrv = this;