diff --git a/public/app/features/dashboard/settings/settings.html b/public/app/features/dashboard/settings/settings.html
index 5103fab8b75..3e9796239dc 100644
--- a/public/app/features/dashboard/settings/settings.html
+++ b/public/app/features/dashboard/settings/settings.html
@@ -87,12 +87,16 @@
-
-
+
diff --git a/public/app/features/dashboard/settings/settings.ts b/public/app/features/dashboard/settings/settings.ts
index 9949b52dd45..0f940c422e1 100755
--- a/public/app/features/dashboard/settings/settings.ts
+++ b/public/app/features/dashboard/settings/settings.ts
@@ -17,7 +17,14 @@ export class SettingsCtrl {
hasUnsavedFolderChange: boolean;
/** @ngInject */
- constructor(private $scope, private $location, private $rootScope, private backendSrv, private dashboardSrv) {
+ constructor(
+ private $scope,
+ private $route,
+ private $location,
+ private $rootScope,
+ private backendSrv,
+ private dashboardSrv
+ ) {
// temp hack for annotations and variables editors
// that rely on inherited scope
$scope.dashboard = this.dashboard;
@@ -93,8 +100,8 @@ export class SettingsCtrl {
}
this.sections.push({
- title: 'View JSON',
- id: 'view_json',
+ title: 'Dashboard JSON',
+ id: 'dashboard_json',
icon: 'gicon gicon-json',
});
@@ -134,13 +141,13 @@ export class SettingsCtrl {
}
saveDashboard() {
- if (this.viewId === 'view_json') {
- this.dashboardSrv.saveJSONDashboard(this.json).then(() => {
- window.location.reload();
- });
- } else {
- this.dashboardSrv.saveDashboard();
- }
+ this.dashboardSrv.saveDashboard();
+ }
+
+ saveDashboardJson() {
+ this.dashboardSrv.saveJSONDashboard(this.json).then(() => {
+ this.$route.reload();
+ });
}
onPostSave() {
diff --git a/public/sass/components/_dashboard_settings.scss b/public/sass/components/_dashboard_settings.scss
index 11d943eb13c..873da7f4935 100644
--- a/public/sass/components/_dashboard_settings.scss
+++ b/public/sass/components/_dashboard_settings.scss
@@ -80,3 +80,7 @@
margin-bottom: 10px;
}
}
+
+.dashboard-settings__json-save-button {
+ margin-top: $spacer;
+}