diff --git a/pkg/api/api.go b/pkg/api/api.go index c7f51a3aec8..fa5854b5333 100644 --- a/pkg/api/api.go +++ b/pkg/api/api.go @@ -240,16 +240,24 @@ func (hs *HttpServer) registerRoutes() { dashboardRoute.Get("/db/:slug", wrap(GetDashboard)) dashboardRoute.Delete("/db/:slug", reqEditorRole, wrap(DeleteDashboard)) - dashboardRoute.Get("/id/:dashboardId/versions", wrap(GetDashboardVersions)) - dashboardRoute.Get("/id/:dashboardId/versions/:id", wrap(GetDashboardVersion)) - dashboardRoute.Post("/id/:dashboardId/restore", reqEditorRole, bind(dtos.RestoreDashboardVersionCommand{}), wrap(RestoreDashboardVersion)) - dashboardRoute.Post("/calculate-diff", bind(dtos.CalculateDiffOptions{}), wrap(CalculateDashboardDiff)) dashboardRoute.Post("/db", reqEditorRole, bind(m.SaveDashboardCommand{}), wrap(PostDashboard)) dashboardRoute.Get("/home", wrap(GetHomeDashboard)) dashboardRoute.Get("/tags", GetDashboardTags) dashboardRoute.Post("/import", bind(dtos.ImportDashboardCommand{}), wrap(ImportDashboard)) + + dashboardRoute.Group("/id/:dashboardId", func(dashIdRoute RouteRegister) { + dashIdRoute.Get("/id/:dashboardId/versions", wrap(GetDashboardVersions)) + dashIdRoute.Get("/id/:dashboardId/versions/:id", wrap(GetDashboardVersion)) + dashIdRoute.Post("/id/:dashboardId/restore", reqEditorRole, bind(dtos.RestoreDashboardVersionCommand{}), wrap(RestoreDashboardVersion)) + + dashIdRoute.Group("/acl", func(aclRoute RouteRegister) { + aclRoute.Get("/", wrap(GetDashboardAclList)) + aclRoute.Post("/", bind(dtos.UpdateDashboardAclCommand{}), wrap(UpdateDashboardAcl)) + aclRoute.Delete("/:aclId", wrap(DeleteDashboardAcl)) + }) + }) }) // Dashboard snapshots diff --git a/public/app/features/dashboard/DashboardModel.ts b/public/app/features/dashboard/DashboardModel.ts index 613698f08db..642b79bb7c6 100644 --- a/public/app/features/dashboard/DashboardModel.ts +++ b/public/app/features/dashboard/DashboardModel.ts @@ -724,6 +724,5 @@ export class DashboardModel { yPos += rowGridHeight; } - console.log('panels', this.panels); } } diff --git a/public/app/features/dashboard/dashboard_ctrl.ts b/public/app/features/dashboard/dashboard_ctrl.ts index b457f6d33c0..20b98a19380 100644 --- a/public/app/features/dashboard/dashboard_ctrl.ts +++ b/public/app/features/dashboard/dashboard_ctrl.ts @@ -135,8 +135,8 @@ export class DashboardCtrl implements PanelContainer { } init(dashboard) { - this.$scope.onAppEvent('show-json-editor', this.$scope.showJsonEditor); - this.$scope.onAppEvent('template-variable-value-updated', this.$scope.templateVariableUpdated); + this.$scope.onAppEvent('show-json-editor', this.showJsonEditor.bind(this)); + this.$scope.onAppEvent('template-variable-value-updated', this.templateVariableUpdated.bind(this)); this.setupDashboard(dashboard); } } diff --git a/public/app/features/dashboard/viewStateSrv.js b/public/app/features/dashboard/viewStateSrv.js index 6820de3189f..34451c25951 100644 --- a/public/app/features/dashboard/viewStateSrv.js +++ b/public/app/features/dashboard/viewStateSrv.js @@ -39,18 +39,8 @@ function (angular, _, $, config) { // dont want url changes like adding orgId to add browser history $location.replace(); this.update(this.getQueryStringState()); - this.expandRowForPanel(); } - DashboardViewState.prototype.expandRowForPanel = function() { - if (!this.state.panelId) { return; } - - var panelInfo = this.$scope.dashboard.getPanelInfoById(this.state.panelId); - if (panelInfo) { - panelInfo.row.collapse = false; - } - }; - DashboardViewState.prototype.needsSync = function(urlState) { return _.isEqual(this.state, urlState) === false; }; diff --git a/public/app/features/panel/panel_ctrl.ts b/public/app/features/panel/panel_ctrl.ts index 83d43a280f7..ad0af0fbc18 100644 --- a/public/app/features/panel/panel_ctrl.ts +++ b/public/app/features/panel/panel_ctrl.ts @@ -194,7 +194,7 @@ export class PanelCtrl { editPanelJson() { this.publishAppEvent('show-json-editor', { - object: this.panel, + object: this.panel.getSaveModel(), updateHandler: this.replacePanel.bind(this) }); } diff --git a/public/app/features/plugins/buit_in_plugins.ts b/public/app/features/plugins/buit_in_plugins.ts index 0603df492b0..aed997f2fb3 100644 --- a/public/app/features/plugins/buit_in_plugins.ts +++ b/public/app/features/plugins/buit_in_plugins.ts @@ -18,6 +18,8 @@ import * as heatmapPanel from 'app/plugins/panel/heatmap/module'; import * as tablePanel from 'app/plugins/panel/table/module'; import * as singlestatPanel from 'app/plugins/panel/singlestat/module'; import * as gettingStartedPanel from 'app/plugins/panel/gettingstarted/module'; +import * as permissionListPlugin from 'app/plugins/panel/permissionlist/module'; + import * as testDataAppPlugin from 'app/plugins/app/testdata/module'; import * as testDataDSPlugin from 'app/plugins/app/testdata/datasource/module'; @@ -35,6 +37,7 @@ const builtInPlugins = { "app/plugins/app/testdata/module": testDataAppPlugin, "app/plugins/app/testdata/datasource/module": testDataDSPlugin, + "app/plugins/panel/permissionlist/module": permissionListPlugin, "app/plugins/panel/text/module": textPanel, "app/plugins/panel/graph/module": graphPanel, "app/plugins/panel/dashlist/module": dashListPanel, diff --git a/public/sass/_variables.dark.scss b/public/sass/_variables.dark.scss index 7eea87b2009..3c015383103 100644 --- a/public/sass/_variables.dark.scss +++ b/public/sass/_variables.dark.scss @@ -105,7 +105,7 @@ $tight-form-bg: $dark-3; $tight-form-func-bg: #333; $tight-form-func-highlight-bg: #444; -$modal-backdrop-bg: $dark-3; +$modal-backdrop-bg: #3a4754; $code-tag-bg: $gray-1; $code-tag-border: lighten($code-tag-bg, 2%); diff --git a/public/sass/_variables.scss b/public/sass/_variables.scss index 12692690772..c3345661581 100644 --- a/public/sass/_variables.scss +++ b/public/sass/_variables.scss @@ -206,7 +206,7 @@ $zindex-modal: 1050; // $btn-padding-x: 1rem !default; -$btn-padding-y: .8rem !default; +$btn-padding-y: .7rem !default; $btn-line-height: 1 !default; $btn-font-weight: 500 !default; diff --git a/public/sass/components/_gf-form.scss b/public/sass/components/_gf-form.scss index 9cf0541e147..6ab35262922 100644 --- a/public/sass/components/_gf-form.scss +++ b/public/sass/components/_gf-form.scss @@ -1,4 +1,4 @@ -$gf-form-margin: 1px; +$gf-form-margin: 3px; .gf-form { margin-bottom: $gf-form-margin; @@ -55,6 +55,7 @@ $gf-form-margin: 1px; .gf-form-label { padding: $input-padding-y $input-padding-x; + margin-right: $gf-form-margin; flex-shrink: 0; font-weight: $font-weight-semi-bold; @@ -107,6 +108,7 @@ $gf-form-margin: 1px; display: block; width: 100%; padding: $input-padding-y $input-padding-x; + margin-right: $gf-form-margin; font-size: $font-size-base; line-height: $input-line-height; color: $input-color; @@ -114,8 +116,6 @@ $gf-form-margin: 1px; background-image: none; background-clip: padding-box; border: 1px solid $input-border-color; - border-bottom: none; - border-left: none; @include border-radius($input-border-radius-sm); @include box-shadow($input-box-shadow); white-space: nowrap; diff --git a/public/sass/components/_tabbed_view.scss b/public/sass/components/_tabbed_view.scss index 756462a4b70..be331947566 100644 --- a/public/sass/components/_tabbed_view.scss +++ b/public/sass/components/_tabbed_view.scss @@ -13,6 +13,9 @@ .gf-tabs-link.active { background-color: $panel-bg; } + .tabbed-view-body { + min-height: 200px; + } } } @@ -46,7 +49,6 @@ .tabbed-view-body { padding: $spacer*2 $spacer; - min-height: 250px; &--small { min-height: 0px;